@accelint/design-toolkit 1.0.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/components/accordion/index.d.ts +2 -2
  2. package/dist/components/avatar/index.d.ts +4 -4
  3. package/dist/components/badge/index.d.ts +2 -2
  4. package/dist/components/box/index.d.ts +3 -3
  5. package/dist/components/checkbox/index.d.ts +2 -2
  6. package/dist/components/chip/index.d.ts +2 -2
  7. package/dist/components/color-picker/index.d.ts +21 -0
  8. package/dist/components/color-picker/index.js +2 -0
  9. package/dist/components/color-picker/index.js.map +1 -0
  10. package/dist/components/combobox/index.js +1 -1
  11. package/dist/components/combobox/index.js.map +1 -1
  12. package/dist/components/date-field/index.d.ts +28 -0
  13. package/dist/components/date-field/index.js +2 -0
  14. package/dist/components/date-field/index.js.map +1 -0
  15. package/dist/components/dialog/index.d.ts +40 -0
  16. package/dist/components/dialog/index.js +2 -0
  17. package/dist/components/dialog/index.js.map +1 -0
  18. package/dist/components/icon/index.js +1 -1
  19. package/dist/components/icon/index.js.map +1 -1
  20. package/dist/components/query-builder/action-element.d.ts +6 -0
  21. package/dist/components/query-builder/action-element.js +2 -0
  22. package/dist/components/query-builder/action-element.js.map +1 -0
  23. package/dist/components/query-builder/constants.d.ts +3 -0
  24. package/dist/components/query-builder/constants.js +2 -0
  25. package/dist/components/query-builder/constants.js.map +1 -0
  26. package/dist/components/query-builder/example-configuration.d.ts +30 -0
  27. package/dist/components/query-builder/example-configuration.js +2 -0
  28. package/dist/components/query-builder/example-configuration.js.map +1 -0
  29. package/dist/components/query-builder/group.d.ts +8 -0
  30. package/dist/components/query-builder/group.js +2 -0
  31. package/dist/components/query-builder/group.js.map +1 -0
  32. package/dist/components/query-builder/index.d.ts +44 -0
  33. package/dist/components/query-builder/index.js +2 -0
  34. package/dist/components/query-builder/index.js.map +1 -0
  35. package/dist/components/query-builder/rule.d.ts +6 -0
  36. package/dist/components/query-builder/rule.js +2 -0
  37. package/dist/components/query-builder/rule.js.map +1 -0
  38. package/dist/components/query-builder/utils.d.ts +14 -0
  39. package/dist/components/query-builder/utils.js +2 -0
  40. package/dist/components/query-builder/utils.js.map +1 -0
  41. package/dist/components/query-builder/value-editor.d.ts +6 -0
  42. package/dist/components/query-builder/value-editor.js +2 -0
  43. package/dist/components/query-builder/value-editor.js.map +1 -0
  44. package/dist/components/query-builder/value-selector.d.ts +6 -0
  45. package/dist/components/query-builder/value-selector.js +2 -0
  46. package/dist/components/query-builder/value-selector.js.map +1 -0
  47. package/dist/components/radio/index.d.ts +2 -2
  48. package/dist/components/radio/index.js +1 -1
  49. package/dist/components/radio/index.js.map +1 -1
  50. package/dist/components/search-field/index.d.ts +19 -0
  51. package/dist/components/search-field/index.js +2 -0
  52. package/dist/components/search-field/index.js.map +1 -0
  53. package/dist/components/switch/index.d.ts +1 -1
  54. package/dist/components/switch/index.js +1 -1
  55. package/dist/components/switch/index.js.map +1 -1
  56. package/dist/components/tabs/index.d.ts +33 -0
  57. package/dist/components/tabs/index.js +2 -0
  58. package/dist/components/tabs/index.js.map +1 -0
  59. package/dist/components/text-area/index.js +1 -1
  60. package/dist/components/text-area/index.js.map +1 -1
  61. package/dist/components/text-field/index.js +1 -1
  62. package/dist/components/text-field/index.js.map +1 -1
  63. package/dist/components/tooltip/index.d.ts +2 -2
  64. package/dist/components/tooltip/index.js +1 -1
  65. package/dist/components/tooltip/index.js.map +1 -1
  66. package/dist/index.css +54 -0
  67. package/dist/index.d.ts +14 -0
  68. package/dist/index.js +1 -1
  69. package/dist/lib/react.d.ts +15 -3
  70. package/dist/lib/react.js +4 -1
  71. package/dist/lib/react.js.map +1 -1
  72. package/dist/metafile-esm.json +1 -1
  73. package/dist/styles.css +439 -6
  74. package/package.json +21 -5
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as cva_types from 'cva/types';
3
- import React from 'react';
3
+ import React__default from 'react';
4
4
  import { DisclosureProps, ButtonProps, DisclosurePanelProps, DisclosureGroupProps } from 'react-aria-components';
5
5
  import { VariantProps } from 'cva';
6
6
 
@@ -18,7 +18,7 @@ declare namespace Accordion {
18
18
  var Group: typeof AccordionGroup;
19
19
  }
20
20
  interface AccordionHeaderProps extends Pick<AccordionProps, 'options' | 'variant'> {
21
- children: React.ReactNode;
21
+ children: React__default.ReactNode;
22
22
  className?: ButtonProps['className'];
23
23
  isDisabled?: boolean;
24
24
  }
@@ -2,22 +2,22 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as cva_types from 'cva/types';
3
3
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
4
4
  import { VariantProps } from 'cva';
5
- import React from 'react';
5
+ import React__default from 'react';
6
6
 
7
7
  declare const avatarStyles: (props?: ({
8
8
  size?: "small" | "medium" | null | undefined;
9
9
  } & cva_types.ClassProp) | undefined) => string;
10
- interface AvatarProps extends React.ComponentProps<typeof AvatarPrimitive.Image>, VariantProps<typeof avatarStyles> {
10
+ interface AvatarProps extends React__default.ComponentProps<typeof AvatarPrimitive.Image>, VariantProps<typeof avatarStyles> {
11
11
  /**
12
12
  * The fallback that the avatar will render if it cannot load the provided source.
13
13
  *
14
14
  * Accepts any React component.
15
15
  */
16
- fallback?: React.ReactNode;
16
+ fallback?: React__default.ReactNode;
17
17
  /** How long the system should wait before it shows the fallback component. By default there is no delay. */
18
18
  fallbackDelay?: number;
19
19
  /** The source of an avatar can either be a URL representing an image or a React component (such as an SVG or an icon from a library). */
20
- source?: string | React.ReactNode;
20
+ source?: string | React__default.ReactNode;
21
21
  }
22
22
  declare const Avatar: {
23
23
  ({ className, children, fallback, fallbackDelay, source, size, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as cva_types from 'cva/types';
3
3
  import { VariantProps } from 'cva';
4
- import React from 'react';
4
+ import React__default from 'react';
5
5
 
6
6
  declare const badgeStyles: (props?: ({
7
7
  variant?: "info" | "advisory" | "normal" | "serious" | "critical" | null | undefined;
8
8
  } & cva_types.ClassProp) | undefined) => string;
9
- interface BadgeProps extends VariantProps<typeof badgeStyles>, Omit<React.HTMLProps<HTMLSpanElement>, 'children'> {
9
+ interface BadgeProps extends VariantProps<typeof badgeStyles>, Omit<React__default.HTMLProps<HTMLSpanElement>, 'children'> {
10
10
  className?: string;
11
11
  /** Used to add text to the badge, such as the number of unread notifications. */
12
12
  children?: string;
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
2
+ import React__default from 'react';
3
3
 
4
- interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
5
- as?: React.ElementType;
4
+ interface BoxProps extends React__default.HTMLAttributes<HTMLDivElement> {
5
+ as?: React__default.ElementType;
6
6
  /** When true, apply flex display */
7
7
  flex?: boolean;
8
8
  /** Flex direction: 'row' or 'col' */
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
2
+ import React__default from 'react';
3
3
  import { CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1 } from 'react-aria-components';
4
4
 
5
5
  /**
@@ -12,7 +12,7 @@ declare namespace Checkbox {
12
12
  var Group: typeof CheckboxGroup;
13
13
  }
14
14
  interface CheckboxGroupProps extends CheckboxGroupProps$1 {
15
- label?: string | React.JSX.Element;
15
+ label?: string | React__default.JSX.Element;
16
16
  }
17
17
  declare function CheckboxGroup({ children, className, label, ...props }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
18
18
 
@@ -1,14 +1,14 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as cva_types from 'cva/types';
3
3
  import { VariantProps } from 'cva';
4
- import React, { ReactNode } from 'react';
4
+ import React__default, { ReactNode } from 'react';
5
5
  import { TagGroupProps, TagListProps, TagProps } from 'react-aria-components';
6
6
 
7
7
  declare const chipStyles: (props?: ({
8
8
  variant?: "info" | "advisory" | "normal" | "serious" | "critical" | null | undefined;
9
9
  size?: "small" | "medium" | null | undefined;
10
10
  } & cva_types.ClassProp) | undefined) => string;
11
- interface ChipProps extends VariantProps<typeof chipStyles>, Omit<React.HTMLProps<HTMLSpanElement>, 'children' | 'size'> {
11
+ interface ChipProps extends VariantProps<typeof chipStyles>, Omit<React__default.HTMLProps<HTMLSpanElement>, 'children' | 'size'> {
12
12
  className?: string;
13
13
  /** Used to add text to the badge, such as the number of unread notifications. */
14
14
  children?: ReactNode;
@@ -0,0 +1,21 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ForwardedRef } from 'react';
3
+ import { ColorSwatchPickerProps, ColorSwatchPickerItemProps, Color } from 'react-aria-components';
4
+
5
+ interface ColorPickerState {
6
+ /** The current color value of the color picker. */
7
+ color: Color | null;
8
+ /** Sets the current color value of the color picker. */
9
+ setColor(color: Color | null): void;
10
+ }
11
+ declare function useColorPickerState(props: ColorSwatchPickerProps): ColorPickerState;
12
+ interface ColorPickerProps extends ColorSwatchPickerProps {
13
+ options: ColorSwatchPickerItemProps['color'][];
14
+ ref?: ForwardedRef<HTMLDivElement>;
15
+ }
16
+ declare function ColorPicker({ options, className, ...props }: ColorPickerProps): react_jsx_runtime.JSX.Element;
17
+ declare namespace ColorPicker {
18
+ var displayName: string;
19
+ }
20
+
21
+ export { ColorPicker, type ColorPickerProps, useColorPickerState };
@@ -0,0 +1,2 @@
1
+ import {cn}from'./../../lib/utils.js';import {useControlledState}from'@react-stately/utils';import {createContext,useMemo,useContext,useEffect}from'react';import {ColorSwatch,parseColor,useContextProps,ColorSwatchPickerContext,ListBox,useLocale,ListBoxItem,ColorSwatchContext}from'react-aria-components';import {jsx}from'react/jsx-runtime';var C=o=>{if(typeof o=="string")try{return parseColor(o)}catch{return}return o};function A(o){let l=useMemo(()=>C(o.value),[o.value]),r=useMemo(()=>C(o.defaultValue||"#000000"),[o.defaultValue]),[e,t]=useControlledState(l||null,r,o.onChange);return {color:e,setColor(c){t(c);}}}function I({ref:o=null,color:l,...r}){let e=l||"#0000",t=useMemo(()=>typeof e=="string"?parseColor(e):e,[e]),{locale:c}=useLocale(),a=useContext(d);return useEffect(()=>{let s=t.toString("hexa");return a?.set(s,t),()=>{a?.delete(s);}},[t,a]),jsx(ListBoxItem,{...r,ref:o,id:t.toString("hexa"),textValue:t.getColorName(c),className:"w-fit outline-none outline outline-offset-1 hover:outline-interactive-hover hover:outline-solid focus:outline-interactive-hover focus:outline-solid data-selected:outline-highlight data-selected:outline-solid",children:jsx(ColorSwatchContext.Provider,{value:{color:t},children:r.children})})}var d=createContext(null);function L({ref:o=null,className:l,children:r,...e}){[e,o]=useContextProps(e,o,ColorSwatchPickerContext);let t=A(e),c=useMemo(()=>new Map,[]);return jsx(ListBox,{className:cn("flex flex-wrap gap-s",l),style:e.style,layout:e.layout||"grid",selectionMode:"single",selectedKeys:t.color?[t.color.toString("hexa")]:void 0,onSelectionChange:a=>{a!=="all"&&(a.size>0?t.setColor(c.get([...a][0])):t.setColor(null));},...e,children:jsx(d.Provider,{value:c,children:r})})}function M({options:o,className:l,...r}){return jsx(L,{className:cn("flex flex-wrap gap-s",l),...r,children:o.map(e=>jsx(I,{color:e,children:jsx(ColorSwatch,{className:"h-[16px] w-[16px]"})},e.toString()))})}M.displayName="ColorPicker";export{M as ColorPicker,A as useColorPickerState};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/color-picker/index.tsx"],"names":["value","parseColor","P","useMemo","parseColorFromProp","props","defaultValue","useControlledState","color","ColorSwatchPickerItem","ref","colorFromProps","propColor","n","locale","map","useContext","ColorMapContext","useEffect","p","key","jsx","AriaListBoxItem","i","k","S","createContext","ColorSwatchPicker","className","useContextProps","ColorSwatchPickerContext","v","state","useColorPickerState","colorMap","u","keys","options","x","ColorPicker"],"mappings":"oVA2CuD,MACjD,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CACnB,GAAA,CAAA,CAAA,CAAA,CACEb,uBACgB,CAAAc,EAAA,CAAA,sBACV9B,EAEH,CAAAgC,CAAAA,GAAAA,CAAAA,CAAAA,QAAa7B,CACZa,CAAAA,CAAAA,IAAC,CAA6C,EAAAE,GAAA,CAAA,CAAA,CAAOf,MACnDa,CAAAA,CAAAA,CAAAA,QAAiB,CAAAE,GAAA,CAAAe,WAAA,CAAA,CAAA,2CAM3BC,EAAY,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,aAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { cn } from '@/lib/utils';\nimport { useControlledState } from '@react-stately/utils';\nimport {\n type ForwardedRef,\n type ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n ColorSwatch as AriaColorSwatch,\n ColorSwatchContext as AriaColorSwatchContext,\n type ColorSwatchPickerItemProps as AriaColorSwatchPickerItemProps,\n type ColorSwatchPickerProps as AriaColorSwatchPickerProps,\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n type Color,\n ColorSwatchPickerContext,\n parseColor,\n useContextProps,\n useLocale,\n} from 'react-aria-components';\n\ninterface ColorPickerState {\n /** The current color value of the color picker. */\n color: Color | null;\n /** Sets the current color value of the color picker. */\n setColor(color: Color | null): void;\n}\n\nconst parseColorFromProp = (value?: Color | string) => {\n if (typeof value === 'string') {\n try {\n return parseColor(value);\n } catch {\n return undefined;\n }\n }\n return value;\n};\n\nexport function useColorPickerState(\n props: AriaColorSwatchPickerProps,\n): ColorPickerState {\n const value = useMemo(() => parseColorFromProp(props.value), [props.value]);\n\n const defaultValue = useMemo(\n () => parseColorFromProp(props.defaultValue || '#000000'),\n [props.defaultValue],\n );\n const [color, setColor] = useControlledState(\n value || null,\n defaultValue as Color,\n props.onChange,\n );\n\n return {\n color,\n setColor(color) {\n setColor(color);\n },\n };\n}\n\n/**\n * Renders a single color swatch item for use within a color picker list.\n *\n * This component manages the registration of its color value in a shared color map context,\n * and provides the color value to its children via context. It also handles accessibility\n * and styling for selection and focus states.\n\n *\n * @remarks\n * - The component registers its color in a shared `ColorMapContext` on mount and removes it on unmount.\n * - The color is parsed and memoized for performance.\n * - The swatch item is rendered as an accessible list box item.\n */\nfunction ColorSwatchPickerItem({\n ref = null,\n color: colorFromProps,\n ...props\n}: Omit<AriaColorSwatchPickerItemProps, 'style'> & {\n children: ReactNode;\n ref?: ForwardedRef<HTMLDivElement>;\n}) {\n const propColor = colorFromProps || '#0000';\n const color = useMemo(\n () => (typeof propColor === 'string' ? parseColor(propColor) : propColor),\n [propColor],\n );\n const { locale } = useLocale();\n const map = useContext(ColorMapContext);\n\n // Register the color in the map context on mount and remove it on unmount.\n // This allows the color picker to manage its own state and selection.\n // The key is the color's hex representation, ensuring uniqueness.\n // The color is also provided to the context for use by children components.\n // This is useful for rendering the swatch or any related UI elements.\n useEffect(() => {\n const key = color.toString('hexa');\n map?.set(key, color);\n return () => {\n map?.delete(key);\n };\n }, [color, map]);\n\n return (\n <AriaListBoxItem\n {...props}\n ref={ref}\n id={color.toString('hexa')}\n textValue={color.getColorName(locale)}\n className='w-fit outline-none outline outline-offset-1 hover:outline-interactive-hover hover:outline-solid focus:outline-interactive-hover focus:outline-solid data-selected:outline-highlight data-selected:outline-solid'\n >\n <AriaColorSwatchContext.Provider value={{ color }}>\n {/* @ts-expect-error package version mismatch TODO*/}\n {props.children}\n </AriaColorSwatchContext.Provider>\n </AriaListBoxItem>\n );\n}\n\nconst ColorMapContext = createContext<Map<string, Color> | null>(null);\n\nexport interface ColorPickerProps extends AriaColorSwatchPickerProps {\n options: AriaColorSwatchPickerItemProps['color'][];\n ref?: ForwardedRef<HTMLDivElement>;\n}\n\n// @ts-expect-error package version mismatch TODO\ninterface ColorSwatchPickerProps extends Omit<ColorPickerProps, 'options'> {\n children?: ReactNode;\n}\n\nfunction ColorSwatchPicker({\n ref = null,\n className,\n children,\n ...props\n}: ColorSwatchPickerProps) {\n [props, ref] = useContextProps(props, ref, ColorSwatchPickerContext);\n const state = useColorPickerState(props);\n const colorMap = useMemo(() => new Map(), []);\n return (\n <AriaListBox\n className={cn('flex flex-wrap gap-s', className)}\n style={props.style}\n layout={props.layout || 'grid'}\n selectionMode='single'\n selectedKeys={state.color ? [state.color.toString('hexa')] : undefined}\n onSelectionChange={(keys) => {\n // single select, 'all' cannot occur.\n if (keys !== 'all') {\n if (keys.size > 0) {\n state.setColor(colorMap.get([...keys][0]));\n } else {\n // If no keys are selected, we can set the color to null or a default value\n state.setColor(null);\n }\n }\n }}\n {...props}\n >\n <ColorMapContext.Provider value={colorMap}>\n {children}\n </ColorMapContext.Provider>\n </AriaListBox>\n );\n}\n\nexport function ColorPicker({\n options,\n className,\n ...props\n}: ColorPickerProps) {\n return (\n <ColorSwatchPicker\n className={cn('flex flex-wrap gap-s', className)}\n {...props}\n >\n {options.map((color) => (\n <ColorSwatchPickerItem key={color.toString()} color={color}>\n <AriaColorSwatch className='h-[16px] w-[16px]' />\n </ColorSwatchPickerItem>\n ))}\n </ColorSwatchPicker>\n );\n}\nColorPicker.displayName = 'ColorPicker';\n"]}
@@ -1,2 +1,2 @@
1
- import'client-only';import {ComboBox,Button,Text,Popover,Virtualizer,ListLayout,ListBox,ListBoxSection,Header,Collection,Input,ListBoxItem}from'react-aria-components';import {cn}from'./../../lib/utils.js';import F from'@accelint/icons/chevron-down';import {cva}from'cva';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var _=cva(["block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive","not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight"},isInvalid:{true:"outline-serious"},size:{medium:"text-body-s",small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"}],defaultVariants:{size:"medium"}}),y=({className:t,isReadOnly:s=false,size:o="medium",...r})=>jsx(Input,{...r,className:({isDisabled:i,isInvalid:a})=>cn(_({isDisabled:i,isInvalid:a,size:o,className:t}))});y.displayName="ComboBox.Input";function p({children:t,className:s,description:o,errorMessage:r,isDisabled:i,isInvalid:a,isReadOnly:l,label:A,placeholder:I,layoutOptions:v,size:u="medium",...x}){let f=u==="small",P=!(f||a)||i,L=a&&!i&&!l;return jsx(ComboBox,{...x,isDisabled:i,isInvalid:a,isReadOnly:l,className:"flex flex-col gap-xs",children:({isDisabled:m,isOpen:N})=>jsxs(Fragment,{children:[!f&&jsx(Label,{className:"empty:hidden",isDisabled:m,isOptional:!x.isRequired,children:A}),jsxs("div",{className:"relative flex items-center",children:[jsx(y,{className:s,isReadOnly:l,placeholder:I,size:u}),jsx(Button,{className:cn(["fg-default-light icon-size-xl absolute right-xs transform",m&&"fg-disabled",N&&"rotate-180",l&&"hidden"]),children:jsx(Icon,{className:"block",children:jsx(F,{})})})]}),P&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",m&&"fg-disabled"]),slot:"description",children:o}),L&&jsx(Text,{className:"fg-serious text-body-xs empty:hidden",slot:"errorMessage",children:r}),jsx(Popover,{className:"w-(--trigger-width)",children:jsx(Virtualizer,{layout:ListLayout,layoutOptions:v,children:jsx(ListBox,{className:"grid max-h-[200px] grid-cols-[auto_1fr] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light",children:t})})})]})})}p.displayName="ComboBox";var q=cva(["fg-default-light icon-size-l col-span-2 grid grid-cols-subgrid items-center p-s pl-xs text-body-s","**:data-[slot=description]:fg-default-dark **:data-[slot=description]:text-body-xs","hover:fg-inverse-light hover:**:data-[slot=description]:fg-inverse-light hover:bg-highlight-bold","ai-focus:fg-inverse-light ai-focus:**:data-[slot=description]:fg-inverse-light ai-focus:bg-highlight-bold","ai-disabled:fg-disabled ai-disabled:**:data-[slot=description]:fg-disabled ai-disabled:bg-transparent"]);function h({children:t,className:s,description:o,icon:r,name:i,...a}){return jsx(ListBoxItem,{textValue:i,...a,className:q({className:s}),children:l=>typeof t=="function"?t(l):jsxs(Fragment,{children:[r&&jsx("span",{className:"mr-xs",children:jsx(Icon,{children:r})}),jsxs("div",{className:"col-start-2 flex flex-col gap-xxs",children:[jsx(Text,{slot:"label",children:i}),o&&jsx(Text,{"data-slot":"description",slot:"description",children:o})]})]})})}h.displayName="ComboBox.Item";p.Item=h;function E({children:t,header:s,items:o}){return jsxs(ListBoxSection,{id:s,className:"col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none",children:[jsx(Header,{className:"col-span-2 m-xs my-s text-default-dark text-header-xs",children:s}),jsx(Collection,{items:o,children:t})]})}p.displayName="ComboBox.Section";p.Section=E;export{p as ComboBox,E as ComboBoxSection};//# sourceMappingURL=index.js.map
1
+ import'client-only';import {ComboBox,Button,Text,Popover,Virtualizer,ListLayout,ListBox,ListBoxSection,Header,Collection,Input,ListBoxItem}from'react-aria-components';import {cn}from'./../../lib/utils.js';import H from'@accelint/icons/chevron-down';import {cva}from'cva';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var q=cva(["block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive","not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight"},isInvalid:{true:"outline-serious"},size:{medium:"text-body-s",small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"}],defaultVariants:{size:"medium"}}),h=({className:t,isReadOnly:s=false,size:o="medium",...r})=>jsx(Input,{...r,className:({isDisabled:i,isInvalid:a})=>cn(q({isDisabled:i,isInvalid:a,size:o,className:t}))});h.displayName="ComboBox.Input";function m({children:t,className:s,description:o,errorMessage:r,isDisabled:i,isInvalid:a,isReadOnly:l,label:u,placeholder:I,layoutOptions:v,size:x="medium",...f}){let b=x==="small",L=!(b||a)||i,P=a&&!i&&!l,N=!b&&u;return jsx(ComboBox,{...f,isDisabled:i,isInvalid:a,isReadOnly:l,className:"flex flex-col gap-xs",children:({isDisabled:p,isOpen:C})=>jsxs(Fragment,{children:[N&&jsx(Label,{className:"empty:hidden",isDisabled:p,isOptional:!f.isRequired,children:u}),jsxs("div",{className:"relative flex items-center",children:[jsx(h,{className:s,isReadOnly:l,placeholder:I,size:x}),jsx(Button,{className:cn(["fg-default-light icon-size-xl absolute right-xs transform",p&&"fg-disabled",C&&"rotate-180",l&&"hidden"]),children:jsx(Icon,{className:"block",children:jsx(H,{})})})]}),L&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",p&&"fg-disabled"]),slot:"description",children:o}),P&&jsx(Text,{className:"fg-serious text-body-xs empty:hidden",slot:"errorMessage",children:r}),jsx(Popover,{className:"w-(--trigger-width)",children:jsx(Virtualizer,{layout:ListLayout,layoutOptions:v,children:jsx(ListBox,{className:"grid max-h-[200px] grid-cols-[auto_1fr] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light",children:t})})})]})})}m.displayName="ComboBox";var E=cva(["fg-default-light icon-size-l flex items-center p-s pl-xs text-body-s","**:data-[slot=description]:fg-default-dark **:data-[slot=description]:text-body-xs","hover:fg-inverse-light hover:**:data-[slot=description]:fg-inverse-light hover:bg-highlight-bold","ai-focus:fg-inverse-light ai-focus:**:data-[slot=description]:fg-inverse-light ai-focus:bg-highlight-bold","ai-disabled:fg-disabled ai-disabled:**:data-[slot=description]:fg-disabled ai-disabled:bg-transparent"]);function B({children:t,className:s,description:o,icon:r,name:i,...a}){return jsx(ListBoxItem,{textValue:i,...a,className:E({className:s}),children:l=>typeof t=="function"?t(l):jsxs(Fragment,{children:[jsx("span",{className:"mr-s flex w-[16px] items-center",children:r&&jsx(Icon,{children:r})}),jsxs("div",{className:"flex min-w-0 flex-col gap-xxs",children:[jsx(Text,{className:"truncate",slot:"label",children:i}),o&&jsx(Text,{className:"truncate","data-slot":"description",slot:"description",children:o})]})]})})}B.displayName="ComboBox.Item";m.Item=B;function G({children:t,header:s,items:o}){return jsxs(ListBoxSection,{id:s,className:"col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none",children:[jsx(Header,{className:"col-span-2 m-xs my-s text-default-dark text-header-xs",children:s}),jsx(Collection,{items:o,children:t})]})}m.displayName="ComboBox.Section";m.Section=G;export{m as ComboBox,G as ComboBoxSection};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/combobox/index.tsx"],"names":["className","isReadOnly","size","jsx","e","V","isDisabled","isInvalid","Input","ComboBox","children","description","errorMessage","label","isSmall","shouldShowDescription","shouldShowError","AriaComboBox","T","isOpen","jsxs","Label","H","n","C","g","AriaText","d","R","AriaListLayout","k","z","b","ComboBoxItem","AriaListBoxItem","name","comboBoxItemStyles","renderProps","Fragment","B","icon","ComboBoxSection","header","items","AriaListBoxSection","M","S"],"mappings":"2YA4CI,sGAEF,CAAA,6MAEE,CAAA,CAAA,CAAU,QACR,CAAA,CAAA,UAEE,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,mCAAA,CAAA,QAAU,CAAA,CAAAnB,GAAK,CAASuB,IAAA,CAAA,CAAA,IAAA,CAAA,OAAA,CAAAQ,QAEtBhC,CAACuB,CAAA,CAAA,CAAS,yBAAwB,CAAA,aAC/B,CAAA,IAAA,CAAA,aAAA,CAAAf,QAIT,CAAA,CAGN,CAEJ,CACAsB,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAEbxB,CAAAA,eAOO,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAASgC,SACd/B,CAAAA,CAAAA,CAAAA,QACAgC,CAAAA,CAAAA,CACA,MAAAC,CACF,CAA4B,CAAA,KAExBvB,CAAAA,CAAAA,CAAAA,CAAAA,CAACwB,OAECrB,IAAA,CAAAsB,cAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,SAEA,CAAA,0FAAA,CAAA,QAAY,CAAA,CAAAzC,GAAA,CAAA0C,MAAA,CAAA,CAAA,SACT,CAAA,uDAAA,CAAAJ,QAEF,CAAsB,CAAA,CAAA,CAAA,CAAAtC,GAAA,CAAOuC,UAAQ,CAAA,CAAA,KAAA,CAAA,CAAA,CAAAjC,QAInC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WACTD,CAAAA,kBAAmBgC,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport 'client-only';\nimport {\n Button as AriaButton,\n ComboBox as AriaComboBox,\n type ComboBoxProps as AriaComboBoxProps,\n Header as AriaHeader,\n Input as AriaInput,\n type InputProps as AriaInputProps,\n ListBox as AriaListBox,\n Collection as AriaListBoxCollection,\n ListBoxItem as AriaListBoxItem,\n type ListBoxItemProps as AriaListBoxItemProps,\n ListBoxSection as AriaListBoxSection,\n type ListBoxSectionProps as AriaListBoxSectionProps,\n ListLayout as AriaListLayout,\n type ListLayoutOptions as AriaListLayoutOptions,\n Popover as AriaPopover,\n Text as AriaText,\n Virtualizer as AriaVirtualizer,\n type VirtualizerProps as AriaVirtualizerProps,\n} from 'react-aria-components';\n\nimport { cn } from '@/lib/utils';\nimport type { MenuItem } from '@/types/types';\nimport ChevronDown from '@accelint/icons/chevron-down';\nimport { type VariantProps, cva } from 'cva';\nimport type { ReactNode } from 'react';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\n\nconst textFieldStyles = cva(\n [\n 'block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive',\n 'not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n size: {\n medium: 'text-body-s',\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface InputProps\n extends VariantProps<typeof textFieldStyles>,\n Omit<AriaInputProps, 'size'> {\n isReadOnly?: boolean;\n}\n\nconst Input = ({\n className,\n isReadOnly = false,\n size = 'medium',\n ...props\n}: InputProps) => {\n return (\n <AriaInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n textFieldStyles({\n isDisabled,\n isInvalid,\n size,\n className,\n }),\n )\n }\n />\n );\n};\nInput.displayName = 'ComboBox.Input';\n\nexport interface ComboBoxProps<T extends MenuItem>\n extends Omit<\n VariantProps<typeof textFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaComboBoxProps<T>, 'children'>,\n Pick<AriaVirtualizerProps<AriaListLayoutOptions>, 'layoutOptions'> {\n className?: string;\n children: ReactNode | ((item: T) => ReactNode);\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n}\n\nexport function ComboBox<T extends MenuItem>({\n children,\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n layoutOptions,\n size = 'medium',\n ...props\n}: ComboBoxProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription = !(isSmall || isInvalid) || isDisabled;\n const shouldShowError = isInvalid && !isDisabled && !isReadOnly;\n\n return (\n <AriaComboBox<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n className='flex flex-col gap-xs'\n >\n {({ isDisabled, isOpen }) => (\n <>\n {!isSmall && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isOptional={!props.isRequired}\n >\n {label}\n </Label>\n )}\n <div className='relative flex items-center'>\n <Input\n className={className}\n isReadOnly={isReadOnly}\n placeholder={placeholder}\n size={size}\n />\n <AriaButton\n className={cn([\n 'fg-default-light icon-size-xl absolute right-xs transform',\n isDisabled && 'fg-disabled',\n isOpen && 'rotate-180',\n isReadOnly && 'hidden',\n ])}\n >\n <Icon className='block'>\n <ChevronDown />\n </Icon>\n </AriaButton>\n </div>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <AriaText\n className='fg-serious text-body-xs empty:hidden'\n slot='errorMessage'\n >\n {errorMessage}\n </AriaText>\n )}\n <AriaPopover className='w-(--trigger-width)'>\n <AriaVirtualizer\n layout={AriaListLayout}\n layoutOptions={layoutOptions}\n >\n <AriaListBox className='grid max-h-[200px] grid-cols-[auto_1fr] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light'>\n {/* @ts-expect-error package version mismatch TODO */}\n {children}\n </AriaListBox>\n </AriaVirtualizer>\n </AriaPopover>\n </>\n )}\n </AriaComboBox>\n );\n}\nComboBox.displayName = 'ComboBox';\n\nconst comboBoxItemStyles = cva([\n 'fg-default-light icon-size-l col-span-2 grid grid-cols-subgrid items-center p-s pl-xs text-body-s',\n '**:data-[slot=description]:fg-default-dark **:data-[slot=description]:text-body-xs',\n 'hover:fg-inverse-light hover:**:data-[slot=description]:fg-inverse-light hover:bg-highlight-bold',\n 'ai-focus:fg-inverse-light ai-focus:**:data-[slot=description]:fg-inverse-light ai-focus:bg-highlight-bold',\n 'ai-disabled:fg-disabled ai-disabled:**:data-[slot=description]:fg-disabled ai-disabled:bg-transparent',\n]);\n\ninterface ComboBoxItemProps<T extends MenuItem>\n extends AriaListBoxItemProps<T> {\n description?: string;\n icon?: ReactNode;\n name: string;\n}\n\nfunction ComboBoxItem<T extends MenuItem>({\n children,\n className,\n description,\n icon,\n name,\n ...props\n}: ComboBoxItemProps<T>) {\n return (\n <AriaListBoxItem<T>\n textValue={name}\n {...props}\n className={comboBoxItemStyles({ className })}\n >\n {(renderProps) => {\n if (typeof children === 'function') {\n return children(renderProps);\n }\n\n return (\n <>\n {icon && (\n <span className='mr-xs'>\n <Icon>{icon}</Icon>\n </span>\n )}\n <div className='col-start-2 flex flex-col gap-xxs'>\n <AriaText slot='label'>{name}</AriaText>\n {description && (\n <AriaText data-slot='description' slot='description'>\n {description}\n </AriaText>\n )}\n </div>\n </>\n );\n }}\n </AriaListBoxItem>\n );\n}\nComboBoxItem.displayName = 'ComboBox.Item';\n\nComboBox.Item = ComboBoxItem;\n\ninterface ComboBoxSectionProps<T extends MenuItem>\n extends AriaListBoxSectionProps<T> {\n header?: string;\n}\n\nexport function ComboBoxSection<T extends MenuItem>({\n children,\n header,\n items,\n}: ComboBoxSectionProps<T>) {\n return (\n <AriaListBoxSection\n id={header}\n className='col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none'\n >\n <AriaHeader className='col-span-2 m-xs my-s text-default-dark text-header-xs'>\n {header}\n </AriaHeader>\n <AriaListBoxCollection items={items}>{children}</AriaListBoxCollection>\n </AriaListBoxSection>\n );\n}\nComboBox.displayName = 'ComboBox.Section';\nComboBox.Section = ComboBoxSection;\n"]}
1
+ {"version":3,"sources":["../../../src/components/combobox/index.tsx"],"names":["y","className","isReadOnly","size","jsx","props","isDisabled","isInvalid","Input","ComboBox","children","description","errorMessage","label","placeholder","layoutOptions","shouldShowDescription","shouldShowError","shouldShowLabel","isSmall","AriaComboBox","e","S","isOpen","jsxs","_","n","T","g","AriaText","d","D","F","AriaListLayout","R","z","ComboBoxItem","AriaListBoxItem","name","comboBoxItemStyles","renderProps","Fragment","A","icon","ComboBoxSection","header","items","AriaListBoxSection","k","w"],"mappings":"2YA4CI,IAAA,CAAA,CAAAA,GAAA,CAAA,CAAA,ySAIU,CAAA,CAAA,CAAA,QACI,CAAA,CAAA,UACJ,CAAA,CAAA,IAAA,CAAA,sEAEJ,CAAA,KAAA,CAAA,0GAEJ,CAAA,CAAA,SAEA,CAAA,CAAA,IAAA,CAAA,iBAEU,CAAA,CAAA,IAAA,CAAA,CAAA,MAAA,CAAA,aACD,CAAA,KAAA,CAAA,cAGO,CAAA,CAAA,CAAA,gBAEd,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,SACW,CAAA,IAAA,CAAA,SAAA,CAAA,8BAGE,CAAA,CAAA,CAAA,eACT,CAAA,CAAA,IACR,CACF,QAUAC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,SACAC,CAAAA,CAAAA,CAAAA,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CAEJ,CACAyB,CAAAA,CAAa,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAA,CAAA,eASpB,CAAA,CAAA,CAAA,IAAA,CAAA,CAAA,CAASQ,SACdlC,CAAAA,CAAAA,CAAAA,QACAmC,CAAAA,CAAAA,CACA,MAAAC,CACF,CAA4B,CAAA,KAExBtB,CAAAA,CAAAA,CAAAA,CAAAA,CAACuB,OAECrB,IAAA,CAAAsB,cAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,SAEA,CAAA,0FAAA,CAAA,QAAY,CAAA,CAAA3B,GAAA,CAAA4B,MAAA,CAAA,CAAA,SACT,CAAA,uDAAA,CAAAJ,QAEF,CAAsB,CAAA,CAAA,CAAA,CAAAxB,GAAA,CAAOyB,UAAQ,CAAA,CAAA,KAAA,CAAA,CAAA,CAAApC,QAInC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WACTD,CAAAA,kBAAmBmC,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport 'client-only';\nimport {\n Button as AriaButton,\n ComboBox as AriaComboBox,\n type ComboBoxProps as AriaComboBoxProps,\n Header as AriaHeader,\n Input as AriaInput,\n type InputProps as AriaInputProps,\n ListBox as AriaListBox,\n Collection as AriaListBoxCollection,\n ListBoxItem as AriaListBoxItem,\n type ListBoxItemProps as AriaListBoxItemProps,\n ListBoxSection as AriaListBoxSection,\n type ListBoxSectionProps as AriaListBoxSectionProps,\n ListLayout as AriaListLayout,\n type ListLayoutOptions as AriaListLayoutOptions,\n Popover as AriaPopover,\n Text as AriaText,\n Virtualizer as AriaVirtualizer,\n type VirtualizerProps as AriaVirtualizerProps,\n} from 'react-aria-components';\n\nimport { cn } from '@/lib/utils';\nimport type { MenuItem } from '@/types/types';\nimport ChevronDown from '@accelint/icons/chevron-down';\nimport { type VariantProps, cva } from 'cva';\nimport type { ReactNode } from 'react';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\n\nconst textFieldStyles = cva(\n [\n 'block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive',\n 'not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n size: {\n medium: 'text-body-s',\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface InputProps\n extends VariantProps<typeof textFieldStyles>,\n Omit<AriaInputProps, 'size'> {\n isReadOnly?: boolean;\n}\n\nconst Input = ({\n className,\n isReadOnly = false,\n size = 'medium',\n ...props\n}: InputProps) => {\n return (\n <AriaInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n textFieldStyles({\n isDisabled,\n isInvalid,\n size,\n className,\n }),\n )\n }\n />\n );\n};\nInput.displayName = 'ComboBox.Input';\n\nexport interface ComboBoxProps<T extends MenuItem>\n extends Omit<\n VariantProps<typeof textFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaComboBoxProps<T>, 'children'>,\n Pick<AriaVirtualizerProps<AriaListLayoutOptions>, 'layoutOptions'> {\n className?: string;\n children: ReactNode | ((item: T) => ReactNode);\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n}\n\nexport function ComboBox<T extends MenuItem>({\n children,\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n layoutOptions,\n size = 'medium',\n ...props\n}: ComboBoxProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription = !(isSmall || isInvalid) || isDisabled;\n const shouldShowError = isInvalid && !isDisabled && !isReadOnly;\n const shouldShowLabel = !isSmall && label;\n\n return (\n <AriaComboBox<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n className='flex flex-col gap-xs'\n >\n {({ isDisabled, isOpen }) => (\n <>\n {shouldShowLabel && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isOptional={!props.isRequired}\n >\n {label}\n </Label>\n )}\n <div className='relative flex items-center'>\n <Input\n className={className}\n isReadOnly={isReadOnly}\n placeholder={placeholder}\n size={size}\n />\n <AriaButton\n className={cn([\n 'fg-default-light icon-size-xl absolute right-xs transform',\n isDisabled && 'fg-disabled',\n isOpen && 'rotate-180',\n isReadOnly && 'hidden',\n ])}\n >\n <Icon className='block'>\n <ChevronDown />\n </Icon>\n </AriaButton>\n </div>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <AriaText\n className='fg-serious text-body-xs empty:hidden'\n slot='errorMessage'\n >\n {errorMessage}\n </AriaText>\n )}\n <AriaPopover className='w-(--trigger-width)'>\n <AriaVirtualizer\n layout={AriaListLayout}\n layoutOptions={layoutOptions}\n >\n <AriaListBox className='grid max-h-[200px] grid-cols-[auto_1fr] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light'>\n {/* @ts-expect-error package version mismatch TODO */}\n {children}\n </AriaListBox>\n </AriaVirtualizer>\n </AriaPopover>\n </>\n )}\n </AriaComboBox>\n );\n}\nComboBox.displayName = 'ComboBox';\n\nconst comboBoxItemStyles = cva([\n 'fg-default-light icon-size-l flex items-center p-s pl-xs text-body-s',\n '**:data-[slot=description]:fg-default-dark **:data-[slot=description]:text-body-xs',\n 'hover:fg-inverse-light hover:**:data-[slot=description]:fg-inverse-light hover:bg-highlight-bold',\n 'ai-focus:fg-inverse-light ai-focus:**:data-[slot=description]:fg-inverse-light ai-focus:bg-highlight-bold',\n 'ai-disabled:fg-disabled ai-disabled:**:data-[slot=description]:fg-disabled ai-disabled:bg-transparent',\n]);\n\ninterface ComboBoxItemProps<T extends MenuItem>\n extends AriaListBoxItemProps<T> {\n description?: string;\n icon?: ReactNode;\n name: string;\n}\n\nfunction ComboBoxItem<T extends MenuItem>({\n children,\n className,\n description,\n icon,\n name,\n ...props\n}: ComboBoxItemProps<T>) {\n return (\n <AriaListBoxItem<T>\n textValue={name}\n {...props}\n className={comboBoxItemStyles({ className })}\n >\n {(renderProps) => {\n if (typeof children === 'function') {\n return children(renderProps);\n }\n\n return (\n <>\n <span className='mr-s flex w-[16px] items-center'>\n {icon && <Icon>{icon}</Icon>}\n </span>\n\n <div className='flex min-w-0 flex-col gap-xxs'>\n <AriaText className='truncate' slot='label'>\n {name}\n </AriaText>\n {description && (\n <AriaText\n className='truncate'\n data-slot='description'\n slot='description'\n >\n {description}\n </AriaText>\n )}\n </div>\n </>\n );\n }}\n </AriaListBoxItem>\n );\n}\nComboBoxItem.displayName = 'ComboBox.Item';\n\nComboBox.Item = ComboBoxItem;\n\ninterface ComboBoxSectionProps<T extends MenuItem>\n extends AriaListBoxSectionProps<T> {\n header?: string;\n}\n\nexport function ComboBoxSection<T extends MenuItem>({\n children,\n header,\n items,\n}: ComboBoxSectionProps<T>) {\n return (\n <AriaListBoxSection\n id={header}\n className='col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none'\n >\n <AriaHeader className='col-span-2 m-xs my-s text-default-dark text-header-xs'>\n {header}\n </AriaHeader>\n <AriaListBoxCollection items={items}>{children}</AriaListBoxCollection>\n </AriaListBoxSection>\n );\n}\nComboBox.displayName = 'ComboBox.Section';\nComboBox.Section = ComboBoxSection;\n"]}
@@ -0,0 +1,28 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import * as cva_types from 'cva/types';
3
+ import { DateValue } from '@internationalized/date';
4
+ import { VariantProps } from 'cva';
5
+ import { DateFieldProps as DateFieldProps$1, DateInputProps } from 'react-aria-components';
6
+
7
+ declare const dateFieldStyles: (props?: ({
8
+ isDisabled?: boolean | null | undefined;
9
+ isInvalid?: boolean | null | undefined;
10
+ isReadOnly?: boolean | null | undefined;
11
+ size?: "small" | "medium" | null | undefined;
12
+ } & cva_types.ClassProp) | undefined) => string;
13
+ interface DateFieldProps<T extends DateValue> extends Omit<VariantProps<typeof dateFieldStyles>, 'isDisabled' | 'isInvalid' | 'isReadOnly'>, Omit<DateFieldProps$1<T>, 'className' | 'style'>, // Exclude className to avoid conflict with cva
14
+ Omit<DateInputProps, 'className' | 'children' | 'style'> {
15
+ isDisabled?: boolean;
16
+ isInvalid?: boolean;
17
+ isReadOnly?: boolean;
18
+ size?: 'small' | 'medium';
19
+ className?: string;
20
+ description?: string;
21
+ errorMessage?: string;
22
+ label?: string;
23
+ placeholder?: string;
24
+ shortMonth?: boolean;
25
+ }
26
+ declare function DateField<T extends DateValue>({ className, description, errorMessage, isDisabled, isInvalid, isReadOnly, label, placeholder, slot, size, shortMonth, ...props }: DateFieldProps<T>): react_jsx_runtime.JSX.Element;
27
+
28
+ export { DateField, type DateFieldProps };
@@ -0,0 +1,2 @@
1
+ import'client-only';import {cn}from'./../../lib/utils.js';import y from'@accelint/icons/calendar';import {cva}from'cva';import {DateField,Text,FieldError,DateInput,DateSegment}from'react-aria-components';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var I=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],T=({value:e,isFocused:o,isPlaceholder:i,placeholder:t,isReadOnly:s,shortMonth:l})=>{if(i)return t;let r=`${e}`;return !s&&o?r=r.padStart(2,"0"):l&&(r=I[(e??0)-1]),r},R=({segment:e,shortMonth:o,...i})=>e.type==="literal"&&e.text!==":"?jsx(Fragment,{}):jsx(DateSegment,{segment:e,className:"focus:bg-highlight focus:text-inverse-light focus:outline-none",...i,children:e.type==="month"?t=>jsx(T,{...t,shortMonth:o}):e.text}),O=cva(["flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover"},isInvalid:{true:"outline-serious"},isReadOnly:{true:"rounded-none p-0 outline-none"},size:{medium:["text-body-s","pl-[32px]"],small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"},{isDisabled:false,size:"medium"}],defaultVariants:{size:"medium"}}),V=({className:e,ref:o=null,size:i="medium",isReadOnly:t,...s})=>jsxs("div",{className:"relative flex",children:[i==="medium"?jsx(Icon,{className:cn(["-translate-y-1/2 absolute top-1/2 left-s",s.isDisabled?"text-disabled":"text-default-light"]),children:jsx(y,{})}):null,jsx(DateInput,{...s,className:({isDisabled:l,isInvalid:r})=>cn(O({isDisabled:l,isInvalid:r,isReadOnly:t,size:i,className:e}))})]});function q({className:e,description:o,errorMessage:i,isDisabled:t,isInvalid:s,isReadOnly:l,label:r,placeholder:E,slot:c,size:d="medium",shortMonth:f=true,...m}){let p=d==="small",D=o&&(!(p||s)||t),h=i&&s&&!t&&!l;return jsxs(DateField,{...m,isDisabled:t,isInvalid:s,isReadOnly:l,slot:c,className:"flex flex-col gap-xs",children:[!p&&jsx(Label,{className:"empty:hidden",isDisabled:t,isOptional:!m.isRequired,children:r}),jsx(V,{className:e,isDisabled:t,size:d,isReadOnly:l,isInvalid:s,children:x=>jsx(R,{segment:x,shortMonth:f})}),D&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",t&&"fg-disabled"]),slot:"description",children:o}),h&&jsx(FieldError,{className:"fg-serious text-body-xs empty:hidden",children:i})]})}export{q as DateField};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["value","isFocused","isReadOnly","isPlaceholder","placeholder","displayValue","months","FormattedDateSegment","segment","shortMonth","Fragment","jsx","DateSegment","a","F","renderProps","dateFieldStyles","cva","g","className","jsxs","u","size","v","n","AriaDateInput","props","P","isDisabled","isInvalid","DateField","label","slot","description","isSmall","shouldShowError","errorMessage","AriaDateField","N","AriaText","S","FieldError"],"mappings":"4UAmCE,CACA,CAAA,CAAA,KAAA,CAAA,KAEA,CAAA,KAAA,CAAA,KAEA,CAAA,KAAA,CAAA,WAGA,CAAA,KAAA,CAAA,WAGF,CAAA,MAEyB,KACvBA,CAAAA,CAAAA,CAAAA,CAAAA,CACA,CAAAC,KAAAA,CAAAA,CAAAA,CAAAA,yBAEA,CAAA,CAAA,CAAA,WACAC,CAAAA,CAAAA,CAAAA,uBAGA,CAAIC,CACF,CAAA,GAAA,CAAA,GAAOC,EAGT,SAA0CJ,IAE1C,MAAI,CAACE,CAAAA,CAAAA,OACyB,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,WAErCG,GAAeC,CAAAA,CAAQN,IAAc,CAAA,CAAA,CAAC,CAGjCK,CAAAA,CAAAA,EAQHE,CAAAA,EAAuB,CAAC,CAC5B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,QACAC,CAAAA,CAAAA,CAAAA,UAEF,CAAA,CACMD,IAAiB,CAAA,CA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UAItDE,CAAAA,CAAAA,CAAC4B,EAAA,CACC,CAAA,CAAA,EAAA1B,GAAA,CAAA2B,IAAA,CAAA,CAAA,SACE,CAAAhB,EAAA,CAAA,CAAA,2CAEF,CAAA,CAAA,EAAA,aAGC,CAAA,CAAA,CAAA,IAAA,CAAA,aAAA,CAAAS,SAIFQ,CAAA,CAAA,CAAW,6BACT,CAAA,sCAAA,CAAAL,QAKX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport 'client-only';\nimport { cn } from '@/lib/utils';\nimport Calendar from '@accelint/icons/calendar';\nimport type { DateValue } from '@internationalized/date';\nimport type { DateSegment as TDateSegment } from '@react-stately/datepicker';\nimport { type VariantProps, cva } from 'cva';\nimport type { ForwardedRef } from 'react';\nimport {\n DateField as AriaDateField,\n type DateFieldProps as AriaDateFieldProps,\n DateInput as AriaDateInput,\n type DateInputProps as AriaDateInputProps,\n type DateSegmentProps as AriaDateSegmentProps,\n Text as AriaText,\n DateSegment,\n type DateSegmentRenderProps,\n FieldError,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\n\nconst months = [\n 'JAN',\n 'FEB',\n 'MAR',\n 'APR',\n 'MAY',\n 'JUN',\n 'JUL',\n 'AUG',\n 'SEP',\n 'OCT',\n 'NOV',\n 'DEC',\n];\n\nconst MonthDateSegment = ({\n value,\n isFocused,\n isPlaceholder,\n placeholder,\n isReadOnly,\n shortMonth,\n}: DateSegmentRenderProps & { shortMonth?: boolean }) => {\n if (isPlaceholder) {\n return placeholder;\n }\n\n let displayValue: string | undefined = `${value}`;\n\n if (!isReadOnly && isFocused) {\n displayValue = displayValue.padStart(2, '0');\n } else if (shortMonth) {\n displayValue = months[(value ?? 0) - 1];\n }\n\n return displayValue;\n};\n\ninterface FormattedDateSegmentProps extends AriaDateSegmentProps {\n segment: TDateSegment;\n shortMonth?: boolean;\n}\n\nconst FormattedDateSegment = ({\n segment,\n shortMonth,\n ...props\n}: FormattedDateSegmentProps) => {\n if (segment.type === 'literal' && segment.text !== ':') {\n return <></>;\n }\n\n return (\n <DateSegment\n segment={segment}\n className='focus:bg-highlight focus:text-inverse-light focus:outline-none' // Ensure caret color is visible, RAC sets the style prop and it is not overridable. Thanks for that.\n {...props}\n >\n {segment.type === 'month'\n ? (renderProps) => (\n <MonthDateSegment {...renderProps} shortMonth={shortMonth} />\n )\n : segment.text}\n </DateSegment>\n );\n};\n\nconst dateFieldStyles = cva(\n [\n 'flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n isReadOnly: {\n true: 'rounded-none p-0 outline-none',\n },\n size: {\n medium: ['text-body-s', 'pl-[32px]'],\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n {\n isDisabled: false,\n size: 'medium',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface DateInputProps\n extends VariantProps<typeof dateFieldStyles>,\n Omit<AriaDateInputProps, 'size'> {\n ref?: ForwardedRef<HTMLDivElement>;\n}\n\nconst DateInput = ({\n className,\n ref = null,\n size = 'medium',\n isReadOnly,\n ...props\n}: DateInputProps) => {\n return (\n <div className='relative flex'>\n {size === 'medium' ? (\n <Icon\n className={cn([\n '-translate-y-1/2 absolute top-1/2 left-s',\n props.isDisabled ? 'text-disabled' : 'text-default-light',\n ])}\n >\n <Calendar />\n </Icon>\n ) : null}\n <AriaDateInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n dateFieldStyles({\n isDisabled,\n isInvalid,\n isReadOnly: isReadOnly,\n size,\n className,\n }),\n )\n }\n />\n </div>\n );\n};\n\nexport interface DateFieldProps<T extends DateValue>\n extends Omit<\n VariantProps<typeof dateFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaDateFieldProps<T>, 'className' | 'style'>, // Exclude className to avoid conflict with cva\n Omit<AriaDateInputProps, 'className' | 'children' | 'style'> {\n isDisabled?: boolean;\n isInvalid?: boolean;\n isReadOnly?: boolean;\n size?: 'small' | 'medium';\n className?: string;\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n shortMonth?: boolean;\n}\n\nexport function DateField<T extends DateValue>({\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n slot,\n size = 'medium',\n shortMonth = true,\n ...props\n}: DateFieldProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription =\n description && (!(isSmall || isInvalid) || isDisabled);\n const shouldShowError =\n errorMessage && isInvalid && !isDisabled && !isReadOnly;\n\n return (\n <AriaDateField<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n slot={slot}\n className={'flex flex-col gap-xs'}\n >\n {!isSmall && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isOptional={!props.isRequired}\n >\n {label}\n </Label>\n )}\n\n <DateInput\n className={className}\n isDisabled={isDisabled}\n size={size}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n >\n {(segment) => (\n <FormattedDateSegment segment={segment} shortMonth={shortMonth} />\n )}\n </DateInput>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <FieldError className='fg-serious text-body-xs empty:hidden'>\n {errorMessage}\n </FieldError>\n )}\n </AriaDateField>\n );\n}\n"]}
@@ -0,0 +1,40 @@
1
+ import * as React from 'react';
2
+ import { RefObject, PropsWithChildren, ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import { DialogTriggerProps, DialogRenderProps } from 'react-aria-components';
5
+ import { ButtonProps } from '../button/index.js';
6
+ import 'cva/types';
7
+ import 'cva';
8
+
9
+ type DialogSize = 'sm' | 'lg';
10
+ interface DialogProps extends DialogTriggerProps {
11
+ size?: DialogSize;
12
+ isDismissable?: boolean;
13
+ isKeyboardDismissDisabled?: boolean;
14
+ isOpen?: boolean;
15
+ onOpenChange?: (isOpen: boolean) => void;
16
+ parentRef?: RefObject<HTMLElement | null>;
17
+ }
18
+ declare const Dialog: {
19
+ ({ children, size, isOpen, onOpenChange, isDismissable, isKeyboardDismissDisabled, parentRef, }: DialogProps): react_jsx_runtime.JSX.Element;
20
+ displayName: string;
21
+ Button: ({ children, className, ...props }: ButtonProps) => react_jsx_runtime.JSX.Element;
22
+ Content: ({ children, className, }: PropsWithChildren<{
23
+ className?: string;
24
+ }>) => react_jsx_runtime.JSX.Element;
25
+ Footer: ({ children, className, }: PropsWithChildren<{
26
+ className?: string;
27
+ }>) => react_jsx_runtime.JSX.Element;
28
+ Title: ({ children, className, }: PropsWithChildren<{
29
+ className?: string;
30
+ }>) => react_jsx_runtime.JSX.Element;
31
+ Body: React.ForwardRefExoticComponent<DialogBodyProps & React.RefAttributes<HTMLDivElement>>;
32
+ };
33
+ interface DialogBodyProps {
34
+ children: ReactNode | ReactNode[] | ((opts: DialogRenderProps) => ReactNode);
35
+ }
36
+ declare const DialogTitle: ({ children, className, }: PropsWithChildren<{
37
+ className?: string;
38
+ }>) => react_jsx_runtime.JSX.Element;
39
+
40
+ export { Dialog, type DialogProps, DialogTitle };
@@ -0,0 +1,2 @@
1
+ import {cn}from'./../../lib/utils.js';import {useIsSSR}from'@react-aria/ssr';import {cva}from'cva';import {createContext,forwardRef,useState,useEffect,useContext}from'react';import {ModalOverlay,Modal,Dialog,DialogTrigger,Heading}from'react-aria-components';import {Button}from'../button/index.js';import {jsx}from'react/jsx-runtime';var M=cva("flex flex-col align-end font-light text-body-m text-default-dark",{variants:{size:{sm:"min-w-[280px] max-w-[280px] rounded-medium p-l",lg:"min-w-[320px] max-w-[720px] rounded-large p-xl"},defaultVariants:{size:"sm"}}}),E={sm:"small",lg:"medium"},b=createContext({size:"sm"}),r=()=>{let e=useContext(b);if(!e)throw new Error("Dialog components must be used within <Dialog>");return e},l=({children:e,size:t,isOpen:o,onOpenChange:i,isDismissable:a=true,isKeyboardDismissDisabled:m=true,parentRef:p})=>jsx(DialogTrigger,{children:jsx(b.Provider,{value:{size:t??"sm",isDismissable:a,isOpen:o,onOpenChange:i,parentRef:p,isKeyboardDismissDisabled:m},children:e})});l.displayName="Dialog";var x=forwardRef(({children:e,...t},o)=>{let{size:i,isDismissable:a,isOpen:m,onOpenChange:p,parentRef:c,isKeyboardDismissDisabled:C}=r(),d=useIsSSR(),[u,D]=useState(d?null:document.body);return useEffect(()=>{let f=c?.current,g=d?null:document.createElement("div");return f&&g&&(f.appendChild(g),D(g)),()=>{g?.remove(),D(d?null:document.body);}},[d,c]),u?jsx(ModalOverlay,{UNSTABLE_portalContainer:u,isKeyboardDismissDisabled:!a&&C,isOpen:m,onOpenChange:p,isDismissable:a,className:"absolute inset-0 flex items-center justify-center",...t,children:jsx(Modal,{ref:o,className:cn("flex flex-col justify-center bg-surface-overlay align-start",i==="sm"&&"rounded-medium",i==="lg"&&"rounded-large"),children:jsx(Dialog,{className:M({size:i}),children:e})})}):null});x.displayName="DialogBody";var H=({children:e,className:t})=>{let{size:o}=r();return jsx("div",{className:cn("flex flex-col",o==="sm"&&"gap-xs",o==="lg"&&"gap-l",t),children:e})},j=({children:e,className:t})=>{let{size:o}=r();return jsx(Heading,{slot:"title",className:cn("text-default-light",o==="sm"&&"mb-s text-header-m",o==="lg"&&"mb-m text-header-l",t),children:e})},K=({children:e,className:t,...o})=>{let{size:i}=r(),a=E[i];return jsx(Button,{size:a,...o,className:cn("ai-pressed:bg-initial",t),children:e})},L=({children:e,className:t})=>{let{size:o}=r();return jsx("div",{className:cn("flex justify-end gap-xs",o==="sm"&&"mt-l",o==="lg"&&"mt-xl",t),children:e})};l.Button=K;l.Content=H;l.Footer=L;l.Title=j;l.Body=x;export{l as Dialog,j as DialogTitle};//# sourceMappingURL=index.js.map
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/dialog/index.tsx"],"names":["R","h","useDialogContext","DialogContext","z","ctx","size","isOpen","parentRef","RACDialogTrigger","s","B","isDismissable","Dialog","forwardRef","ref","onOpenChange","isKeyboardDismissDisabled","isSSR","useIsSSR","portal","setPortal","y","N","useEffect","P","port","node","jsx","RACModalOverlay","T","n","DialogBody","children","className","cn","S","buttonSize","buttonSizes","dialogSize","Button","DialogButton","DialogContent","DialogFooter","DialogTitle"],"mappings":"8UAsCE,IAAA,CAAA,CAAAA,GAAA,CAAA,4EAGM,CAAA,CAAA,IACA,CAAA,CAAA,EAAA,CAAA,oGAEF,CAAA,CAAA,eAEA,CAAA,CAAA,IAGN,CAAA,IAGE,CAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CACJ,OACF,CAAA,EAAA,CAAA,QAa0D,CAAA,CAAA,CAAA,CAAMC,mBAE1DC,CAAmB,IAAA,CAAM,CAC7B,CAAA,CAAA,CAAA,IAAuBC,CAAAA,IACvB,CAAA,CAAIC,UAACC,CAAAA,CACH,MAAM,CAAI,CAAA,MAAA,IAAsD,KAAA,CAAA,gDAE3DA,CAAAA,CACT,OAYE,CAAA,CAAA,CAAA,CAAA,CAAA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,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,QAAUC,CAAAA,CAAAA,CAAAA,YAAuC,GACvE,CAAM,CAAE,GAAA,CAAA,GAAiB,CAAIhC,IACvBmC,CAAAA,CAAaC,CAAYC,CAAAA,CAAU,EACzC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACEX,CAACY,OACC9B,GAAA,CAAM2B,MACL,CAAA,CAAA,IAGD,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SAAuCH,CAAAA,EAAAA,CAAAA,uBAEtC,CAAA,CAAA,CAAA,CAAA,QAKc,CAAC,CACpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAEM,CAAA,CAAA,CAAE,GAAA5B,CAAAA,IAASJ,IACjB,CACE0B,CAAAA,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,OACElB,GAAA,CAAA,KAAA,CAAA,CAAA,SAEEJ,CAAAA,EAAAA,CAAAA,yBAAiB,CAAA,CAAA,GAAA,IAAA,EACR,MAAA,CAAA,CAAA,SACT4B,OAGDD,CAAAA,CAAAA,CAAAA,CAAAA,QAKA,CAASQ,CAAAA,CAAAA,CAAAA,EAAAA,CAAAA,CAAAA,MACT,CAAA,CAAA,CAAA,CAAA,CAAUC,OACDC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MACT,CAAA,CAAA,CAAQC,CACf/B,CAAAA,KAAcmB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { cn } from '@/lib/utils';\nimport { useIsSSR } from '@react-aria/ssr';\nimport { cva } from 'cva';\nimport {\n type PropsWithChildren,\n type ReactNode,\n type RefObject,\n createContext,\n forwardRef,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport {\n type DialogRenderProps,\n type DialogTriggerProps,\n Dialog as RACDialog,\n DialogTrigger as RACDialogTrigger,\n Heading as RACHeading,\n Modal as RACModal,\n ModalOverlay as RACModalOverlay,\n} from 'react-aria-components';\nimport { Button, type ButtonProps } from '../button';\n\nconst dialogClasses = cva(\n 'flex flex-col align-end font-light text-body-m text-default-dark',\n {\n variants: {\n size: {\n sm: 'min-w-[280px] max-w-[280px] rounded-medium p-l',\n lg: 'min-w-[320px] max-w-[720px] rounded-large p-xl',\n },\n defaultVariants: {\n size: 'sm',\n },\n },\n },\n);\n\nconst buttonSizes: Record<string, ButtonProps['size']> = {\n sm: 'small',\n lg: 'medium',\n};\n\ntype DialogSize = 'sm' | 'lg';\n\ninterface DialogContextValue {\n size: DialogSize;\n isDismissable?: boolean;\n isKeyboardDismissDisabled?: boolean;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n parentRef?: RefObject<HTMLElement | null>;\n}\n\nconst DialogContext = createContext<DialogContextValue>({ size: 'sm' });\n\nconst useDialogContext = () => {\n const ctx = useContext(DialogContext);\n if (!ctx) {\n throw new Error('Dialog components must be used within <Dialog>');\n }\n return ctx;\n};\n\nexport interface DialogProps extends DialogTriggerProps {\n size?: DialogSize;\n isDismissable?: boolean;\n isKeyboardDismissDisabled?: boolean;\n isOpen?: boolean;\n onOpenChange?: (isOpen: boolean) => void;\n parentRef?: RefObject<HTMLElement | null>;\n}\n\nexport const Dialog = ({\n children,\n size,\n isOpen,\n onOpenChange,\n isDismissable = true,\n isKeyboardDismissDisabled = true,\n parentRef,\n}: DialogProps) => {\n return (\n <RACDialogTrigger>\n <DialogContext.Provider\n value={{\n size: size ?? 'sm',\n isDismissable,\n isOpen,\n onOpenChange,\n parentRef,\n isKeyboardDismissDisabled,\n }}\n >\n {children}\n </DialogContext.Provider>\n </RACDialogTrigger>\n );\n};\nDialog.displayName = 'Dialog';\n\ninterface DialogBodyProps {\n children: ReactNode | ReactNode[] | ((opts: DialogRenderProps) => ReactNode);\n}\n\nconst DialogBody = forwardRef<HTMLDivElement, DialogBodyProps>(\n ({ children, ...rest }, ref) => {\n const {\n size,\n isDismissable,\n isOpen,\n onOpenChange,\n parentRef,\n isKeyboardDismissDisabled,\n } = useDialogContext();\n const isSSR = useIsSSR();\n const [portal, setPortal] = useState(isSSR ? null : document.body);\n\n useEffect(() => {\n const node = parentRef?.current;\n /* Ensure proper ssr hydration TODO */\n const port = isSSR ? null : document.createElement('div');\n\n if (node && port) {\n node.appendChild(port);\n setPortal(port);\n }\n\n return () => {\n port?.remove();\n\n setPortal(isSSR ? null : document.body);\n };\n }, [isSSR, parentRef]);\n\n return portal ? (\n <RACModalOverlay\n UNSTABLE_portalContainer={portal}\n isKeyboardDismissDisabled={!isDismissable && isKeyboardDismissDisabled}\n isOpen={isOpen}\n onOpenChange={onOpenChange}\n isDismissable={isDismissable}\n className='absolute inset-0 flex items-center justify-center'\n {...rest}\n >\n <RACModal\n ref={ref}\n className={cn(\n 'flex flex-col justify-center bg-surface-overlay align-start',\n size === 'sm' && 'rounded-medium',\n size === 'lg' && 'rounded-large',\n )}\n >\n {/* @ts-expect-error package version mismatch TODO */}\n <RACDialog className={dialogClasses({ size })}>{children}</RACDialog>\n </RACModal>\n </RACModalOverlay>\n ) : null;\n },\n);\nDialogBody.displayName = 'DialogBody';\n\nconst DialogContent = ({\n children,\n className,\n}: PropsWithChildren<{ className?: string }>) => {\n const { size } = useDialogContext();\n return (\n <div\n className={cn(\n 'flex flex-col',\n size === 'sm' && 'gap-xs',\n size === 'lg' && 'gap-l',\n className,\n )}\n >\n {children}\n </div>\n );\n};\n\nexport const DialogTitle = ({\n children,\n className,\n}: PropsWithChildren<{ className?: string }>) => {\n const { size } = useDialogContext();\n return (\n <RACHeading\n slot='title'\n className={cn(\n 'text-default-light',\n size === 'sm' && 'mb-s text-header-m',\n size === 'lg' && 'mb-m text-header-l',\n className,\n )}\n >\n {/* @ts-expect-error package version mismatch TODO */}\n {children}\n </RACHeading>\n );\n};\n\nconst DialogButton = ({ children, className, ...props }: ButtonProps) => {\n const { size: dialogSize } = useDialogContext();\n const buttonSize = buttonSizes[dialogSize];\n return (\n <Button\n size={buttonSize}\n {...props}\n //overriding the style to deal with rac's pressed state inherited\n //from the trigger state\n className={cn('ai-pressed:bg-initial', className)}\n >\n {children}\n </Button>\n );\n};\n\nconst DialogFooter = ({\n children,\n className,\n}: PropsWithChildren<{ className?: string }>) => {\n const { size } = useDialogContext();\n return (\n <div\n className={cn(\n 'flex justify-end gap-xs',\n size === 'sm' && 'mt-l',\n size === 'lg' && 'mt-xl',\n className,\n )}\n >\n {children}\n </div>\n );\n};\n\nDialog.Button = DialogButton;\nDialog.Content = DialogContent;\nDialog.Footer = DialogFooter;\nDialog.Title = DialogTitle;\nDialog.Body = DialogBody;\n"]}
@@ -1,2 +1,2 @@
1
- import {cva}from'cva';import {cn}from'../../lib/utils.js';import {jsx}from'react/jsx-runtime';var e=cva("inline-block [color:var(--icon-color,currentColor)] [height:var(--icon-size)] [width:var(--icon-size)]",{variants:{size:{large:"h-[var(--icon-size,24px)] w-[var(--icon-size,24px)]",medium:"h-[var(--icon-size,20px)] w-[var(--icon-size,20px)]",small:"h-[var(--icon-size,16px)] w-[var(--icon-size,16px)]",xsmall:"h-[var(--icon-size,12px)] w-[var(--icon-size,12px)]"}},defaultVariants:{size:"medium"}}),a=({children:i,className:o,size:n,...s})=>jsx("span",{className:cn(e({size:n}),o),...s,children:i});a.displayName="Icon";a.as=(i,o)=>cn(e({...i,className:o}));export{a as Icon};//# sourceMappingURL=index.js.map
1
+ import {cva}from'cva';import {cn}from'../../lib/utils.js';import {jsx}from'react/jsx-runtime';var e=cva("block [color:var(--icon-color,currentColor)] [height:var(--icon-size)] [width:var(--icon-size)]",{variants:{size:{large:"h-[var(--icon-size,24px)] w-[var(--icon-size,24px)]",medium:"h-[var(--icon-size,20px)] w-[var(--icon-size,20px)]",small:"h-[var(--icon-size,16px)] w-[var(--icon-size,16px)]",xsmall:"h-[var(--icon-size,12px)] w-[var(--icon-size,12px)]"}},defaultVariants:{size:"medium"}}),a=({children:o,className:i,size:s,...n})=>jsx("span",{className:cn(e({size:s}),i),...n,children:o});a.displayName="Icon";a.as=(o,i)=>cn(e({...o,className:i}));export{a as Icon};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["iconStyles","cva","Icon","children","className","size","rest","t","cn","props"],"mappings":"8FAgBMA,IAAaC,CAAAA,CAAAA,GACjB,yGACA,CACE,CAAA,QAAU,CACR,CAAM,IAAA,CACJ,CAAO,KAAA,CAAA,qDACP,OAAQ,CACR,qDAAA,CAAA,KAAO,CACP,qDAAA,CAAA,MAAQ,sDAEZ,CAAA,CACA,CAAiB,eAAA,CACf,KAAM,CACR,QACF,CACF,CAOaC,CAAAA,CAAAA,CAAO,CAAC,CAAE,CAAA,QAAAC,CAAU,CAAA,CAAA,SAAAC,EAAW,CAAAC,IAAAA,CAAAA,CAAM,CAAGC,GAAK,KAErDC,GAAA,CAAA,MAAA,CACC,CAAWC,SAAAA,CAAAA,EACTR,EAAW,CACT,CAAA,IAAAK,CACF,CAAC,CAAA,CACDD,CACF,CACC,CAAA,CAAA,GAEA,CAAA,CAAA,QAAAD,EACH,CAGJD,EAAAA,CAAK,YAAc,CACnBA,MAAAA,CAAAA,CAAK,GAAK,CACRO,CAAAA,CACAL,CACGI,CAAAA,GAAAA,EAAGR,EAAW,CAAE,CAAA,IAAU,CAAAI,SAAAA,CAAU,CAAC,CAAC,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { type VariantProps, cva } from 'cva';\nimport type { ReactNode } from 'react';\nimport { cn } from '../../lib/utils';\n\nconst iconStyles = cva(\n 'inline-block [color:var(--icon-color,currentColor)] [height:var(--icon-size)] [width:var(--icon-size)]',\n {\n variants: {\n size: {\n large: 'h-[var(--icon-size,24px)] w-[var(--icon-size,24px)]',\n medium: 'h-[var(--icon-size,20px)] w-[var(--icon-size,20px)]',\n small: 'h-[var(--icon-size,16px)] w-[var(--icon-size,16px)]',\n xsmall: 'h-[var(--icon-size,12px)] w-[var(--icon-size,12px)]',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\nexport interface IconProps extends VariantProps<typeof iconStyles> {\n className?: string;\n children: ReactNode;\n}\n\nexport const Icon = ({ children, className, size, ...rest }: IconProps) => {\n return (\n <span\n className={cn(\n iconStyles({\n size,\n }),\n className,\n )}\n {...rest}\n >\n {children}\n </span>\n );\n};\nIcon.displayName = 'Icon';\nIcon.as = (\n props: VariantProps<typeof iconStyles>,\n className?: string | string[],\n) => cn(iconStyles({ ...props, className }));\n"]}
1
+ {"version":3,"sources":["../../../src/components/icon/index.tsx"],"names":["iconStyles","cva","Icon","children","className","size","rest","t","cn","props"],"mappings":"8FAgBMA,IAAaC,CAAAA,CAAAA,GACjB,kGACA,CACE,CAAA,QAAU,CACR,CAAM,IAAA,CACJ,CAAO,KAAA,CAAA,qDACP,OAAQ,CACR,qDAAA,CAAA,KAAO,CACP,qDAAA,CAAA,MAAQ,sDAEZ,CAAA,CACA,CAAiB,eAAA,CACf,KAAM,CACR,QACF,CACF,CAOaC,CAAAA,CAAAA,CAAO,CAAC,CAAE,CAAA,QAAAC,CAAU,CAAA,CAAA,SAAAC,EAAW,CAAAC,IAAAA,CAAAA,CAAM,CAAGC,GAAK,KAErDC,GAAA,CAAA,MAAA,CACC,CAAWC,SAAAA,CAAAA,EACTR,EAAW,CACT,CAAA,IAAAK,CACF,CAAC,CAAA,CACDD,CACF,CACC,CAAA,CAAA,GAEA,CAAA,CAAA,QAAAD,EACH,CAGJD,EAAAA,CAAK,YAAc,CACnBA,MAAAA,CAAAA,CAAK,GAAK,CACRO,CAAAA,CACAL,CACGI,CAAAA,GAAAA,EAAGR,EAAW,CAAE,CAAA,IAAU,CAAAI,SAAAA,CAAU,CAAC,CAAC,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { type VariantProps, cva } from 'cva';\nimport type { ReactNode } from 'react';\nimport { cn } from '../../lib/utils';\n\nconst iconStyles = cva(\n 'block [color:var(--icon-color,currentColor)] [height:var(--icon-size)] [width:var(--icon-size)]',\n {\n variants: {\n size: {\n large: 'h-[var(--icon-size,24px)] w-[var(--icon-size,24px)]',\n medium: 'h-[var(--icon-size,20px)] w-[var(--icon-size,20px)]',\n small: 'h-[var(--icon-size,16px)] w-[var(--icon-size,16px)]',\n xsmall: 'h-[var(--icon-size,12px)] w-[var(--icon-size,12px)]',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\nexport interface IconProps extends VariantProps<typeof iconStyles> {\n className?: string;\n children: ReactNode;\n}\n\nexport const Icon = ({ children, className, size, ...rest }: IconProps) => {\n return (\n <span\n className={cn(\n iconStyles({\n size,\n }),\n className,\n )}\n {...rest}\n >\n {children}\n </span>\n );\n};\nIcon.displayName = 'Icon';\nIcon.as = (\n props: VariantProps<typeof iconStyles>,\n className?: string | string[],\n) => cn(iconStyles({ ...props, className }));\n"]}
@@ -0,0 +1,6 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ActionProps } from 'react-querybuilder';
3
+
4
+ declare function ActionElement({ disabled, disabledTranslation, title: titleProp, handleOnClick, }: ActionProps): react_jsx_runtime.JSX.Element;
5
+
6
+ export { ActionElement };
@@ -0,0 +1,2 @@
1
+ import {useCallback,useMemo}from'react';import {Button}from'../button/index.js';import {pressToMouseEvent}from'./utils.js';import {jsx}from'react/jsx-runtime';function E({disabled:e,disabledTranslation:t,title:o,handleOnClick:r}){let s=useCallback(p=>r(pressToMouseEvent(p)),[r]),m=useMemo(()=>t?.title&&e?t.title:o,[t?.title,e,o]);return jsx(Button,{isDisabled:e&&!t,onPress:s,size:"small",variant:"outline",children:m})}export{E as ActionElement};//# sourceMappingURL=action-element.js.map
2
+ //# sourceMappingURL=action-element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/query-builder/action-element.tsx"],"names":["handleOnClick","useCallback","event","pressToMouseEvent","title","useMemo","n","disabledTranslation","disabled","titleProp","Button","u","handlePress"],"mappings":"+JAmBO,SAAuB,CAC5B,UACA,CAAA,CAAA,CAAA,mBACA,CAAA,CAAA,CAAA,MACA,CAAAA,CAAAA,aACF,CAAgB,CAAA,CAEd,MAAoBC,CAAAA,CACjBC,WAAsBF,CAAAA,CAAAA,EAAcG,EAAkBD,iBAAK,CAAC,CAC7D,CAAA,CAACF,CAAa,CAChB,CAEMI,CAAAA,CAAAA,CAAQC,EACZC,OACEC,CAAAA,IAAAA,CAAqB,EAASC,KAAAA,EAC1BD,EAAoB,CACpBE,CAAAA,KAAAA,CACN,CAACF,CAAAA,CAAAA,CAAqB,OAAiBE,CAAAA,CAAS,CAClD,CAAA,CAEA,SACGC,GAAAA,CAAAC,MACC,CAAA,CAAA,YAAwB,EAACJ,CACzB,CAASK,CAAAA,OAAAA,CACT,MACA,CAAA,OAAA,CAAA,OAEC,CAAA,SAAA,CAAA,SACH,CAEJ,CAAA,CAAA","file":"action-element.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 type { PressEvent } from '@react-types/shared';\nimport { useCallback, useMemo } from 'react';\nimport type { ActionProps } from 'react-querybuilder';\nimport { Button } from '../button';\nimport { pressToMouseEvent } from './utils';\n\nexport function ActionElement({\n disabled,\n disabledTranslation,\n title: titleProp,\n handleOnClick,\n}: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n const title = useMemo(\n () =>\n disabledTranslation?.title && disabled\n ? disabledTranslation.title\n : titleProp,\n [disabledTranslation?.title, disabled, titleProp],\n );\n\n return (\n <Button\n isDisabled={disabled && !disabledTranslation}\n onPress={handlePress}\n size='small'\n variant='outline'\n >\n {title}\n </Button>\n );\n}\n"]}
@@ -0,0 +1,3 @@
1
+ declare const multiValueOperators: string[];
2
+
3
+ export { multiValueOperators };
@@ -0,0 +1,2 @@
1
+ var e=["between","notBetween","during","overlapped","overlaps"];export{e as multiValueOperators};//# sourceMappingURL=constants.js.map
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/query-builder/constants.ts"],"names":["multiValueOperators"],"mappings":"AAaO,IAAMA,EAAsB,CACjC,SAAA,CACA,YACA,CAAA,QAAA,CACA,aACA,UACF","file":"constants.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\nexport const multiValueOperators = [\n 'between',\n 'notBetween',\n 'during',\n 'overlapped',\n 'overlaps',\n];\n"]}
@@ -0,0 +1,30 @@
1
+ import { Field } from 'react-querybuilder';
2
+
3
+ /**
4
+ * Represents sample field types and data for building a query.
5
+ * These fields and their validators are for demonstration of capability and are not required for implementation.
6
+ *
7
+ */
8
+ declare const fields: Field[];
9
+ /**
10
+ * Represents an initial query to populate the rulesets
11
+ * to illustrate examples.
12
+ */
13
+ declare const defaultQuery: {
14
+ combinator: string;
15
+ rules: ({
16
+ field: string;
17
+ operator: string;
18
+ value: string;
19
+ } | {
20
+ field: string;
21
+ operator: string;
22
+ value: string[];
23
+ } | {
24
+ field: string;
25
+ operator: string;
26
+ value: boolean;
27
+ })[];
28
+ };
29
+
30
+ export { defaultQuery, fields };
@@ -0,0 +1,2 @@
1
+ import {z}from'zod';var n=[{name:"AK_HIGH",label:"AK High",type:"i32",inputType:"number",operators:[{name:"=",value:"=",label:"is"},{name:"<",value:"<",label:"less than"},{name:">",value:">",label:"greater than"},{name:"<=",value:"<=",label:"less than equal"},{name:">=",value:">=",label:"greater than equal"},{name:"between",value:"between",label:"between"},{name:"in",value:"in",label:"in"}],validator:a=>({valid:z.union([z.coerce.number().int().gte(-2147483648).lte(2147483647),z.tuple([z.coerce.number().int().gte(-2147483648).lte(2147483647),z.coerce.number().int().gte(-2147483648).lte(2147483647)])]).safeParse(a.value).success,reasons:["Number must be in range."]})},{name:"AK_LOW",label:"AK Low",type:"i32",inputType:"number",operators:[{name:"=",value:"=",label:"is"},{name:"<",value:"<",label:"less than"},{name:">",value:">",label:"greater than"},{name:"<=",value:"<=",label:"less than equal"},{name:">=",value:">=",label:"greater than equal"},{name:"between",value:"between",label:"between"},{name:"in",value:"in",label:"in"}],validator:a=>({valid:z.union([z.coerce.number().int().gte(-2147483648).lte(2147483647),z.tuple([z.coerce.number().int().gte(-2147483648).lte(2147483647),z.coerce.number().int().gte(-2147483648).lte(2147483647)])]).safeParse(a.value).success,reasons:["Number must be in range."]})},{name:"COUNTRY",label:"Country",type:"str",operators:[{name:"=",value:"=",label:"is"},{name:"like",value:"like",label:"like"},{name:"in",value:"in",label:"in"}],inputType:"text",validator:a=>({valid:z.string().min(1).safeParse(a.value).success,reasons:["At least one character is required."]})},{name:"NOTES",label:"Operator Notes",type:"str",valueEditorType:"textarea"},{name:"OPERSTATUS",label:"Is Operational",type:"bool",defaultValue:false,operators:[{name:"=",value:"=",label:"is"}],valueEditorType:"checkbox"},{name:"DONUTS",label:"Has Donuts",type:"bool",operators:[{name:"=",value:"=",label:"is"}],valueEditorType:"switch"},{name:"SERVCITY",label:"Service City",valueEditorType:"select",values:[{name:"Anchorage",label:"Anchorage",value:"Anchorage"},{name:"Juneau",label:"Juneau",value:"Juneau"},{name:"Fairbanks",label:"Fairbanks",value:"Fairbanks"},{name:"Sitka",label:"Sitka",value:"Sitka"},{name:"Montgomery",label:"Montgomery",value:"Montgomery"},{name:"Birmingham",label:"Birmingham",value:"Birmingham"},{name:"Huntsville",label:"Huntsville",value:"Huntsville"},{name:"Mobile",label:"Mobile",value:"Mobile"}],type:"str",operators:[{name:"=",value:"=",label:"is"},{name:"like",value:"like",label:"like"},{name:"in",value:"in",label:"in"},{name:"between",value:"between",label:"between"}]},{name:"TYPE_CODE",label:"Type Code",type:"str",operators:[{name:"=",value:"=",label:"is"}],valueEditorType:"radio",values:[{name:"Heliport",label:"Heliport",value:"Heliport"},{name:"Aerodrome",label:"Aerodrome",value:"Aerodrome"},{name:"Unknown",label:"Unknown",value:"Unknown"}],defaultValue:"Aerodrome"},{name:"ESTABLISHED",label:"Established",type:"date",operators:[{name:"equals",value:"tequals",label:"is"},{name:"during",value:"during",label:"occurs between"},{name:"before",value:"before",label:"ends before"},{name:"after",value:"after",label:"starts after"},{name:"overlapped",value:"overlappedby",label:"starts during"},{name:"overlaps",value:"toverlaps",label:"ends during"}],inputType:"date",validator:a=>({valid:z.union([z.string().min(1),z.tuple([z.string().min(1),z.string().min(1)])]).safeParse(a.value).success,reasons:["At least one character is required."]})},{name:"MAINTENANCE",label:"Maintenance",type:"datetime",operators:[{name:"equals",value:"tequals",label:"is"},{name:"during",value:"during",label:"occurs between"},{name:"before",value:"before",label:"ends before"},{name:"after",value:"after",label:"starts after"},{name:"overlapped",value:"overlappedby",label:"starts during"},{name:"overlaps",value:"toverlaps",label:"ends during"}],inputType:"datetime-local",validator:a=>({valid:z.union([z.string().min(1),z.tuple([z.string().min(1),z.string().min(1)])]).safeParse(a.value).success,reasons:["At least one character is required."]})},{name:"PEAK_TRAFFIC",label:"Peak Traffic",type:"time",operators:[{name:"equals",value:"tequals",label:"is"},{name:"during",value:"during",label:"occurs between"},{name:"before",value:"before",label:"ends before"},{name:"after",value:"after",label:"starts after"},{name:"overlapped",value:"overlappedby",label:"starts during"},{name:"overlaps",value:"toverlaps",label:"ends during"}],inputType:"time",validator:a=>({valid:z.union([z.string().min(1),z.tuple([z.string().min(1),z.string().min(1)])]).safeParse(a.value).success,reasons:["At least one character is required."]})}],t={combinator:"AND",rules:[{field:"AK_HIGH",operator:">",value:"10000"},{field:"AK_LOW",operator:"between",value:["1000","5000"]},{field:"COUNTRY",operator:"like",value:"Canada"},{field:"NOTES",operator:"contains",value:"Clear skies..."},{field:"SERVCITY",operator:"like",value:"Anchorage"},{field:"OPERSTATUS",operator:"=",value:false},{field:"DONUTS",operator:"=",value:true},{field:"TYPE_CODE",operator:"=",value:"Aerodrome"},{field:"ESTABLISHED",operator:"during",value:["2024-10-01","2024-11-01"]},{field:"PEAK_TRAFFIC",operator:"overlaps",value:["18:22:54","19:22:54"]},{field:"MAINTENANCE",operator:"overlapped",value:["2024-10-01T18:22:54","2024-11-01T18:22:54"]}]};export{t as defaultQuery,n as fields};//# sourceMappingURL=example-configuration.js.map
2
+ //# sourceMappingURL=example-configuration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/query-builder/example-configuration.ts"],"names":["fields","rule","z","defaultQuery"],"mappings":"oBAqBaA,IAAAA,CAAAA,CAAkB,CAC7B,CACE,IAAA,CAAM,SACN,CAAA,KAAA,CAAO,SACP,CAAA,IAAA,CAAM,MACN,SAAW,CAAA,QAAA,CACX,SAAW,CAAA,CACT,CAAE,IAAA,CAAM,GAAK,CAAA,KAAA,CAAO,GAAK,CAAA,KAAA,CAAO,IAAK,CAAA,CACrC,CAAE,IAAA,CAAM,IAAK,KAAO,CAAA,GAAA,CAAK,KAAO,CAAA,WAAY,CAC5C,CAAA,CAAE,IAAM,CAAA,GAAA,CAAK,KAAO,CAAA,GAAA,CAAK,KAAO,CAAA,cAAe,CAC/C,CAAA,CAAE,KAAM,IAAM,CAAA,KAAA,CAAO,IAAM,CAAA,KAAA,CAAO,iBAAkB,CAAA,CACpD,CAAE,IAAA,CAAM,IAAM,CAAA,KAAA,CAAO,IAAM,CAAA,KAAA,CAAO,oBAAqB,CAAA,CACvD,CAAE,IAAM,CAAA,SAAA,CAAW,KAAO,CAAA,SAAA,CAAW,KAAO,CAAA,SAAU,CACtD,CAAA,CAAE,IAAM,CAAA,IAAA,CAAM,KAAO,CAAA,IAAA,CAAM,KAAO,CAAA,IAAK,CACzC,CACA,CAAA,SAAA,CAAYC,CAAU,GAAA,CACpB,KAAOC,CAAA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AA,aAAA,CACP,QAAU,CAAA,YAAA,CACV,KAAO,CAAA,CAAC,qBAAuB,CAAA,qBAAqB,CACtD,CACF,CACF","file":"example-configuration.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 type { Field } from 'react-querybuilder';\nimport { z } from 'zod';\n\n/**\n * Represents sample field types and data for building a query.\n * These fields and their validators are for demonstration of capability and are not required for implementation.\n *\n */\nexport const fields: Field[] = [\n {\n name: 'AK_HIGH',\n label: 'AK High',\n type: 'i32',\n inputType: 'number', // as in HTML input type <input type=\"number\">\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: '<', value: '<', label: 'less than' } as const,\n { name: '>', value: '>', label: 'greater than' } as const,\n { name: '<=', value: '<=', label: 'less than equal' } as const,\n { name: '>=', value: '>=', label: 'greater than equal' } as const,\n { name: 'between', value: 'between', label: 'between' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n ],\n validator: (rule) => ({\n valid: z\n .union([\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n z.tuple([\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n ]),\n ])\n .safeParse(rule.value).success,\n reasons: ['Number must be in range.'],\n }),\n },\n {\n name: 'AK_LOW',\n label: 'AK Low',\n type: 'i32',\n inputType: 'number', // as in HTML input type <input type=\"number\">\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: '<', value: '<', label: 'less than' } as const,\n { name: '>', value: '>', label: 'greater than' } as const,\n { name: '<=', value: '<=', label: 'less than equal' } as const,\n { name: '>=', value: '>=', label: 'greater than equal' } as const,\n { name: 'between', value: 'between', label: 'between' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n ],\n validator: (rule) => ({\n valid: z\n .union([\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n z.tuple([\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n z.coerce.number().int().gte(-2_147_483_648).lte(2_147_483_647),\n ]),\n ])\n .safeParse(rule.value).success,\n reasons: ['Number must be in range.'],\n }),\n },\n {\n name: 'COUNTRY',\n label: 'Country',\n type: 'str',\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: 'like', value: 'like', label: 'like' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n ],\n inputType: 'text',\n validator: (rule) => ({\n valid: z.string().min(1).safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n {\n name: 'NOTES',\n label: 'Operator Notes',\n type: 'str',\n valueEditorType: 'textarea',\n },\n {\n name: 'OPERSTATUS',\n label: 'Is Operational',\n type: 'bool',\n defaultValue: false,\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n valueEditorType: 'checkbox',\n },\n {\n name: 'DONUTS',\n label: 'Has Donuts',\n type: 'bool',\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n valueEditorType: 'switch',\n },\n {\n name: 'SERVCITY',\n label: 'Service City',\n valueEditorType: 'select',\n values: [\n { name: 'Anchorage', label: 'Anchorage', value: 'Anchorage' },\n { name: 'Juneau', label: 'Juneau', value: 'Juneau' },\n {\n name: 'Fairbanks',\n label: 'Fairbanks',\n value: 'Fairbanks',\n },\n { name: 'Sitka', label: 'Sitka', value: 'Sitka' },\n { name: 'Montgomery', label: 'Montgomery', value: 'Montgomery' },\n { name: 'Birmingham', label: 'Birmingham', value: 'Birmingham' },\n {\n name: 'Huntsville',\n label: 'Huntsville',\n value: 'Huntsville',\n },\n { name: 'Mobile', label: 'Mobile', value: 'Mobile' },\n ],\n type: 'str',\n operators: [\n { name: '=', value: '=', label: 'is' } as const,\n { name: 'like', value: 'like', label: 'like' } as const,\n { name: 'in', value: 'in', label: 'in' } as const,\n { name: 'between', value: 'between', label: 'between' } as const,\n ],\n },\n {\n name: 'TYPE_CODE',\n label: 'Type Code',\n type: 'str',\n operators: [{ name: '=', value: '=', label: 'is' } as const],\n valueEditorType: 'radio',\n values: [\n { name: 'Heliport', label: 'Heliport', value: 'Heliport' },\n { name: 'Aerodrome', label: 'Aerodrome', value: 'Aerodrome' },\n { name: 'Unknown', label: 'Unknown', value: 'Unknown' },\n ],\n defaultValue: 'Aerodrome',\n },\n {\n name: 'ESTABLISHED',\n label: 'Established',\n type: 'date',\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'date',\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n {\n name: 'MAINTENANCE',\n label: 'Maintenance',\n type: 'datetime',\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'datetime-local', // mm/dd/yyyy hh:mm a\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n {\n name: 'PEAK_TRAFFIC',\n label: 'Peak Traffic',\n type: 'time',\n operators: [\n { name: 'equals', value: 'tequals', label: 'is' } as const,\n { name: 'during', value: 'during', label: 'occurs between' } as const,\n { name: 'before', value: 'before', label: 'ends before' } as const,\n { name: 'after', value: 'after', label: 'starts after' } as const,\n {\n name: 'overlapped',\n value: 'overlappedby',\n label: 'starts during',\n } as const,\n { name: 'overlaps', value: 'toverlaps', label: 'ends during' } as const,\n ],\n inputType: 'time', // hh:mm a\n validator: (rule) => ({\n valid: z\n .union([\n z.string().min(1),\n z.tuple([z.string().min(1), z.string().min(1)]),\n ])\n .safeParse(rule.value).success,\n reasons: ['At least one character is required.'],\n }),\n },\n] satisfies Field[];\n\n/**\n * Represents an initial query to populate the rulesets\n * to illustrate examples.\n */\nexport const defaultQuery = {\n combinator: 'AND',\n rules: [\n { field: 'AK_HIGH', operator: '>', value: '10000' }, // i32\n { field: 'AK_LOW', operator: 'between', value: ['1000', '5000'] }, // between\n { field: 'COUNTRY', operator: 'like', value: 'Canada' }, //text\n { field: 'NOTES', operator: 'contains', value: 'Clear skies...' }, // textarea\n { field: 'SERVCITY', operator: 'like', value: 'Anchorage' }, // options with headers\n { field: 'OPERSTATUS', operator: '=', value: false }, // bool\n { field: 'DONUTS', operator: '=', value: true }, // switch\n { field: 'TYPE_CODE', operator: '=', value: 'Aerodrome' }, // radio\n {\n field: 'ESTABLISHED',\n operator: 'during',\n value: ['2024-10-01', '2024-11-01'],\n }, // date\n {\n field: 'PEAK_TRAFFIC',\n operator: 'overlaps',\n value: ['18:22:54', '19:22:54'],\n }, // time\n {\n field: 'MAINTENANCE',\n operator: 'overlapped',\n value: ['2024-10-01T18:22:54', '2024-11-01T18:22:54'],\n }, // datetime\n ],\n};\n"]}
@@ -0,0 +1,8 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { RuleGroupProps, useRuleGroup } from 'react-querybuilder';
3
+
4
+ declare function RuleGroup(props: RuleGroupProps): react_jsx_runtime.JSX.Element;
5
+ declare function RuleGroupHeaderComponent(ruleGroup: RuleGroupProps & ReturnType<typeof useRuleGroup>): react_jsx_runtime.JSX.Element;
6
+ declare function RuleGroupFooterComponent(ruleGroup: RuleGroupProps & ReturnType<typeof useRuleGroup>): react_jsx_runtime.JSX.Element;
7
+
8
+ export { RuleGroup, RuleGroupFooterComponent, RuleGroupHeaderComponent };