@accelint/design-toolkit 2.3.2 → 2.4.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 (104) hide show
  1. package/dist/components/accordion/index.js +1 -1
  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 +16 -24
  6. package/dist/components/avatar/index.js +1 -1
  7. package/dist/components/avatar/index.js.map +1 -1
  8. package/dist/components/avatar/styles.d.ts +47 -0
  9. package/dist/components/avatar/styles.js +2 -0
  10. package/dist/components/avatar/styles.js.map +1 -0
  11. package/dist/components/avatar/types.d.ts +19 -0
  12. package/dist/components/avatar/types.js +2 -0
  13. package/dist/components/avatar/types.js.map +1 -0
  14. package/dist/components/badge/index.d.ts +16 -16
  15. package/dist/components/badge/index.js +1 -1
  16. package/dist/components/badge/index.js.map +1 -1
  17. package/dist/components/badge/styles.d.ts +32 -0
  18. package/dist/components/badge/styles.js +2 -0
  19. package/dist/components/badge/styles.js.map +1 -0
  20. package/dist/components/badge/types.d.ts +16 -0
  21. package/dist/components/badge/types.js +2 -0
  22. package/dist/components/badge/types.js.map +1 -0
  23. package/dist/components/button/index.js +1 -1
  24. package/dist/components/button/index.js.map +1 -1
  25. package/dist/components/button/styles.d.ts +12 -103
  26. package/dist/components/button/styles.js +1 -1
  27. package/dist/components/button/styles.js.map +1 -1
  28. package/dist/components/button/types.d.ts +3 -1
  29. package/dist/components/checkbox/styles.js +1 -1
  30. package/dist/components/checkbox/styles.js.map +1 -1
  31. package/dist/components/chip/index.js +1 -1
  32. package/dist/components/chip/index.js.map +1 -1
  33. package/dist/components/chip/styles.d.ts +130 -134
  34. package/dist/components/chip/styles.js +1 -1
  35. package/dist/components/chip/styles.js.map +1 -1
  36. package/dist/components/chip/types.d.ts +7 -5
  37. package/dist/components/classification-badge/index.js +1 -1
  38. package/dist/components/classification-badge/index.js.map +1 -1
  39. package/dist/components/classification-badge/styles.d.ts +2 -15
  40. package/dist/components/classification-badge/styles.js +1 -1
  41. package/dist/components/classification-badge/styles.js.map +1 -1
  42. package/dist/components/classification-badge/types.d.ts +3 -1
  43. package/dist/components/icon/index.d.ts +0 -2
  44. package/dist/components/icon/index.js +1 -1
  45. package/dist/components/icon/index.js.map +1 -1
  46. package/dist/components/icon/styles.d.ts +2 -31
  47. package/dist/components/icon/styles.js +1 -1
  48. package/dist/components/icon/styles.js.map +1 -1
  49. package/dist/components/icon/types.d.ts +4 -4
  50. package/dist/components/input/index.d.ts +16 -0
  51. package/dist/components/input/index.js +2 -0
  52. package/dist/components/input/index.js.map +1 -0
  53. package/dist/components/input/styles.d.ts +152 -0
  54. package/dist/components/input/styles.js +2 -0
  55. package/dist/components/input/styles.js.map +1 -0
  56. package/dist/components/input/types.d.ts +20 -0
  57. package/dist/components/input/types.js +2 -0
  58. package/dist/components/input/types.js.map +1 -0
  59. package/dist/components/label/styles.js +1 -1
  60. package/dist/components/label/styles.js.map +1 -1
  61. package/dist/components/menu/index.d.ts +48 -0
  62. package/dist/components/menu/index.js +2 -0
  63. package/dist/components/menu/index.js.map +1 -0
  64. package/dist/components/menu/styles.d.ts +95 -0
  65. package/dist/components/menu/styles.js +2 -0
  66. package/dist/components/menu/styles.js.map +1 -0
  67. package/dist/components/menu/types.d.ts +30 -0
  68. package/dist/components/menu/types.js +2 -0
  69. package/dist/components/menu/types.js.map +1 -0
  70. package/dist/components/query-builder/value-editor.js +1 -1
  71. package/dist/components/query-builder/value-editor.js.map +1 -1
  72. package/dist/components/switch/styles.js +1 -1
  73. package/dist/components/switch/styles.js.map +1 -1
  74. package/dist/components/text-area-field/index.d.ts +0 -2
  75. package/dist/components/text-area-field/index.js +1 -1
  76. package/dist/components/text-area-field/index.js.map +1 -1
  77. package/dist/components/text-area-field/styles.d.ts +33 -93
  78. package/dist/components/text-area-field/styles.js +1 -1
  79. package/dist/components/text-area-field/styles.js.map +1 -1
  80. package/dist/components/text-area-field/types.d.ts +6 -9
  81. package/dist/components/text-field/index.d.ts +18 -24
  82. package/dist/components/text-field/index.js +1 -1
  83. package/dist/components/text-field/index.js.map +1 -1
  84. package/dist/components/text-field/styles.d.ts +53 -0
  85. package/dist/components/text-field/styles.js +2 -0
  86. package/dist/components/text-field/styles.js.map +1 -0
  87. package/dist/components/text-field/types.d.ts +26 -0
  88. package/dist/components/text-field/types.js +2 -0
  89. package/dist/components/text-field/types.js.map +1 -0
  90. package/dist/index.css +79 -69
  91. package/dist/index.d.ts +22 -9
  92. package/dist/index.js +1 -1
  93. package/dist/metafile-esm.json +1 -1
  94. package/dist/styles.css +812 -262
  95. package/dist/tokens/{generated/tokens.d.ts → index.d.ts} +19 -4
  96. package/dist/tokens/index.js +2 -0
  97. package/dist/tokens/index.js.map +1 -0
  98. package/dist/tokens/{generated/themes.css → themes.css} +19 -4
  99. package/dist/tokens/{generated/tokens.css → tokens.css} +18 -3
  100. package/dist/tokens/tokens.d.ts +2 -0
  101. package/package.json +2 -1
  102. package/dist/tokens/generated/tokens.js +0 -2
  103. package/dist/tokens/generated/tokens.js.map +0 -1
  104. /package/dist/tokens/{generated/themes.d.ts → themes.d.ts} +0 -0
@@ -0,0 +1,16 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as react from 'react';
3
+ import { ContextValue } from 'react-aria-components';
4
+ import { InputProps } from './types.js';
5
+ import 'tailwind-variants';
6
+ import '../button/types.js';
7
+ import '../button/styles.js';
8
+ import './styles.js';
9
+
10
+ declare const InputContext: react.Context<ContextValue<InputProps, HTMLInputElement>>;
11
+ declare function Input({ ref, ...props }: InputProps): react_jsx_runtime.JSX.Element;
12
+ declare namespace Input {
13
+ var displayName: string;
14
+ }
15
+
16
+ export { Input, InputContext };
@@ -0,0 +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';import {jsxs,jsx}from'react/jsx-runtime';var {container:S,sizer:w,input:A,clear:B}=InputStyles(),v={target:{value:""}},F=createContext(null);function K({ref:t,...a}){[a,t]=useContextProps(a,t??null,InputContext),[a,t]=useContextProps(a,t??null,F);let{classNames:s,defaultValue:h="",disabled:i,placeholder:p,readOnly:c,required:m,size:f,type:l=InputStylesDefaults.type,value:g,isClearable:n,isInvalid:x,onChange:I,onKeyDown:E,...P}=a,[u,N]=useControlledState(g,h,I),b=(`${u??""}`.length||p?.length)??0,o=u==null||u==="";function d(e){I?.(e),e.defaultPrevented||N(e.target.value);}return jsxs("div",{className:S({className:s?.container,type:l,isClearable:n,isEmpty:o}),"data-disabled":i||null,"data-invalid":x||null,"data-length":b,"data-placeholder":!!p&&o||null,"data-readonly":c||null,"data-required":m||null,"data-size":f,children:[jsx("div",{className:w({className:s?.sizer,type:l,isClearable:n,isEmpty:o}),children:jsx(Input,{...P,ref:t,className:composeRenderProps(s?.input,e=>A({className:e,type:l,isClearable:n,isEmpty:o})),disabled:i,placeholder:p,readOnly:c,required:m,type:l,value:u,onChange:d,onKeyDown:e=>{E?.(e),n&&!e.defaultPrevented&&e.key==="Escape"&&d(v);}})}),n&&jsx(Button,{className:composeRenderProps(s?.clear,e=>B({className:e,type:l,isClearable:n,isEmpty:o})),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,F as InputContext};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/input/index.tsx"],"names":["InputStyles","M","clearInputEvent","InputContext","createContext","T","props","ref","useContextProps","q","InputStylesDefaults","O","rest","value","setValue","useControlledState","valueProp","defaultValue","onChange","length","placeholder","event","isInvalid","isEmpty","readOnly","required","r","classNames","AriaInput","V","className","input","onKeyDown","isClearable","jsx","Button","H","clear","Icon","L","CancelFill","Input"],"mappings":"8ZA8BQ,IAAA,CAAA,SAAW,CAAA,CAAA,CAAA,KAAO,CAAA,CAAA,CAAA,KAAO,CAAA,CAAA,CAAA,MAAUA,CAAAA,CAAY,CAAAC,WAGjDC,EAAkB,CACtB,CAAA,CAAA,CAAA,MAAU,CAAA,CAAA,KAAU,CACtB,EAEaC,EACXC,CAAAA,CAA0D,CAAAC,aAAA,CAAA,IAErD,EAAA,SAAiB,CAAA,CAAA,CAAA,GAAK,CAAA,CAAA,CAAGC,GAAqB,CACnD,CAACA,EAAOC,CAAG,CAAA,CAAIC,EAAgBF,CAAAA,eAAOC,CAAAA,CAAAA,CAAO,CAAA,EAAA,KAC7CE,YAACH,CAAAA,CAAOC,CAAG,CAAA,CAAIC,EAAgBF,CAAAA,eAAOC,CAAAA,CAAAA,CAAO,CAAA,EAAA,KAE7C,CAAA,CAAA,CAAM,cAEJ,CAAA,CAAA,CAAA,YAAe,CAAA,CAAA,CACf,EAAA,CAAA,QACA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,QACA,WACA,CAAA,CAAA,CAAA,IACA,CAAA,CAAA,CAAA,IAAOG,CAAAA,CAAoB,CAAAC,mBAAA,CAAA,UAE3B,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,SACA,WACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAGC,GACDN,CAAAA,CAEE,CAACO,CAAAA,CAAOC,CAAQ,CAAA,CAAIC,CAAAA,CACxBC,CAAAA,kBACAC,CAAAA,CACAC,CACF,CAAA,CACMC,CAAAA,CAAAA,CAAU,GAAGN,CAAAA,EAAS,CAAA,IAAK,CAAA,CAAA,CAAA,MAAUO,EAAa,CAAA,EAAA,MAAW,IACnDP,CAAAA,CAAAA,CAAS,CAAA,EAAA,OAAkB,GAE3C,EAAA,CAAA,SAAsBQ,CAAsC,CAC1DH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AAA,CACCC,MAAA,CAAA,CAAA,SAA8BT,CAAAA,kBAAAA,CAAY,CAAA,EAAA,MACxCU,CAAAA,EAAQ,YAAW,CAAA,CAAA,CAAA,IAAM,CAAA,CAAA,CAAA,WAAa,CAAA,CAAA,CAAA,OAAS,CACjD,EACA,CAAA,CAAA,CAAA,mBAAmB,CACnB,IAAA,CAAA,IAAK,CAAA,eACG,CAAA,MACR,CAAA,UACA,CAAA,CAAA,CAAA,OAAS,CAAA,IACMnC,CAAe,CAAA,CAE5BK,CAAAA,CAAAA,CAAK,UAAS,EAAA,QAGhB,CAAA,CAAA,QAAC+B,IAAA,CACCC,IAAA,CAAA,CAAA,QAACC,CAAAA,GAAA,WAAW,CAAA,EACd,CACF,GAEJ,CAEJ,CACAC,EAAM,CAAA,CAAA,CAAA,WAAc,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 [props, ref] = useContextProps(props, ref ?? null, AriaInputContext);\n [props, ref] = useContextProps(props, ref ?? null, InputContext);\n\n const {\n classNames,\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(\n valueProp,\n defaultValue,\n onChange,\n );\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 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 type,\n isClearable,\n isEmpty,\n })}\n >\n <AriaInput\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className, 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, 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"]}
@@ -0,0 +1,152 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+
3
+ declare const InputStylesDefaults: {
4
+ readonly type: "text";
5
+ };
6
+ declare const InputStyles: tailwind_variants.TVReturnType<{
7
+ type: {
8
+ button: string;
9
+ checkbox: string;
10
+ color: string;
11
+ date: string;
12
+ 'datetime-local': string;
13
+ email: string;
14
+ file: string;
15
+ hidden: string;
16
+ image: string;
17
+ month: string;
18
+ number: {
19
+ input: string;
20
+ };
21
+ password: string;
22
+ radio: string;
23
+ range: string;
24
+ reset: string;
25
+ search: string;
26
+ submit: string;
27
+ tel: string;
28
+ text: string;
29
+ time: string;
30
+ url: string;
31
+ week: string;
32
+ };
33
+ isClearable: {
34
+ false: {
35
+ container: string;
36
+ };
37
+ true: {
38
+ container: string;
39
+ };
40
+ };
41
+ isEmpty: {
42
+ false: {
43
+ clear: string;
44
+ };
45
+ true: {
46
+ clear: string;
47
+ };
48
+ };
49
+ }, {
50
+ container: string;
51
+ sizer: string[];
52
+ input: string[];
53
+ clear: string[];
54
+ }, undefined, {
55
+ type: {
56
+ button: string;
57
+ checkbox: string;
58
+ color: string;
59
+ date: string;
60
+ 'datetime-local': string;
61
+ email: string;
62
+ file: string;
63
+ hidden: string;
64
+ image: string;
65
+ month: string;
66
+ number: {
67
+ input: string;
68
+ };
69
+ password: string;
70
+ radio: string;
71
+ range: string;
72
+ reset: string;
73
+ search: string;
74
+ submit: string;
75
+ tel: string;
76
+ text: string;
77
+ time: string;
78
+ url: string;
79
+ week: string;
80
+ };
81
+ isClearable: {
82
+ false: {
83
+ container: string;
84
+ };
85
+ true: {
86
+ container: string;
87
+ };
88
+ };
89
+ isEmpty: {
90
+ false: {
91
+ clear: string;
92
+ };
93
+ true: {
94
+ clear: string;
95
+ };
96
+ };
97
+ }, {
98
+ container: string;
99
+ sizer: string[];
100
+ input: string[];
101
+ clear: string[];
102
+ }, tailwind_variants.TVReturnType<{
103
+ type: {
104
+ button: string;
105
+ checkbox: string;
106
+ color: string;
107
+ date: string;
108
+ 'datetime-local': string;
109
+ email: string;
110
+ file: string;
111
+ hidden: string;
112
+ image: string;
113
+ month: string;
114
+ number: {
115
+ input: string;
116
+ };
117
+ password: string;
118
+ radio: string;
119
+ range: string;
120
+ reset: string;
121
+ search: string;
122
+ submit: string;
123
+ tel: string;
124
+ text: string;
125
+ time: string;
126
+ url: string;
127
+ week: string;
128
+ };
129
+ isClearable: {
130
+ false: {
131
+ container: string;
132
+ };
133
+ true: {
134
+ container: string;
135
+ };
136
+ };
137
+ isEmpty: {
138
+ false: {
139
+ clear: string;
140
+ };
141
+ true: {
142
+ clear: string;
143
+ };
144
+ };
145
+ }, {
146
+ container: string;
147
+ sizer: string[];
148
+ input: string[];
149
+ clear: string[];
150
+ }, undefined, unknown, unknown, undefined>>;
151
+
152
+ export { InputStyles, InputStylesDefaults };
@@ -0,0 +1,2 @@
1
+ import {tv}from'./../../lib/utils.js';var 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:{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:["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-medium/input:min-w-[160px] group-size-medium/input:max-w-[400px]","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))] group-size-small/input:max-w-[200px]"]}}],defaultVariants:t});export{i as InputStyles,t as InputStylesDefaults};//# sourceMappingURL=styles.js.map
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/input/styles.ts"],"names":[],"mappings":"sCAeE,IAAA,CAAM,CAAA,CAAA,IACR,CAAA,MAGE,OAAO,CACL,KAAA,CAAA,CAAA,SACE,CAAA,+HACK,CACL,KAAA,CAAA,CAAA,iCACA,CAAA,uFAEK,CACL,KAAA,CAAA,CAAA,4IACA,CAAA,6CACA,CAAA,qDACA,CAAA,6CACA,CAAA,6HAEF,CAAO,CACL,KAAA,CAAA,CAAA,iCACA,CAAA,6DACA,CAAA,+CACA,CAAA,iEACA,CAAA,iEAGJ,CAAA,CAAA,CAAA,QACQ,CACJ,CAAA,IAAA,CAAA,CAAQ,MACR,CAAA,EAAA,CAAA,QACA,CAAA,EAAO,MACP,CAAA,EAAM,CAAA,IACN,CAAA,EAAA,CAAA,gBACA,CAAA,EAAO,CAAA,KACP,CAAA,EAAM,CAAA,QACE,MACR,CAAA,EAAO,CAAA,KACP,CAAA,EAAO,CAAA,KACP,CAAA,EAAA,CAAQ,MACN,CACE,2JAEJ,CAAA,CAAA,QACA,CAAA,EAAO,CAAA,KACP,CAAA,EAAO,CAAA,KACP,CAAA,EAAO,CAAA,KACP,CAAA,EAAA,CAAQ,MACR,CAAA,EAAA,CAAQ,MACR,CAAK,EAAA,CACL,GAAA,CAAA,OACA,CAAA,EAAM,CAAA,IACN,CAAK,EAAA,CACL,GAAA,CAAA,EAAM,CACR,IACA,CAAA,EAAA,CAAA,CAAA,WACE,CAAO,CACL,KAAA,CAAA,CAAA,SAAW,CAAA,cAEP,CACJ,CAAA,IAAA,CAAA,CAAA,yBAGJ,CAAA,CAAA,CAAA,OACE,CAAO,CACL,KAAA,CAAO,CAAA,KAAA,CAAA,qCAEH,CACJ,CAAA,IAAA,CAAO,CAAA,KAAA,CAAA,QAIb,CAAA,CAAA,CAAA,CAAA,gBAEI,CAAM,CAAC,CAAA,IAAA,CAAA,CAAA,QAAgB,CAAA,MACvB,CAAA,CAAA,UACS,CACL,KAAA,CAAA,CAAA,yNACA,CAAA,kTAKR,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 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: ['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))] group-size-medium/input:min-w-[160px] group-size-medium/input:max-w-[400px]',\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))] group-size-small/input:max-w-[200px]',\n ],\n },\n },\n ],\n defaultVariants: InputStylesDefaults,\n});\n"]}
@@ -0,0 +1,20 @@
1
+ import { RefAttributes } from 'react';
2
+ import { InputProps as InputProps$1 } from 'react-aria-components';
3
+ import { VariantProps } from 'tailwind-variants';
4
+ import { ButtonProps } from '../button/types.js';
5
+ import { InputStyles } from './styles.js';
6
+ import '../button/styles.js';
7
+
8
+ type InputProps = Omit<InputProps$1, 'className' | 'size' | 'type'> & RefAttributes<HTMLInputElement> & Omit<VariantProps<typeof InputStyles>, 'isEmpty'> & {
9
+ classNames?: {
10
+ container?: string;
11
+ sizer?: string;
12
+ input?: InputProps$1['className'];
13
+ clear?: ButtonProps['className'];
14
+ };
15
+ size?: 'medium' | 'small';
16
+ isClearable?: boolean;
17
+ isInvalid?: boolean;
18
+ };
19
+
20
+ export type { InputProps };
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';var a=tv({base:["text-header-s","enabled:fg-default-light","disabled:fg-disabled"]});export{a as LabelStyles};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';var 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,IAAA,CAAA,CAAAA,EAAM,CAAC,CAAA,IAAA,CAAA,CAAA,eAAiB,CAAA,0BAA4B,CAAA,sBACrD,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: ['text-header-s', 'enabled:fg-default-light', 'disabled:fg-disabled'],\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/label/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAM,CACJ,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"]}
@@ -0,0 +1,48 @@
1
+ import * as react_aria_components from 'react-aria-components';
2
+ import { MenuTrigger, ContextValue } from 'react-aria-components';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import * as react from 'react';
5
+ import { MenuProps, MenuItemProps, MenuTextProps, SeparatorProps, MenuSectionProps } from './types.js';
6
+ import '../icon/types.js';
7
+ import './styles.js';
8
+ import 'tailwind-variants';
9
+
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
+ declare function MenuSection<T extends object>(props: MenuSectionProps<T>): react_jsx_runtime.JSX.Element;
32
+ declare namespace MenuSection {
33
+ var displayName: string;
34
+ }
35
+ declare function MenuSeparator({ className, ...rest }: SeparatorProps): react_jsx_runtime.JSX.Element;
36
+ declare namespace MenuSeparator {
37
+ var displayName: string;
38
+ }
39
+ declare function MenuLabel(props: MenuTextProps): react_jsx_runtime.JSX.Element;
40
+ declare namespace MenuLabel {
41
+ var displayName: string;
42
+ }
43
+ declare function MenuDescription(props: MenuTextProps): react_jsx_runtime.JSX.Element;
44
+ declare namespace MenuDescription {
45
+ var displayName: string;
46
+ }
47
+
48
+ export { Menu, MenuContext, MenuDescription, MenuItem, MenuLabel, MenuSection, MenuSeparator };
@@ -0,0 +1,2 @@
1
+ import'client-only';import {isSlottedContextValue}from'./../../lib/utils.js';import y from'@accelint/icons/chevron-right';import {createContext,useContext}from'react';import {Text,MenuItem,composeRenderProps,Provider,KeyboardContext,DEFAULT_SLOT,useContextProps,Popover,Menu,MenuSection,Header,Collection,Separator,MenuTrigger,SubmenuTrigger}from'react-aria-components';import {IconContext,Icon}from'../icon/index.js';import {MenuStyles,MenuStylesDefaults}from'./styles.js';import {jsx,jsxs}from'react/jsx-runtime';var {menu:z,icon:B,item:G,label:J,description:Q,more:W,sectionHeader:X,separator:Y,keyboard:Z}=MenuStyles(),d=createContext(null);function s({ref:n,...e}){[e,n]=useContextProps(e,n??null,d);let{children:a,className:t,selectionMode:i="single",offset:c=-4,placement:u,isNonModal:r,containerPadding:m,variant:N=MenuStylesDefaults.variant,...b}=e;return jsx(Popover,{offset:c,placement:u,isNonModal:r,containerPadding:m,children:jsx(d.Provider,{value:{variant:N},children:jsx(Menu,{ref:n,className:composeRenderProps(t,g=>z({className:g,variant:N})),selectionMode:i,...b,children:a})})})}s.displayName="Menu";var l=n=>{let e=useContext(d),a=(isSlottedContextValue(e)?void 0:e?.variant)??MenuStylesDefaults.variant,{classNames:t,color:i=MenuStylesDefaults.color,children:c,...u}=n;return jsx(MenuItem,{...u,className:composeRenderProps(t?.item,r=>G({className:r,variant:a,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,{})})]}))})};l.displayName="Menu.Item";function P(n){let{header:e,children:a,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:a})]})}P.displayName="Menu.Section";function S({className:n,...e}){return jsx(Separator,{...e,className:Y({className:n})})}S.displayName="Menu.Separator";function T(n){let{children:e,className:a,...t}=n;return jsx(Text,{...t,slot:"label",className:J({className:a}),children:e})}T.displayName="Menu.Item.Label";function f(n){let{children:e,className:a,...t}=n;return jsx(Text,{...t,slot:"description","data-slot":"description",className:Q({className:a}),children:e})}f.displayName="Menu.Item.Description";s.Trigger=MenuTrigger;s.Submenu=SubmenuTrigger;s.Item=l;l.Label=T;l.Description=f;s.Separator=S;s.Section=P;export{s as Menu,d as MenuContext,f as MenuDescription,l as MenuItem,T as MenuLabel,P as MenuSection,S as MenuSeparator};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,QACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,aAAgB,CAAA,CAAA,CAChB,QAAAC,CAAS,MACT,CAAA,CAAA,CAAA,EAAA,CAAA,SACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAA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AA,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"]}
@@ -0,0 +1,95 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import { ReactNode } from 'react';
4
+
5
+ declare const MenuStylesDefaults: {
6
+ readonly variant: "cozy";
7
+ readonly color: "info";
8
+ };
9
+ declare const MenuStyles: tailwind_variants.TVReturnType<{
10
+ variant: {
11
+ cozy: {
12
+ item: string;
13
+ };
14
+ compact: {
15
+ item: string;
16
+ };
17
+ };
18
+ color: {
19
+ info: {
20
+ item: string[];
21
+ };
22
+ serious: {
23
+ item: string[];
24
+ };
25
+ };
26
+ }, {
27
+ menu: string;
28
+ icon: string;
29
+ item: string[];
30
+ label: string;
31
+ description: string;
32
+ more: string;
33
+ sectionHeader: string;
34
+ separator: string;
35
+ keyboard: string;
36
+ }, undefined, {
37
+ variant: {
38
+ cozy: {
39
+ item: string;
40
+ };
41
+ compact: {
42
+ item: string;
43
+ };
44
+ };
45
+ color: {
46
+ info: {
47
+ item: string[];
48
+ };
49
+ serious: {
50
+ item: string[];
51
+ };
52
+ };
53
+ }, {
54
+ menu: string;
55
+ icon: string;
56
+ item: string[];
57
+ label: string;
58
+ description: string;
59
+ more: string;
60
+ sectionHeader: string;
61
+ separator: string;
62
+ keyboard: string;
63
+ }, tailwind_variants.TVReturnType<{
64
+ variant: {
65
+ cozy: {
66
+ item: string;
67
+ };
68
+ compact: {
69
+ item: string;
70
+ };
71
+ };
72
+ color: {
73
+ info: {
74
+ item: string[];
75
+ };
76
+ serious: {
77
+ item: string[];
78
+ };
79
+ };
80
+ }, {
81
+ menu: string;
82
+ icon: string;
83
+ item: string[];
84
+ label: string;
85
+ description: string;
86
+ more: string;
87
+ sectionHeader: string;
88
+ separator: string;
89
+ keyboard: string;
90
+ }, undefined, unknown, unknown, undefined>>;
91
+ type MenuStyleVariants = VariantProps<typeof MenuStyles> & {
92
+ prefixIcon?: ReactNode;
93
+ };
94
+
95
+ export { type MenuStyleVariants, MenuStyles, MenuStylesDefaults };
@@ -0,0 +1,2 @@
1
+ import {tv}from'./../../lib/utils.js';var t={variant:"cozy",color:"info"},o=tv({slots:{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/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-data-[slot=description]/item:row-span-full",description:"fg-default-dark group-hover/item:fg-inverse-light group-data-[focused]/item:fg-inverse-light group-data-[disabled]/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
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/menu/styles.ts"],"names":["e"],"mappings":"sCAiBE,IAAA,CAAA,CAAA,CAAA,OAAS,CACT,MAAO,CAAA,KACT,OAGE,CAAA,CAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAM,CAAA,CAAA,IAAA,CAAA,8HACA,CAAA,IAAA,CAAA,kBAEJ,CAAA,IAAA,CAAA,CAAA,uDACA,CAAA,qHACA,CAAA,8CAEF,CACE,CAAA,KAAA,CAAA,qFACF,CAAA,WACE,CAAA,mLACI,CAAA,IAAA,CAAA,oBACN,CAAA,aAAe,CAAA,2CACf,CAAA,gDACA,CAAA,QAAU,CAAA,oBAEZ,CAAA,CAAA,QACE,CAAA,CAAA,OACQ,CACJ,KAAM,CAAA,CAAA,IAAA,CAAA,WAER,CAAA,CAAA,OACQ,CAAA,CAAA,IAAA,CAAA,aAGV,CAAA,CAAO,CACL,KAAM,CACJ,CAAA,IAAM,CACJ,uHACA,CAAA,mGAGJ,CAAA,CAAA,CAAA,OACQ,CACJ,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: '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/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-data-[slot=description]/item:row-span-full',\n description:\n 'fg-default-dark group-hover/item:fg-inverse-light group-data-[focused]/item:fg-inverse-light group-data-[disabled]/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"]}
@@ -0,0 +1,30 @@
1
+ import { RefAttributes, PropsWithChildren } from 'react';
2
+ import { MenuProps as MenuProps$1, PopoverProps, MenuItemProps as MenuItemProps$1, TextProps, SeparatorProps as SeparatorProps$1, MenuSectionProps as MenuSectionProps$1, MenuTriggerProps as MenuTriggerProps$1, SubmenuTriggerProps as SubmenuTriggerProps$1 } from 'react-aria-components';
3
+ import { IconProps } from '../icon/types.js';
4
+ import { MenuStyleVariants } from './styles.js';
5
+ import 'tailwind-variants';
6
+
7
+ type MenuProps<T> = MenuProps$1<T> & Pick<MenuStyleVariants, 'variant'> & RefAttributes<HTMLDivElement> & Pick<PopoverProps, 'placement' | 'offset' | 'containerPadding' | 'isNonModal'>;
8
+ type MenuItemProps = Omit<MenuItemProps$1, 'className'> & {
9
+ color?: 'info' | 'serious';
10
+ classNames?: {
11
+ item?: MenuItemProps$1['className'];
12
+ text?: TextProps['className'];
13
+ more?: IconProps['className'];
14
+ icon?: IconProps['className'];
15
+ keyboard?: string;
16
+ };
17
+ };
18
+ type MenuTriggerProps = MenuTriggerProps$1;
19
+ type SubmenuTriggerProps = SubmenuTriggerProps$1;
20
+ type MenuSectionProps<T> = Omit<MenuSectionProps$1<T>, 'className'> & {
21
+ header?: string;
22
+ classNames?: {
23
+ section?: string;
24
+ sectionHeader?: string;
25
+ };
26
+ };
27
+ type SeparatorProps = SeparatorProps$1;
28
+ type MenuTextProps = PropsWithChildren & TextProps;
29
+
30
+ export type { MenuItemProps, MenuProps, MenuSectionProps, MenuTextProps, MenuTriggerProps, SeparatorProps, SubmenuTriggerProps };
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -1,2 +1,2 @@
1
- import {useCallback}from'react';import {useValueEditor}from'react-querybuilder';import {Checkbox}from'../checkbox/index.js';import {Radio}from'../radio/index.js';import {Switch}from'../switch/index.js';import {TextAreaField}from'../text-area-field/index.js';import {TextField}from'../text-field/index.js';import {multiValueOperators}from'./constants.js';import {getValidationResult}from'./utils.js';import {ValueSelector}from'./value-selector.js';import {jsx,Fragment}from'react/jsx-runtime';function k({disabled:a,fieldData:{name:e,validator:t},handleOnChange:l,rule:o,value:r}){let{valid:i}=getValidationResult(o,t);return jsx(Checkbox,{isDisabled:a,isSelected:r,onChange:l,"aria-invalid":!i,"aria-label":e})}function x({disabled:a,fieldData:{name:e,validator:t},handleOnChange:l,rule:o,value:r,values:i}){let{valid:u}=getValidationResult(o,t);return jsx(Radio.Group,{value:r,isDisabled:a,onChange:l,"aria-invalid":!u,"aria-label":e,"aria-labelledby":e,children:i?.map(n=>jsx(Radio,{value:n.value,children:n.label},n.name))})}var R=[];function S({disabled:a,fieldData:{name:e,validator:t},handleOnChange:l,rule:o,type:r,value:i,values:u=R,...n}){let{valid:p}=getValidationResult(o,t);return jsx(ValueSelector,{...n,disabled:a,multiple:r==="multiselect",options:u,title:e,validation:!p,value:i,handleOnChange:l,"aria-labelledby":e})}function T({disabled:a,fieldData:{name:e,validator:t},handleOnChange:l,rule:o,value:r}){let{valid:i}=getValidationResult(o,t);return jsx(Switch,{isDisabled:a,isSelected:!!r,onChange:l,"aria-invalid":!i,"aria-label":e,"aria-labelledby":e})}function w({disabled:a,fieldData:{name:e,placeholder:t,validator:l},handleOnChange:o,inputType:r,rule:i,value:u}){let{valid:n,reasons:p}=getValidationResult(i,l);return jsx(TextField,{isDisabled:a,isInvalid:!n,placeholder:t,type:r??"text",size:"small",value:u,onChange:o,"aria-invalid":!n,"aria-label":e,"aria-labelledby":e,errorMessage:p?.join("/n")})}function I({disabled:a,fieldData:{name:e,placeholder:t,validator:l},handleOnChange:o,rule:r,value:i}){let{valid:u,reasons:n}=getValidationResult(r,l);return jsx(TextAreaField,{size:"small",errorMessage:n?.join("/n"),inputProps:{placeholder:t},value:i,isDisabled:a,isInvalid:!u,onChange:o,"aria-label":e,"aria-invalid":!u,"aria-labelledby":e})}var O={checkbox:k,radio:x,select:S,switch:T,text:w,textarea:I};function q(a){let{fieldData:{name:e,valueEditorType:t},operator:l,rule:o}=a,{valueAsArray:r,multiValueHandler:i}=useValueEditor({...a,skipHook:true}),u=useCallback(s=>({...o,value:r[s]}),[o,r]),n=useCallback(s=>i(s,0),[i]),p=useCallback(s=>i(s,1),[i]),E=(typeof t=="function"?t(l):t)??"text",f=O?.[E];return l==="null"||l==="notNull"||!f?null:multiValueOperators.includes(l)?jsx(Fragment,{children:["start","end"].map((s,v)=>jsx("div",{children:jsx(f,{...a,rule:u(v),value:r[v],handleOnChange:v?p:n})},`${e}-${s}`))}):jsx("div",{children:jsx(f,{...a})})}export{q as ValueEditor};//# sourceMappingURL=value-editor.js.map
1
+ import {useCallback}from'react';import {useValueEditor}from'react-querybuilder';import {Checkbox}from'../checkbox/index.js';import {Radio}from'../radio/index.js';import {Switch}from'../switch/index.js';import {TextAreaField}from'../text-area-field/index.js';import {TextField}from'../text-field/index.js';import {multiValueOperators}from'./constants.js';import {getValidationResult}from'./utils.js';import {ValueSelector}from'./value-selector.js';import {jsx,Fragment}from'react/jsx-runtime';function k({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r}){let{valid:l}=getValidationResult(o,t);return jsx(Checkbox,{isDisabled:a,isSelected:r,onChange:i,"aria-invalid":!l,"aria-label":e})}function x({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r,values:l}){let{valid:d}=getValidationResult(o,t);return jsx(Radio.Group,{value:r,isDisabled:a,onChange:i,"aria-invalid":!d,"aria-label":e,"aria-labelledby":e,children:l?.map(n=>jsx(Radio,{value:n.value,children:n.label},n.name))})}var R=[];function S({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,type:r,value:l,values:d=R,...n}){let{valid:c}=getValidationResult(o,t);return jsx(ValueSelector,{...n,disabled:a,multiple:r==="multiselect",options:d,title:e,validation:!c,value:l,handleOnChange:i,"aria-labelledby":e})}function T({disabled:a,fieldData:{name:e,validator:t},handleOnChange:i,rule:o,value:r}){let{valid:l}=getValidationResult(o,t);return jsx(Switch,{isDisabled:a,isSelected:!!r,onChange:i,"aria-invalid":!l,"aria-label":e,"aria-labelledby":e})}function w({disabled:a,fieldData:{name:e,placeholder:t,validator:i},handleOnChange:o,inputType:r,rule:l,value:d}){let{valid:n,reasons:c}=getValidationResult(l,i);return jsx(TextField,{inputProps:{placeholder:t},type:r??"text",size:"small",value:d,isDisabled:a,isInvalid:!n,onChange:o,"aria-invalid":!n,"aria-label":e,"aria-labelledby":e,errorMessage:c?.join("/n")})}function I({disabled:a,fieldData:{name:e,placeholder:t,validator:i},handleOnChange:o,rule:r,value:l}){let{valid:d,reasons:n}=getValidationResult(r,i);return jsx(TextAreaField,{size:"small",errorMessage:n?.join("/n"),inputProps:{placeholder:t},value:l,isDisabled:a,isInvalid:!d,onChange:o,"aria-label":e,"aria-invalid":!d,"aria-labelledby":e})}var O={checkbox:k,radio:x,select:S,switch:T,text:w,textarea:I};function q(a){let{fieldData:{name:e,valueEditorType:t},operator:i,rule:o}=a,{valueAsArray:r,multiValueHandler:l}=useValueEditor({...a,skipHook:true}),d=useCallback(s=>({...o,value:r[s]}),[o,r]),n=useCallback(s=>l(s,0),[l]),c=useCallback(s=>l(s,1),[l]),E=(typeof t=="function"?t(i):t)??"text",f=O?.[E];return i==="null"||i==="notNull"||!f?null:multiValueOperators.includes(i)?jsx(Fragment,{children:["start","end"].map((s,v)=>jsx("div",{children:jsx(f,{...a,rule:d(v),value:r[v],handleOnChange:v?c:n})},`${e}-${s}`))}):jsx("div",{children:jsx(f,{...a})})}export{q as ValueEditor};//# sourceMappingURL=value-editor.js.map
2
2
  //# sourceMappingURL=value-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/query-builder/value-editor.tsx"],"names":["name","rule","value","validator","c","jsx","d","h","values","m","option","defaultOptions","type","rest","P","y","valid","reasons","C","inputType","g","valueEditors","RadioGroupValueEditor","SelectValueEditor","SwitchValueEditor","TextValueEditor","ruleProp","props","V","useCallback","index","b","valueAsArray","handleRangeStartChange","multiValueHandler","handleRangeEndChange","valueEditorType","Editor","operator","multiValueOperators","D","term"],"mappings":"4eA6BA,oBAEE,CAAA,CAAA,CAAA,SAAaA,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,2BAEnBC,CAAAA,CACA,CAAA,IAAA,CAAAC,CACF,CAAA,KACQ,CAAE,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,KAA8BC,CAAS,CAAA,CAErD,CAAAC,mBAAA,CAAA,CAAA,CAAA,CAAA,CACEC,QACEC,GAAA,CAAAC,QAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,yBAEA,CAAA,CAAA,CAAA,CAAA,YAKN,CAAA,CAAA,CAAA,CAAA,CAAA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAAaP,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,SACnB,CAAA,CAAA,CAAA,CAAA,cACAC,CAAAA,CACA,CAAA,IAAA,CAAAC,CAAAA,CACA,KAAA,CAAA,CAAAM,CACF,MACQ,CAAE,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,KAA8BL,CAAS,CAAA,CAErD,CAAAC,mBAAA,CAAA,CAAA,CAAA,CAAA,CACEC,CAAAA,OAAOC,GAAA,CAANG,KACC,CAAA,KAAOP,CAAAA,CACP,kBACA,CAAA,CA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AAS,OAAO,CAAA,KAAKC,CAAMX,CAAAA,GAC3BzB,CAAAA,CAAC,SACC,CAAA,KAAA,CAAA,CAAA,QACG,CAAGsB,GAAAA,CACJ,CAAA,CAAA,CAAA,GAAM1B,CAAK6B,CAAK,IAChB,CAAA,CAAA,CAAA,CAAOE,CAAAA,CAAaF,KACpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,cAGF,CAAA,CARQ,CAAA,CAAA,CAAG9B,CAAI,CAAA,CAAA,CAAA,CAAIyC,CAAI,EASzB,CACD,CAAA,CACH,EAKFpC,CAAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,GACC,CAAA,KAAA,CAAA,CAAA,QAAS,CAAGqB,GAAAA,CAAO,EACrB,CAEJ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"value-editor.js","sourcesContent":["// __private-exports\n/*\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 { useCallback } from 'react';\nimport {\n type InputType,\n type ValueEditorProps,\n useValueEditor,\n} from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport type { QueryBuilderValueEditors } from './';\nimport { multiValueOperators } from './constants';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\n\nfunction CheckboxValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Radio.Group\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n isDisabled={disabled}\n isInvalid={!valid}\n placeholder={placeholder}\n type={(inputType as InputType) ?? 'text'}\n size='small'\n value={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/query-builder/value-editor.tsx"],"names":["name","rule","value","validator","p","jsx","u","h","values","m","option","defaultOptions","type","rest","P","y","valid","reasons","C","inputType","g","valueEditors","RadioGroupValueEditor","SelectValueEditor","SwitchValueEditor","TextValueEditor","ruleProp","props","V","useCallback","b","valueAsArray","index","handleRangeStartChange","multiValueHandler","handleRangeEndChange","valueEditorType","operator","multiValueOperators","D","A","term"],"mappings":"4eA6BA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAAaA,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,SACnB,CAAA,CAAA,CAAA,CAAA,cACAC,CAAAA,CACA,CAAA,IAAA,CAAAC,CACF,CAAA,KACQ,CAAE,OAAM,CAAA,KAA8BC,CAAS,CAAA,CAErD,CAAAC,mBAAA,CAAA,CAAA,CAAA,CAAA,CACEC,CAAAA,OACEC,GAAA,CAAAC,QAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,cACA,CAAA,CAAA,CAAA,CAAA,YAKN,CAAA,CAAA,CAAA,CAAA,CAAA,oBAEE,CAAA,CAAA,CAAA,SAAaP,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,2BAEnBC,CAAAA,CACA,CAAA,IAAA,CAAAC,CAAAA,CACA,KAAA,CAAA,CAAAM,CACF,MACQ,CAAE,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,KAA8BL,CAAS,EAErD,CAAAC,mBAAA,CAAA,CAAA,CAAA,CAAA,CACEC,CAAAA,OAAOC,GAAA,CAANG,KACC,CAAA,KAAOP,CAAAA,CACP,KAAA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,cACA,CAAA,CAAA,CAAA,CAAA,YACA,CAAA,CAAA,CAAA,iBAEC,CAAA,CAAA,CAAA,QAAaQ,CAAAA,CAAAA,EACZL,GAAC,CAAwB,CAAA,EAAAC,GAAA,CAAAG,KAAOC,EAAO,KAAA,CACpC,CAAA,CAAA,KAAA,CAAA,QAAO,CAAA,CADEA,CAAAA,KAEZ,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CAAS,OAAO,CAAA,KAAKC,CAAMT,CAAAA,GAC3B3B,EAAC,CAAA,CAAA,CAAA,GAAAC,GACC,CAAA,KAAA,CAAA,CAAA,QACG,CAAGqB,GAAAA,CACJ,CAAA,CAAA,CAAA,IAAWK,CAAK,IAChB,CAAA,CAAA,CAAA,CAAOD,CAAAA,CAAaC,KACpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,cAGF,CAAA,CARQ,CAAA,CAAA,CAAGhC,CAAI,CAAA,CAAA,CAAA,CAAIyC,CAAI,EASzB,CACD,EACH,EAKFpC,CAAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,GACC,CAAA,KAAA,CAAA,CAAA,QAAS,CAAGqB,GAAAA,CAAO,EACrB,CAEJ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"value-editor.js","sourcesContent":["// __private-exports\n/*\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 { useCallback } from 'react';\nimport {\n type InputType,\n type ValueEditorProps,\n useValueEditor,\n} from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport type { QueryBuilderValueEditors } from './';\nimport { multiValueOperators } from './constants';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\n\nfunction CheckboxValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Radio.Group\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n inputProps={{ placeholder }}\n type={(inputType as InputType) ?? 'text'}\n size='small'\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';var o=tv({slots:{switch:"group flex cursor-pointer items-center gap-s disabled:cursor-not-allowed",control:["flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark","group-enabled:group-focus:bg-interactive-hover-dark group-enabled:group-focus:outline-interactive-hover group-enabled:group-focus:before:bg-interactive-hover","group-enabled:group-hover:bg-interactive-hover-dark group-enabled:group-hover:outline-interactive-hover group-enabled:group-hover:before:bg-interactive-hover","group-enabled:group-selected:outline-highlight group-selected:before:mr-0 group-selected:before:ml-l group-enabled:group-selected:before:bg-highlight","group-enabled:group-selected:group-focus:bg-highlight-subtle group-enabled:group-selected:group-focus:outline-interactive-hover group-enabled:group-selected:group-focus:before:bg-highlight","group-enabled:group-selected:group-hover:bg-highlight-subtle group-enabled:group-selected:group-hover:outline-highlight group-enabled:group-selected:group-hover:before:bg-highlight","group-disabled:bg-interactive-disabled group-disabled:outline-interactive-disabled group-disabled:before:bg-disabled"],label:["text-body-s text-interactive-default","group-disabled:text-interactive-disabled"]}});export{o as SwitchStyles};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';var i=tv({slots:{switch:"group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed",control:["flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark","group-enabled/switch:group-focus/switch:bg-interactive-hover-dark group-enabled/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-focus/switch:before:bg-interactive-hover","group-enabled/switch:group-hover/switch:bg-interactive-hover-dark group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-hover","group-enabled/switch:group-selected/switch:outline-highlight group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-highlight","group-enabled/switch:group-selected/switch:group-focus/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus/switch:before:bg-highlight","group-enabled/switch:group-selected/switch:group-hover/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-hover/switch:outline-highlight group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-highlight","group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-disabled"],label:["text-body-s text-interactive-default","group-disabled/switch:text-interactive-disabled"]}});export{i as SwitchStyles};//# sourceMappingURL=styles.js.map
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/switch/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAA,CACE,MAAA,CAAA,0EACF,CAAA,OACE,CAAA,CAAA,uJACA,CAAA,+JACA,CAAA,+JACA,CAAA,uJACA,CAAA,8LACA,CAAA,sLACA,CAAA,sHAEF,CAAO,CACL,KAAA,CAAA,CAAA,sCACA,CAAA,0CAGL,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 SwitchStyles = tv({\n slots: {\n switch:\n 'group flex cursor-pointer items-center gap-s disabled:cursor-not-allowed',\n control: [\n 'flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark',\n 'group-enabled:group-focus:bg-interactive-hover-dark group-enabled:group-focus:outline-interactive-hover group-enabled:group-focus:before:bg-interactive-hover',\n 'group-enabled:group-hover:bg-interactive-hover-dark group-enabled:group-hover:outline-interactive-hover group-enabled:group-hover:before:bg-interactive-hover',\n 'group-enabled:group-selected:outline-highlight group-selected:before:mr-0 group-selected:before:ml-l group-enabled:group-selected:before:bg-highlight',\n 'group-enabled:group-selected:group-focus:bg-highlight-subtle group-enabled:group-selected:group-focus:outline-interactive-hover group-enabled:group-selected:group-focus:before:bg-highlight',\n 'group-enabled:group-selected:group-hover:bg-highlight-subtle group-enabled:group-selected:group-hover:outline-highlight group-enabled:group-selected:group-hover:before:bg-highlight',\n 'group-disabled:bg-interactive-disabled group-disabled:outline-interactive-disabled group-disabled:before:bg-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled:text-interactive-disabled',\n ],\n },\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/switch/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAA,CACE,MAAA,CAAA,iFACF,CAAA,OACE,CAAA,CAAA,uJACA,CAAA,yMACA,CAAA,yMACA,CAAA,iMACA,CAAA,6PACA,CAAA,qPACA,CAAA,2IAEF,CAAO,CACL,KAAA,CAAA,CAAA,sCACA,CAAA,iDAGL,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 SwitchStyles = tv({\n slots: {\n switch:\n 'group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed',\n control: [\n 'flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-default-dark',\n 'group-enabled/switch:group-focus/switch:bg-interactive-hover-dark group-enabled/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-focus/switch:before:bg-interactive-hover',\n 'group-enabled/switch:group-hover/switch:bg-interactive-hover-dark group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-hover',\n 'group-enabled/switch:group-selected/switch:outline-highlight group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-highlight',\n 'group-enabled/switch:group-selected/switch:group-focus/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-focus/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus/switch:before:bg-highlight',\n 'group-enabled/switch:group-selected/switch:group-hover/switch:bg-highlight-subtle group-enabled/switch:group-selected/switch:group-hover/switch:outline-highlight group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-highlight',\n 'group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled/switch:text-interactive-disabled',\n ],\n },\n});\n"]}
@@ -2,8 +2,6 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as react from 'react';
3
3
  import { ContextValue } from 'react-aria-components';
4
4
  import { TextAreaFieldProps, TextAreaFieldProviderProps } from './types.js';
5
- import 'tailwind-variants';
6
- import './styles.js';
7
5
 
8
6
  declare const TextAreaFieldContext: react.Context<ContextValue<TextAreaFieldProviderProps, HTMLDivElement>>;
9
7
  declare function TextAreaFieldProvider({ children, ...props }: TextAreaFieldProviderProps): react_jsx_runtime.JSX.Element;