@accelint/design-toolkit 2.5.0 → 3.0.0

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 (171) hide show
  1. package/dist/components/accordion/index.d.ts +42 -0
  2. package/dist/components/accordion/index.js.map +1 -1
  3. package/dist/components/accordion/styles.js +1 -1
  4. package/dist/components/accordion/styles.js.map +1 -1
  5. package/dist/components/avatar/index.d.ts +29 -0
  6. package/dist/components/avatar/index.js.map +1 -1
  7. package/dist/components/badge/index.d.ts +24 -0
  8. package/dist/components/badge/index.js.map +1 -1
  9. package/dist/components/button/index.d.ts +104 -0
  10. package/dist/components/button/index.js +1 -1
  11. package/dist/components/button/index.js.map +1 -1
  12. package/dist/components/button/styles.d.ts +28 -106
  13. package/dist/components/button/styles.js +1 -1
  14. package/dist/components/button/styles.js.map +1 -1
  15. package/dist/components/button/types.d.ts +6 -4
  16. package/dist/components/checkbox/index.d.ts +33 -0
  17. package/dist/components/checkbox/index.js.map +1 -1
  18. package/dist/components/checkbox/styles.d.ts +3 -3
  19. package/dist/components/checkbox/styles.js +1 -1
  20. package/dist/components/checkbox/styles.js.map +1 -1
  21. package/dist/components/chip/index.d.ts +34 -0
  22. package/dist/components/chip/index.js.map +1 -1
  23. package/dist/components/chip/styles.js +1 -1
  24. package/dist/components/chip/styles.js.map +1 -1
  25. package/dist/components/classification-badge/index.d.ts +15 -0
  26. package/dist/components/classification-badge/index.js.map +1 -1
  27. package/dist/components/classification-banner/index.d.ts +11 -0
  28. package/dist/components/classification-banner/index.js.map +1 -1
  29. package/dist/components/color-picker/styles.js +1 -1
  30. package/dist/components/color-picker/styles.js.map +1 -1
  31. package/dist/components/combobox-field/index.d.ts +19 -0
  32. package/dist/components/combobox-field/index.js +2 -0
  33. package/dist/components/combobox-field/index.js.map +1 -0
  34. package/dist/components/combobox-field/styles.d.ts +72 -0
  35. package/dist/components/combobox-field/styles.js +2 -0
  36. package/dist/components/combobox-field/styles.js.map +1 -0
  37. package/dist/components/combobox-field/types.d.ts +29 -0
  38. package/dist/components/date-field/index.d.ts +44 -0
  39. package/dist/components/date-field/index.js.map +1 -1
  40. package/dist/components/date-field/styles.d.ts +3 -3
  41. package/dist/components/date-field/styles.js +1 -1
  42. package/dist/components/date-field/styles.js.map +1 -1
  43. package/dist/components/dialog/index.d.ts +26 -4
  44. package/dist/components/dialog/index.js +1 -1
  45. package/dist/components/dialog/index.js.map +1 -1
  46. package/dist/components/drawer/events.d.ts +8 -0
  47. package/dist/components/drawer/events.js +2 -0
  48. package/dist/components/drawer/events.js.map +1 -0
  49. package/dist/components/drawer/index.d.ts +89 -43
  50. package/dist/components/drawer/index.js +1 -1
  51. package/dist/components/drawer/index.js.map +1 -1
  52. package/dist/components/drawer/styles.d.ts +50 -16
  53. package/dist/components/drawer/styles.js +1 -1
  54. package/dist/components/drawer/styles.js.map +1 -1
  55. package/dist/components/drawer/types.d.ts +154 -238
  56. package/dist/components/drawer/types.js +1 -1
  57. package/dist/components/drawer/types.js.map +1 -1
  58. package/dist/components/hotkey/index.d.ts +56 -0
  59. package/dist/components/hotkey/index.js +2 -0
  60. package/dist/components/hotkey/index.js.map +1 -0
  61. package/dist/components/hotkey/styles.d.ts +53 -0
  62. package/dist/components/hotkey/styles.js +2 -0
  63. package/dist/components/hotkey/styles.js.map +1 -0
  64. package/dist/components/hotkey/types.d.ts +8 -0
  65. package/dist/components/hotkey/types.js +2 -0
  66. package/dist/components/hotkey/types.js.map +1 -0
  67. package/dist/components/icon/index.d.ts +29 -0
  68. package/dist/components/icon/index.js.map +1 -1
  69. package/dist/components/input/index.d.ts +19 -0
  70. package/dist/components/input/index.js +1 -1
  71. package/dist/components/input/index.js.map +1 -1
  72. package/dist/components/input/styles.d.ts +2 -24
  73. package/dist/components/input/styles.js +1 -1
  74. package/dist/components/input/styles.js.map +1 -1
  75. package/dist/components/input/types.d.ts +1 -0
  76. package/dist/components/label/index.d.ts +19 -0
  77. package/dist/components/label/index.js.map +1 -1
  78. package/dist/components/menu/index.d.ts +69 -7
  79. package/dist/components/menu/index.js +1 -1
  80. package/dist/components/menu/index.js.map +1 -1
  81. package/dist/components/menu/styles.d.ts +19 -43
  82. package/dist/components/menu/styles.js +1 -1
  83. package/dist/components/menu/styles.js.map +1 -1
  84. package/dist/components/menu/types.d.ts +17 -15
  85. package/dist/components/options/index.d.ts +41 -0
  86. package/dist/components/options/index.js.map +1 -1
  87. package/dist/components/options/styles.d.ts +3 -3
  88. package/dist/components/options/styles.js +1 -1
  89. package/dist/components/options/styles.js.map +1 -1
  90. package/dist/components/popover/index.d.ts +36 -2
  91. package/dist/components/popover/index.js +1 -1
  92. package/dist/components/popover/index.js.map +1 -1
  93. package/dist/components/query-builder/index.d.ts +24 -0
  94. package/dist/components/query-builder/index.js.map +1 -1
  95. package/dist/components/query-builder/value-selector.js +1 -1
  96. package/dist/components/query-builder/value-selector.js.map +1 -1
  97. package/dist/components/radio/index.d.ts +31 -0
  98. package/dist/components/radio/index.js.map +1 -1
  99. package/dist/components/radio/styles.d.ts +3 -3
  100. package/dist/components/radio/styles.js +1 -1
  101. package/dist/components/radio/styles.js.map +1 -1
  102. package/dist/components/search-field/styles.js +1 -1
  103. package/dist/components/search-field/styles.js.map +1 -1
  104. package/dist/components/search-field/types.d.ts +1 -0
  105. package/dist/components/select-field/index.d.ts +67 -0
  106. package/dist/components/select-field/index.js +2 -0
  107. package/dist/components/select-field/index.js.map +1 -0
  108. package/dist/components/select-field/styles.d.ts +60 -0
  109. package/dist/components/select-field/styles.js +2 -0
  110. package/dist/components/select-field/styles.js.map +1 -0
  111. package/dist/components/select-field/types.d.ts +27 -0
  112. package/dist/components/select-field/types.js +2 -0
  113. package/dist/components/select-field/types.js.map +1 -0
  114. package/dist/components/slider/index.d.ts +36 -2
  115. package/dist/components/slider/index.js +1 -1
  116. package/dist/components/slider/index.js.map +1 -1
  117. package/dist/components/switch/index.d.ts +36 -0
  118. package/dist/components/switch/index.js +1 -1
  119. package/dist/components/switch/index.js.map +1 -1
  120. package/dist/components/switch/styles.d.ts +23 -21
  121. package/dist/components/switch/styles.js +1 -1
  122. package/dist/components/switch/styles.js.map +1 -1
  123. package/dist/components/switch/types.d.ts +1 -0
  124. package/dist/components/tabs/index.d.ts +46 -0
  125. package/dist/components/tabs/index.js.map +1 -1
  126. package/dist/components/text-area-field/index.d.ts +20 -0
  127. package/dist/components/text-area-field/index.js.map +1 -1
  128. package/dist/components/text-area-field/styles.d.ts +3 -3
  129. package/dist/components/text-area-field/styles.js +1 -1
  130. package/dist/components/text-area-field/styles.js.map +1 -1
  131. package/dist/components/text-field/index.d.ts +62 -0
  132. package/dist/components/text-field/index.js.map +1 -1
  133. package/dist/components/text-field/styles.d.ts +3 -3
  134. package/dist/components/text-field/types.d.ts +1 -0
  135. package/dist/components/tooltip/index.d.ts +42 -0
  136. package/dist/components/tooltip/index.js.map +1 -1
  137. package/dist/components/view-stack/events.d.ts +9 -0
  138. package/dist/components/view-stack/events.js +2 -0
  139. package/dist/components/view-stack/events.js.map +1 -0
  140. package/dist/components/view-stack/index.d.ts +31 -0
  141. package/dist/components/view-stack/index.js +2 -0
  142. package/dist/components/view-stack/index.js.map +1 -0
  143. package/dist/components/view-stack/types.d.ts +62 -0
  144. package/dist/components/view-stack/types.js +2 -0
  145. package/dist/components/view-stack/types.js.map +1 -0
  146. package/dist/index.css +20 -0
  147. package/dist/index.d.ts +24 -17
  148. package/dist/index.js +1 -1
  149. package/dist/lib/types.d.ts +6 -2
  150. package/dist/metafile-esm.json +1 -1
  151. package/dist/styles.css +1081 -676
  152. package/dist/variants/variants.css +6 -5
  153. package/package.json +11 -6
  154. package/dist/components/box/index.d.ts +0 -19
  155. package/dist/components/box/index.js +0 -2
  156. package/dist/components/box/index.js.map +0 -1
  157. package/dist/components/combobox/index.d.ts +0 -27
  158. package/dist/components/combobox/index.js +0 -2
  159. package/dist/components/combobox/index.js.map +0 -1
  160. package/dist/components/drawer/context.d.ts +0 -13
  161. package/dist/components/drawer/context.js +0 -2
  162. package/dist/components/drawer/context.js.map +0 -1
  163. package/dist/components/drawer/state.d.ts +0 -26
  164. package/dist/components/drawer/state.js +0 -2
  165. package/dist/components/drawer/state.js.map +0 -1
  166. package/dist/components/navigation-stack/index.d.ts +0 -20
  167. package/dist/components/navigation-stack/index.js +0 -2
  168. package/dist/components/navigation-stack/index.js.map +0 -1
  169. package/dist/components/navigation-stack/types.d.ts +0 -31
  170. /package/dist/components/{navigation-stack → combobox-field}/types.js +0 -0
  171. /package/dist/components/{navigation-stack → combobox-field}/types.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["createContext","a","props","i","IconProvider","ref","useContextProps","rest","P","Icon"],"mappings":"mLAoBEA,MAAwD,CAAA,CAAAC,aAAA,CAAI,IAE9D,EAAA,oBAAkC,CAAA,CAAGC,CAAM,GACzC,WAAoBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,gBAC/B,CACAC,CAAAA,CAAa,CAAA,CAAA,CAAA,CAAA,2BAEN,CAAA,SAAgB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACnC,CAACA,CAAAA,CAAOG,CAAG,EAAIC,CAAAA,CAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,SAAQ,CAAA,QAAU,CAAA,CAAA,CAAA,gBAAkB,CAAA,CAAA,CAAA,QAAaE,CAAK,GAAIL,CAE1D,WACGC,GAAA,CAAA,OACKI,CAAAA,GACJ,CAAA,CAAKF,GACL,CAAA,CAAA,CAAA,SAAwB,CAAAG,UAAA,CAAA,CAAA,UACxB,CAAA,CAAA,CAAA,CAAA,sBAKN,CACAC,CAAAA,CAAK,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,MACd,CAAA,CAAA,CAAA,QAAWL,CAAAA,CAAAA","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 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport { type ContextValue, useContextProps } from 'react-aria-components';\nimport { IconStyles } from './styles';\nimport type { IconProps } from './types';\n\nexport const IconContext =\n createContext<ContextValue<IconProps, HTMLSpanElement>>(null);\n\nfunction IconProvider({ children, ...props }: ProviderProps<IconProps>) {\n return <IconContext.Provider value={props}>{children}</IconContext.Provider>;\n}\nIconProvider.displayName = 'Icon.Provider';\n\nexport function Icon({ ref, ...props }: IconProps) {\n [props, ref] = useContextProps(props, ref ?? null, IconContext);\n\n const { children, className, size = 'medium', ...rest } = props;\n\n return (\n <span\n {...rest}\n ref={ref}\n className={IconStyles({ className })}\n data-size={size}\n >\n {children}\n </span>\n );\n}\nIcon.displayName = 'Icon';\nIcon.Provider = IconProvider;\n"]}
1
+ {"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["createContext","a","props","i","IconProvider","ref","useContextProps","rest","P","Icon"],"mappings":"mLAoBEA,MAAwD,CAAA,CAAAC,aAAA,CAAI,IAE9D,EAAA,oBAAkC,CAAA,CAAGC,CAAM,GACzC,WAAoBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,gBAC/B,CACAC,CAAAA,CAAa,CAAA,CAAA,CAAA,CAAA,2BA+BN,CAAA,SAAgB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACnC,CAACA,CAAAA,CAAOG,CAAG,EAAIC,CAAAA,CAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,SAAQ,CAAA,QAAU,CAAA,CAAA,CAAA,gBAAkB,CAAA,CAAA,CAAA,QAAaE,CAAK,GAAIL,CAE1D,WACGC,GAAA,CAAA,OACKI,CAAAA,GACJ,CAAA,CAAKF,GACL,CAAA,CAAA,CAAA,SAAwB,CAAAG,UAAA,CAAA,CAAA,UACxB,CAAA,CAAA,CAAA,CAAA,sBAKN,CACAC,CAAAA,CAAK,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,MACd,CAAA,CAAA,CAAA,QAAWL,CAAAA,CAAAA","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 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport { type ContextValue, useContextProps } from 'react-aria-components';\nimport { IconStyles } from './styles';\nimport type { IconProps } from './types';\n\nexport const IconContext =\n createContext<ContextValue<IconProps, HTMLSpanElement>>(null);\n\nfunction IconProvider({ children, ...props }: ProviderProps<IconProps>) {\n return <IconContext.Provider value={props}>{children}</IconContext.Provider>;\n}\nIconProvider.displayName = 'Icon.Provider';\n\n/**\n * Icon - A wrapper component for displaying SVG icons with consistent sizing\n *\n * Provides a standardized container for SVG icons with built-in size variants and\n * proper accessibility support. Works seamlessly with the Accelint icon library\n * and supports custom SVG elements with consistent styling and alignment.\n *\n * @example\n * // Basic icon usage\n * <Icon>\n * <Settings />\n * </Icon>\n *\n * @example\n * // Icon with different sizes\n * <Icon size=\"small\">\n * <User />\n * </Icon>\n * <Icon size=\"large\">\n * <Dashboard />\n * </Icon>\n *\n * @example\n * // Icon in button context (automatically inherits sizing)\n * <Button>\n * <Icon><Plus /></Icon>\n * Add Item\n * </Button>\n */\nexport function Icon({ ref, ...props }: IconProps) {\n [props, ref] = useContextProps(props, ref ?? null, IconContext);\n\n const { children, className, size = 'medium', ...rest } = props;\n\n return (\n <span\n {...rest}\n ref={ref}\n className={IconStyles({ className })}\n data-size={size}\n >\n {children}\n </span>\n );\n}\nIcon.displayName = 'Icon';\nIcon.Provider = IconProvider;\n"]}
@@ -4,11 +4,30 @@ import { ContextValue } from 'react-aria-components';
4
4
  import { InputProps } from './types.js';
5
5
  import 'tailwind-variants';
6
6
  import '../button/types.js';
7
+ import '../../lib/types.js';
7
8
  import '../button/styles.js';
8
9
  import 'tailwind-merge';
9
10
  import './styles.js';
10
11
 
11
12
  declare const InputContext: react.Context<ContextValue<InputProps, HTMLInputElement>>;
13
+ /**
14
+ * Input - A flexible text input component with enhanced features
15
+ *
16
+ * Provides a customizable text input with automatic sizing, clear functionality,
17
+ * and integrated validation states. Supports various styling options and integrates
18
+ * seamlessly with form field components for comprehensive form experiences.
19
+ *
20
+ * @example
21
+ * // Basic input
22
+ * <Input placeholder="Enter text..." />
23
+ *
24
+ * @example
25
+ * // Input with clear button
26
+ * <Input
27
+ * defaultValue="Clearable text"
28
+ * classNames={{ clear: "hover:bg-gray-100" }}
29
+ * />
30
+ */
12
31
  declare function Input({ ref, ...props }: InputProps): react_jsx_runtime.JSX.Element;
13
32
  declare namespace Input {
14
33
  var displayName: string;
@@ -1,2 +1,2 @@
1
- import {jsxs,jsx}from'react/jsx-runtime';import'client-only';import {CancelFill}from'@accelint/icons';import {useControlledState}from'@react-stately/utils';import {createContext}from'react';import {useContextProps,InputContext,Input,composeRenderProps}from'react-aria-components';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {InputStyles,InputStylesDefaults}from'./styles.js';const {container:w,sizer:A,input:B,clear:F}=InputStyles(),v={target:{value:""}},K=createContext(null);function k({ref:t,...a}){[a,t]=useContextProps(a,t??null,InputContext),[a,t]=useContextProps({...a},t??null,K);const{classNames:r,autoSize:s,defaultValue:h="",disabled:p,placeholder:d,readOnly:m,required:I,size:f,type:l=InputStylesDefaults.type,value:g,isClearable:n,isInvalid:x,onChange:E,onKeyDown:P,...N}=a,[i,b]=useControlledState(g,h),z=(`${i??""}`.length||d?.length)??0,o=i==null||i==="";function c(e){E?.(e),e.defaultPrevented||b(e.target.value);}return jsxs("div",{className:w({className:r?.container,autoSize:s,type:l,isClearable:n,isEmpty:o}),"data-disabled":p||null,"data-invalid":x||null,"data-length":z,"data-placeholder":!!d&&o||null,"data-readonly":m||null,"data-required":I||null,"data-size":f,children:[jsx("div",{className:A({className:r?.sizer,autoSize:s,type:l,isClearable:n,isEmpty:o}),children:jsx(Input,{...N,ref:t,className:composeRenderProps(r?.input,e=>B({className:e,autoSize:s,type:l,isClearable:n,isEmpty:o})),disabled:p,placeholder:d,readOnly:m,required:I,type:l,value:i,onChange:c,onKeyDown:e=>{P?.(e),n&&!e.defaultPrevented&&e.key==="Escape"&&c(v);}})}),n&&jsx(Button,{className:composeRenderProps(r?.clear,e=>F({className:e,autoSize:s,type:l,isClearable:n,isEmpty:o})),excludeFromTabOrder:true,size:"small",variant:"icon",isDisabled:p,onPress:()=>{c(v),t?.current?.focus();},children:jsx(Icon,{children:jsx(CancelFill,{})})})]})}k.displayName="Input";export{k as Input,K as InputContext};//# sourceMappingURL=index.js.map
1
+ import {jsxs,jsx}from'react/jsx-runtime';import'client-only';import {CancelFill}from'@accelint/icons';import {useControlledState}from'@react-stately/utils';import {createContext}from'react';import {useContextProps,InputContext,Input,composeRenderProps}from'react-aria-components';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {InputStyles,InputStylesDefaults}from'./styles.js';const {container:w,sizer:A,input:B,clear:F}=InputStyles(),v={target:{value:""}},K=createContext(null);function k({ref:t,...a}){[a,t]=useContextProps(a,t??null,InputContext),[a,t]=useContextProps({...a},t??null,K);const{classNames:u,autoSize:r,defaultValue:h="",disabled:i,placeholder:d,readOnly:c,required:m,size:f="medium",type:l=InputStylesDefaults.type,value:g,isClearable:n,isInvalid:x,onChange:E,onKeyDown:P,...N}=a,[s,b]=useControlledState(g,h),z=(`${s??""}`.length||d?.length)??0,I=s==null||s==="";function p(e){E?.(e),e.defaultPrevented||b(e.target.value);}return jsxs("div",{className:w({className:u?.container,autoSize:r,type:l,isClearable:n}),"data-disabled":i||null,"data-empty":I||null,"data-invalid":x||null,"data-length":z,"data-placeholder":!!d&&I||null,"data-readonly":c||null,"data-required":m||null,"data-size":f,children:[jsx("div",{className:A({className:u?.sizer,autoSize:r,type:l,isClearable:n}),children:jsx(Input,{...N,ref:t,className:composeRenderProps(u?.input,e=>B({className:e,autoSize:r,type:l,isClearable:n})),disabled:i,placeholder:d,readOnly:c,required:m,type:l,value:s,onChange:p,onKeyDown:e=>{P?.(e),n&&!e.defaultPrevented&&e.key==="Escape"&&p(v);}})}),n&&jsx(Button,{className:composeRenderProps(u?.clear,e=>F({className:e,autoSize:r,type:l,isClearable:n})),excludeFromTabOrder:true,size:"small",variant:"icon",isDisabled:i,onPress:()=>{p(v),t?.current?.focus();},children:jsx(Icon,{children:jsx(CancelFill,{})})})]})}k.displayName="Input";export{k as Input,K as InputContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/input/index.tsx"],"names":["clear","clearInputEvent","M","InputContext","createContext","Input","ref","props","useContextProps","C","q","autoSize","defaultValue","placeholder","readOnly","required","type","valueProp","isInvalid","onChange","onKeyDown","value","setValue","length","isEmpty","handleChange","event","jsxs","R","classNames","jsx","u","AriaInput","composeRenderProps","className","input","y","disabled","isClearable","D"],"mappings":"8ZA8B0B,MAAA,CAAA,SAAO,CAAAA,CAAM,CAAA,KAGjCC,CAAAA,CAAkB,CACtB,OAAQ,CAAE,KAAA,CAAO,EAAG,CACtBC,WAAA,EAEaC,CACXC,CAAAA,CAA0D,OAErD,CAAA,CAAA,K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,CAAA,IACR,gBACA,CAAA,iBAGO,CAAA,CAAA,CAAA,OAAS,CAAA,IAAM,CACtB,CAAA,CAEA,CAAA,CAAA,CAAA,CAAA,EAAA,OAAC,WACCM,CAAAA,QACF,CACFC,QAEJ,CAEJ,CACA1B,QAAM,CAAA0B,GAAA,CAAAQ,UAAA,CAAA,EAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,OAAA","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\n'use client';\n\nimport 'client-only';\nimport { CancelFill } from '@accelint/icons';\nimport { useControlledState } from '@react-stately/utils';\nimport { type ChangeEvent, createContext } from 'react';\nimport {\n Input as AriaInput,\n InputContext as AriaInputContext,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { InputStyles, InputStylesDefaults } from './styles';\nimport type { InputProps } from './types';\n\nconst { container, sizer, input, clear } = InputStyles();\n\n// TODO: Improve this implementation so it is more of a realistic event\nconst clearInputEvent = {\n target: { value: '' },\n} as ChangeEvent<HTMLInputElement>;\n\nexport const InputContext =\n createContext<ContextValue<InputProps, HTMLInputElement>>(null);\n\nexport function Input({ ref, ...props }: InputProps) {\n /**\n * It is necessary to pull in the AriaInputContext to capture defaultValue,\n * value & onChange props that may be supplied by a Field component\n *\n * These are necessary due to the implementation of useControlledState for\n * the purposes of supporting the clear button and to capture the length\n * of the current value for the autoSize feature\n */\n [props, ref] = useContextProps(props, ref ?? null, AriaInputContext);\n [props, ref] = useContextProps({ ...props }, ref ?? null, InputContext);\n\n const {\n classNames,\n autoSize,\n defaultValue = '',\n disabled,\n placeholder,\n readOnly,\n required,\n size,\n type = InputStylesDefaults.type,\n value: valueProp,\n isClearable,\n isInvalid,\n onChange,\n onKeyDown,\n ...rest\n } = props;\n\n const [value, setValue] = useControlledState(valueProp, defaultValue);\n const length = (`${value ?? ''}`.length || placeholder?.length) ?? 0;\n const isEmpty = value == null || value === '';\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n onChange?.(event);\n\n if (!event.defaultPrevented) {\n setValue(event.target.value);\n }\n }\n\n return (\n <div\n className={container({\n className: classNames?.container,\n autoSize,\n type,\n isClearable,\n isEmpty,\n })}\n data-disabled={disabled || null}\n data-invalid={isInvalid || null}\n data-length={length}\n data-placeholder={(!!placeholder && isEmpty) || null}\n data-readonly={readOnly || null}\n data-required={required || null}\n data-size={size}\n >\n <div\n className={sizer({\n className: classNames?.sizer,\n autoSize,\n type,\n isClearable,\n isEmpty,\n })}\n >\n <AriaInput\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className, autoSize, type, isClearable, isEmpty }),\n )}\n disabled={disabled}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n type={type}\n value={value}\n onChange={handleChange}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n\n if (\n isClearable &&\n !event.defaultPrevented &&\n event.key === 'Escape'\n ) {\n handleChange(clearInputEvent);\n }\n }}\n />\n </div>\n {isClearable && (\n <Button\n className={composeRenderProps(classNames?.clear, (className) =>\n clear({ className, autoSize, type, isClearable, isEmpty }),\n )}\n excludeFromTabOrder\n size='small'\n variant='icon'\n isDisabled={disabled}\n onPress={() => {\n handleChange(clearInputEvent);\n\n ref?.current?.focus();\n }}\n >\n <Icon>\n <CancelFill />\n </Icon>\n </Button>\n )}\n </div>\n );\n}\nInput.displayName = 'Input';\n"]}
1
+ {"version":3,"sources":["../../../src/components/input/index.tsx"],"names":["clear","clearInputEvent","M","InputContext","createContext","Input","ref","props","useContextProps","C","q","defaultValue","placeholder","readOnly","type","InputStylesDefaults","O","isInvalid","onChange","onKeyDown","value","setValue","length","S","isEmpty","handleChange","event","jsxs","R","classNames","autoSize","required","jsx","composeRenderProps","className","input","y","isClearable","o","D"],"mappings":"8ZA8B0B,MAAA,CAAA,SAAO,CAAAA,CAAM,CAAA,KAGjCC,CAAAA,CAAkB,CACtB,OAAQ,CAAE,KAAA,CAAO,EAAG,CACtBC,WAAA,EAEaC,CACXC,CAAAA,CAA0D,OAoBrD,CAAA,CAAA,KAAA,CAASC,EAAM,CAAE,CAAA,CAAA,CAAA,CAAAC,cAAK,IAAS,EAAe,SASpBC,CAAAA,CAAOD,IAAO,CAAA,CAAA,CAAA,GAAsB,CACnE,CAACC,EAAOD,CAAG,CAAA,CAAIE,EAAgB,CAAEC,eAAA,CAAA,CAAGF,CAAM,CAAA,EAAGD,IAAO,CAAAI,YAAA,CAAMP,CAAY,EAEtE,CAAA,CAAA,CAAA,CAAAM,eAAM,CACJ,cACA,CAAA,CAAA,CAAA,CAAA,MACA,UAAA,CAAA,CAAA,CAAAE,QACA,CAAA,CAAA,CAAA,YACA,CAAA,CAAA,CAAA,EAAAC,CAAAA,UACAC,CAAAA,YAEA,CAAA,CAAA,QAAO,CAAA,CAAA,CAAA,QACPC,EAAOC,CAAAA,IAAoB,CAAA,CAC3B,SACA,CAAA,IAAA,CAAA,CAAA,CAAAC,mBAAA,CAAA,IACA,CAAA,KAAA,CAAA,CAAA,CAAAC,WACAC,CAAAA,CACA,UAAAC,CAAAA,CACA,CAAA,QAGKC,CAAAA,CAAOC,CAAQ,SAChBC,GAAU,GAAGF,CAAAA,CAAAA,CAAS,EAAE,CAAA,CAAA,CAAG,CAAA,CAAA,CAAAG,kBAAA,CAAA,CAAA,CAAA,CAAUX,CAAAA,CAAAA,CAAa,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,GAClDY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AA,CAAY,QAAQK,MAAAA,CAAAA,CAChDlC,SAAQ,CAAAoC,kBAAA,CAAA,CAAAF,EAAW,KAAA,CAAA,CAAA,EAAAJ,CAAAA,CAAU,UAAM,CAAA,CAAA,CAAA,QAAa,CAClD,EACA,IAAA,CAAA,CAAA,CAAA,WAAA,CAAA,CAAmB,CAAA,CAAA,CACnB,CAAA,oBACQ,IAAA,CAAA,IACR,CAAA,OAAA,CAAA,OACA,CAAA,MAAS,CAAA,UAGF,UAAS,CAAA,IAAM,CACtB,EAEA,CAAA,CAAA,CAAA,CAAA,EAAA,OAAC,EACC,KAAA,GAAA,CAAAE,CAAAA,QACF,CACFM,QAEJ,CAEJ,CACAjC,QAAM,CAAAiC,GAAA,CAAAC,UAAA,CAAA,EAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,OAAA","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\n'use client';\n\nimport 'client-only';\nimport { CancelFill } from '@accelint/icons';\nimport { useControlledState } from '@react-stately/utils';\nimport { type ChangeEvent, createContext } from 'react';\nimport {\n Input as AriaInput,\n InputContext as AriaInputContext,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { InputStyles, InputStylesDefaults } from './styles';\nimport type { InputProps } from './types';\n\nconst { container, sizer, input, clear } = InputStyles();\n\n// TODO: Improve this implementation so it is more of a realistic event\nconst clearInputEvent = {\n target: { value: '' },\n} as ChangeEvent<HTMLInputElement>;\n\nexport const InputContext =\n createContext<ContextValue<InputProps, HTMLInputElement>>(null);\n\n/**\n * Input - A flexible text input component with enhanced features\n *\n * Provides a customizable text input with automatic sizing, clear functionality,\n * and integrated validation states. Supports various styling options and integrates\n * seamlessly with form field components for comprehensive form experiences.\n *\n * @example\n * // Basic input\n * <Input placeholder=\"Enter text...\" />\n *\n * @example\n * // Input with clear button\n * <Input\n * defaultValue=\"Clearable text\"\n * classNames={{ clear: \"hover:bg-gray-100\" }}\n * />\n */\nexport function Input({ ref, ...props }: InputProps) {\n /**\n * It is necessary to pull in the AriaInputContext to capture defaultValue,\n * value & onChange props that may be supplied by a Field component\n *\n * These are necessary due to the implementation of useControlledState for\n * the purposes of supporting the clear button and to capture the length\n * of the current value for the autoSize feature\n */\n [props, ref] = useContextProps(props, ref ?? null, AriaInputContext);\n [props, ref] = useContextProps({ ...props }, ref ?? null, InputContext);\n\n const {\n classNames,\n autoSize,\n defaultValue = '',\n disabled,\n placeholder,\n readOnly,\n required,\n size = 'medium',\n type = InputStylesDefaults.type,\n value: valueProp,\n isClearable,\n isInvalid,\n onChange,\n onKeyDown,\n ...rest\n } = props;\n\n const [value, setValue] = useControlledState(valueProp, defaultValue);\n const length = (`${value ?? ''}`.length || placeholder?.length) ?? 0;\n const isEmpty = value == null || value === '';\n\n function handleChange(event: ChangeEvent<HTMLInputElement>) {\n onChange?.(event);\n\n if (!event.defaultPrevented) {\n setValue(event.target.value);\n }\n }\n\n return (\n <div\n className={container({\n className: classNames?.container,\n autoSize,\n type,\n isClearable,\n })}\n data-disabled={disabled || null}\n data-empty={isEmpty || null}\n data-invalid={isInvalid || null}\n data-length={length}\n data-placeholder={(!!placeholder && isEmpty) || null}\n data-readonly={readOnly || null}\n data-required={required || null}\n data-size={size}\n >\n <div\n className={sizer({\n className: classNames?.sizer,\n autoSize,\n type,\n isClearable,\n })}\n >\n <AriaInput\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className, autoSize, type, isClearable }),\n )}\n disabled={disabled}\n placeholder={placeholder}\n readOnly={readOnly}\n required={required}\n type={type}\n value={value}\n onChange={handleChange}\n onKeyDown={(event) => {\n onKeyDown?.(event);\n\n if (\n isClearable &&\n !event.defaultPrevented &&\n event.key === 'Escape'\n ) {\n handleChange(clearInputEvent);\n }\n }}\n />\n </div>\n {isClearable && (\n <Button\n className={composeRenderProps(classNames?.clear, (className) =>\n clear({ className, autoSize, type, isClearable }),\n )}\n excludeFromTabOrder\n size='small'\n variant='icon'\n isDisabled={disabled}\n onPress={() => {\n handleChange(clearInputEvent);\n\n ref?.current?.focus();\n }}\n >\n <Icon>\n <CancelFill />\n </Icon>\n </Button>\n )}\n </div>\n );\n}\nInput.displayName = 'Input';\n"]}
@@ -1,7 +1,9 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
2
 
3
3
  declare const InputStylesDefaults: {
4
+ readonly autoSize: false;
4
5
  readonly type: "text";
6
+ readonly isClearable: false;
5
7
  };
6
8
  declare const InputStyles: tailwind_variants.TVReturnType<{
7
9
  autoSize: {
@@ -42,14 +44,6 @@ declare const InputStyles: tailwind_variants.TVReturnType<{
42
44
  container: string;
43
45
  };
44
46
  };
45
- isEmpty: {
46
- false: {
47
- clear: string;
48
- };
49
- true: {
50
- clear: string;
51
- };
52
- };
53
47
  }, {
54
48
  container: string;
55
49
  sizer: string[];
@@ -94,14 +88,6 @@ declare const InputStyles: tailwind_variants.TVReturnType<{
94
88
  container: string;
95
89
  };
96
90
  };
97
- isEmpty: {
98
- false: {
99
- clear: string;
100
- };
101
- true: {
102
- clear: string;
103
- };
104
- };
105
91
  }, {
106
92
  container: string;
107
93
  sizer: string[];
@@ -146,14 +132,6 @@ declare const InputStyles: tailwind_variants.TVReturnType<{
146
132
  container: string;
147
133
  };
148
134
  };
149
- isEmpty: {
150
- false: {
151
- clear: string;
152
- };
153
- true: {
154
- clear: string;
155
- };
156
- };
157
135
  }, {
158
136
  container: string;
159
137
  sizer: string[];
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';const t={type:"text"},i=tv({slots:{container:"group/input grid items-center [--length:attr(data-length_type(<number>),0)] [grid-template-columns:minmax(0,1fr)_min-content]",sizer:["[grid-column:1/-1] [grid-row:1]","font-display group-size-medium/input:text-body-s group-size-small/input:text-body-xs"],input:["block w-full rounded-medium py-xs pr-[calc(var(--room)+var(--spacing-s))] pl-s font-display text-default-light outline outline-interactive","enabled:group-focus/input:outline-highlight","enabled:group-hover/input:outline-interactive-hover","enabled:group-invalid/input:outline-serious","disabled:cursor-not-allowed disabled:text-disabled disabled:outline-interactive-disabled disabled:placeholder:text-disabled"],clear:["[grid-column:2/-1] [grid-row:1]","group-size-medium/input:mr-xs group-size-small/input:mr-xxs","enabled:fg-interactive enabled:bg-transparent","enabled:focus:fg-interactive-hover enabled:focus:bg-transparent","enabled:hover:fg-interactive-hover enabled:hover:bg-transparent"]},variants:{autoSize:{false:"",true:""},type:{button:"",checkbox:"",color:"",date:"","datetime-local":"",email:"",file:"",hidden:"",image:"",month:"",number:{input:"[appearance:textfield] placeholder:text-default-dark [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"},password:"",radio:"",range:"",reset:"",search:"",submit:"",tel:"",text:"",time:"",url:"",week:""},isClearable:{false:{container:"[--room:0px]"},true:{container:"[--room:20px]"}},isEmpty:{false:{clear:"group-not-focus-within/input:hidden"},true:{clear:"hidden"}}},compoundVariants:[{type:["color","date","datetime-local","email","number","password","search","tel","text","time","url"],className:{sizer:["group-size-medium/input:min-w-[160px] group-size-medium/input:max-w-[400px]","group-size-medium/input:min-w-[80px] group-size-small/input:max-w-[200px]"]}},{autoSize:true,type:["number","text"],className:{sizer:["group-size-medium/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-s-spacing))+(var(--spacing-s)*2)+var(--room))]","group-size-small/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))] group-size-small/input:min-w-[calc(2ch+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))]"]}}],defaultVariants:t});export{i as InputStyles,t as InputStylesDefaults};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';const t={autoSize:false,type:"text",isClearable:false},a=tv({slots:{container:"group/input grid items-center [--length:attr(data-length_type(<number>),0)] [grid-template-columns:minmax(0,1fr)_min-content]",sizer:["font-display [grid-column:1/-1] [grid-row:1]","group-size-medium/input:text-body-s group-size-small/input:text-body-xs"],input:["block w-full rounded-medium py-xs pr-[calc(var(--room)+var(--spacing-s))] pl-s font-display text-default-light outline outline-interactive","enabled:group-focus-visible-within/input:outline-highlight","enabled:group-hover/input:outline-interactive-hover","enabled:group-invalid/input:outline-serious","disabled:cursor-not-allowed disabled:text-disabled disabled:outline-interactive-disabled disabled:placeholder:text-disabled"],clear:["[grid-column:2/-1] [grid-row:1]","group-size-medium/input:mr-xs group-size-small/input:mr-xxs","enabled:fg-interactive enabled:bg-transparent","enabled:focus-visible:fg-interactive-hover enabled:focus-visible:bg-transparent","enabled:hover:fg-interactive-hover enabled:hover:bg-transparent","group-empty/input:invisible","group-not-empty/input:group-not-focus-within/input:invisible"]},variants:{autoSize:{false:"",true:""},type:{button:"",checkbox:"",color:"",date:"","datetime-local":"",email:"",file:"",hidden:"",image:"",month:"",number:{input:"[appearance:textfield] placeholder:text-default-dark [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none"},password:"",radio:"",range:"",reset:"",search:"",submit:"",tel:"",text:"",time:"",url:"",week:""},isClearable:{false:{container:"[--room:0px]"},true:{container:"[--room:20px]"}}},compoundVariants:[{type:["color","date","datetime-local","email","number","password","search","tel","text","time","url"],className:{sizer:["group-size-medium/input:min-w-[160px] group-size-medium/input:max-w-[400px]","group-size-small/input:min-w-[80px] group-size-small/input:max-w-[200px]"]}},{autoSize:true,type:["number","text"],className:{sizer:["group-size-medium/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-s-spacing))+(var(--spacing-s)*2)+var(--room))]","group-size-small/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))] group-size-small/input:min-w-[calc(2ch+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))]"]}}],defaultVariants:t});export{a as InputStyles,t as InputStylesDefaults};//# sourceMappingURL=styles.js.map
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/input/styles.ts"],"names":["InputStyles","tv","e"],"mappings":"sCAeQ,MAAA,CAAA,CAAA,CAAA,IAGKA,CAAcC,MACzB,CAAA,CAAA,CAAO,CACLC,EAAA,CAAA,CAAA,KAAA,CAAA,CACE,SAAA,CAAA,+HAEA,CAAA,KAAA,CAAA,CAAA,iCACA,CAAA,sFAGA,CAAA,CAAA,KAAA,CAAA,CAAA,0LAEA,CAAA,qDACA,CAAA,2KAIA,CAAA,CAAA,KAAA,CAAA,CAAA,+FAEA,CAAA,+CACA,CAAA,qIAIM,CACR,QAAA,CAAU,CACR,SACA,CAAA,KAAM,CACR,EACA,CAAA,IAAM,CACJ,QAAQ,CAAA,CACR,MAAA,CAAA,EAAU,CAAA,QACH,GACP,CAAA,KAAM,CAAA,2BAEC,GACP,CAAA,KAAM,CAAA,EACN,CAAA,IAAA,CAAQ,EAAA,CACR,MAAO,CAAA,EACP,CAAA,KAAO,GACP,CAAA,KAAA,CAAQ,SAEJ,CAAA,CAAA,KAAA,CAAA,oJAEJ,CAAU,CAAA,QACH,CAAA,EACP,CAAA,KAAO,GACP,CAAA,KAAO,CAAA,EACP,OAAQ,EAAA,CACR,MAAA,CAAQ,EAAA,CACR,OACA,EAAA,CAAA,GAAM,CAAA,EACN,CAAA,IAAM,CAAA,OACD,CACL,EAAA,CAAA,GAAM,CACR,EACA,qBAEI,CAAA,CAAA,KAAA,CAAA,CAAW,SAAA,CAAA,cAGX,CAAA,CAAA,IAAA,CAAA,CAAW,SAAA,CAAA,eAGf,CAAS,CACP,CAAA,cACS,CAAA,CAAA,KAAA,CAAA,2CAGA,CAAA,CAAA,KAEX,CACF,QACA,CAAA,CAAA,CAAA,CAAA,gBAGM,CAAA,CAAA,CAAA,IACA,SACA,CAAA,MAAA,CAAA,wBAGA,CAAA,QAAA,CAAA,UAEA,SACA,CAAA,KACA,CAAA,MACA,CAAA,cAES,SAEP,CAAA,CAAA,KAAA,CAAA,CAAA,6EACA,CAAA,2EAKJ,CAAA,CAAA,CAAA,CAAU,SACH,WAAU,CAAA,iBACN,SAEP,CAAA,CAAA,KAAA,CAAA,CAAA,2ZAMR,CAAA,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const InputStylesDefaults = {\n type: 'text',\n} as const;\n\nexport const InputStyles = tv({\n slots: {\n container:\n 'group/input grid items-center [--length:attr(data-length_type(<number>),0)] [grid-template-columns:minmax(0,1fr)_min-content]',\n sizer: [\n '[grid-column:1/-1] [grid-row:1]',\n 'font-display group-size-medium/input:text-body-s group-size-small/input:text-body-xs',\n ],\n input: [\n 'block w-full rounded-medium py-xs pr-[calc(var(--room)+var(--spacing-s))] pl-s font-display text-default-light outline outline-interactive',\n 'enabled:group-focus/input:outline-highlight',\n 'enabled:group-hover/input:outline-interactive-hover',\n 'enabled:group-invalid/input:outline-serious',\n 'disabled:cursor-not-allowed disabled:text-disabled disabled:outline-interactive-disabled disabled:placeholder:text-disabled',\n ],\n clear: [\n '[grid-column:2/-1] [grid-row:1]',\n 'group-size-medium/input:mr-xs group-size-small/input:mr-xxs',\n 'enabled:fg-interactive enabled:bg-transparent',\n 'enabled:focus:fg-interactive-hover enabled:focus:bg-transparent',\n 'enabled:hover:fg-interactive-hover enabled:hover:bg-transparent',\n ],\n },\n variants: {\n autoSize: {\n false: '',\n true: '',\n },\n type: {\n button: '',\n checkbox: '',\n color: '',\n date: '',\n 'datetime-local': '',\n email: '',\n file: '',\n hidden: '',\n image: '',\n month: '',\n number: {\n input:\n '[appearance:textfield] placeholder:text-default-dark [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n },\n password: '',\n radio: '',\n range: '',\n reset: '',\n search: '',\n submit: '',\n tel: '',\n text: '',\n time: '',\n url: '',\n week: '',\n },\n isClearable: {\n false: {\n container: '[--room:0px]',\n },\n true: {\n container: '[--room:20px]',\n },\n },\n isEmpty: {\n false: {\n clear: 'group-not-focus-within/input:hidden',\n },\n true: {\n clear: 'hidden',\n },\n },\n },\n compoundVariants: [\n {\n type: [\n 'color',\n 'date',\n 'datetime-local',\n 'email',\n 'number',\n 'password',\n 'search',\n 'tel',\n 'text',\n 'time',\n 'url',\n ],\n className: {\n sizer: [\n 'group-size-medium/input:min-w-[160px] group-size-medium/input:max-w-[400px]',\n 'group-size-medium/input:min-w-[80px] group-size-small/input:max-w-[200px]',\n ],\n },\n },\n {\n autoSize: true,\n type: ['number', 'text'],\n className: {\n sizer: [\n 'group-size-medium/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-s-spacing))+(var(--spacing-s)*2)+var(--room))]',\n 'group-size-small/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))] group-size-small/input:min-w-[calc(2ch+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))]',\n ],\n },\n },\n ],\n defaultVariants: InputStylesDefaults,\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/input/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAA,CAAU,CAAA,QACJ,CAAA,KAAA,CAAA,uBAKN,CAAA,KAAA,CAAA,CAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAA,CAAA,CACE,SAAA,CAAA,+HAEA,CAAA,KAAA,CAAA,CAAA,8CACA,CAAA,yEAGA,CAAA,CAAA,KAAA,CAAA,CAAA,4IACA,CAAA,4DACA,CAAA,mGAEA,CAAA,6HAGA,CAAA,CAAA,KAAA,CAAA,CAAA,+FAEA,CAAA,+CACA,CAAA,iFACA,CAAA,iEACA,CAAA,4FAIJ,CAAA,CAAU,CACR,SAAU,CACR,QAAO,CACP,CAAA,MACF,EACA,CAAA,IAAM,CACJ,EAAA,CAAA,CAAA,IAAQ,CAAA,CACR,SAAU,CAAA,QACH,CAAA,EACP,CAAA,QACA,CAAA,IAAA,CAAA,EAAA,CAAA,gBACO,CAAA,EACP,MAAM,CAAA,EACN,CAAA,IAAA,CAAQ,EAAA,CACR,MAAO,GACP,CAAA,KAAO,CAAA,EACP,OAAQ,EACN,CAAA,kKAGF,CAAU,CAAA,QACH,GACP,CAAA,KAAO,CAAA,EACP,CAAA,KAAO,CAAA,EACP,OAAQ,EAAA,CACR,MAAA,CAAQ,EAAA,CACR,OACA,EAAA,CAAA,GAAM,CAAA,OACA,CAAA,EACN,CAAA,KACA,EAAA,CAAA,GAAM,CACR,EACA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,WAEI,CAAA,CAAA,KAAA,CAAA,CAAW,SAAA,CAAA,cAGX,CAAA,CAAA,IAAA,CAAA,CAAW,SAAA,CAAA,mCAOX,CAAA,CAAA,CAAA,IACA,CAAA,CAAA,OACA,CAAA,MAAA,CAAA,gBAEA,CAAA,OACA,CAAA,QAAA,CAAA,UAEA,CAAA,cAEA,CAAA,MACA,CAAA,MAEF,CAAA,KAAA,CAAA,CAAW,+FAGP,CAAA,0EAKJ,CAAA,CAAA,CAAA,CAAU,CAAA,QACH,CAAA,IAAA,CAAA,IAAA,CAAU,CAAA,iBACN,SAEP,CAAA,CAAA,KAAA,CAAA,CAAA,2ZAMR,CAAA,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const InputStylesDefaults = {\n autoSize: false,\n type: 'text',\n isClearable: false,\n} as const;\n\nexport const InputStyles = tv({\n slots: {\n container:\n 'group/input grid items-center [--length:attr(data-length_type(<number>),0)] [grid-template-columns:minmax(0,1fr)_min-content]',\n sizer: [\n 'font-display [grid-column:1/-1] [grid-row:1]',\n 'group-size-medium/input:text-body-s group-size-small/input:text-body-xs',\n ],\n input: [\n 'block w-full rounded-medium py-xs pr-[calc(var(--room)+var(--spacing-s))] pl-s font-display text-default-light outline outline-interactive',\n 'enabled:group-focus-visible-within/input:outline-highlight',\n 'enabled:group-hover/input:outline-interactive-hover',\n 'enabled:group-invalid/input:outline-serious',\n 'disabled:cursor-not-allowed disabled:text-disabled disabled:outline-interactive-disabled disabled:placeholder:text-disabled',\n ],\n clear: [\n '[grid-column:2/-1] [grid-row:1]',\n 'group-size-medium/input:mr-xs group-size-small/input:mr-xxs',\n 'enabled:fg-interactive enabled:bg-transparent',\n 'enabled:focus-visible:fg-interactive-hover enabled:focus-visible:bg-transparent',\n 'enabled:hover:fg-interactive-hover enabled:hover:bg-transparent',\n 'group-empty/input:invisible',\n 'group-not-empty/input:group-not-focus-within/input:invisible',\n ],\n },\n variants: {\n autoSize: {\n false: '',\n true: '',\n },\n type: {\n button: '',\n checkbox: '',\n color: '',\n date: '',\n 'datetime-local': '',\n email: '',\n file: '',\n hidden: '',\n image: '',\n month: '',\n number: {\n input:\n '[appearance:textfield] placeholder:text-default-dark [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n },\n password: '',\n radio: '',\n range: '',\n reset: '',\n search: '',\n submit: '',\n tel: '',\n text: '',\n time: '',\n url: '',\n week: '',\n },\n isClearable: {\n false: {\n container: '[--room:0px]',\n },\n true: {\n container: '[--room:20px]',\n },\n },\n },\n compoundVariants: [\n {\n type: [\n 'color',\n 'date',\n 'datetime-local',\n 'email',\n 'number',\n 'password',\n 'search',\n 'tel',\n 'text',\n 'time',\n 'url',\n ],\n className: {\n sizer: [\n 'group-size-medium/input:min-w-[160px] group-size-medium/input:max-w-[400px]',\n 'group-size-small/input:min-w-[80px] group-size-small/input:max-w-[200px]',\n ],\n },\n },\n {\n autoSize: true,\n type: ['number', 'text'],\n className: {\n sizer: [\n 'group-size-medium/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-s-spacing))+(var(--spacing-s)*2)+var(--room))]',\n 'group-size-small/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))] group-size-small/input:min-w-[calc(2ch+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))]',\n ],\n },\n },\n ],\n defaultVariants: InputStylesDefaults,\n});\n"]}
@@ -3,6 +3,7 @@ import { InputProps as InputProps$1 } from 'react-aria-components';
3
3
  import { VariantProps } from 'tailwind-variants';
4
4
  import { ButtonProps } from '../button/types.js';
5
5
  import { InputStyles } from './styles.js';
6
+ import '../../lib/types.js';
6
7
  import '../button/styles.js';
7
8
  import 'tailwind-merge';
8
9
 
@@ -9,6 +9,25 @@ declare function LabelProvider({ children, ...props }: ProviderProps<LabelProps>
9
9
  declare namespace LabelProvider {
10
10
  var displayName: string;
11
11
  }
12
+ /**
13
+ * Label - A semantic label component for form elements and content
14
+ *
15
+ * Provides accessible labeling for form controls with automatic handling of
16
+ * required/optional states. Integrates with React Aria form components to
17
+ * ensure proper accessibility and screen reader support.
18
+ *
19
+ * @example
20
+ * // Basic label
21
+ * <Label>Username</Label>
22
+ *
23
+ * @example
24
+ * // Required field label
25
+ * <Label isRequired>Email Address</Label>
26
+ *
27
+ * @example
28
+ * // Disabled label
29
+ * <Label isDisabled>Inactive Field</Label>
30
+ */
12
31
  declare function Label({ ref, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
13
32
  declare namespace Label {
14
33
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/label/index.tsx"],"names":["createContext","b","props","u","LabelProvider","ref","useContextProps","rest","P","d","m","isRequired","Label"],"mappings":"+LAyBEA,MAA0D,CAAA,CAAAC,aAAA,CAAI,IAEhE,EAAA,SAAyB,CAAA,CAAA,CAAA,QAAU,CAAA,CAAGC,CAAM,GAC1C,CAAA,CAAA,CAAA,CAAA,OACgBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAE1C,CACAC,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,gBAErB,CAAA,SAAiB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACpC,CAACA,CAAAA,CAAOG,CAAG,CAAA,CAAIC,CAAAA,CAAgBJ,EAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,CAAA,CAAA,CAAA,CAAA,cAAkB,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,UAAY,CAAA,CAAA,CAAA,UAAY,CAAA,CAAGE,CAAK,GAAIL,CAEjE,CAAA,CAAA,CAAA,CAAA,OACGM,IACE,CAAAC,KAAA,CAAGF,CAAAA,GACJ,CAAA,CAAA,SAAyB,CAAAG,WAAA,CAAA,CAAA,SAAW,CACpC,CAAA,CAAA,CAAA,CAAA,eAA6B,CAAA,CAAA,EAAA,IAC7B,CAAA,eAA6B,CAAA,CAAA,EAAA,IAE5B,CAAA,QACA,CAACC,CAAAA,CAAAA,CAAc,CAAA,CAAA,EAAA,aAItBC,CAAAA,CAAM,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,OACd,CAAA,CAAA,CAAA,QAAWR,CAAAA,CAAAA","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'use client';\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n Label as AriaLabel,\n type ContextValue,\n useContextProps,\n} from 'react-aria-components';\nimport { LabelStyles } from './styles';\nimport type { LabelProps } from './types';\n\nexport const LabelContext =\n createContext<ContextValue<LabelProps, HTMLLabelElement>>(null);\n\nfunction LabelProvider({ children, ...props }: ProviderProps<LabelProps>) {\n return (\n <LabelContext.Provider value={props}>{children}</LabelContext.Provider>\n );\n}\nLabelProvider.displayName = 'Label.Provider';\n\nexport function Label({ ref, ...props }: LabelProps) {\n [props, ref] = useContextProps(props, ref ?? null, LabelContext);\n\n const { children, className, isDisabled, isRequired, ...rest } = props;\n\n return (\n <AriaLabel\n {...rest}\n className={LabelStyles({ className })}\n data-disabled={isDisabled || null}\n data-required={isRequired || null}\n >\n {children}\n {!isRequired && ' (optional)'}\n </AriaLabel>\n );\n}\nLabel.displayName = 'Label';\nLabel.Provider = LabelProvider;\n"]}
1
+ {"version":3,"sources":["../../../src/components/label/index.tsx"],"names":["createContext","b","props","u","LabelProvider","ref","useContextProps","rest","P","d","m","isRequired","Label"],"mappings":"+LAyBEA,MAA0D,CAAA,CAAAC,aAAA,CAAI,IAEhE,EAAA,SAAyB,CAAA,CAAA,CAAA,QAAU,CAAA,CAAGC,CAAM,GAC1C,CAAA,CAAA,CAAA,CAAA,OACgBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAE1C,CACAC,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,gBAqBrB,CAAA,SAAiB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACpC,CAACA,CAAAA,CAAOG,CAAG,CAAA,CAAIC,CAAAA,CAAgBJ,EAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,CAAA,CAAA,CAAA,CAAA,cAAkB,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,UAAY,CAAA,CAAA,CAAA,UAAY,CAAA,CAAGE,CAAK,GAAIL,CAEjE,CAAA,CAAA,CAAA,CAAA,OACGM,IACE,CAAAC,KAAA,CAAGF,CAAAA,GACJ,CAAA,CAAA,SAAyB,CAAAG,WAAA,CAAA,CAAA,SAAW,CACpC,CAAA,CAAA,CAAA,CAAA,eAA6B,CAAA,CAAA,EAAA,IAC7B,CAAA,eAA6B,CAAA,CAAA,EAAA,IAE5B,CAAA,QACA,CAACC,CAAAA,CAAAA,CAAc,CAAA,CAAA,EAAA,aAItBC,CAAAA,CAAM,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,OACd,CAAA,CAAA,CAAA,QAAWR,CAAAA,CAAAA","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'use client';\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n Label as AriaLabel,\n type ContextValue,\n useContextProps,\n} from 'react-aria-components';\nimport { LabelStyles } from './styles';\nimport type { LabelProps } from './types';\n\nexport const LabelContext =\n createContext<ContextValue<LabelProps, HTMLLabelElement>>(null);\n\nfunction LabelProvider({ children, ...props }: ProviderProps<LabelProps>) {\n return (\n <LabelContext.Provider value={props}>{children}</LabelContext.Provider>\n );\n}\nLabelProvider.displayName = 'Label.Provider';\n\n/**\n * Label - A semantic label component for form elements and content\n *\n * Provides accessible labeling for form controls with automatic handling of\n * required/optional states. Integrates with React Aria form components to\n * ensure proper accessibility and screen reader support.\n *\n * @example\n * // Basic label\n * <Label>Username</Label>\n *\n * @example\n * // Required field label\n * <Label isRequired>Email Address</Label>\n *\n * @example\n * // Disabled label\n * <Label isDisabled>Inactive Field</Label>\n */\nexport function Label({ ref, ...props }: LabelProps) {\n [props, ref] = useContextProps(props, ref ?? null, LabelContext);\n\n const { children, className, isDisabled, isRequired, ...rest } = props;\n\n return (\n <AriaLabel\n {...rest}\n className={LabelStyles({ className })}\n data-disabled={isDisabled || null}\n data-required={isRequired || null}\n >\n {children}\n {!isRequired && ' (optional)'}\n </AriaLabel>\n );\n}\nLabel.displayName = 'Label';\nLabel.Provider = LabelProvider;\n"]}
@@ -1,14 +1,14 @@
1
1
  import * as react_aria_components from 'react-aria-components';
2
- import { MenuTrigger, ContextValue } from 'react-aria-components';
2
+ import { MenuTrigger, TextProps, SeparatorProps, ContextValue } from 'react-aria-components';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as react from 'react';
5
- import { MenuProps, MenuItemProps, MenuTextProps, SeparatorProps, MenuSectionProps } from './types.js';
5
+ import { MenuProps, MenuItemProps, MenuSectionProps } from './types.js';
6
+ import 'tailwind-variants';
6
7
  import '../icon/types.js';
7
8
  import './styles.js';
8
- import 'tailwind-variants';
9
9
 
10
10
  declare const MenuContext: react.Context<ContextValue<MenuProps<unknown>, HTMLDivElement>>;
11
- declare function MenuSection<T extends object>(props: MenuSectionProps<T>): react_jsx_runtime.JSX.Element;
11
+ declare function MenuSection<T extends object>({ children, classNames, items, title, ...rest }: MenuSectionProps<T>): react_jsx_runtime.JSX.Element;
12
12
  declare namespace MenuSection {
13
13
  var displayName: string;
14
14
  }
@@ -16,20 +16,82 @@ declare function MenuSeparator({ className, ...rest }: SeparatorProps): react_js
16
16
  declare namespace MenuSeparator {
17
17
  var displayName: string;
18
18
  }
19
- declare function MenuLabel(props: MenuTextProps): react_jsx_runtime.JSX.Element;
19
+ declare function MenuLabel({ children, className, ...rest }: TextProps): react_jsx_runtime.JSX.Element;
20
20
  declare namespace MenuLabel {
21
21
  var displayName: string;
22
22
  }
23
- declare function MenuDescription(props: MenuTextProps): react_jsx_runtime.JSX.Element;
23
+ declare function MenuDescription({ children, className, ...rest }: TextProps): react_jsx_runtime.JSX.Element;
24
24
  declare namespace MenuDescription {
25
25
  var displayName: string;
26
26
  }
27
- declare function MenuItem(props: MenuItemProps): react_jsx_runtime.JSX.Element;
27
+ declare function MenuItem({ children, classNames, color, ...rest }: MenuItemProps): react_jsx_runtime.JSX.Element;
28
28
  declare namespace MenuItem {
29
29
  var displayName: string;
30
30
  var Label: typeof MenuLabel;
31
31
  var Description: typeof MenuDescription;
32
32
  }
33
+ /**
34
+ * Menu - A dropdown menu component with keyboard navigation and selection
35
+ *
36
+ * Provides accessible dropdown menu functionality with support for single and
37
+ * multiple selection modes. Includes sections, separators, and submenu support
38
+ * with comprehensive keyboard navigation and ARIA compliance.
39
+ *
40
+ * @example
41
+ * // Basic menu with trigger
42
+ * <Menu.Trigger>
43
+ * <Button>Open Menu</Button>
44
+ * <Menu>
45
+ * <Menu.Item>Edit</Menu.Item>
46
+ * <Menu.Item>Copy</Menu.Item>
47
+ * <Menu.Item>Delete</Menu.Item>
48
+ * </Menu>
49
+ * </Menu.Trigger>
50
+ *
51
+ * @example
52
+ * // Menu with sections and separators
53
+ * <Menu.Trigger>
54
+ * <Button>Open</Button>
55
+ * <Menu>
56
+ * <Menu.Section>
57
+ * <Menu.Item>New File</Menu.Item>
58
+ * <Menu.Item>Open File</Menu.Item>
59
+ * </Menu.Section>
60
+ *
61
+ * <Menu.Separator />
62
+ *
63
+ * <Menu.Item>Settings</Menu.Item>
64
+ * </Menu>
65
+ * </Menu.Trigger>
66
+ *
67
+ * @example
68
+ * // Menu with selection
69
+ * <Menu.Trigger>
70
+ * <Button>Group</Button>
71
+ * <Menu selectionMode='multiple'>
72
+ * <Menu.Item>Option 1</Menu.Item>
73
+ * <Menu.Item>Option 2</Menu.Item>
74
+ * </Menu>
75
+ * </Menu.Trigger>
76
+ *
77
+ * @example
78
+ * // Menu with submenu
79
+ * <Menu.Trigger>
80
+ * <Button>Actions</Button>
81
+ * <Menu>
82
+ * <Menu.Item>New File</Menu.Item>
83
+ * <Menu.Submenu>
84
+ * <Menu.Item>Export</Menu.Item>
85
+ * <Menu>
86
+ * <Menu.Item>Export as PDF</Menu.Item>
87
+ * <Menu.Item>Export as CSV</Menu.Item>
88
+ * <Menu.Item>Export as JSON</Menu.Item>
89
+ * </Menu>
90
+ * </Menu.Submenu>
91
+ * <Menu.Item>Delete</Menu.Item>
92
+ * </Menu>
93
+ * </Menu.Trigger>
94
+ */
33
95
  declare function Menu<T extends object>({ ref, ...props }: MenuProps<T>): react_jsx_runtime.JSX.Element;
34
96
  declare namespace Menu {
35
97
  var displayName: string;
@@ -1,2 +1,2 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {isSlottedContextValue}from'./../../lib/utils.js';import y from'@accelint/icons/chevron-right';import {createContext,useContext}from'react';import {useContextProps,Popover,Menu,composeRenderProps,MenuTrigger,SubmenuTrigger,MenuSection,Header,Collection,Separator,Text,MenuItem,Provider,KeyboardContext,DEFAULT_SLOT}from'react-aria-components';import {IconContext,Icon}from'../icon/index.js';import {MenuStyles,MenuStylesDefaults}from'./styles.js';const {menu:z,icon:B,item:G,label:J,description:Q,more:W,sectionHeader:X,separator:Y,keyboard:Z}=MenuStyles(),N=createContext(null);function P(n){const{header:e,children:o,classNames:t,items:i,...c}=n;return jsxs(MenuSection,{className:t?.section,...c,children:[jsx(Header,{className:X({className:t?.sectionHeader}),children:e}),jsx(Collection,{items:i,children:o})]})}P.displayName="Menu.Section";function S({className:n,...e}){return jsx(Separator,{...e,className:Y({className:n})})}S.displayName="Menu.Separator";function T(n){const{children:e,className:o,...t}=n;return jsx(Text,{...t,slot:"label",className:J({className:o}),children:e})}T.displayName="Menu.Item.Label";function f(n){const{children:e,className:o,...t}=n;return jsx(Text,{...t,slot:"description",className:Q({className:o}),children:e})}f.displayName="Menu.Item.Description";function u(n){const e=useContext(N),o=(isSlottedContextValue(e)?void 0:e?.variant)??MenuStylesDefaults.variant,{classNames:t,color:i=MenuStylesDefaults.color,children:c,...l}=n;return jsx(MenuItem,{...l,className:composeRenderProps(t?.item,r=>G({className:r,variant:o,color:i})),children:composeRenderProps(c,(r,{hasSubmenu:m})=>jsxs(Provider,{values:[[KeyboardContext,{className:Z({className:t?.keyboard})}],[IconContext,{slots:{[DEFAULT_SLOT]:{className:B({className:t?.icon})},submenu:{className:W({className:t?.more})}}}]],children:[typeof r=="string"?jsx(Text,{className:t?.text,slot:"label",children:r}):r,m&&jsx(Icon,{slot:"submenu",children:jsx(y,{})})]}))})}u.displayName="Menu.Item",u.Label=T,u.Description=f;function s({ref:n,...e}){[e,n]=useContextProps(e,n??null,N);const{children:o,className:t,selectionMode:i="single",offset:c=-4,placement:l,isNonModal:r,containerPadding:m,variant:x=MenuStylesDefaults.variant,...b}=e;return jsx(Popover,{offset:c,placement:l,isNonModal:r,containerPadding:m,children:jsx(N.Provider,{value:{variant:x},children:jsx(Menu,{ref:n,className:composeRenderProps(t,g=>z({className:g,variant:x})),selectionMode:i,...b,children:o})})})}s.displayName="Menu",s.Trigger=MenuTrigger,s.Submenu=SubmenuTrigger,s.Item=u,s.Separator=S,s.Section=P;export{s as Menu,N as MenuContext};//# sourceMappingURL=index.js.map
1
+ import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {isSlottedContextValue}from'./../../lib/utils.js';import f from'@accelint/icons/chevron-right';import {createContext,useContext}from'react';import {useContextProps,Popover,composeRenderProps,Menu,MenuTrigger,SubmenuTrigger,MenuSection,Header,Collection,Separator,Text,MenuItem,Provider,KeyboardContext,DEFAULT_SLOT}from'react-aria-components';import {IconContext,Icon}from'../icon/index.js';import {MenuStyles,MenuStylesDefaults}from'./styles.js';const {menu:U,icon:_,item:q,label:z,description:B,more:G,section:J,header:Q,separator:W,hotkey:X,popover:Y}=MenuStyles(),d=createContext(null);function P({children:t,classNames:e,items:n,title:a,...s}){return jsxs(MenuSection,{...s,className:J({className:e?.section}),children:[a&&jsx(Header,{className:Q({className:e?.header}),children:a}),jsx(Collection,{items:n,children:t})]})}P.displayName="Menu.Section";function S({className:t,...e}){return jsx(Separator,{...e,className:W({className:t})})}S.displayName="Menu.Separator";function N({children:t,className:e,...n}){return jsx(Text,{...n,slot:"label",className:z({className:e}),children:t})}N.displayName="Menu.Item.Label";function v({children:t,className:e,...n}){return jsx(Text,{...n,slot:"description",className:B({className:e}),children:t})}v.displayName="Menu.Item.Description";function m({children:t,classNames:e,color:n="info",...a}){const s=useContext(d),l=(isSlottedContextValue(s)?void 0:s?.variant)??MenuStylesDefaults.variant;return jsx(MenuItem,{...a,className:composeRenderProps(e?.item,r=>q({className:r,variant:l})),"data-color":n,children:composeRenderProps(t,(r,{hasSubmenu:p})=>jsxs(Provider,{values:[[KeyboardContext,{className:X({className:e?.hotkey})}],[IconContext,{slots:{[DEFAULT_SLOT]:{className:_({className:e?.icon})},submenu:{className:G({className:e?.more})}}}]],children:[typeof r=="string"?jsx(Text,{slot:"label",className:e?.text,children:r}):r,p&&jsx(Icon,{slot:"submenu",children:jsx(f,{})})]}))})}m.displayName="Menu.Item",m.Label=N,m.Description=v;function i({ref:t,...e}){[e,t]=useContextProps(e,t??null,d);const{children:n,classNames:a,popoverProps:s,selectionMode:l="single",variant:r=MenuStylesDefaults.variant,...p}=e;return jsx(Popover,{...s,className:composeRenderProps(a?.popover,c=>Y({className:c})),children:jsx(d.Provider,{value:{variant:r},children:jsx(Menu,{...p,ref:t,className:composeRenderProps(a?.menu,c=>U({className:c,variant:r})),selectionMode:l,children:n})})})}i.displayName="Menu",i.Trigger=MenuTrigger,i.Submenu=SubmenuTrigger,i.Item=m,i.Separator=S,i.Section=P;export{i as Menu,d as MenuContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["label","description","sectionHeader","keyboard","MenuStyles","MenuSection","props","C","children","classNames","rest","jsxs","A","k","jsx","a","h","items","H","MenuSeparator","className","E","p","useContext","MenuContext","context","I","v","MenuStylesDefaults","d","L","item","M","variant","composeRenderProps","Provider","K","w","_","icon","j","more","AriaText","hasSubmenu","U","MenuItem","MenuDescription","Menu","ref","O","placement","isNonModal","offset","F","AriaMenu","menu","AriaSubmenuTrigger"],"mappings":"mgBAkDE,MAAA,CAAA,IAAAA,CACA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,IAAAC,CACA,CAAA,CAAA,KACA,CAAA,CAAA,CAAA,WAAAC,CAAAA,CACA,CAAA,IAAA,CAAA,CAAA,CAAA,aACAC,CACF,CAAA,CAAIC,SAG8D,CAAA,CAAA,CAAI,QAEtE,CAAA,CAAA,CAASC,CAAAA,UAA8BC,EAA4B,CACjE,CAAA,CAAAC,aAAA,CAAA,IAAQ,E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ACEf,CAAAA,OACE,CAAA,GAAQsC,CAAAA,CACR,CAAA,CAAA,CAAA,OAAWF,GAAAA,CACXG,OAAA,CAAA,CAAA,MAAA,CAAA,CAAYF,CAAAA,SACZ,CAAA,CAAA,CAAA,UAEA,CAAA,CAAA,CAAA,gBAAa,CAAZ,CAAqB,CAAA,QAAS,CAAApC,GAAA,CAAA,CAAA,CAAA,QAC7B,CAAA,CAAA,KAACuC,CAAAA,CAAA,OAEC,CAAA,CAAA,CAAA,CAAA,QAA8BlC,CAAAA,GAAYA,CAAAA,IAAAA,CACxCmC,CAAAA,GAAO,CAAA,CAAA,CAAA,SAAW,CAAAvB,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAC,CAC7B,CAAA,SACA,CAAA,CAAA,CAAA,OACC,CAAGtB,CAAAA,CAEH,CAAA,CAAA,CAAA,aAKX,CACAqC,CAAAA,CAAK,GAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CACnBA,CAAAA,CAAK,CAAA,CAAA,CAAA,WACA,CAAA,MAAUS,CACfT,CAAAA,CAAK,OACLA,CAAAA,WAAK,CAAA,CAAA,CAAA,OAAY5B,CAAAA,cACjB4B,EAAK,CAAA,IAAA,CAAA,CAAA,CAAU1C,CAAAA,CAAAA,SAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","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\n'use client';\n\nimport 'client-only';\nimport { isSlottedContextValue } from '@/lib/utils';\nimport ChevronRight from '@accelint/icons/chevron-right';\nimport { createContext, useContext } from 'react';\nimport {\n Header as AriaHeader,\n Menu as AriaMenu,\n Collection as AriaMenuCollection,\n MenuItem as AriaMenuItem,\n MenuSection as AriaMenuSection,\n MenuTrigger as AriaMenuTrigger,\n Separator as AriaSeparator,\n SubmenuTrigger as AriaSubmenuTrigger,\n Text as AriaText,\n type ContextValue,\n DEFAULT_SLOT,\n KeyboardContext,\n Popover,\n Provider,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon, IconContext } from '../icon';\nimport { MenuStyles, MenuStylesDefaults } from './styles';\nimport type {\n MenuItemProps,\n MenuProps,\n MenuSectionProps,\n MenuTextProps,\n SeparatorProps,\n} from './types';\n\nconst {\n menu,\n icon,\n item,\n label,\n description,\n more,\n sectionHeader,\n separator,\n keyboard,\n} = MenuStyles();\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps<unknown>, HTMLDivElement>>(null);\n\nfunction MenuSection<T extends object>(props: MenuSectionProps<T>) {\n const { header, children, classNames, items, ...rest } = props;\n\n return (\n <AriaMenuSection className={classNames?.section} {...rest}>\n <AriaHeader\n className={sectionHeader({ className: classNames?.sectionHeader })}\n >\n {header}\n </AriaHeader>\n <AriaMenuCollection items={items}>{children}</AriaMenuCollection>\n </AriaMenuSection>\n );\n}\nMenuSection.displayName = 'Menu.Section';\n\nfunction MenuSeparator({ className, ...rest }: SeparatorProps) {\n return <AriaSeparator {...rest} className={separator({ className })} />;\n}\nMenuSeparator.displayName = 'Menu.Separator';\n\nfunction MenuLabel(props: MenuTextProps) {\n const { children, className, ...rest } = props;\n\n return (\n <AriaText {...rest} slot='label' className={label({ className })}>\n {children}\n </AriaText>\n );\n}\nMenuLabel.displayName = 'Menu.Item.Label';\n\nfunction MenuDescription(props: MenuTextProps) {\n const { children, className, ...rest } = props;\n\n return (\n <AriaText\n {...rest}\n slot='description'\n className={description({ className })}\n >\n {children}\n </AriaText>\n );\n}\nMenuDescription.displayName = 'Menu.Item.Description';\n\nfunction MenuItem(props: MenuItemProps) {\n const context = useContext(MenuContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n MenuStylesDefaults.variant;\n\n const {\n classNames,\n color = MenuStylesDefaults.color,\n children,\n ...rest\n } = props;\n\n return (\n <AriaMenuItem\n {...rest}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className, variant, color }),\n )}\n >\n {composeRenderProps(children, (children, { hasSubmenu }) => (\n <Provider\n values={[\n [\n KeyboardContext,\n { className: keyboard({ className: classNames?.keyboard }) },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: {\n className: icon({ className: classNames?.icon }),\n },\n submenu: { className: more({ className: classNames?.more }) },\n },\n },\n ],\n ]}\n >\n {typeof children === 'string' ? (\n <AriaText className={classNames?.text} slot='label'>\n {children}\n </AriaText>\n ) : (\n children\n )}\n {hasSubmenu && (\n <Icon slot='submenu'>\n <ChevronRight />\n </Icon>\n )}\n </Provider>\n ))}\n </AriaMenuItem>\n );\n}\nMenuItem.displayName = 'Menu.Item';\nMenuItem.Label = MenuLabel;\nMenuItem.Description = MenuDescription;\n\nexport function Menu<T extends object>({ ref, ...props }: MenuProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, MenuContext);\n\n const {\n children,\n className,\n selectionMode = 'single',\n offset = -4,\n placement,\n isNonModal,\n containerPadding,\n variant = MenuStylesDefaults.variant,\n ...rest\n } = props;\n\n return (\n <Popover\n offset={offset}\n placement={placement}\n isNonModal={isNonModal}\n containerPadding={containerPadding}\n >\n <MenuContext.Provider value={{ variant }}>\n <AriaMenu\n ref={ref}\n className={composeRenderProps(className, (className) =>\n menu({ className, variant }),\n )}\n selectionMode={selectionMode}\n {...rest}\n >\n {children}\n </AriaMenu>\n </MenuContext.Provider>\n </Popover>\n );\n}\nMenu.displayName = 'Menu';\nMenu.Trigger = AriaMenuTrigger;\nMenu.Submenu = AriaSubmenuTrigger;\nMenu.Item = MenuItem;\nMenu.Separator = MenuSeparator;\nMenu.Section = MenuSection;\n"]}
1
+ {"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["label","description","header","MenuStyles","MenuContext","MenuSection","b","children","classNames","jsxs","AriaMenuSection","rest","y","A","title","jsx","o","h","Collection","items","D","MenuSeparator","className","R","M","context","useContext","isSlottedContextValue","C","T","MenuStylesDefaults","x","g","item","u","composeRenderProps","Provider","E","hotkey","k","K","icon","L","more","Text","hasSubmenu","F","MenuItem","MenuDescription","Menu","props","ref","w","popoverProps","V","AriaMenu","menu","SubmenuTrigger"],"mappings":"mgBA8CE,MAAA,CAAA,IAAAA,CACA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,IAAAC,CACA,CAAA,CAAA,KACA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAAC,IACA,CAAA,CAAA,CAAA,OACA,CAAA,CAAA,CAAA,MACA,CAAA,CAAA,CAAA,SACEC,CAAW,CAAA,CAEFC,MACqD,CAAA,CAAI,CAAA,OAEtE,CAAA,CAAA,CAASC,CAAAA,UAA8B,EACrC,CAAA,CAAA,CAAAC,aAAA,CAAA,IAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,QACA,CAAA,CAAA,CAAA,UAEF,CAAwB,CACtB,CAAA,KAAA,CACEC,CAAAA,CAACC,KACE,CAAGC,CAAAA,CACJ,GAAA,CAAA,CAAA,CAAA,CAAA,OAAqBC,IAAA,CAAAC,WAAA,CAAA,CAAA,GAAA,CAAWL,CAAAA,SAAoB,CAAC,CAAA,CAEpD,CAAA,SAAAM,CAAAA,CAAAA,EACCC,OAAQ,CAAA,CAAA,CAAA,QAAoB,CAAA,CAAA,CAAA,EAAAC,GAAA,CAAAC,MAAA,CAAWT,CAAAA,SAAoB,CAAA,CACxD,CAAA,CAAA,SACH,CAAA,CAEFO,EAACG,MAAW,CAAA,CAAA,CAAOC,QAAQ,CAAA,CAAA,CAAAZ,CAAAA,CAASS,GAAA,CAAAI,UACtC,CAEJ,CACAf,KAAY,CAA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B2B,CAAAA,CAAK,CAAA,CAAA,CAAA,WACA,CAAA,MAAUQ,CACfR,CAAAA,CAAK,OACLA,CAAAA,WAAK,CAAA,CAAA,CAAA,OAAY5B,CAAAA,cACjB4B,CAAAA,CAAK,CAAA,IAAA,CAAA,CAAA,CAAU5C,CAAAA,CAAAA,SAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","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\n'use client';\n\nimport 'client-only';\nimport { isSlottedContextValue } from '@/lib/utils';\nimport ChevronRight from '@accelint/icons/chevron-right';\nimport { createContext, useContext } from 'react';\nimport {\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n MenuSection as AriaMenuSection,\n Collection,\n type ContextValue,\n DEFAULT_SLOT,\n Header,\n KeyboardContext,\n MenuTrigger,\n Popover,\n Provider,\n Separator,\n type SeparatorProps,\n SubmenuTrigger,\n Text,\n type TextProps,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon, IconContext } from '../icon';\nimport { MenuStyles, MenuStylesDefaults } from './styles';\nimport type { MenuItemProps, MenuProps, MenuSectionProps } from './types';\n\nconst {\n menu,\n icon,\n item,\n label,\n description,\n more,\n section,\n header,\n separator,\n hotkey,\n popover,\n} = MenuStyles();\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps<unknown>, HTMLDivElement>>(null);\n\nfunction MenuSection<T extends object>({\n children,\n classNames,\n items,\n title,\n ...rest\n}: MenuSectionProps<T>) {\n return (\n <AriaMenuSection\n {...rest}\n className={section({ className: classNames?.section })}\n >\n {title && (\n <Header className={header({ className: classNames?.header })}>\n {title}\n </Header>\n )}\n <Collection items={items}>{children}</Collection>\n </AriaMenuSection>\n );\n}\nMenuSection.displayName = 'Menu.Section';\n\nfunction MenuSeparator({ className, ...rest }: SeparatorProps) {\n return <Separator {...rest} className={separator({ className })} />;\n}\nMenuSeparator.displayName = 'Menu.Separator';\n\nfunction MenuLabel({ children, className, ...rest }: TextProps) {\n return (\n <Text {...rest} slot='label' className={label({ className })}>\n {children}\n </Text>\n );\n}\nMenuLabel.displayName = 'Menu.Item.Label';\n\nfunction MenuDescription({ children, className, ...rest }: TextProps) {\n return (\n <Text {...rest} slot='description' className={description({ className })}>\n {children}\n </Text>\n );\n}\nMenuDescription.displayName = 'Menu.Item.Description';\n\nfunction MenuItem({\n children,\n classNames,\n color = 'info',\n ...rest\n}: MenuItemProps) {\n const context = useContext(MenuContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n MenuStylesDefaults.variant;\n\n return (\n <AriaMenuItem\n {...rest}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className, variant }),\n )}\n data-color={color}\n >\n {composeRenderProps(children, (children, { hasSubmenu }) => (\n <Provider\n values={[\n [\n KeyboardContext,\n { className: hotkey({ className: classNames?.hotkey }) },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: {\n className: icon({ className: classNames?.icon }),\n },\n submenu: { className: more({ className: classNames?.more }) },\n },\n },\n ],\n ]}\n >\n {typeof children === 'string' ? (\n <Text slot='label' className={classNames?.text}>\n {children}\n </Text>\n ) : (\n children\n )}\n {hasSubmenu && (\n <Icon slot='submenu'>\n <ChevronRight />\n </Icon>\n )}\n </Provider>\n ))}\n </AriaMenuItem>\n );\n}\nMenuItem.displayName = 'Menu.Item';\nMenuItem.Label = MenuLabel;\nMenuItem.Description = MenuDescription;\n\n/**\n * Menu - A dropdown menu component with keyboard navigation and selection\n *\n * Provides accessible dropdown menu functionality with support for single and\n * multiple selection modes. Includes sections, separators, and submenu support\n * with comprehensive keyboard navigation and ARIA compliance.\n *\n * @example\n * // Basic menu with trigger\n * <Menu.Trigger>\n * <Button>Open Menu</Button>\n * <Menu>\n * <Menu.Item>Edit</Menu.Item>\n * <Menu.Item>Copy</Menu.Item>\n * <Menu.Item>Delete</Menu.Item>\n * </Menu>\n * </Menu.Trigger>\n *\n * @example\n * // Menu with sections and separators\n * <Menu.Trigger>\n * <Button>Open</Button>\n * <Menu>\n * <Menu.Section>\n * <Menu.Item>New File</Menu.Item>\n * <Menu.Item>Open File</Menu.Item>\n * </Menu.Section>\n *\n * <Menu.Separator />\n *\n * <Menu.Item>Settings</Menu.Item>\n * </Menu>\n * </Menu.Trigger>\n *\n * @example\n * // Menu with selection\n * <Menu.Trigger>\n * <Button>Group</Button>\n * <Menu selectionMode='multiple'>\n * <Menu.Item>Option 1</Menu.Item>\n * <Menu.Item>Option 2</Menu.Item>\n * </Menu>\n * </Menu.Trigger>\n *\n * @example\n * // Menu with submenu\n * <Menu.Trigger>\n * <Button>Actions</Button>\n * <Menu>\n * <Menu.Item>New File</Menu.Item>\n * <Menu.Submenu>\n * <Menu.Item>Export</Menu.Item>\n * <Menu>\n * <Menu.Item>Export as PDF</Menu.Item>\n * <Menu.Item>Export as CSV</Menu.Item>\n * <Menu.Item>Export as JSON</Menu.Item>\n * </Menu>\n * </Menu.Submenu>\n * <Menu.Item>Delete</Menu.Item>\n * </Menu>\n * </Menu.Trigger>\n */\nexport function Menu<T extends object>({ ref, ...props }: MenuProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, MenuContext);\n\n const {\n children,\n classNames,\n popoverProps,\n selectionMode = 'single',\n variant = MenuStylesDefaults.variant,\n ...rest\n } = props;\n\n return (\n <Popover\n {...popoverProps}\n className={composeRenderProps(classNames?.popover, (className) =>\n popover({ className }),\n )}\n >\n <MenuContext.Provider value={{ variant }}>\n <AriaMenu\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.menu, (className) =>\n menu({ className, variant }),\n )}\n selectionMode={selectionMode}\n >\n {children}\n </AriaMenu>\n </MenuContext.Provider>\n </Popover>\n );\n}\nMenu.displayName = 'Menu';\nMenu.Trigger = MenuTrigger;\nMenu.Submenu = SubmenuTrigger;\nMenu.Item = MenuItem;\nMenu.Separator = MenuSeparator;\nMenu.Section = MenuSection;\n"]}
@@ -1,10 +1,7 @@
1
1
  import * as tailwind_variants from 'tailwind-variants';
2
- import { VariantProps } from 'tailwind-variants';
3
- import { ReactNode } from 'react';
4
2
 
5
3
  declare const MenuStylesDefaults: {
6
4
  readonly variant: "cozy";
7
- readonly color: "info";
8
5
  };
9
6
  declare const MenuStyles: tailwind_variants.TVReturnType<{
10
7
  variant: {
@@ -15,24 +12,18 @@ declare const MenuStyles: tailwind_variants.TVReturnType<{
15
12
  item: string;
16
13
  };
17
14
  };
18
- color: {
19
- info: {
20
- item: string[];
21
- };
22
- serious: {
23
- item: string[];
24
- };
25
- };
26
15
  }, {
27
16
  menu: string;
28
- icon: string;
29
17
  item: string[];
18
+ icon: string;
30
19
  label: string;
31
- description: string;
20
+ description: string[];
32
21
  more: string;
33
- sectionHeader: string;
22
+ section: string;
23
+ header: string;
34
24
  separator: string;
35
- keyboard: string;
25
+ hotkey: string[];
26
+ popover: string;
36
27
  }, undefined, {
37
28
  variant: {
38
29
  cozy: {
@@ -42,24 +33,18 @@ declare const MenuStyles: tailwind_variants.TVReturnType<{
42
33
  item: string;
43
34
  };
44
35
  };
45
- color: {
46
- info: {
47
- item: string[];
48
- };
49
- serious: {
50
- item: string[];
51
- };
52
- };
53
36
  }, {
54
37
  menu: string;
55
- icon: string;
56
38
  item: string[];
39
+ icon: string;
57
40
  label: string;
58
- description: string;
41
+ description: string[];
59
42
  more: string;
60
- sectionHeader: string;
43
+ section: string;
44
+ header: string;
61
45
  separator: string;
62
- keyboard: string;
46
+ hotkey: string[];
47
+ popover: string;
63
48
  }, tailwind_variants.TVReturnType<{
64
49
  variant: {
65
50
  cozy: {
@@ -69,27 +54,18 @@ declare const MenuStyles: tailwind_variants.TVReturnType<{
69
54
  item: string;
70
55
  };
71
56
  };
72
- color: {
73
- info: {
74
- item: string[];
75
- };
76
- serious: {
77
- item: string[];
78
- };
79
- };
80
57
  }, {
81
58
  menu: string;
82
- icon: string;
83
59
  item: string[];
60
+ icon: string;
84
61
  label: string;
85
- description: string;
62
+ description: string[];
86
63
  more: string;
87
- sectionHeader: string;
64
+ section: string;
65
+ header: string;
88
66
  separator: string;
89
- keyboard: string;
67
+ hotkey: string[];
68
+ popover: string;
90
69
  }, undefined, unknown, unknown, undefined>>;
91
- type MenuStyleVariants = VariantProps<typeof MenuStyles> & {
92
- prefixIcon?: ReactNode;
93
- };
94
70
 
95
- export { type MenuStyleVariants, MenuStyles, MenuStylesDefaults };
71
+ export { MenuStyles, MenuStylesDefaults };
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';const t={variant:"cozy",color:"info"},o=tv({slots:{menu:"group/menu mt-s overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light",icon:"[grid-area:icon]",item:["group/menu-item flex items-center gap-x-s px-s text-body-s",'grid grid-cols-[auto_auto_1fr_auto] [grid-template-areas:"icon_label_space_action"_"icon_description_space_action"]',"disabled:fg-disabled disabled:bg-transparent"],label:"truncate [grid-area:label] group-not-has-[>_[slot=description]]/menu-item:row-span-full",description:"fg-default-dark group-hover/menu-item:fg-inverse-light group-focus/menu-item:fg-inverse-light group-disabled/menu-item:fg-disabled truncate text-body-xs [grid-area:description]",more:"[grid-area:action]",sectionHeader:"fg-default-dark px-s py-xs text-header-xs",separator:"mx-3 my-1 border border-static-light",keyboard:"[grid-area:action]"},variants:{variant:{cozy:{item:"pt-s pb-s"},compact:{item:"pt-xs pb-xs"}},color:{info:{item:["fg-default-light hover:fg-inverse-light focus:fg-inverse-light open:fg-inverse-light selected:fg-inverse-light","selected:bg-highlight-bold open:bg-highlight-bold hover:bg-highlight-bold focus:bg-highlight-bold"]},serious:{item:["fg-serious hover:fg-inverse-light focus:fg-inverse-light open:fg-inverse-light selected:fg-inverse-light","selected:bg-serious-bold open:bg-serious-bold hover:bg-serious-bold focus:bg-serious-bold"]}}},defaultVariants:t});export{o as MenuStyles,t as MenuStylesDefaults};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';const o={variant:"cozy"},l=tv({slots:{menu:"group/menu overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light",item:["group/menu-item flex items-center gap-x-s px-s text-body-s outline outline-transparent",'grid grid-cols-[auto_auto_1fr_auto] [grid-template-areas:"icon_label_space_action"_"icon_description_space_action"]',"enabled:focus-visible:outline-interactive-hover","color-info:enabled:fg-default-light","color-info:enabled:focus-visible:fg-inverse-light color-info:enabled:focus-visible:bg-highlight-bold","color-info:enabled:hover:fg-inverse-light color-info:enabled:hover:bg-highlight-bold","color-info:enabled:open:fg-inverse-light color-info:enabled:open:bg-highlight-bold","color-info:enabled:selected:fg-inverse-light color-info:enabled:selected:bg-highlight-bold","color-serious:enabled:fg-serious","color-serious:enabled:focus-visible:fg-inverse-light color-serious:enabled:focus-visible:bg-serious-bold","color-serious:enabled:hover:fg-inverse-light color-serious:enabled:hover:bg-serious-bold","color-serious:enabled:open:fg-inverse-light color-serious:enabled:open:bg-serious-bold","color-serious:enabled:selected:fg-inverse-light color-serious:enabled:selected:bg-serious-bold","disabled:fg-disabled disabled:bg-transparent"],icon:"[grid-area:icon]",label:"truncate [grid-area:label] group-not-has-[>_[slot=description]]/menu-item:row-span-full",description:["[grid-area:description]","fg-default-dark truncate text-body-xs","group-hover/menu-item:fg-inverse-light group-focus-visible/menu-item:fg-inverse-light","group-disabled/menu-item:fg-disabled"],more:"[grid-area:action]",section:"",header:"fg-default-dark px-s py-xs text-header-xs",separator:"mx-3 my-1 border border-static-light",hotkey:["[grid-area:action]","group-hover/menu-item:fg-inverse-light group-focus-visible/menu-item:fg-inverse-light","group-disabled/menu-item:fg-disabled"],popover:"outline-none"},variants:{variant:{cozy:{item:"pt-s pb-s"},compact:{item:"pt-xs pb-xs"}}},defaultVariants:o});export{l as MenuStyles,o as MenuStylesDefaults};//# sourceMappingURL=styles.js.map
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/menu/styles.ts"],"names":["MenuStyles","tv","e"],"mappings":"sCAiBE,MAAA,CAAS,CAAA,CAAA,OACT,CAAA,MAAO,CAAA,KAGIA,CAAaC,MACxB,CAAA,CAAA,CAAO,CACLC,EAAA,CAAA,CAAA,KAAM,CAAA,CAAA,IAAA,CAAA,yIACA,CAAA,IAAA,CAAA,kBAEJ,CAAA,IAAA,CAAA,CAAA,4DACA,CAAA,qHACA,CAAA,8CAGA,CAAA,CAAA,KAAA,CAAA,yFACF,CAAA,WACE,CAAA,kLACI,CAAA,IAAA,CAAA,oBACN,CAAA,aAAe,CAAA,2CACf,CAAW,gDACD,CAAA,QAAA,CAAA,oBAEZ,CAAU,CACR,QAAS,CACP,CAAA,aACQ,CAAA,CAAA,IAAA,CAAA,WAEC,CACP,QAAM,CAAA,CAAA,IAAA,CAAA,aAIR,CAAA,CAAA,CAAA,KACE,CAAA,CAAA,4HAEE,CAAA,mGAGJ,CAAS,CACP,CAAA,OACE,CAAA,CAAA,IAAA,CAAA,CAAA,0GACA,CAAA,2FAKR,CAAA,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\nimport type { ReactNode } from 'react';\nimport type { VariantProps } from 'tailwind-variants';\n\nexport const MenuStylesDefaults = {\n variant: 'cozy',\n color: 'info',\n} as const;\n\nexport const MenuStyles = tv({\n slots: {\n menu: 'group/menu mt-s overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light',\n icon: '[grid-area:icon]',\n item: [\n 'group/menu-item flex items-center gap-x-s px-s text-body-s',\n 'grid grid-cols-[auto_auto_1fr_auto] [grid-template-areas:\"icon_label_space_action\"_\"icon_description_space_action\"]',\n 'disabled:fg-disabled disabled:bg-transparent',\n ],\n label:\n 'truncate [grid-area:label] group-not-has-[>_[slot=description]]/menu-item:row-span-full',\n description:\n 'fg-default-dark group-hover/menu-item:fg-inverse-light group-focus/menu-item:fg-inverse-light group-disabled/menu-item:fg-disabled truncate text-body-xs [grid-area:description]',\n more: '[grid-area:action]',\n sectionHeader: 'fg-default-dark px-s py-xs text-header-xs',\n separator: 'mx-3 my-1 border border-static-light',\n keyboard: '[grid-area:action]',\n },\n variants: {\n variant: {\n cozy: {\n item: 'pt-s pb-s',\n },\n compact: {\n item: 'pt-xs pb-xs',\n },\n },\n color: {\n info: {\n item: [\n 'fg-default-light hover:fg-inverse-light focus:fg-inverse-light open:fg-inverse-light selected:fg-inverse-light',\n 'selected:bg-highlight-bold open:bg-highlight-bold hover:bg-highlight-bold focus:bg-highlight-bold',\n ],\n },\n serious: {\n item: [\n 'fg-serious hover:fg-inverse-light focus:fg-inverse-light open:fg-inverse-light selected:fg-inverse-light',\n 'selected:bg-serious-bold open:bg-serious-bold hover:bg-serious-bold focus:bg-serious-bold',\n ],\n },\n },\n },\n defaultVariants: MenuStylesDefaults,\n});\n\nexport type MenuStyleVariants = VariantProps<typeof MenuStyles> & {\n prefixIcon?: ReactNode;\n};\n"]}
1
+ {"version":3,"sources":["../../../src/components/menu/styles.ts"],"names":["MenuStyles","tv","e"],"mappings":"sCAeE,MAAA,CAAS,CAAA,CAAA,OAGEA,CAAaC,MACxB,CAAA,CAAA,CAAO,CACLC,EAAA,CAAA,CAAA,gJAEE,CAAA,IAAA,CAAA,CAAA,wFACA,CAAA,uKAIA,CAAA,qCACA,CAAA,sGACA,CAAA,sFACA,CAAA,iLAIA,CAAA,kCACA,CAAA,0GACA,CAAA,0FACA,CAAA,yLAGA,CAAA,8CAEI,CAAA,CAAA,IAAA,CAAA,kHAGN,CAAA,WACE,CAAA,CAAA,yBACA,CAAA,+HAEA,CAAA,sCAEI,CAAA,CAAA,IAAA,CAAA,oBACG,CAAA,OACT,CAAQ,EAAA,CAAA,MAAA,CAAA,2CACR,CAAW,6EAGT,CAAA,uFACA,CAAA,sCAEO,CAAA,CAAA,OAAA,CAAA,cAEX,CAAU,CACR,QAAS,CACP,CAAA,aACQ,CAAA,CAAA,IAAA,CAAA,WAEC,CACP,QAAM,CAAA,CAAA,IAAA,CAAA,aAIZ,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.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 { tv } from '@/lib/utils';\n\nexport const MenuStylesDefaults = {\n variant: 'cozy',\n} as const;\n\nexport const MenuStyles = tv({\n slots: {\n menu: 'group/menu overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light',\n item: [\n 'group/menu-item flex items-center gap-x-s px-s text-body-s outline outline-transparent',\n 'grid grid-cols-[auto_auto_1fr_auto] [grid-template-areas:\"icon_label_space_action\"_\"icon_description_space_action\"]',\n 'enabled:focus-visible:outline-interactive-hover',\n\n // Info\n 'color-info:enabled:fg-default-light',\n 'color-info:enabled:focus-visible:fg-inverse-light color-info:enabled:focus-visible:bg-highlight-bold',\n 'color-info:enabled:hover:fg-inverse-light color-info:enabled:hover:bg-highlight-bold',\n 'color-info:enabled:open:fg-inverse-light color-info:enabled:open:bg-highlight-bold',\n 'color-info:enabled:selected:fg-inverse-light color-info:enabled:selected:bg-highlight-bold',\n\n // Serious\n 'color-serious:enabled:fg-serious',\n 'color-serious:enabled:focus-visible:fg-inverse-light color-serious:enabled:focus-visible:bg-serious-bold',\n 'color-serious:enabled:hover:fg-inverse-light color-serious:enabled:hover:bg-serious-bold',\n 'color-serious:enabled:open:fg-inverse-light color-serious:enabled:open:bg-serious-bold',\n 'color-serious:enabled:selected:fg-inverse-light color-serious:enabled:selected:bg-serious-bold',\n\n 'disabled:fg-disabled disabled:bg-transparent',\n ],\n icon: '[grid-area:icon]',\n label:\n 'truncate [grid-area:label] group-not-has-[>_[slot=description]]/menu-item:row-span-full',\n description: [\n '[grid-area:description]',\n 'fg-default-dark truncate text-body-xs',\n 'group-hover/menu-item:fg-inverse-light group-focus-visible/menu-item:fg-inverse-light',\n 'group-disabled/menu-item:fg-disabled',\n ],\n more: '[grid-area:action]',\n section: '',\n header: 'fg-default-dark px-s py-xs text-header-xs',\n separator: 'mx-3 my-1 border border-static-light',\n hotkey: [\n '[grid-area:action]',\n 'group-hover/menu-item:fg-inverse-light group-focus-visible/menu-item:fg-inverse-light',\n 'group-disabled/menu-item:fg-disabled',\n ],\n popover: 'outline-none',\n },\n variants: {\n variant: {\n cozy: {\n item: 'pt-s pb-s',\n },\n compact: {\n item: 'pt-xs pb-xs',\n },\n },\n },\n defaultVariants: MenuStylesDefaults,\n});\n"]}