@accelint/design-toolkit 2.4.3 → 2.6.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.
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.d.ts +1 -5
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/accordion/types.d.ts +9 -10
- package/dist/components/avatar/index.d.ts +4 -2
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/styles.d.ts +16 -15
- package/dist/components/avatar/styles.js +1 -1
- package/dist/components/avatar/styles.js.map +1 -1
- package/dist/components/avatar/types.d.ts +7 -7
- package/dist/components/badge/index.d.ts +3 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/badge/styles.js +1 -1
- package/dist/components/badge/styles.js.map +1 -1
- package/dist/components/badge/types.d.ts +3 -4
- package/dist/components/box/index.js +1 -1
- package/dist/components/box/index.js.map +1 -1
- package/dist/components/button/index.d.ts +6 -4
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +25 -24
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +3 -5
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/styles.d.ts +19 -18
- package/dist/components/checkbox/styles.js +1 -1
- package/dist/components/checkbox/styles.js.map +1 -1
- package/dist/components/chip/index.d.ts +4 -2
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.d.ts +70 -69
- package/dist/components/chip/styles.js +1 -1
- package/dist/components/chip/styles.js.map +1 -1
- package/dist/components/chip/types.d.ts +5 -5
- package/dist/components/classification-badge/index.d.ts +3 -2
- package/dist/components/classification-badge/index.js +1 -1
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/styles.js +1 -1
- package/dist/components/classification-badge/styles.js.map +1 -1
- package/dist/components/classification-badge/types.d.ts +3 -4
- package/dist/components/classification-banner/index.d.ts +3 -2
- package/dist/components/classification-banner/index.js +1 -1
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/styles.js +1 -1
- package/dist/components/classification-banner/styles.js.map +1 -1
- package/dist/components/classification-banner/types.d.ts +3 -4
- package/dist/components/color-picker/index.d.ts +45 -15
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-picker/styles.d.ts +42 -0
- package/dist/components/color-picker/styles.js +2 -0
- package/dist/components/color-picker/styles.js.map +1 -0
- package/dist/components/color-picker/types.d.ts +13 -0
- package/dist/components/color-picker/types.js +2 -0
- package/dist/components/color-picker/types.js.map +1 -0
- package/dist/components/combobox-field/index.d.ts +18 -0
- package/dist/components/combobox-field/index.js +2 -0
- package/dist/components/combobox-field/index.js.map +1 -0
- package/dist/components/combobox-field/styles.d.ts +72 -0
- package/dist/components/combobox-field/styles.js +2 -0
- package/dist/components/combobox-field/styles.js.map +1 -0
- package/dist/components/combobox-field/types.d.ts +28 -0
- package/dist/components/combobox-field/types.js +2 -0
- package/dist/components/combobox-field/types.js.map +1 -0
- package/dist/components/date-field/index.d.ts +8 -24
- package/dist/components/date-field/index.js +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.d.ts +69 -0
- package/dist/components/date-field/styles.js +2 -0
- package/dist/components/date-field/styles.js.map +1 -0
- package/dist/components/date-field/types.d.ts +29 -0
- package/dist/components/date-field/types.js +2 -0
- package/dist/components/date-field/types.js.map +1 -0
- package/dist/components/details-list/index.d.ts +59 -0
- package/dist/components/details-list/index.js +2 -0
- package/dist/components/details-list/index.js.map +1 -0
- package/dist/components/details-list/styles.d.ts +65 -0
- package/dist/components/details-list/styles.js +2 -0
- package/dist/components/details-list/styles.js.map +1 -0
- package/dist/components/details-list/types.d.ts +16 -0
- package/dist/components/details-list/types.js +2 -0
- package/dist/components/details-list/types.js.map +1 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/drawer/context.d.ts +13 -0
- package/dist/components/drawer/context.js +2 -0
- package/dist/components/drawer/context.js.map +1 -0
- package/dist/components/drawer/index.d.ts +48 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/drawer/state.d.ts +26 -0
- package/dist/components/drawer/state.js +2 -0
- package/dist/components/drawer/state.js.map +1 -0
- package/dist/components/drawer/styles.d.ts +118 -0
- package/dist/components/drawer/styles.js +2 -0
- package/dist/components/drawer/styles.js.map +1 -0
- package/dist/components/drawer/types.d.ts +279 -0
- package/dist/components/drawer/types.js +2 -0
- package/dist/components/drawer/types.js.map +1 -0
- package/dist/components/hero/index.d.ts +45 -0
- package/dist/components/hero/index.js +2 -0
- package/dist/components/hero/index.js.map +1 -0
- package/dist/components/hero/styles.d.ts +48 -0
- package/dist/components/hero/styles.js +2 -0
- package/dist/components/hero/styles.js.map +1 -0
- package/dist/components/hero/types.d.ts +13 -0
- package/dist/components/hero/types.js +2 -0
- package/dist/components/hero/types.js.map +1 -0
- package/dist/components/hotkey/index.d.ts +25 -0
- package/dist/components/hotkey/index.js +2 -0
- package/dist/components/hotkey/index.js.map +1 -0
- package/dist/components/hotkey/styles.d.ts +53 -0
- package/dist/components/hotkey/styles.js +2 -0
- package/dist/components/hotkey/styles.js.map +1 -0
- package/dist/components/hotkey/types.d.ts +8 -0
- package/dist/components/hotkey/types.js +2 -0
- package/dist/components/hotkey/types.js.map +1 -0
- package/dist/components/icon/index.d.ts +3 -2
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/styles.js +1 -1
- package/dist/components/icon/styles.js.map +1 -1
- package/dist/components/icon/types.d.ts +4 -5
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.d.ts +2 -24
- package/dist/components/input/styles.js +1 -1
- package/dist/components/input/styles.js.map +1 -1
- package/dist/components/input/types.d.ts +1 -0
- package/dist/components/label/index.d.ts +3 -2
- package/dist/components/label/index.js +1 -1
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/styles.js +1 -1
- package/dist/components/label/styles.js.map +1 -1
- package/dist/components/label/types.d.ts +2 -3
- package/dist/components/menu/index.d.ts +16 -21
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/styles.d.ts +9 -6
- package/dist/components/menu/styles.js +1 -1
- package/dist/components/menu/styles.js.map +1 -1
- package/dist/components/menu/types.d.ts +9 -2
- package/dist/components/options/index.d.ts +28 -22
- package/dist/components/options/index.js +1 -1
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/styles.d.ts +72 -0
- package/dist/components/options/styles.js +2 -0
- package/dist/components/options/styles.js.map +1 -0
- package/dist/components/options/types.d.ts +29 -0
- package/dist/components/options/types.js +2 -0
- package/dist/components/options/types.js.map +1 -0
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.d.ts +16 -15
- package/dist/components/popover/styles.js +1 -1
- package/dist/components/popover/styles.js.map +1 -1
- package/dist/components/query-builder/action-element.js +1 -1
- package/dist/components/query-builder/action-element.js.map +1 -1
- package/dist/components/query-builder/constants.js +1 -1
- package/dist/components/query-builder/constants.js.map +1 -1
- package/dist/components/query-builder/group.js +1 -1
- package/dist/components/query-builder/group.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +5 -20
- package/dist/components/query-builder/index.js +1 -1
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/rule.js +1 -1
- package/dist/components/query-builder/rule.js.map +1 -1
- package/dist/components/query-builder/types.d.ts +22 -0
- package/dist/components/query-builder/types.js +2 -0
- package/dist/components/query-builder/types.js.map +1 -0
- package/dist/components/query-builder/utils.js +1 -1
- package/dist/components/query-builder/utils.js.map +1 -1
- package/dist/components/query-builder/value-editor.js +1 -1
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.js +1 -1
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.d.ts +19 -18
- package/dist/components/radio/styles.js +1 -1
- package/dist/components/radio/styles.js.map +1 -1
- package/dist/components/radio/types.d.ts +2 -3
- package/dist/components/search-field/index.d.ts +56 -15
- package/dist/components/search-field/index.js +1 -1
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-field/styles.d.ts +53 -0
- package/dist/components/search-field/styles.js +2 -0
- package/dist/components/search-field/styles.js.map +1 -0
- package/dist/components/search-field/types.d.ts +25 -0
- package/dist/components/search-field/types.js +2 -0
- package/dist/components/search-field/types.js.map +1 -0
- package/dist/components/select-field/index.d.ts +23 -0
- package/dist/components/select-field/index.js +2 -0
- package/dist/components/select-field/index.js.map +1 -0
- package/dist/components/select-field/styles.d.ts +60 -0
- package/dist/components/select-field/styles.js +2 -0
- package/dist/components/select-field/styles.js.map +1 -0
- package/dist/components/select-field/types.d.ts +26 -0
- package/dist/components/select-field/types.js +2 -0
- package/dist/components/select-field/types.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +42 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/skeleton/styles.d.ts +23 -0
- package/dist/components/skeleton/styles.js +2 -0
- package/dist/components/skeleton/styles.js.map +1 -0
- package/dist/components/skeleton/types.d.ts +8 -0
- package/dist/components/skeleton/types.js +2 -0
- package/dist/components/skeleton/types.js.map +1 -0
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +3 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +13 -12
- package/dist/components/switch/styles.js +1 -1
- package/dist/components/switch/styles.js.map +1 -1
- package/dist/components/switch/types.d.ts +2 -3
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +4 -3
- package/dist/components/text-area-field/index.js +1 -1
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.d.ts +19 -18
- package/dist/components/text-area-field/styles.js +1 -1
- package/dist/components/text-area-field/styles.js.map +1 -1
- package/dist/components/text-area-field/types.d.ts +2 -3
- package/dist/components/text-field/index.d.ts +4 -2
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.d.ts +19 -18
- package/dist/components/text-field/styles.js +1 -1
- package/dist/components/text-field/styles.js.map +1 -1
- package/dist/components/text-field/types.d.ts +4 -4
- package/dist/components/tooltip/index.d.ts +14 -28
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/styles.d.ts +5 -0
- package/dist/components/tooltip/styles.js +2 -0
- package/dist/components/tooltip/styles.js.map +1 -0
- package/dist/components/tooltip/types.d.ts +8 -0
- package/dist/components/tooltip/types.js +2 -0
- package/dist/components/tooltip/types.js.map +1 -0
- package/dist/components/view-stack/index.d.ts +28 -0
- package/dist/components/view-stack/index.js +2 -0
- package/dist/components/view-stack/index.js.map +1 -0
- package/dist/components/view-stack/types.d.ts +58 -0
- package/dist/components/view-stack/types.js +2 -0
- package/dist/components/view-stack/types.js.map +1 -0
- package/dist/icons/catalog.js +1 -1
- package/dist/index.css +20 -0
- package/dist/index.d.ts +60 -27
- package/dist/index.js +1 -1
- package/dist/lib/react.d.ts +13 -12
- package/dist/lib/react.js +4 -4
- package/dist/lib/react.js.map +1 -1
- package/dist/lib/types.d.ts +6 -2
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +1476 -321
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/variants/variants.css +6 -0
- package/package.json +84 -56
- package/dist/components/combobox/index.d.ts +0 -32
- package/dist/components/combobox/index.js +0 -2
- package/dist/components/combobox/index.js.map +0 -1
- package/dist/components/options-item/index.d.ts +0 -30
- package/dist/components/options-item/index.js +0 -2
- package/dist/components/options-item/index.js.map +0 -1
- package/dist/components/query-builder/example-configuration.d.ts +0 -30
- package/dist/components/query-builder/example-configuration.js +0 -2
- package/dist/components/query-builder/example-configuration.js.map +0 -1
@@ -1,8 +1,7 @@
|
|
1
|
-
import {
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
2
2
|
|
3
|
-
type IconProps =
|
3
|
+
type IconProps = ComponentPropsWithRef<'span'> & {
|
4
4
|
size?: 'large' | 'medium' | 'small' | 'xsmall';
|
5
|
-
}
|
6
|
-
type IconProviderProps = PropsWithChildren<IconProps>;
|
5
|
+
};
|
7
6
|
|
8
|
-
export type { IconProps
|
7
|
+
export type { IconProps };
|
@@ -5,6 +5,7 @@ import { InputProps } from './types.js';
|
|
5
5
|
import 'tailwind-variants';
|
6
6
|
import '../button/types.js';
|
7
7
|
import '../button/styles.js';
|
8
|
+
import 'tailwind-merge';
|
8
9
|
import './styles.js';
|
9
10
|
|
10
11
|
declare const InputContext: react.Context<ContextValue<InputProps, HTMLInputElement>>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
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';
|
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:p,readOnly:c,required:m,size:f,type:l=InputStylesDefaults.type,value:g,isClearable:n,isInvalid:x,onChange:E,onKeyDown:P,...N}=a,[s,b]=useControlledState(g,h),z=(`${s??""}`.length||p?.length)??0,I=s==null||s==="";function d(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":!!p&&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:p,readOnly:c,required:m,type:l,value:s,onChange:d,onKeyDown:e=>{P?.(e),n&&!e.defaultPrevented&&e.key==="Escape"&&d(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:()=>{d(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":["
|
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","O","isInvalid","onChange","onKeyDown","value","setValue","length","S","isEmpty","handleChange","event","jsxs","R","classNames","jsx","composeRenderProps","className","input","y","isClearable","o","D"],"mappings":"8aA8BiC,CAAAA,CAAM,CAAA,KAGjCC,CAAAA,CAAkB,CACtB,KAAA,CAAA,CAAQ,CAAE,MAAO,CAAA,CAAG,CACtBC,WAAA,EAEaC,CACXC,EAA0D,CAAA,cAE5CC,EAAM,CAAE,IAAAC,aAAAA,CAAK,IAAS,EAAe,SASpBC,EAAOD,CAAAA,GAAO,CAAA,CAAA,CAAA,GAAsB,CACnE,CAACC,CAAAA,CAAOD,CAAG,EAAIE,CAAAA,CAAgB,CAAEC,iBAAGF,CAAM,CAAA,EAAGD,IAAO,CAAAI,YAAA,CAAMP,CAAY,CAAA,CAEtE,CAAA,CAAA,CAAA,CAAAM,eAAM,CACJ,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,EAAA,aACAE,CACA,UAAA,CAAA,CAAA,CAAAC,uBAEA,CAAA,CAAA,CAAA,EAAAC,SACA,CAAA,CAAAC,CAAAA,WACAC,CACA,CAAA,CAAA,QACA,CAAA,CAAAC,SACA,OAAOC,CACP,CAAA,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,CAAUZ,CAAAA,CAAAA,CAAa,CAAA,CAAA,CAAA,EAAA,CAAA,EAAA,GAClDa,CAAAA,CAAUJ,SAAiBA,EAAAA,cAExBK,EAAa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,CAAAoC,kBAAA,CAAA,CAAAF,EAAW,KAAA,CAAA,CAAA,EAAAvB,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,CAAAqB,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\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 })}\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';
|
1
|
+
import {tv}from'./../../lib/utils.js';const t={autoSize:false,type:"text",isClearable:false},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","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-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
|
2
2
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/input/styles.ts"],"names":["e"],"mappings":"sCAeE,
|
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,iCACA,CAAA,sFAGA,CAAA,CAAA,KAAA,CAAA,CAAA,4IACA,CAAA,6CACA,CAAA,mGAEA,CAAA,6HAGA,CAAA,CAAA,KAAA,CAAA,CAAA,+FAEA,CAAA,+CACA,CAAA,iEACA,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,2EAKJ,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 '[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 '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-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"]}
|
@@ -4,6 +4,7 @@ import { VariantProps } from 'tailwind-variants';
|
|
4
4
|
import { ButtonProps } from '../button/types.js';
|
5
5
|
import { InputStyles } from './styles.js';
|
6
6
|
import '../button/styles.js';
|
7
|
+
import 'tailwind-merge';
|
7
8
|
|
8
9
|
type InputProps = Omit<InputProps$1, 'className' | 'size' | 'type'> & RefAttributes<HTMLInputElement> & Omit<VariantProps<typeof InputStyles>, 'isEmpty'> & {
|
9
10
|
classNames?: {
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import * as react from 'react';
|
3
|
+
import { ProviderProps } from '../../lib/types.js';
|
3
4
|
import { ContextValue } from 'react-aria-components';
|
4
|
-
import { LabelProps
|
5
|
+
import { LabelProps } from './types.js';
|
5
6
|
|
6
7
|
declare const LabelContext: react.Context<ContextValue<LabelProps, HTMLLabelElement>>;
|
7
|
-
declare function LabelProvider({ children, ...props }:
|
8
|
+
declare function LabelProvider({ children, ...props }: ProviderProps<LabelProps>): react_jsx_runtime.JSX.Element;
|
8
9
|
declare namespace LabelProvider {
|
9
10
|
var displayName: string;
|
10
11
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import'client-only';import {createContext}from'react';import {useContextProps,Label}from'react-aria-components';import {LabelStyles}from'./styles.js';
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Label}from'react-aria-components';import {LabelStyles}from'./styles.js';const o=createContext(null);function t({children:r,...e}){return jsx(o.Provider,{value:e,children:r})}t.displayName="Label.Provider";function a({ref:r,...e}){[e,r]=useContextProps(e,r??null,o);const{children:i,className:s,isDisabled:n,isRequired:l,...p}=e;return jsxs(Label,{...p,className:LabelStyles({className:s}),"data-disabled":n||null,"data-required":l||null,children:[i,!l&&" (optional)"]})}a.displayName="Label",a.Provider=t;export{a as Label,o as LabelContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/label/index.tsx"],"names":["
|
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,2 +1,2 @@
|
|
1
|
-
import {tv}from'./../../lib/utils.js';
|
1
|
+
import {tv}from'./../../lib/utils.js';const t=tv({base:["group/label text-header-s","enabled:fg-default-light","disabled:fg-disabled"]});export{t as LabelStyles};//# sourceMappingURL=styles.js.map
|
2
2
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/label/styles.ts"],"names":["e"],"mappings":"sCAeE,
|
1
|
+
{"version":3,"sources":["../../../src/components/label/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAM,CACJ,CAAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,2BACA,CAAA,0BACA,CAAA,sBAEH,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 LabelStyles = tv({\n base: [\n 'group/label text-header-s',\n 'enabled:fg-default-light',\n 'disabled:fg-disabled',\n ],\n});\n"]}
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import { RefAttributes
|
1
|
+
import { RefAttributes } from 'react';
|
2
2
|
import { LabelProps as LabelProps$1 } from 'react-aria-components';
|
3
3
|
|
4
4
|
type LabelProps = LabelProps$1 & RefAttributes<HTMLLabelElement> & {
|
5
5
|
isDisabled?: boolean;
|
6
6
|
isRequired?: boolean;
|
7
7
|
};
|
8
|
-
type LabelProviderProps = PropsWithChildren<LabelProps>;
|
9
8
|
|
10
|
-
export type { LabelProps
|
9
|
+
export type { LabelProps };
|
@@ -8,26 +8,6 @@ import './styles.js';
|
|
8
8
|
import 'tailwind-variants';
|
9
9
|
|
10
10
|
declare const MenuContext: react.Context<ContextValue<MenuProps<unknown>, HTMLDivElement>>;
|
11
|
-
declare function Menu<T extends object>({ ref, ...props }: MenuProps<T>): react_jsx_runtime.JSX.Element;
|
12
|
-
declare namespace Menu {
|
13
|
-
var displayName: string;
|
14
|
-
var Trigger: typeof MenuTrigger;
|
15
|
-
var Submenu: (props: react_aria_components.SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => react.ReactElement | null;
|
16
|
-
var Item: {
|
17
|
-
(props: MenuItemProps): react_jsx_runtime.JSX.Element;
|
18
|
-
displayName: string;
|
19
|
-
Label: typeof MenuLabel;
|
20
|
-
Description: typeof MenuDescription;
|
21
|
-
};
|
22
|
-
var Separator: typeof MenuSeparator;
|
23
|
-
var Section: typeof MenuSection;
|
24
|
-
}
|
25
|
-
declare const MenuItem: {
|
26
|
-
(props: MenuItemProps): react_jsx_runtime.JSX.Element;
|
27
|
-
displayName: string;
|
28
|
-
Label: typeof MenuLabel;
|
29
|
-
Description: typeof MenuDescription;
|
30
|
-
};
|
31
11
|
declare function MenuSection<T extends object>(props: MenuSectionProps<T>): react_jsx_runtime.JSX.Element;
|
32
12
|
declare namespace MenuSection {
|
33
13
|
var displayName: string;
|
@@ -44,5 +24,20 @@ declare function MenuDescription(props: MenuTextProps): react_jsx_runtime.JSX.El
|
|
44
24
|
declare namespace MenuDescription {
|
45
25
|
var displayName: string;
|
46
26
|
}
|
27
|
+
declare function MenuItem(props: MenuItemProps): react_jsx_runtime.JSX.Element;
|
28
|
+
declare namespace MenuItem {
|
29
|
+
var displayName: string;
|
30
|
+
var Label: typeof MenuLabel;
|
31
|
+
var Description: typeof MenuDescription;
|
32
|
+
}
|
33
|
+
declare function Menu<T extends object>({ ref, ...props }: MenuProps<T>): react_jsx_runtime.JSX.Element;
|
34
|
+
declare namespace Menu {
|
35
|
+
var displayName: string;
|
36
|
+
var Trigger: typeof MenuTrigger;
|
37
|
+
var Submenu: (props: react_aria_components.SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => react.ReactElement | null;
|
38
|
+
var Item: typeof MenuItem;
|
39
|
+
var Separator: typeof MenuSeparator;
|
40
|
+
var Section: typeof MenuSection;
|
41
|
+
}
|
47
42
|
|
48
|
-
export { Menu, MenuContext
|
43
|
+
export { Menu, MenuContext };
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import'client-only';import {isSlottedContextValue}from'./../../lib/utils.js';import
|
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,sectionHeader:J,separator:Q,hotkey:W,popover:X}=MenuStyles(),N=createContext(null);function x(n){const{header:t,children:r,classNames:e,items:u,...s}=n;return jsxs(MenuSection,{className:e?.section,...s,children:[jsx(Header,{className:J({className:e?.sectionHeader}),children:t}),jsx(Collection,{items:u,children:r})]})}x.displayName="Menu.Section";function S({className:n,...t}){return jsx(Separator,{...t,className:Q({className:n})})}S.displayName="Menu.Separator";function P(n){const{children:t,className:r,...e}=n;return jsx(Text,{...e,slot:"label",className:z({className:r}),children:t})}P.displayName="Menu.Item.Label";function T(n){const{children:t,className:r,...e}=n;return jsx(Text,{...e,slot:"description",className:B({className:r}),children:t})}T.displayName="Menu.Item.Description";function m(n){const t=useContext(N),r=(isSlottedContextValue(t)?void 0:t?.variant)??MenuStylesDefaults.variant,{classNames:e,color:u=MenuStylesDefaults.color,children:s,...p}=n;return jsx(MenuItem,{...p,className:composeRenderProps(e?.item,a=>q({className:a,variant:r,color:u})),children:composeRenderProps(s,(a,{hasSubmenu:c})=>jsxs(Provider,{values:[[KeyboardContext,{className:W({className:e?.hotkey})}],[IconContext,{slots:{[DEFAULT_SLOT]:{className:_({className:e?.icon})},submenu:{className:G({className:e?.more})}}}]],children:[typeof a=="string"?jsx(Text,{className:e?.text,slot:"label",children:a}):a,c&&jsx(Icon,{slot:"submenu",children:jsx(f,{})})]}))})}m.displayName="Menu.Item",m.Label=P,m.Description=T;function i({ref:n,...t}){[t,n]=useContextProps(t,n??null,N);const{children:r,classNames:e,selectionMode:u="single",variant:s=MenuStylesDefaults.variant,popoverProps:p,...a}=t;return jsx(Popover,{...p,className:composeRenderProps(e?.popover,c=>X({className:c})),children:jsx(N.Provider,{value:{variant:s},children:jsx(Menu,{ref:n,className:composeRenderProps(e?.menu,c=>U({className:c,variant:s})),selectionMode:u,...a,children:r})})})}i.displayName="Menu",i.Trigger=MenuTrigger,i.Submenu=SubmenuTrigger,i.Item=m,i.Separator=S,i.Section=x;export{i as Menu,N as MenuContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["icon","item","label","more","keyboard","MenuContext","createContext","q","C","Menu","props","useContextProps","ref","O","children","offset","variant","M","jsx","Popover","o","F","D","menu","p","context","useContext","isSlottedContextValue","v","color","MenuStylesDefaults","AriaMenuItem","rest","L","className","composeRenderProps","A","K","KeyboardContext","w","_","DEFAULT_SLOT","j","x","hasSubmenu","Icon","U","MenuItem","MenuSection","header","items","jsxs","AriaMenuSection","k","h","MenuSeparator","AriaSeparator","E","MenuLabel","AriaText","MenuDescription","AriaMenuTrigger","V","AriaSubmenuTrigger"],"mappings":"mgBAgDE,IAAA,CAAA,IAAAA,CACA,CAAA,CAAA,IAAAC,CACA,CAAA,CAAA,IAAAC,CAAAA,CACA,CAAA,KAAA,CAAA,CAAA,CAAA,WACAC,CACA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,aACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAAC,QAGWC,CACXC,CAAAA,CAAgE,CAAAC,UAAA,EAAI,CAAA,CAE/D,CAAAC,aAAA,CAAA,IAAA,EAASC,SAA8B,CAAA,CAAA,CAAGC,GAAuB,CACtE,CAACA,CAAAA,GAAU,CAAIC,CAAAA,CAAgBD,CAAAA,CAAOE,CAAAA,CAAAA,CAAO,CAAA,CAAAC,eAAA,CAAA,CAAMR,CAAW,CAAA,EAE9D,IACE,CAAA,CAAA,CAAA,CAAA,GAAA,CAAAS,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,CAAA,GAAA,CAAA9C,QAAU,CAAA,CAAA,CAAA,SAAuBJ,CAAAA,CAEzC,CAAA,GAAA,CAAA,CAAA,CACEQ,CAAAA,CAACyC,OACK3B,GACJ,CAAAW,IAAA,CAAA,CAAA,GAAK,CAAA,CAAA,IAAA,CAAA,aACL,CAAA,WAAU,CAAA,aACV,CAAA,SAAyB,CAAA,CAAA,CAAA,CAAA,SAExB,CAAA,CAAA,CAAA,CAAA,CAAA7B,QAIS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,uBAEzB,CAAA,CAAU+C,CAAAA,OACV,CAAAC,WAAA,CAAA,CAAUC,CAAAA,OACV,CAAOhB,cAAAA,CACZA,CAAAA,CAAS,IAAA,CAAA,CAAQW,CAAAA,CACjBX,CAAAA,KAAS,CAAA,CAAA,CAAA,CAAA,CAAA,WACJ,CAAA,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,CAAUC,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\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';\n\nexport const 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';\n\nexport function 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\nexport function MenuSeparator({ className, ...rest }: SeparatorProps) {\n return <AriaSeparator {...rest} className={separator({ className })} />;\n}\nMenuSeparator.displayName = 'Menu.Separator';\n\nexport function 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\nexport function MenuDescription(props: MenuTextProps) {\n const { children, className, ...rest } = props;\n\n return (\n <AriaText\n {...rest}\n slot='description'\n data-slot='description'\n className={description({ className })}\n >\n {children}\n </AriaText>\n );\n}\nMenuDescription.displayName = 'Menu.Item.Description';\n\nMenu.Trigger = AriaMenuTrigger;\nMenu.Submenu = AriaSubmenuTrigger;\nMenu.Item = MenuItem;\nMenuItem.Label = MenuLabel;\nMenuItem.Description = MenuDescription;\nMenu.Separator = MenuSeparator;\nMenu.Section = MenuSection;\n"]}
|
1
|
+
{"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["label","description","sectionHeader","MenuStyles","MenuContext","MenuSection","props","y","children","classNames","rest","jsxs","v","D","jsx","o","C","items","I","MenuSeparator","className","L","M","context","b","A","MenuStylesDefaults","d","h","item","l","variant","composeRenderProps","Provider","j","hotkey","E","K","icon","V","more","AriaText","hasSubmenu","F","MenuItem","MenuDescription","Menu","ref","w","popoverProps","R","AriaMenu","g","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,aAEA,CAAA,CAAA,CAAA,SACEC,CAAW,CAAA,CAEFC,MACqD,CAAA,CAAI,CAAA,OAEtE,CAAA,CAAA,CAASC,CAAAA,UAA8BC,EAA4B,CACjE,CAAA,CAAAC,aAAA,CAAA,IAAQ,EAAA,SAAQ,CAAA,CAAA,CAAA,CAAA,CAAAC,KAAU,CAAA,MAAA,CAAAC,CAAAA,CAAY,QAAO,CAAA,CAAA,CAAGC,UAEhD,CAAA,CACEC,CAAAA,KAAiB,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAWF,CAAAA,CAAAA,OAAYG,IAAA,CAAUC,WAAA,CAAA,CAAGH,SACnD,CAAA,CAAA,EAAAI,qBAC6B,CAAA,CAAAC,GAAA,CAAAC,MAAA,CAAWP,CAAAA,SAAY,CAAA,CAAA,CAAA,CAAA,SAEjD,CAAA,CAAA,EAAA,aAEiB,CAAA,CAAA,CAAOQ,QAAQ,CAAA,CAAA,CAAAT,CAAAA,CAASO,GAAA,CAAAG,UAC9C,CAEJ,CACAb,KAAY,CAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAE1B,CAASc,cAAgBC,CAAW,SAClC,CAAA,CAAA,CAAA,SAAuB,CAAGV,CAAAA,CAAM,GAAA,CAAA,CAAA,CAAA,CAAA,OAAuBK,GAAA,CAAAM,SAAA,CAAA,CAAA,GAAA,CAAAD,CAAU,SAErD,CAAA,CAAA,CAAA,CAAA,SAAc,CAAA,CAAA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,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 hotkey,\n popover,\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: 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 <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 classNames,\n selectionMode = 'single',\n variant = MenuStylesDefaults.variant,\n popoverProps,\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 ref={ref}\n className={composeRenderProps(classNames?.menu, (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"]}
|
@@ -28,11 +28,12 @@ declare const MenuStyles: tailwind_variants.TVReturnType<{
|
|
28
28
|
icon: string;
|
29
29
|
item: string[];
|
30
30
|
label: string;
|
31
|
-
description: string;
|
31
|
+
description: string[];
|
32
32
|
more: string;
|
33
33
|
sectionHeader: string;
|
34
34
|
separator: string;
|
35
|
-
|
35
|
+
hotkey: string[];
|
36
|
+
popover: string;
|
36
37
|
}, undefined, {
|
37
38
|
variant: {
|
38
39
|
cozy: {
|
@@ -55,11 +56,12 @@ declare const MenuStyles: tailwind_variants.TVReturnType<{
|
|
55
56
|
icon: string;
|
56
57
|
item: string[];
|
57
58
|
label: string;
|
58
|
-
description: string;
|
59
|
+
description: string[];
|
59
60
|
more: string;
|
60
61
|
sectionHeader: string;
|
61
62
|
separator: string;
|
62
|
-
|
63
|
+
hotkey: string[];
|
64
|
+
popover: string;
|
63
65
|
}, tailwind_variants.TVReturnType<{
|
64
66
|
variant: {
|
65
67
|
cozy: {
|
@@ -82,11 +84,12 @@ declare const MenuStyles: tailwind_variants.TVReturnType<{
|
|
82
84
|
icon: string;
|
83
85
|
item: string[];
|
84
86
|
label: string;
|
85
|
-
description: string;
|
87
|
+
description: string[];
|
86
88
|
more: string;
|
87
89
|
sectionHeader: string;
|
88
90
|
separator: string;
|
89
|
-
|
91
|
+
hotkey: string[];
|
92
|
+
popover: string;
|
90
93
|
}, undefined, unknown, unknown, undefined>>;
|
91
94
|
type MenuStyleVariants = VariantProps<typeof MenuStyles> & {
|
92
95
|
prefixIcon?: ReactNode;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {tv}from'./../../lib/utils.js';
|
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:["[grid-area:description]","fg-default-dark truncate text-body-xs","group-hover/menu-item:fg-inverse-light group-focus/menu-item:fg-inverse-light","group-disabled/menu-item:fg-disabled"],more:"[grid-area:action]",sectionHeader:"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/menu-item:fg-inverse-light","group-disabled/menu-item:fg-disabled"],popover:""},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
|
2
2
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/menu/styles.ts"],"names":["e"],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/menu/styles.ts"],"names":["tv","e"],"mappings":"6CAiBW,CAAA,CAAA,OACT,CAAA,MAAO,CAAA,MAGiBA,SACjB,CACLC,EAAA,CAAA,CAAA,qJACM,CAAA,IAAA,CAAA,qFAGJ,CAAA,qHACA,CAAA,8CAGA,CAAA,CAAA,KAAA,CAAA,qGAEA,CAAA,CAAA,iEAEA,CAAA,+EACA,CAAA,sCAEI,CAAA,CAAA,IAAA,CAAA,kCACS,CAAA,2CACf,CAAW,gDAET,CAAA,MAAA,CAAA,CAAA,oBACA,CAAA,sHAGO,EACX,OACA,CAAA,EAAA,CAAU,CACR,QAAS,CACP,QACE,CAAA,CAAA,sBAEO,CACP,CAAA,OAAM,CAAA,CAAA,IAAA,CAAA,aAIR,CAAA,CAAA,CAAA,KACE,CAAA,CAAA,4HAEE,CAAA,mGAGJ,CAAS,CACP,QACE,CAAA,CAAA,IAAA,CAAA,CAAA,sMAMR,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 '[grid-area:description]',\n 'fg-default-dark truncate text-body-xs',\n 'group-hover/menu-item:fg-inverse-light group-focus/menu-item:fg-inverse-light',\n 'group-disabled/menu-item:fg-disabled',\n ],\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 hotkey: [\n '[grid-area:action]',\n 'group-hover/menu-item:fg-inverse-light group-focus/menu-item:fg-inverse-light',\n 'group-disabled/menu-item:fg-disabled',\n ],\n popover: '',\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"]}
|
@@ -4,7 +4,14 @@ import { IconProps } from '../icon/types.js';
|
|
4
4
|
import { MenuStyleVariants } from './styles.js';
|
5
5
|
import 'tailwind-variants';
|
6
6
|
|
7
|
-
type MenuProps<T> = MenuProps$1<T> & Pick<MenuStyleVariants, 'variant'> & RefAttributes<HTMLDivElement> &
|
7
|
+
type MenuProps<T> = Omit<MenuProps$1<T>, 'className'> & Pick<MenuStyleVariants, 'variant'> & RefAttributes<HTMLDivElement> & {
|
8
|
+
classNames?: {
|
9
|
+
menu?: MenuProps$1<T>['className'];
|
10
|
+
popover?: PopoverProps['className'];
|
11
|
+
};
|
12
|
+
} & {
|
13
|
+
popoverProps?: Omit<PopoverProps, 'children' | 'className' | 'style'>;
|
14
|
+
};
|
8
15
|
type MenuItemProps = Omit<MenuItemProps$1, 'className'> & {
|
9
16
|
color?: 'info' | 'serious';
|
10
17
|
classNames?: {
|
@@ -12,7 +19,7 @@ type MenuItemProps = Omit<MenuItemProps$1, 'className'> & {
|
|
12
19
|
text?: TextProps['className'];
|
13
20
|
more?: IconProps['className'];
|
14
21
|
icon?: IconProps['className'];
|
15
|
-
|
22
|
+
hotkey?: string;
|
16
23
|
};
|
17
24
|
};
|
18
25
|
type MenuTriggerProps = MenuTriggerProps$1;
|
@@ -1,32 +1,38 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import * as react from 'react';
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import '
|
6
|
-
import 'cva';
|
3
|
+
import { ContextValue } from 'react-aria-components';
|
4
|
+
import { OptionsDataItem, OptionsProps, OptionsItemProps, OptionsItemTextProps, OptionsSectionProps } from './types.js';
|
5
|
+
import '../icon/types.js';
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
label?: string;
|
13
|
-
placeholder?: string;
|
14
|
-
size?: OptionsItemProps<T>['size'];
|
15
|
-
type?: OptionsItemProps<T>['type'];
|
7
|
+
declare const OptionsContext: react.Context<ContextValue<OptionsProps<OptionsDataItem>, HTMLDivElement>>;
|
8
|
+
declare function OptionsSection<T extends OptionsDataItem>({ children, classNames, header, items, }: OptionsSectionProps<T>): react_jsx_runtime.JSX.Element;
|
9
|
+
declare namespace OptionsSection {
|
10
|
+
var displayName: string;
|
16
11
|
}
|
17
|
-
declare
|
18
|
-
declare
|
19
|
-
declare namespace Options {
|
12
|
+
declare function OptionsItemContent({ className, ...rest }: OptionsItemTextProps): react_jsx_runtime.JSX.Element;
|
13
|
+
declare namespace OptionsItemContent {
|
20
14
|
var displayName: string;
|
21
|
-
var Item: typeof OptionsItem;
|
22
|
-
var Section: typeof OptionsSection;
|
23
15
|
}
|
24
|
-
|
25
|
-
|
16
|
+
declare function OptionsItemLabel({ className, ...rest }: OptionsItemTextProps): react_jsx_runtime.JSX.Element;
|
17
|
+
declare namespace OptionsItemLabel {
|
18
|
+
var displayName: string;
|
26
19
|
}
|
27
|
-
declare function
|
28
|
-
declare namespace
|
20
|
+
declare function OptionsItemDescription({ className, ...rest }: OptionsItemTextProps): react_jsx_runtime.JSX.Element;
|
21
|
+
declare namespace OptionsItemDescription {
|
29
22
|
var displayName: string;
|
30
23
|
}
|
24
|
+
declare function OptionsItem<T extends OptionsDataItem>({ children, classNames, color, textValue, ...rest }: OptionsItemProps<T>): react_jsx_runtime.JSX.Element;
|
25
|
+
declare namespace OptionsItem {
|
26
|
+
var displayName: string;
|
27
|
+
var Label: typeof OptionsItemLabel;
|
28
|
+
var Content: typeof OptionsItemContent;
|
29
|
+
var Description: typeof OptionsItemDescription;
|
30
|
+
}
|
31
|
+
declare function Options<T extends OptionsDataItem>({ ref, ...props }: OptionsProps<T>): react_jsx_runtime.JSX.Element;
|
32
|
+
declare namespace Options {
|
33
|
+
var displayName: string;
|
34
|
+
var Item: typeof OptionsItem;
|
35
|
+
var Section: typeof OptionsSection;
|
36
|
+
}
|
31
37
|
|
32
|
-
export { Options, OptionsContext
|
38
|
+
export { Options, OptionsContext };
|