@accelint/design-toolkit 2.2.0 → 2.3.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 (150) hide show
  1. package/README.md +1 -0
  2. package/dist/components/accordion/index.d.ts +2 -2
  3. package/dist/components/accordion/index.js +1 -1
  4. package/dist/components/accordion/index.js.map +1 -1
  5. package/dist/components/accordion/styles.d.ts +3 -39
  6. package/dist/components/accordion/styles.js +1 -1
  7. package/dist/components/accordion/styles.js.map +1 -1
  8. package/dist/components/avatar/index.d.ts +4 -4
  9. package/dist/components/avatar/index.js +1 -1
  10. package/dist/components/avatar/index.js.map +1 -1
  11. package/dist/components/badge/index.d.ts +2 -2
  12. package/dist/components/box/index.d.ts +3 -3
  13. package/dist/components/button/index.d.ts +35 -23
  14. package/dist/components/button/index.js +1 -1
  15. package/dist/components/button/index.js.map +1 -1
  16. package/dist/components/button/styles.d.ts +297 -0
  17. package/dist/components/button/styles.js +2 -0
  18. package/dist/components/button/styles.js.map +1 -0
  19. package/dist/components/button/types.d.ts +14 -0
  20. package/dist/components/button/types.js +2 -0
  21. package/dist/components/button/types.js.map +1 -0
  22. package/dist/components/checkbox/index.d.ts +2 -2
  23. package/dist/components/checkbox/index.js +1 -1
  24. package/dist/components/checkbox/index.js.map +1 -1
  25. package/dist/components/chip/index.d.ts +25 -48
  26. package/dist/components/chip/index.js +1 -1
  27. package/dist/components/chip/index.js.map +1 -1
  28. package/dist/components/chip/styles.d.ts +250 -0
  29. package/dist/components/chip/styles.js +2 -0
  30. package/dist/components/chip/styles.js.map +1 -0
  31. package/dist/components/chip/types.d.ts +20 -0
  32. package/dist/components/chip/types.js +2 -0
  33. package/dist/components/chip/types.js.map +1 -0
  34. package/dist/components/classification-badge/index.d.ts +15 -16
  35. package/dist/components/classification-badge/index.js +1 -1
  36. package/dist/components/classification-badge/index.js.map +1 -1
  37. package/dist/components/classification-badge/styles.d.ts +51 -0
  38. package/dist/components/classification-badge/styles.js +2 -0
  39. package/dist/components/classification-badge/styles.js.map +1 -0
  40. package/dist/components/classification-badge/types.d.ts +9 -0
  41. package/dist/components/classification-badge/types.js +2 -0
  42. package/dist/components/classification-badge/types.js.map +1 -0
  43. package/dist/components/classification-banner/index.d.ts +15 -16
  44. package/dist/components/classification-banner/index.js +1 -2
  45. package/dist/components/classification-banner/index.js.map +1 -1
  46. package/dist/components/classification-banner/styles.d.ts +38 -0
  47. package/dist/components/classification-banner/styles.js +2 -0
  48. package/dist/components/classification-banner/styles.js.map +1 -0
  49. package/dist/components/classification-banner/types.d.ts +9 -0
  50. package/dist/components/classification-banner/types.js +2 -0
  51. package/dist/components/classification-banner/types.js.map +1 -0
  52. package/dist/components/color-picker/index.js +1 -1
  53. package/dist/components/color-picker/index.js.map +1 -1
  54. package/dist/components/combobox/index.js +1 -1
  55. package/dist/components/combobox/index.js.map +1 -1
  56. package/dist/components/date-field/index.js +1 -1
  57. package/dist/components/date-field/index.js.map +1 -1
  58. package/dist/components/dialog/index.d.ts +5 -5
  59. package/dist/components/dialog/index.js +1 -1
  60. package/dist/components/dialog/index.js.map +1 -1
  61. package/dist/components/icon/index.d.ts +2 -2
  62. package/dist/components/icon/index.js +1 -1
  63. package/dist/components/icon/index.js.map +1 -1
  64. package/dist/components/icon/types.d.ts +3 -5
  65. package/dist/components/label/index.d.ts +10 -7
  66. package/dist/components/label/index.js +1 -1
  67. package/dist/components/label/index.js.map +1 -1
  68. package/dist/components/label/styles.d.ts +5 -0
  69. package/dist/components/label/styles.js +2 -0
  70. package/dist/components/label/styles.js.map +1 -0
  71. package/dist/components/label/types.d.ts +10 -0
  72. package/dist/components/label/types.js +2 -0
  73. package/dist/components/label/types.js.map +1 -0
  74. package/dist/components/options/index.d.ts +2 -2
  75. package/dist/components/options/index.js +1 -1
  76. package/dist/components/options/index.js.map +1 -1
  77. package/dist/components/options-item/index.js +1 -1
  78. package/dist/components/options-item/index.js.map +1 -1
  79. package/dist/components/popover/index.js +1 -1
  80. package/dist/components/popover/index.js.map +1 -1
  81. package/dist/components/popover/styles.d.ts +3 -3
  82. package/dist/components/query-builder/index.js +1 -1
  83. package/dist/components/query-builder/index.js.map +1 -1
  84. package/dist/components/query-builder/value-editor.js +1 -1
  85. package/dist/components/query-builder/value-editor.js.map +1 -1
  86. package/dist/components/radio/index.d.ts +11 -9
  87. package/dist/components/radio/index.js +1 -1
  88. package/dist/components/radio/index.js.map +1 -1
  89. package/dist/components/radio/styles.d.ts +53 -0
  90. package/dist/components/radio/styles.js +2 -0
  91. package/dist/components/radio/styles.js.map +1 -0
  92. package/dist/components/radio/types.d.ts +21 -0
  93. package/dist/components/radio/types.js +2 -0
  94. package/dist/components/radio/types.js.map +1 -0
  95. package/dist/components/search-field/index.js +1 -1
  96. package/dist/components/search-field/index.js.map +1 -1
  97. package/dist/components/slider/index.js +1 -1
  98. package/dist/components/slider/index.js.map +1 -1
  99. package/dist/components/switch/index.d.ts +10 -7
  100. package/dist/components/switch/index.js +1 -1
  101. package/dist/components/switch/index.js.map +1 -1
  102. package/dist/components/switch/styles.d.ts +41 -0
  103. package/dist/components/switch/styles.js +2 -0
  104. package/dist/components/switch/styles.js.map +1 -0
  105. package/dist/components/switch/types.d.ts +13 -0
  106. package/dist/components/switch/types.js +2 -0
  107. package/dist/components/switch/types.js.map +1 -0
  108. package/dist/components/tabs/index.js +1 -1
  109. package/dist/components/tabs/index.js.map +1 -1
  110. package/dist/components/text-area-field/index.d.ts +19 -0
  111. package/dist/components/text-area-field/index.js +2 -0
  112. package/dist/components/text-area-field/index.js.map +1 -0
  113. package/dist/components/text-area-field/styles.d.ts +113 -0
  114. package/dist/components/text-area-field/styles.js +2 -0
  115. package/dist/components/text-area-field/styles.js.map +1 -0
  116. package/dist/components/text-area-field/types.d.ts +23 -0
  117. package/dist/components/text-area-field/types.js +2 -0
  118. package/dist/components/text-area-field/types.js.map +1 -0
  119. package/dist/components/text-field/index.js +1 -1
  120. package/dist/components/text-field/index.js.map +1 -1
  121. package/dist/components/tooltip/index.d.ts +2 -2
  122. package/dist/components/tooltip/index.js +1 -1
  123. package/dist/components/tooltip/index.js.map +1 -1
  124. package/dist/index.css +122 -252
  125. package/dist/index.d.ts +25 -11
  126. package/dist/index.js +1 -1
  127. package/dist/lib/react.js.map +1 -1
  128. package/dist/lib/utils.js +1 -1
  129. package/dist/lib/utils.js.map +1 -1
  130. package/dist/metafile-esm.json +1 -1
  131. package/dist/styles.css +873 -754
  132. package/dist/tokens/generated/themes.css +147 -0
  133. package/dist/tokens/generated/themes.d.ts +2 -0
  134. package/dist/tokens/generated/tokens.css +119 -0
  135. package/dist/tokens/generated/tokens.d.ts +108 -0
  136. package/dist/tokens/generated/tokens.js +2 -0
  137. package/dist/tokens/generated/tokens.js.map +1 -0
  138. package/package.json +5 -5
  139. package/dist/components/floating-button/index.d.ts +0 -18
  140. package/dist/components/floating-button/index.js +0 -2
  141. package/dist/components/floating-button/index.js.map +0 -1
  142. package/dist/components/icon-button/index.d.ts +0 -20
  143. package/dist/components/icon-button/index.js +0 -2
  144. package/dist/components/icon-button/index.js.map +0 -1
  145. package/dist/components/text-area/index.d.ts +0 -30
  146. package/dist/components/text-area/index.js +0 -2
  147. package/dist/components/text-area/index.js.map +0 -1
  148. package/dist/components/toggle-icon-button/index.d.ts +0 -20
  149. package/dist/components/toggle-icon-button/index.js +0 -2
  150. package/dist/components/toggle-icon-button/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/popover/index.tsx"],"names":["content","body","title","footer","PopoverStyles","Popover","placement","children","jsx","AriaDialogTrigger","rest","PopoverTrigger","Pressable","PopoverContent","className","AriaPopover","AriaDialog","AriaHeading","PopoverTitle","PopoverBody","PopoverFooter"],"mappings":"+JA+BM,IAAE,CAAA,OAAAA,CAAAA,CAAS,CAAA,IAAAC,EAAM,CAAA,KAAAC,CAAAA,CAAO,OAAAC,CAAO,CAAA,CAAIC,cAAc,EAE1CC,CAAAA,CAAU,CAAC,CACtB,CAAA,SAAAC,E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AAC,CACrB,CAAA,QAAAb,CAAAA,CACA,UAAAO,CACF,CAAA,CAAA,GACSN,GAAC,CAAA,KAAA,CAAI,CAAA,SAAWL,CAAAA,CAAO,CAAE,CAAA,SAAAW,CAAU,CAAC,CAAA,CAAI,CAAA,QAAAP,EAAS,CAAA,CAE1Da,CAAAA,CAAc,CAAA,WAAc,CAAA,gBAE5Bf,CAAAA,CAAQ,CAAA,KAAQa,EAChBb,CAAAA,CAAQ,CAAA,OAAUQ,EAClBR,CAAAA,CAAQ,CAAA,IAAOc,EACfd,CAAAA,CAAQ,CAAA,MAASe,CAAAA,CACjBf,CAAAA,CAAQ,CAAA,OAAUM,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 type { ReactNode } from 'react';\nimport {\n Dialog as AriaDialog,\n DialogTrigger as AriaDialogTrigger,\n Heading as AriaHeading,\n Popover as AriaPopover,\n Pressable,\n} from 'react-aria-components';\n\nimport type {\n PopoverBodyProps,\n PopoverContentProps,\n PopoverProps,\n PopoverTitleProps,\n PopoverTriggerProps,\n} from './types';\n\nimport { PopoverStyles } from './styles';\n\nconst { content, body, title, footer } = PopoverStyles();\n\nexport const Popover = ({\n placement = 'bottom',\n children,\n ...rest\n}: PopoverProps) => {\n return <AriaDialogTrigger {...rest}>{children}</AriaDialogTrigger>;\n};\nPopover.displayName = 'Popover';\n\nexport const PopoverTrigger = ({ children, ...props }: PopoverTriggerProps) => {\n return <Pressable {...props}>{children}</Pressable>;\n};\nPopover.displayName = 'Popover.Trigger';\n\nconst PopoverContent = ({\n children,\n className,\n ...rest\n}: PopoverContentProps) => {\n return (\n <AriaPopover className={content({ className })} {...rest}>\n {/* @ts-expect-error package version mismatch TODO */}\n <AriaDialog>{children}</AriaDialog>\n </AriaPopover>\n );\n};\nPopoverContent.displayName = 'Popover.Content';\n\nconst PopoverTitle = ({ children, className, ...rest }: PopoverTitleProps) => {\n return (\n <AriaHeading slot='title' className={title({ className })} {...rest}>\n {children}\n </AriaHeading>\n );\n};\n\nPopoverTitle.displayName = 'Popover.Title';\n\nconst PopoverBody = ({ children, className }: PopoverBodyProps) => {\n return <div className={body({ className })}>{children}</div>;\n};\nPopoverBody.displayName = 'Popover.Body';\n\nconst PopoverFooter = ({\n children,\n className,\n}: { children: ReactNode; className?: string }) => {\n return <div className={footer({ className })}>{children}</div>;\n};\nPopoverFooter.displayName = 'Popover.Footer';\n\nPopover.Title = PopoverTitle;\nPopover.Content = PopoverContent;\nPopover.Body = PopoverBody;\nPopover.Footer = PopoverFooter;\nPopover.Trigger = PopoverTrigger;\n"]}
1
+ {"version":3,"sources":["../../../src/components/popover/index.tsx"],"names":["content","body","title","footer","PopoverStyles","Popover","placement","children","jsx","AriaDialogTrigger","rest","PopoverTrigger","Pressable","props","PopoverContent","className","AriaPopover","AriaDialog","PopoverTitle","AriaHeading","PopoverBody","PopoverFooter"],"mappings":"mLAiCM,IAAE,CAAA,OAAAA,EAAS,CAAA,IAAAC,CAAAA,CAAM,MAAAC,CAAAA,CAAO,CAAA,MAAAC,CAAO,CAAA,CAAIC,CAAAA,aAAc,EAE1CC,CAAAA,CAAU,CAAC,CACtB,UAAAC,CAAAA,CAAY,CAAA,QACZ,SAAAC,CAAAA,CACA,CAAA,GACF,CAAA,CAAA,GACSC,GAACC,CAAAA,aAAA,CAAmB,CAAA,GAAGC,CAAO,SAAAH,CAAAA,CAAS,CAAA,GAExC,CAAA,WAAc,CAAA,SAEf,CAAMI,IAAAA,CAAiB,CAAC,CAAE,CAAA,QAAAJ,CAAA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AA,WAAc,CAAA,gBAE5BhB,CAAAA,CAAQ,CAAA,KAAQa,EAChBb,CAAAA,CAAQ,CAAA,OAAUS,EAClBT,CAAAA,CAAQ,CAAA,IAAOe,EACff,CAAAA,CAAQ,CAAA,MAASgB,CAAAA,CACjBhB,CAAAA,CAAQ,CAAA,OAAUM,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport 'client-only';\nimport type { ReactNode } from 'react';\nimport {\n Dialog as AriaDialog,\n DialogTrigger as AriaDialogTrigger,\n Heading as AriaHeading,\n Popover as AriaPopover,\n Pressable,\n} from 'react-aria-components';\n\nimport type {\n PopoverBodyProps,\n PopoverContentProps,\n PopoverProps,\n PopoverTitleProps,\n PopoverTriggerProps,\n} from './types';\n\nimport { PopoverStyles } from './styles';\n\nconst { content, body, title, footer } = PopoverStyles();\n\nexport const Popover = ({\n placement = 'bottom',\n children,\n ...rest\n}: PopoverProps) => {\n return <AriaDialogTrigger {...rest}>{children}</AriaDialogTrigger>;\n};\nPopover.displayName = 'Popover';\n\nexport const PopoverTrigger = ({ children, ...props }: PopoverTriggerProps) => {\n return <Pressable {...props}>{children}</Pressable>;\n};\nPopover.displayName = 'Popover.Trigger';\n\nconst PopoverContent = ({\n children,\n className,\n ...rest\n}: PopoverContentProps) => {\n return (\n <AriaPopover className={content({ className })} {...rest}>\n {/* @ts-expect-error package version mismatch TODO */}\n <AriaDialog>{children}</AriaDialog>\n </AriaPopover>\n );\n};\nPopoverContent.displayName = 'Popover.Content';\n\nconst PopoverTitle = ({ children, className, ...rest }: PopoverTitleProps) => {\n return (\n <AriaHeading slot='title' className={title({ className })} {...rest}>\n {children}\n </AriaHeading>\n );\n};\n\nPopoverTitle.displayName = 'Popover.Title';\n\nconst PopoverBody = ({ children, className }: PopoverBodyProps) => {\n return <div className={body({ className })}>{children}</div>;\n};\nPopoverBody.displayName = 'Popover.Body';\n\nconst PopoverFooter = ({\n children,\n className,\n}: { children: ReactNode; className?: string }) => {\n return <div className={footer({ className })}>{children}</div>;\n};\nPopoverFooter.displayName = 'Popover.Footer';\n\nPopover.Title = PopoverTitle;\nPopover.Content = PopoverContent;\nPopover.Body = PopoverBody;\nPopover.Footer = PopoverFooter;\nPopover.Trigger = PopoverTrigger;\n"]}
@@ -4,18 +4,18 @@ declare const PopoverStyles: tailwind_variants.TVReturnType<{
4
4
  [key: string]: {
5
5
  [key: string]: tailwind_variants.ClassValue | {
6
6
  content?: tailwind_variants.ClassValue;
7
+ title?: tailwind_variants.ClassValue;
7
8
  body?: tailwind_variants.ClassValue;
8
9
  footer?: tailwind_variants.ClassValue;
9
- title?: tailwind_variants.ClassValue;
10
10
  };
11
11
  };
12
12
  } | {
13
13
  [x: string]: {
14
14
  [x: string]: tailwind_variants.ClassValue | {
15
15
  content?: tailwind_variants.ClassValue;
16
+ title?: tailwind_variants.ClassValue;
16
17
  body?: tailwind_variants.ClassValue;
17
18
  footer?: tailwind_variants.ClassValue;
18
- title?: tailwind_variants.ClassValue;
19
19
  };
20
20
  };
21
21
  } | {}, {
@@ -27,9 +27,9 @@ declare const PopoverStyles: tailwind_variants.TVReturnType<{
27
27
  [key: string]: {
28
28
  [key: string]: tailwind_variants.ClassValue | {
29
29
  content?: tailwind_variants.ClassValue;
30
+ title?: tailwind_variants.ClassValue;
30
31
  body?: tailwind_variants.ClassValue;
31
32
  footer?: tailwind_variants.ClassValue;
32
- title?: tailwind_variants.ClassValue;
33
33
  };
34
34
  };
35
35
  } | {}, {
@@ -1,2 +1,2 @@
1
- import {LockFill,Delete,Duplicate}from'@accelint/icons';import {useMemo,createContext,useCallback}from'react';import {QueryBuilder}from'react-querybuilder';import {cn}from'../../lib/utils.js';import {Icon}from'../icon/index.js';import {IconButton}from'../icon-button/index.js';import {Label}from'../label/index.js';import {Radio}from'../radio/index.js';import {Tooltip}from'../tooltip/index.js';import {ActionElement}from'./action-element.js';import {RuleGroup,RuleGroupHeaderComponent,RuleGroupFooterComponent}from'./group.js';import {Rule}from'./rule.js';import {getValidationResult,pressToMouseEvent}from'./utils.js';import {ValueEditor}from'./value-editor.js';import {ValueSelector}from'./value-selector.js';import {jsx,jsxs}from'react/jsx-runtime';var N={AND:"All rules below must be true for a match",OR:"One of the rules below must be true for a match"};function C({options:r,value:n,handleOnChange:l}){return jsxs(Radio.Group,{value:n,onChange:l,orientation:"horizontal",children:[jsx(Label,{children:"Combinator"}),r.map(o=>jsx(Radio,{value:o.label,children:jsxs(Tooltip,{children:[jsx(Tooltip.Trigger,{children:jsx("span",{children:o.label})}),jsx(Tooltip.Body,{placement:"top",children:N[o.label]})]})},o.label))]})}function x({handleOnClick:r,className:n,...l}){let o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(IconButton,{size:"small",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(Delete,{})})})}function u({handleOnClick:r,className:n,...l}){let o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(IconButton,{size:"small",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(LockFill,{})})})}function p({handleOnClick:r,className:n,...l}){let o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(IconButton,{size:"small",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(Duplicate,{})})})}function t({controlClassnames:r,controlElements:n,orientation:l="horizontal",showRuleLines:o=true,...i}){let G=useMemo(()=>({combinatorSelector:C,cloneGroupAction:p,cloneRuleAction:p,removeRuleAction:x,lockGroupAction:u,lockRuleAction:u,ruleGroup:RuleGroup,rule:Rule,actionElement:ActionElement,valueSelector:ValueSelector,valueEditor:ValueEditor,...n}),[n]),y=useMemo(()=>({queryBuilder:"border border-transparent",ruleGroup:"group col-span-full flex flex-col gap-s p-s border border-info rounded-medium",header:"flex gap-s",body:cn("group grid gap-x-s empty:hidden",o?"grid-cols-[10px_minmax(100px,_1fr)_min-content]":"grid-cols-[minmax(100px,_1fr)_min-content]"),combinators:"my-s",addRule:"",addGroup:"",cloneRule:"fg-interactive hover:fg-interactive-hover",cloneGroup:"fg-interactive hover:fg-interactive-hover",removeGroup:"",rule:cn("flex gap-xs py-s",l==="vertical"?"flex-col":"min-height-[50px] items-start"),fields:"w-full",operators:"",value:"w-full",removeRule:"",valid:"",invalid:"",disabled:"",lockRule:"fg-interactive hover:fg-interactive-hover",lockGroup:"fg-interactive hover:fg-interactive-hover",valueSource:"",valueListItem:""}),[l,o]),Q=useMemo(()=>({...y,...r}),[r,y]),E=createContext({orientation:l,showRuleLines:o});return jsx(QueryBuilder,{showNotToggle:false,showShiftActions:false,enableDragAndDrop:false,controlClassnames:Q,controlElements:G,context:E,listsAsArrays:true,...i})}t.CombinatorSelector=C;t.RemoveRuleAction=x;t.LockAction=u;t.CloneAction=p;t.ActionElement=ActionElement;t.Rule=Rule;t.RuleGroup=RuleGroup;t.RuleGroupHeaderComponent=RuleGroupHeaderComponent;t.RuleGroupFooterComponent=RuleGroupFooterComponent;t.getValidationResult=getValidationResult;t.ValueEditor=ValueEditor;t.ValueSelector=ValueSelector;export{t as QueryBuilder};//# sourceMappingURL=index.js.map
1
+ import {LockFill,Delete,Duplicate}from'@accelint/icons';import'client-only';import {useMemo,createContext,useCallback}from'react';import {QueryBuilder}from'react-querybuilder';import {cn}from'../../lib/utils.js';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {Radio}from'../radio/index.js';import {Tooltip}from'../tooltip/index.js';import {ActionElement}from'./action-element.js';import {RuleGroup,RuleGroupHeaderComponent,RuleGroupFooterComponent}from'./group.js';import {Rule}from'./rule.js';import {getValidationResult,pressToMouseEvent}from'./utils.js';import {ValueEditor}from'./value-editor.js';import {ValueSelector}from'./value-selector.js';import {jsx,jsxs}from'react/jsx-runtime';var z={AND:"All rules below must be true for a match",OR:"One of the rules below must be true for a match"};function C({options:r,value:n,handleOnChange:l}){return jsxs(Radio.Group,{value:n,onChange:l,orientation:"horizontal",children:[jsx(Label,{children:"Combinator"}),r.map(o=>jsx(Radio,{value:o.label,children:jsxs(Tooltip,{children:[jsx(Tooltip.Trigger,{children:jsx("span",{children:o.label})}),jsx(Tooltip.Body,{placement:"top",children:z[o.label]})]})},o.label))]})}function x({handleOnClick:r,className:n,...l}){let o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(Delete,{})})})}function u({handleOnClick:r,className:n,...l}){let o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(LockFill,{})})})}function p({handleOnClick:r,className:n,...l}){let o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(Duplicate,{})})})}function t({controlClassnames:r,controlElements:n,orientation:l="horizontal",showRuleLines:o=true,...i}){let G=useMemo(()=>({combinatorSelector:C,cloneGroupAction:p,cloneRuleAction:p,removeRuleAction:x,lockGroupAction:u,lockRuleAction:u,ruleGroup:RuleGroup,rule:Rule,actionElement:ActionElement,valueSelector:ValueSelector,valueEditor:ValueEditor,...n}),[n]),y=useMemo(()=>({queryBuilder:"border border-transparent",ruleGroup:"group col-span-full flex flex-col gap-s p-s border border-info rounded-medium",header:"flex gap-s",body:cn("group grid gap-x-s empty:hidden",o?"grid-cols-[10px_minmax(100px,_1fr)_min-content]":"grid-cols-[minmax(100px,_1fr)_min-content]"),combinators:"my-s",addRule:"",addGroup:"",cloneRule:"fg-interactive hover:fg-interactive-hover",cloneGroup:"fg-interactive hover:fg-interactive-hover",removeGroup:"",rule:cn("flex gap-xs py-s",l==="vertical"?"flex-col":"min-height-[50px] items-start"),fields:"w-full",operators:"",value:"w-full",removeRule:"",valid:"",invalid:"",disabled:"",lockRule:"fg-interactive hover:fg-interactive-hover",lockGroup:"fg-interactive hover:fg-interactive-hover",valueSource:"",valueListItem:""}),[l,o]),Q=useMemo(()=>({...y,...r}),[r,y]),E=createContext({orientation:l,showRuleLines:o});return jsx(QueryBuilder,{showNotToggle:false,showShiftActions:false,enableDragAndDrop:false,controlClassnames:Q,controlElements:G,context:E,listsAsArrays:true,...i})}t.CombinatorSelector=C;t.RemoveRuleAction=x;t.LockAction=u;t.CloneAction=p;t.ActionElement=ActionElement;t.Rule=Rule;t.RuleGroup=RuleGroup;t.RuleGroupHeaderComponent=RuleGroupHeaderComponent;t.RuleGroupFooterComponent=RuleGroupFooterComponent;t.getValidationResult=getValidationResult;t.ValueEditor=ValueEditor;t.ValueSelector=ValueSelector;export{t as QueryBuilder};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/query-builder/index.tsx"],"names":["CombinatorSelector","options","jsxs","Radio","v","g","handleOnChange","jsx","Label","e","V","option","Tooltip","a","RemoveRuleAction","className","handlePress","event","handleOnClick","m","f","IconButton","d","Icon","Delete","w","LockAction","LockFill","F","CloneAction","Duplicate","T","QueryBuilder","orientation","mergedElements","s","RuleGroup","B","P","b","A","ValueEditor","h","defaultClassnames","useMemo","R","mergedClassnames","QueryBuilderContext","createContext","D","RQBBuilder","S","L","I","k","ValueSelector"],"mappings":"ivBA2GO,IAAA,CAAA,CAAA,CAAA,GAAA,CAAA,0CACD,CAAA,EAAA,CAAA,iDAGGA,CAAmB,CAC1B,SAAAC,CACA,CAAA,CAAA,OACA,CAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,cAGEC,CAAAA,CAACC,CAAAA,CAAM,CAA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A,CAAA,CAAA,CAAA,aAIA1B,CAAAA,CAAC2C,CAAAA,CAAA,CACC,OAAAzC,GAAA,CAAA0C,YAAA,CAAA,CAAA,aACA,CAAA,KAAA,CAAA,gBACA,CAAA,KAAA,CAAA,iBACA,CAAA,KAAA,CAAA,iBACA,CAAA,CAAA,CAAA,eACSJ,CACT,CAAA,CAAA,OAAA,CAAA,CAAA,CAAA,aAMNf,CAAa,IAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,kBACA,CAAA,CAAA,CAAA,CAAA,CAAA,gBACA,CAAA,CAAA,CAAA,CAAaN,CAAAA,UACb,CAAA,CAAA,CAAA,CAAA,CAAcG,WACd,CAAA,CAAA,CAAA,CAAA,CAAA,aAEbG,CAAAA,aAAa,CAAA,CAAA,CAAA,IAAA,CAAAM,IAAA,CAAYF,CAAAA,CACzBJ,SAAa,CAAAK,SAAA,CAAA,CAAA,CAAA,wBACA,CAAAe,wBAAA,CAAA,CAAA,CAAA,wBACA,CAAAC,wBAAA,CAAA,CAAA,CAAA,mBACA,CAAAC,mBAAA,CAAA,CAAA,CAAcb,WACd,CAAAC,WAAA,CAAA,CAAA,CAAA,aAAgBa,CAAAA,aAAAA","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 { Duplicate, LockFill } from '@accelint/icons';\nimport { Delete } from '@accelint/icons';\nimport type { PressEvent } from '@react-types/shared';\nimport { type ReactElement, createContext, useCallback, useMemo } from 'react';\nimport {\n type ActionProps,\n type Classnames,\n type CombinatorSelectorProps,\n type FullCombinator,\n type FullField,\n type FullOperator,\n QueryBuilder as RQBBuilder,\n type Classnames as RQBClassnames,\n type Field as RQBField,\n type QueryBuilderProps as RQBProps,\n type RuleGroupType as RQBRuleGroupType,\n type ValueEditorProps,\n} from 'react-querybuilder';\nimport type { LiteralUnion } from 'type-fest';\nimport { cn } from '../../lib/utils';\nimport { Icon } from '../icon';\nimport { IconButton } from '../icon-button';\nimport { Label } from '../label';\nimport { Radio } from '../radio';\nimport { Tooltip } from '../tooltip';\nimport { ActionElement } from './action-element';\nimport {\n RuleGroup,\n RuleGroupFooterComponent,\n RuleGroupHeaderComponent,\n} from './group';\nimport { Rule } from './rule';\nimport { getValidationResult, pressToMouseEvent } from './utils';\nimport { ValueEditor } from './value-editor';\nimport { ValueSelector } from './value-selector';\n\nexport type RuleGroupType = RQBRuleGroupType;\nexport type Field = RQBField;\n\nexport type DefaultRQBProps = RQBProps<\n RuleGroupType,\n FullField,\n FullOperator,\n FullCombinator\n>;\n\n// TODO: need to add multiselect back in when we have a compatible component\nexport type QueryBuilderValueEditors = Record<\n LiteralUnion<\n Exclude<ValueEditorProps['type'], null | undefined | 'multiselect'>,\n string\n >,\n (props: ValueEditorProps) => ReactElement\n>;\n\n/**\n * Omitted props are currently unsupported functionality\n */\nexport type QueryBuilderProps = Partial<\n Omit<\n DefaultRQBProps,\n | 'showCombinatorsBetweenRules'\n | 'independentCombinators'\n | 'listsAsArrays'\n | 'enableDragAndDrop'\n | 'showNotToggle'\n | 'showShiftActions'\n > & {\n orientation?: 'horizontal' | 'vertical';\n showRuleLines?: boolean;\n }\n>;\n\n/**\n * Omitted classnames are for unsupported features\n */\nexport type ClassNames = Omit<\n RQBClassnames,\n | 'betweenRules'\n | 'branches'\n | 'dndDragging'\n | 'dndOver'\n | 'dndCopy'\n | 'dndGroup'\n | 'dragHandle'\n | 'shiftActions'\n | 'notToggle'\n>;\n\nexport type QueryBuilderContextType = Pick<\n QueryBuilderProps,\n 'showRuleLines' | 'orientation'\n>;\n\nconst operatorDescriptions: Record<string, string> = {\n AND: 'All rules below must be true for a match',\n OR: 'One of the rules below must be true for a match',\n};\n\nfunction CombinatorSelector({\n options,\n value,\n handleOnChange,\n}: CombinatorSelectorProps) {\n return (\n <Radio.Group\n value={value}\n onChange={handleOnChange}\n orientation='horizontal'\n >\n <Label>Combinator</Label>\n {options.map((option) => (\n <Radio key={option.label} value={option.label}>\n <Tooltip>\n <Tooltip.Trigger>\n <span>{option.label}</span>\n </Tooltip.Trigger>\n <Tooltip.Body placement='top'>\n {operatorDescriptions[option.label]}\n </Tooltip.Body>\n </Tooltip>\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nfunction RemoveRuleAction({ handleOnClick, className, ...rest }: 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 return (\n <IconButton\n size='small'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Delete />\n </Icon>\n </IconButton>\n );\n}\n\nfunction LockAction({ handleOnClick, className, ...rest }: 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 return (\n <IconButton\n size={'small'}\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <LockFill />\n </Icon>\n </IconButton>\n );\n}\n\nfunction CloneAction({ handleOnClick, className, ...rest }: 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 return (\n <IconButton\n size={'small'}\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Duplicate />\n </Icon>\n </IconButton>\n );\n}\n\nexport function QueryBuilder({\n controlClassnames,\n controlElements,\n orientation = 'horizontal',\n showRuleLines = true,\n ...rest\n}: QueryBuilderProps) {\n /**\n * Represents the list of available controls that the component can use as a custom\n * component override.Passed in as a map of our custom defaults, but can be\n * overridden by using the controlElements prop\n */\n const mergedElements = useMemo(\n () => ({\n combinatorSelector: CombinatorSelector,\n cloneGroupAction: CloneAction,\n cloneRuleAction: CloneAction,\n removeRuleAction: RemoveRuleAction,\n lockGroupAction: LockAction,\n lockRuleAction: LockAction,\n ruleGroup: RuleGroup,\n rule: Rule,\n actionElement: ActionElement,\n valueSelector: ValueSelector,\n valueEditor: ValueEditor,\n ...controlElements,\n }),\n [controlElements],\n );\n\n /**\n * Represents the list of available classnames that the component will recognize.\n * Passed in as a map as all the default styling, but can be overridden by using the\n * controlClassnames prop\n */\n const defaultClassnames: Partial<Classnames> = useMemo(\n () => ({\n queryBuilder: 'border border-transparent',\n ruleGroup:\n 'group col-span-full flex flex-col gap-s p-s border border-info rounded-medium',\n header: 'flex gap-s',\n body: cn(\n 'group grid gap-x-s empty:hidden',\n showRuleLines\n ? 'grid-cols-[10px_minmax(100px,_1fr)_min-content]'\n : 'grid-cols-[minmax(100px,_1fr)_min-content]',\n ),\n combinators: 'my-s',\n addRule: '',\n addGroup: '',\n cloneRule: 'fg-interactive hover:fg-interactive-hover',\n cloneGroup: 'fg-interactive hover:fg-interactive-hover',\n removeGroup: '',\n rule: cn(\n 'flex gap-xs py-s',\n orientation === 'vertical'\n ? 'flex-col'\n : 'min-height-[50px] items-start',\n ),\n fields: 'w-full',\n operators: '',\n value: 'w-full',\n removeRule: '',\n valid: '',\n invalid: '',\n disabled: '',\n lockRule: 'fg-interactive hover:fg-interactive-hover',\n lockGroup: 'fg-interactive hover:fg-interactive-hover',\n valueSource: '',\n valueListItem: '',\n }),\n [orientation, showRuleLines],\n );\n\n const mergedClassnames = useMemo(() => {\n return {\n ...defaultClassnames,\n ...controlClassnames,\n };\n }, [controlClassnames, defaultClassnames]);\n\n const QueryBuilderContext = createContext<QueryBuilderContextType>({\n orientation,\n showRuleLines,\n });\n\n return (\n <RQBBuilder\n showNotToggle={false}\n showShiftActions={false}\n enableDragAndDrop={false}\n controlClassnames={mergedClassnames}\n controlElements={mergedElements}\n context={QueryBuilderContext}\n listsAsArrays\n {...rest}\n />\n );\n}\n\nQueryBuilder.CombinatorSelector = CombinatorSelector;\nQueryBuilder.RemoveRuleAction = RemoveRuleAction;\nQueryBuilder.LockAction = LockAction;\nQueryBuilder.CloneAction = CloneAction;\nQueryBuilder.ActionElement = ActionElement;\nQueryBuilder.Rule = Rule;\nQueryBuilder.RuleGroup = RuleGroup;\nQueryBuilder.RuleGroupHeaderComponent = RuleGroupHeaderComponent;\nQueryBuilder.RuleGroupFooterComponent = RuleGroupFooterComponent;\nQueryBuilder.getValidationResult = getValidationResult;\nQueryBuilder.ValueEditor = ValueEditor;\nQueryBuilder.ValueSelector = ValueSelector;\n"]}
1
+ {"version":3,"sources":["../../../src/components/query-builder/index.tsx"],"names":["CombinatorSelector","options","jsxs","Radio","v","g","handleOnChange","jsx","Label","e","V","option","Tooltip","a","RemoveRuleAction","className","handlePress","event","handleOnClick","m","f","Button","c","Icon","Delete","T","LockAction","LockFill","w","CloneAction","Duplicate","F","QueryBuilder","orientation","mergedElements","s","RuleGroup","B","P","b","A","ValueEditor","h","defaultClassnames","useMemo","R","mergedClassnames","QueryBuilderContext","createContext","D","RQBBuilder","S","k","L","N","ValueSelector"],"mappings":"4vBA4GO,IAAA,CAAA,CAAA,CAAA,GAAA,CAAA,0CACD,CAAA,EAAA,CAAA,iDAGGA,CAAmB,CAC1B,SAAAC,CACA,CAAA,CAAA,OACA,CAAA,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,cAGEC,CAAAA,CAACC,CAAAA,CAAM,CAAA,OACLC,IAAA,CAAAC,KAAA,CAAA,KACA,CAAA,CAAA,KAAUC,CAAAA,CACV,CAAA,QAAA,CAAA,CAAA,CAAY,WAAA,CAAA,YAEZC,CAACC,QAAM,CAAA,CAAAC,GAAA,CAAAC,KAAA,CAAA,CAAA,QAAA,CAAA,YAELH,CAAA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A,CAAA,KAAA,CAAA,gBACA,CAAA,KAAA,CAAA,iBACA,CAAA,KAAA,CAAA,iBACA,CAAA,CAAA,CAAA,eACSJ,CACT,CAAA,CAAA,OAAA,CAAA,CAAA,CAAA,aAMNf,CAAa,IAAA,CAAA,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,kBACA,CAAA,CAAA,CAAA,CAAA,CAAA,gBACA,CAAA,CAAA,CAAA,CAAaN,CAAAA,UACb,CAAA,CAAA,CAAA,CAAA,CAAcG,WACd,CAAA,CAAA,CAAA,CAAA,CAAA,aAEbG,CAAAA,aAAa,CAAA,CAAA,CAAA,IAAA,CAAAM,IAAA,CAAYF,CAAAA,CACzBJ,SAAa,CAAAK,SAAA,CAAA,CAAA,CAAA,wBACA,CAAAe,wBAAA,CAAA,CAAA,CAAA,wBACA,CAAAC,wBAAA,CAAA,CAAA,CAAA,mBACA,CAAAC,mBAAA,CAAA,CAAA,CAAcb,WACd,CAAAC,WAAA,CAAA,CAAA,CAAA,aAAgBa,CAAAA,aAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { Delete, Duplicate, LockFill } from '@accelint/icons';\nimport type { PressEvent } from '@react-types/shared';\nimport 'client-only';\nimport { type ReactElement, createContext, useCallback, useMemo } from 'react';\nimport {\n type ActionProps,\n type Classnames,\n type CombinatorSelectorProps,\n type FullCombinator,\n type FullField,\n type FullOperator,\n QueryBuilder as RQBBuilder,\n type Classnames as RQBClassnames,\n type Field as RQBField,\n type QueryBuilderProps as RQBProps,\n type RuleGroupType as RQBRuleGroupType,\n type ValueEditorProps,\n} from 'react-querybuilder';\nimport type { LiteralUnion } from 'type-fest';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Radio } from '../radio';\nimport { Tooltip } from '../tooltip';\nimport { ActionElement } from './action-element';\nimport {\n RuleGroup,\n RuleGroupFooterComponent,\n RuleGroupHeaderComponent,\n} from './group';\nimport { Rule } from './rule';\nimport { getValidationResult, pressToMouseEvent } from './utils';\nimport { ValueEditor } from './value-editor';\nimport { ValueSelector } from './value-selector';\n\nexport type RuleGroupType = RQBRuleGroupType;\nexport type Field = RQBField;\n\nexport type DefaultRQBProps = RQBProps<\n RuleGroupType,\n FullField,\n FullOperator,\n FullCombinator\n>;\n\n// TODO: need to add multiselect back in when we have a compatible component\nexport type QueryBuilderValueEditors = Record<\n LiteralUnion<\n Exclude<ValueEditorProps['type'], null | undefined | 'multiselect'>,\n string\n >,\n (props: ValueEditorProps) => ReactElement\n>;\n\n/**\n * Omitted props are currently unsupported functionality\n */\nexport type QueryBuilderProps = Partial<\n Omit<\n DefaultRQBProps,\n | 'showCombinatorsBetweenRules'\n | 'independentCombinators'\n | 'listsAsArrays'\n | 'enableDragAndDrop'\n | 'showNotToggle'\n | 'showShiftActions'\n > & {\n orientation?: 'horizontal' | 'vertical';\n showRuleLines?: boolean;\n }\n>;\n\n/**\n * Omitted classnames are for unsupported features\n */\nexport type ClassNames = Omit<\n RQBClassnames,\n | 'betweenRules'\n | 'branches'\n | 'dndDragging'\n | 'dndOver'\n | 'dndCopy'\n | 'dndGroup'\n | 'dragHandle'\n | 'shiftActions'\n | 'notToggle'\n>;\n\nexport type QueryBuilderContextType = Pick<\n QueryBuilderProps,\n 'showRuleLines' | 'orientation'\n>;\n\nconst operatorDescriptions: Record<string, string> = {\n AND: 'All rules below must be true for a match',\n OR: 'One of the rules below must be true for a match',\n};\n\nfunction CombinatorSelector({\n options,\n value,\n handleOnChange,\n}: CombinatorSelectorProps) {\n return (\n <Radio.Group\n value={value}\n onChange={handleOnChange}\n orientation='horizontal'\n >\n <Label>Combinator</Label>\n {options.map((option) => (\n <Radio key={option.label} value={option.label}>\n <Tooltip>\n <Tooltip.Trigger>\n <span>{option.label}</span>\n </Tooltip.Trigger>\n <Tooltip.Body placement='top'>\n {operatorDescriptions[option.label]}\n </Tooltip.Body>\n </Tooltip>\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nfunction RemoveRuleAction({ handleOnClick, className, ...rest }: 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 return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Delete />\n </Icon>\n </Button>\n );\n}\n\nfunction LockAction({ handleOnClick, className, ...rest }: 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 return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <LockFill />\n </Icon>\n </Button>\n );\n}\n\nfunction CloneAction({ handleOnClick, className, ...rest }: 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 return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Duplicate />\n </Icon>\n </Button>\n );\n}\n\nexport function QueryBuilder({\n controlClassnames,\n controlElements,\n orientation = 'horizontal',\n showRuleLines = true,\n ...rest\n}: QueryBuilderProps) {\n /**\n * Represents the list of available controls that the component can use as a custom\n * component override.Passed in as a map of our custom defaults, but can be\n * overridden by using the controlElements prop\n */\n const mergedElements = useMemo(\n () => ({\n combinatorSelector: CombinatorSelector,\n cloneGroupAction: CloneAction,\n cloneRuleAction: CloneAction,\n removeRuleAction: RemoveRuleAction,\n lockGroupAction: LockAction,\n lockRuleAction: LockAction,\n ruleGroup: RuleGroup,\n rule: Rule,\n actionElement: ActionElement,\n valueSelector: ValueSelector,\n valueEditor: ValueEditor,\n ...controlElements,\n }),\n [controlElements],\n );\n\n /**\n * Represents the list of available classnames that the component will recognize.\n * Passed in as a map as all the default styling, but can be overridden by using the\n * controlClassnames prop\n */\n const defaultClassnames: Partial<Classnames> = useMemo(\n () => ({\n queryBuilder: 'border border-transparent',\n ruleGroup:\n 'group col-span-full flex flex-col gap-s p-s border border-info rounded-medium',\n header: 'flex gap-s',\n body: cn(\n 'group grid gap-x-s empty:hidden',\n showRuleLines\n ? 'grid-cols-[10px_minmax(100px,_1fr)_min-content]'\n : 'grid-cols-[minmax(100px,_1fr)_min-content]',\n ),\n combinators: 'my-s',\n addRule: '',\n addGroup: '',\n cloneRule: 'fg-interactive hover:fg-interactive-hover',\n cloneGroup: 'fg-interactive hover:fg-interactive-hover',\n removeGroup: '',\n rule: cn(\n 'flex gap-xs py-s',\n orientation === 'vertical'\n ? 'flex-col'\n : 'min-height-[50px] items-start',\n ),\n fields: 'w-full',\n operators: '',\n value: 'w-full',\n removeRule: '',\n valid: '',\n invalid: '',\n disabled: '',\n lockRule: 'fg-interactive hover:fg-interactive-hover',\n lockGroup: 'fg-interactive hover:fg-interactive-hover',\n valueSource: '',\n valueListItem: '',\n }),\n [orientation, showRuleLines],\n );\n\n const mergedClassnames = useMemo(() => {\n return {\n ...defaultClassnames,\n ...controlClassnames,\n };\n }, [controlClassnames, defaultClassnames]);\n\n const QueryBuilderContext = createContext<QueryBuilderContextType>({\n orientation,\n showRuleLines,\n });\n\n return (\n <RQBBuilder\n showNotToggle={false}\n showShiftActions={false}\n enableDragAndDrop={false}\n controlClassnames={mergedClassnames}\n controlElements={mergedElements}\n context={QueryBuilderContext}\n listsAsArrays\n {...rest}\n />\n );\n}\n\nQueryBuilder.CombinatorSelector = CombinatorSelector;\nQueryBuilder.RemoveRuleAction = RemoveRuleAction;\nQueryBuilder.LockAction = LockAction;\nQueryBuilder.CloneAction = CloneAction;\nQueryBuilder.ActionElement = ActionElement;\nQueryBuilder.Rule = Rule;\nQueryBuilder.RuleGroup = RuleGroup;\nQueryBuilder.RuleGroupHeaderComponent = RuleGroupHeaderComponent;\nQueryBuilder.RuleGroupFooterComponent = RuleGroupFooterComponent;\nQueryBuilder.getValidationResult = getValidationResult;\nQueryBuilder.ValueEditor = ValueEditor;\nQueryBuilder.ValueSelector = ValueSelector;\n"]}
@@ -1,2 +1,2 @@
1
- import {useCallback}from'react';import {useValueEditor}from'react-querybuilder';import {Checkbox}from'../checkbox/index.js';import {Radio}from'../radio/index.js';import {Switch}from'../switch/index.js';import {TextArea}from'../text-area/index.js';import {TextField}from'../text-field/index.js';import {multiValueOperators}from'./constants.js';import {getValidationResult}from'./utils.js';import {ValueSelector}from'./value-selector.js';import {jsx,Fragment}from'react/jsx-runtime';function x({disabled:a,fieldData:{name:e,validator:r},handleOnChange:l,rule:o,value:t}){let{valid:i}=getValidationResult(o,r);return jsx(Checkbox,{isDisabled:a,isSelected:t,onChange:l,"aria-invalid":!i,"aria-label":e})}function P({disabled:a,fieldData:{name:e,validator:r},handleOnChange:l,rule:o,value:t,values:i}){let{valid:u}=getValidationResult(o,r);return jsx(Radio.Group,{value:t,isDisabled:a,onChange:l,"aria-invalid":!u,"aria-label":e,"aria-labelledby":e,children:i?.map(n=>jsx(Radio,{value:n.value,children:n.label},n.name))})}var R=[];function S({disabled:a,fieldData:{name:e,validator:r},handleOnChange:l,rule:o,type:t,value:i,values:u=R,...n}){let{valid:p}=getValidationResult(o,r);return jsx(ValueSelector,{...n,disabled:a,multiple:t==="multiselect",options:u,title:e,validation:!p,value:i,handleOnChange:l,"aria-labelledby":e})}function T({disabled:a,fieldData:{name:e,validator:r},handleOnChange:l,rule:o,value:t}){let{valid:i}=getValidationResult(o,r);return jsx(Switch,{isDisabled:a,isSelected:!!t,onChange:l,"aria-invalid":!i,"aria-label":e,"aria-labelledby":e})}function w({disabled:a,fieldData:{name:e,placeholder:r,validator:l},handleOnChange:o,inputType:t,rule:i,value:u}){let{valid:n,reasons:p}=getValidationResult(i,l);return jsx(TextField,{isDisabled:a,isInvalid:!n,placeholder:r,type:t??"text",size:"small",value:u,onChange:o,"aria-invalid":!n,"aria-label":e,"aria-labelledby":e,errorMessage:p?.join("/n")})}function I({disabled:a,fieldData:{name:e,placeholder:r,validator:l},handleOnChange:o,rule:t,value:i}){let{valid:u,reasons:n}=getValidationResult(t,l);return jsx(TextArea,{isDisabled:a,isInvalid:!u,placeholder:r,value:i,onChange:o,"aria-label":e,"aria-invalid":!u,"aria-labelledby":e,errorMessage:n?.join("/n")})}var O={checkbox:x,radio:P,select:S,switch:T,text:w,textarea:I};function q(a){let{fieldData:{name:e,valueEditorType:r},operator:l,rule:o}=a,{valueAsArray:t,multiValueHandler:i}=useValueEditor({...a,skipHook:true}),u=useCallback(s=>({...o,value:t[s]}),[o,t]),n=useCallback(s=>i(s,0),[i]),p=useCallback(s=>i(s,1),[i]),E=(typeof r=="function"?r(l):r)??"text",f=O?.[E];return l==="null"||l==="notNull"||!f?null:multiValueOperators.includes(l)?jsx(Fragment,{children:["start","end"].map((s,v)=>jsx("div",{children:jsx(f,{...a,rule:u(v),value:t[v],handleOnChange:v?p:n})},`${e}-${s}`))}):jsx("div",{children:jsx(f,{...a})})}export{q as ValueEditor};//# sourceMappingURL=value-editor.js.map
1
+ import {useCallback}from'react';import {useValueEditor}from'react-querybuilder';import {Checkbox}from'../checkbox/index.js';import {Radio}from'../radio/index.js';import {Switch}from'../switch/index.js';import {TextAreaField}from'../text-area-field/index.js';import {TextField}from'../text-field/index.js';import {multiValueOperators}from'./constants.js';import {getValidationResult}from'./utils.js';import {ValueSelector}from'./value-selector.js';import {jsx,Fragment}from'react/jsx-runtime';function k({disabled:a,fieldData:{name:e,validator:t},handleOnChange:l,rule:o,value:r}){let{valid:i}=getValidationResult(o,t);return jsx(Checkbox,{isDisabled:a,isSelected:r,onChange:l,"aria-invalid":!i,"aria-label":e})}function x({disabled:a,fieldData:{name:e,validator:t},handleOnChange:l,rule:o,value:r,values:i}){let{valid:u}=getValidationResult(o,t);return jsx(Radio.Group,{value:r,isDisabled:a,onChange:l,"aria-invalid":!u,"aria-label":e,"aria-labelledby":e,children:i?.map(n=>jsx(Radio,{value:n.value,children:n.label},n.name))})}var R=[];function S({disabled:a,fieldData:{name:e,validator:t},handleOnChange:l,rule:o,type:r,value:i,values:u=R,...n}){let{valid:p}=getValidationResult(o,t);return jsx(ValueSelector,{...n,disabled:a,multiple:r==="multiselect",options:u,title:e,validation:!p,value:i,handleOnChange:l,"aria-labelledby":e})}function T({disabled:a,fieldData:{name:e,validator:t},handleOnChange:l,rule:o,value:r}){let{valid:i}=getValidationResult(o,t);return jsx(Switch,{isDisabled:a,isSelected:!!r,onChange:l,"aria-invalid":!i,"aria-label":e,"aria-labelledby":e})}function w({disabled:a,fieldData:{name:e,placeholder:t,validator:l},handleOnChange:o,inputType:r,rule:i,value:u}){let{valid:n,reasons:p}=getValidationResult(i,l);return jsx(TextField,{isDisabled:a,isInvalid:!n,placeholder:t,type:r??"text",size:"small",value:u,onChange:o,"aria-invalid":!n,"aria-label":e,"aria-labelledby":e,errorMessage:p?.join("/n")})}function I({disabled:a,fieldData:{name:e,placeholder:t,validator:l},handleOnChange:o,rule:r,value:i}){let{valid:u,reasons:n}=getValidationResult(r,l);return jsx(TextAreaField,{size:"small",errorMessage:n?.join("/n"),inputProps:{placeholder:t},value:i,isDisabled:a,isInvalid:!u,onChange:o,"aria-label":e,"aria-invalid":!u,"aria-labelledby":e})}var O={checkbox:k,radio:x,select:S,switch:T,text:w,textarea:I};function q(a){let{fieldData:{name:e,valueEditorType:t},operator:l,rule:o}=a,{valueAsArray:r,multiValueHandler:i}=useValueEditor({...a,skipHook:true}),u=useCallback(s=>({...o,value:r[s]}),[o,r]),n=useCallback(s=>i(s,0),[i]),p=useCallback(s=>i(s,1),[i]),E=(typeof t=="function"?t(l):t)??"text",f=O?.[E];return l==="null"||l==="notNull"||!f?null:multiValueOperators.includes(l)?jsx(Fragment,{children:["start","end"].map((s,v)=>jsx("div",{children:jsx(f,{...a,rule:u(v),value:r[v],handleOnChange:v?p:n})},`${e}-${s}`))}):jsx("div",{children:jsx(f,{...a})})}export{q as ValueEditor};//# sourceMappingURL=value-editor.js.map
2
2
  //# sourceMappingURL=value-editor.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/query-builder/value-editor.tsx"],"names":["name","rule","value","validator","c","jsx","d","h","values","m","option","defaultOptions","type","rest","k","y","valid","reasons","C","inputType","g","valueEditors","RadioGroupValueEditor","SelectValueEditor","SwitchValueEditor","TextValueEditor","ruleProp","props","V","useCallback","index","b","valueAsArray","handleRangeStartChange","multiValueHandler","handleRangeEndChange","valueEditorType","Editor","operator","multiValueOperators","D","term"],"mappings":"ieA6BA,oBAEE,CAAA,CAAA,CAAA,SAAaA,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,2BAEnBC,CAAAA,CACA,CAAA,IAAA,CAAAC,CACF,CAAA,KACQ,CAAE,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,KAA8BC,CAAS,CAAA,CAErD,CAAAC,mBAAA,CAAA,CAAA,CAAA,CAAA,CACEC,CAAAA,OACEC,GAAA,CAAAC,QAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,cACA,CAAA,CAAA,CAAA,CAAA,YAKN,CAAA,CAAA,CAAA,CAAA,CAAA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAAaP,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,SACnB,CAAA,CAAA,CAAA,CAAA,cACAC,CAAAA,CACA,CAAA,IAAA,CAAAC,CAAAA,CACA,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,CAAuBN,CAAAA,CAC1B3B,CAAAA,CAAAA,CAAkBgC,EAAkBhC,CAAAA,WAAO,CAAC,CAAA,EAC5CgC,CAAiB,CACpB,CAAA,CAEMtB,CAAAA,CAAAA,CACH,OAAOwB,CAAAA,OAAoB,CAAA,EAAA,UAExBA,CAAAA,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,GAEpBC,MAA4B,CAAA,CAElC,CAAA,CAAA,GAAA,CAAA,CAAIC,CAAAA,OAAa,CAAA,GAAUA,MAAa,EAAA,CAAA,GAAA,SAC/B,EAGLC,CAAAA,CAAoB,CAAA,IAAA,CAAAC,mBAAA,CAAA,QAEpB,CACG,yBAAC,CAAA,CAAS,OAAO,CAAA,KAAKC,CAAMX,CAAAA,GAC3BzB,CAAAA,CAAC,SACC,CAAA,KAAA,CAAA,CAAA,QACG,CAAGsB,GAAAA,CACJ,CAAA,CAAA,CAAA,GAAM1B,CAAK6B,CAAK,IAChB,CAAA,CAAA,CAAA,CAAOE,CAAAA,CAAaF,KACpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,cAGF,CAAA,CARQ,CAAA,CAAA,CAAG9B,CAAI,CAAA,CAAA,CAAA,CAAIyC,CAAI,EASzB,CACD,CAAA,CACH,EAKFpC,CAAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,GACC,CAAA,KAAA,CAAA,CAAA,QAAS,CAAGqB,GAAAA,CAAO,EACrB,CAEJ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"value-editor.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useCallback } from 'react';\nimport {\n type InputType,\n type ValueEditorProps,\n useValueEditor,\n} from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { Switch } from '../switch';\nimport { TextArea } from '../text-area';\nimport { TextField } from '../text-field';\nimport type { QueryBuilderValueEditors } from './';\nimport { multiValueOperators } from './constants';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\n\nfunction CheckboxValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Radio.Group\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n isDisabled={disabled}\n isInvalid={!valid}\n placeholder={placeholder}\n type={(inputType as InputType) ?? 'text'}\n size='small'\n value={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextArea\n isDisabled={disabled}\n isInvalid={!valid}\n placeholder={placeholder}\n value={value}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/query-builder/value-editor.tsx"],"names":["name","rule","value","validator","c","jsx","d","h","values","m","option","defaultOptions","type","rest","P","y","valid","reasons","C","inputType","g","valueEditors","RadioGroupValueEditor","SelectValueEditor","SwitchValueEditor","TextValueEditor","ruleProp","props","V","useCallback","index","b","valueAsArray","handleRangeStartChange","multiValueHandler","handleRangeEndChange","valueEditorType","Editor","operator","multiValueOperators","D","term"],"mappings":"4eA6BA,oBAEE,CAAA,CAAA,CAAA,SAAaA,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,2BAEnBC,CAAAA,CACA,CAAA,IAAA,CAAAC,CACF,CAAA,KACQ,CAAE,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,KAA8BC,CAAS,CAAA,CAErD,CAAAC,mBAAA,CAAA,CAAA,CAAA,CAAA,CACEC,QACEC,GAAA,CAAAC,QAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,yBAEA,CAAA,CAAA,CAAA,CAAA,YAKN,CAAA,CAAA,CAAA,CAAA,CAAA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SAAaP,CAAM,CAAA,IAAA,CAAA,CAAA,CAAA,SACnB,CAAA,CAAA,CAAA,CAAA,cACAC,CAAAA,CACA,CAAA,IAAA,CAAAC,CAAAA,CACA,KAAA,CAAA,CAAAM,CACF,MACQ,CAAE,CAAA,CAAA,CAAA,CAAA,GAAM,CAAA,KAA8BL,CAA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AAa,CAAA,GAAUA,MAAa,EAAA,CAAA,GAAA,SAC/B,EAGLC,CAAAA,CAAoB,CAAA,IAAA,CAAAC,mBAAA,CAAA,QAEpB,CACG,yBAAC,CAAA,CAAS,OAAO,CAAA,KAAKC,CAAMX,CAAAA,GAC3BzB,CAAAA,CAAC,SACC,CAAA,KAAA,CAAA,CAAA,QACG,CAAGsB,GAAAA,CACJ,CAAA,CAAA,CAAA,GAAM1B,CAAK6B,CAAK,IAChB,CAAA,CAAA,CAAA,CAAOE,CAAAA,CAAaF,KACpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,cAGF,CAAA,CARQ,CAAA,CAAA,CAAG9B,CAAI,CAAA,CAAA,CAAA,CAAIyC,CAAI,EASzB,CACD,CAAA,CACH,EAKFpC,CAAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAC,GACC,CAAA,KAAA,CAAA,CAAA,QAAS,CAAGqB,GAAAA,CAAO,EACrB,CAEJ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"value-editor.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { useCallback } from 'react';\nimport {\n type InputType,\n type ValueEditorProps,\n useValueEditor,\n} from 'react-querybuilder';\nimport { Checkbox } from '../checkbox';\nimport { Radio } from '../radio';\nimport { Switch } from '../switch';\nimport { TextAreaField } from '../text-area-field';\nimport { TextField } from '../text-field';\nimport type { QueryBuilderValueEditors } from './';\nimport { multiValueOperators } from './constants';\nimport { getValidationResult } from './utils';\nimport { ValueSelector } from './value-selector';\n\nfunction CheckboxValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Checkbox\n isDisabled={disabled}\n isSelected={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n />\n );\n}\n\nfunction RadioGroupValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n values,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Radio.Group\n value={value}\n isDisabled={disabled}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n >\n {values?.map((option) => (\n <Radio key={option.name} value={option.value}>\n {option.label}\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nconst defaultOptions: unknown[] = [];\n\nfunction SelectValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n type,\n value,\n values = defaultOptions,\n ...rest\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <ValueSelector\n {...rest}\n disabled={disabled}\n multiple={type === 'multiselect'}\n options={values}\n title={name}\n validation={!valid}\n value={value}\n handleOnChange={handleOnChange}\n aria-labelledby={name}\n />\n );\n}\n\nfunction SwitchValueEditor({\n disabled,\n fieldData: { name, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid } = getValidationResult(rule, validator);\n\n return (\n <Switch\n isDisabled={disabled}\n isSelected={Boolean(value)}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n />\n );\n}\n\nfunction TextValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n inputType,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextField\n isDisabled={disabled}\n isInvalid={!valid}\n placeholder={placeholder}\n type={(inputType as InputType) ?? 'text'}\n size='small'\n value={value}\n onChange={handleOnChange}\n aria-invalid={!valid}\n aria-label={name}\n aria-labelledby={name}\n errorMessage={reasons?.join('/n')}\n />\n );\n}\n\nfunction TextareaValueEditor({\n disabled,\n fieldData: { name, placeholder, validator },\n handleOnChange,\n rule,\n value,\n}: ValueEditorProps) {\n const { valid, reasons } = getValidationResult(rule, validator);\n\n return (\n <TextAreaField\n size='small'\n errorMessage={reasons?.join('/n')}\n inputProps={{ placeholder }}\n value={value}\n isDisabled={disabled}\n isInvalid={!valid}\n onChange={handleOnChange}\n aria-label={name}\n aria-invalid={!valid}\n aria-labelledby={name}\n />\n );\n}\n\nconst valueEditors: QueryBuilderValueEditors = {\n checkbox: CheckboxValueEditor,\n radio: RadioGroupValueEditor,\n select: SelectValueEditor,\n switch: SwitchValueEditor,\n text: TextValueEditor,\n textarea: TextareaValueEditor,\n};\n\nexport function ValueEditor(props: ValueEditorProps) {\n const {\n fieldData: { name, valueEditorType },\n operator,\n rule: ruleProp,\n } = props;\n\n const { valueAsArray, multiValueHandler } = useValueEditor({\n ...props,\n skipHook: true,\n });\n\n const rule = useCallback(\n (index: number) => ({\n ...ruleProp,\n value: valueAsArray[index],\n }),\n [ruleProp, valueAsArray],\n );\n\n const handleRangeStartChange = useCallback(\n (value: string) => multiValueHandler(value, 0),\n [multiValueHandler],\n );\n\n const handleRangeEndChange = useCallback(\n (value: string) => multiValueHandler(value, 1),\n [multiValueHandler],\n );\n\n const type =\n (typeof valueEditorType === 'function'\n ? valueEditorType(operator)\n : valueEditorType) ?? 'text';\n\n const Editor = valueEditors?.[type];\n\n if (operator === 'null' || operator === 'notNull' || !Editor) {\n return null;\n }\n\n if (multiValueOperators.includes(operator)) {\n return (\n <>\n {['start', 'end'].map((term, index) => (\n <div key={`${name}-${term}`}>\n <Editor\n {...props}\n rule={rule(index)}\n value={valueAsArray[index]}\n handleOnChange={\n index ? handleRangeEndChange : handleRangeStartChange\n }\n />\n </div>\n ))}\n </>\n );\n }\n\n return (\n <div>\n <Editor {...props} />\n </div>\n );\n}\n"]}
@@ -1,16 +1,18 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React__default from 'react';
3
- import { RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1 } from 'react-aria-components';
2
+ import * as react from 'react';
3
+ import { ContextValue } from 'react-aria-components';
4
+ import { RadioProps, RadioGroupProps } from './types.js';
5
+ import '../label/types.js';
4
6
 
5
- interface RadioProps extends RadioProps$1 {
7
+ declare const RadioContext: react.Context<ContextValue<RadioGroupProps, HTMLDivElement>>;
8
+ declare function RadioGroup({ ref, ...props }: RadioGroupProps): react_jsx_runtime.JSX.Element;
9
+ declare namespace RadioGroup {
10
+ var displayName: string;
6
11
  }
7
- declare function Radio({ className, children, ...args }: RadioProps): react_jsx_runtime.JSX.Element;
12
+ declare function Radio({ classNames, children, ...rest }: RadioProps): react_jsx_runtime.JSX.Element;
8
13
  declare namespace Radio {
14
+ var displayName: string;
9
15
  var Group: typeof RadioGroup;
10
16
  }
11
- interface RadioGroupProps extends RadioGroupProps$1 {
12
- label?: string | React__default.JSX.Element;
13
- }
14
- declare function RadioGroup({ children, className, label, ...props }: RadioGroupProps): react_jsx_runtime.JSX.Element;
15
17
 
16
- export { Radio, type RadioGroupProps, type RadioProps };
18
+ export { Radio, RadioContext };
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import {cva}from'cva';import {Radio,RadioGroup,composeRenderProps}from'react-aria-components';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var v=cva("fg-default-light flex size-l items-center justify-center rounded-round outline outline-interactive before:block before:size-s before:rounded-round before:bg-transparent",{variants:{isSelected:{true:"outline-highlight before:bg-highlight"},isFocused:{true:"outline-interactive-hover hover:outline-interactive-hover"},isHovered:{true:"outline-interactive-hover hover:outline-interactive-hover"},isDisabled:{true:"outline-interactive-disabled"}},compoundVariants:[{isDisabled:true,isSelected:true,className:"hover:interactive-disabled outline-interactive-disabled before:bg-interactive-disabled"},{isDisabled:true,className:"hover:interactive-disabled outline-interactive-disabled"}],defaultVariants:{isDisabled:false,isFocused:false,isHovered:false,isSelected:false}});function m({className:i,children:o,...t}){return jsx(Radio,{...t,className:cn("fg-default-light flex items-center gap-m dtk-disabled:text-interactive-disabled",i),children:e=>jsxs(Fragment,{children:[jsx("div",{className:cn(v({isDisabled:e.isDisabled,isFocused:e.isFocused,isHovered:e.isHovered,isSelected:e.isSelected})),"aria-hidden":true}),typeof o=="function"?o(e):o]})})}function R({children:i,className:o,label:t,...e}){return jsx(RadioGroup,{...e,className:composeRenderProps(o,(r,n)=>cn("fg-default-light flex flex-col gap-m text-body-s",n.orientation==="horizontal"&&"flex-row items-center",r)),children:r=>jsxs(Fragment,{children:[t?jsx(Label,{children:t}):void 0,typeof i=="function"?i(r):i]})})}m.Group=R;export{m as Radio};//# sourceMappingURL=index.js.map
1
+ import'client-only';import {createContext}from'react';import {Radio,composeRenderProps,useContextProps,RadioGroup}from'react-aria-components';import {Label}from'../label/index.js';import {RadioStyles}from'./styles.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var {group:y,groupLabel:C,radio:A,control:D,label:L}=RadioStyles(),g=createContext(null);function n({ref:o,...e}){[e,o]=useContextProps(e,o??null,g);let{children:s,classNames:a,label:t,isDisabled:p,isRequired:d,...c}=e;return jsx(RadioGroup,{...c,ref:o,className:composeRenderProps(a?.group,l=>y({className:l})),isDisabled:p,isRequired:d,children:composeRenderProps(s,l=>jsxs(Fragment,{children:[t&&jsx(Label,{className:C({className:a?.label}),isDisabled:p,isRequired:d,children:t}),l]}))})}n.displayName="Radio.Group";function u({classNames:o,children:e,...s}){return jsx(Radio,{...s,className:composeRenderProps(o?.radio,a=>A({className:a})),children:composeRenderProps(e,a=>jsxs(Fragment,{children:[jsx("span",{className:D({className:o?.control})}),jsx("span",{className:L({className:o?.label}),children:a})]}))})}u.displayName="Radio";u.Group=n;export{u as Radio,g as RadioContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/radio/index.tsx"],"names":["u","jsx","args","c","s","l","d","a","children","label","props","f","renderProps","cn","b","Radio","RadioGroup"],"mappings":"4NAyBE,IAAA,CAAA,CAAAA,GAAA,CAAA,0KAEE,CAAA,CAAA,QACE,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,uCAER,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,sEAGA,CAAA,CAAA,IAAA,CAAA,2DAER,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,8BAGV,CAAA,CAAA,CAAA,gBAEI,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,UACA,CAAA,IAAA,CAAA,SACE,CAAA,wFAGF,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,SAAW,CAAA,yDAGf,CAAA,CAAA,CAAA,eACE,CAAA,CAAA,UACA,CAAA,KAAA,CAAA,SACA,CAAA,KAAA,CAAA,0BAQC,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,SAAiB,CAAA,CAAA,CAAA,oBAA6B,CAAe,CAClE,OACEC,CAAAA,OACMC,GAAAA,CACJC,KAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SACE,CAAAC,EAAA,CAAA,iFAID,CAAA,CAAA,CAAA,CAAA,QACC,CACE,CAAA,EAAAC,IAAA,CAAAC,QAAA,CAAA,CAAA,QAAC,CAAA,CAAAC,GACC,CAAA,KAAA,CAAA,CAAA,0BAEsB,CAAA,CAAA,CAAA,oBACD,CAAA,CAAA,CAAA,SACjB,CAAA,SAAiB,CAAA,CAAA,CAAA,SACjB,CAAA,UAAkB,CAAA,CAAA,CAAA,UAGtB,CAAA,CAAA,CAAA,CAAA,aAED,CAAA,IAAA,CAAA,CAAOC,CAAAA,OAAa,CAAA,EAAA,UAA+BA,CACtD,CAAA,CAEJ,CAEJ,CAOA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SAAsB,CAAA,CAAA,CAAA,QAAU,CAAA,CAAA,CAAA,SAAW,CAAAC,EAAO,MAA6B,CAC7E,CAAA,GAAA,CAAA,CAAA,CACER,QACMS,GAAAA,CACJC,UAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SAAqDC,qBACnDC,CAAAA,CACE,CAAA,CAAA,CAAA,GAAAT,EAAA,CAAA,kDACY,CAAA,CAAA,CAAA,WAAgB,GAAA,YAAgB,EAAA,oCAO9C,CACG,CAAA,EAAAC,IAAA,CAAAC,QAAA,CAAA,CAAA,QAAS,CAAO,CAAA,CAAA,CAAAC,GAAA,CAAAO,KAAA,CAAA,CAAA,YAChB,CAAA,MAAON,CAAAA,OAAa,CAAA,EAAA,WACvB,CAAA,CAEJ,CAEJ,CAEAO,CAAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQC,CAAAA,CAAAA,KAAAA,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 { cva } from 'cva';\nimport type React from 'react';\nimport {\n Radio as AriaRadio,\n RadioGroup as AriaRadioGroup,\n type RadioGroupProps as AriaRadioGroupProps,\n type RadioProps as AriaRadioProps,\n composeRenderProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\n\nconst radioStyles = cva(\n 'fg-default-light flex size-l items-center justify-center rounded-round outline outline-interactive before:block before:size-s before:rounded-round before:bg-transparent',\n {\n variants: {\n isSelected: {\n true: 'outline-highlight before:bg-highlight',\n },\n isFocused: {\n true: 'outline-interactive-hover hover:outline-interactive-hover',\n },\n isHovered: {\n true: 'outline-interactive-hover hover:outline-interactive-hover',\n },\n isDisabled: {\n true: 'outline-interactive-disabled',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isSelected: true,\n className:\n 'hover:interactive-disabled outline-interactive-disabled before:bg-interactive-disabled',\n },\n {\n isDisabled: true,\n className: 'hover:interactive-disabled outline-interactive-disabled',\n },\n ],\n defaultVariants: {\n isDisabled: false,\n isFocused: false,\n isHovered: false,\n isSelected: false,\n },\n },\n);\n\nexport interface RadioProps extends AriaRadioProps {}\n\nexport function Radio({ className, children, ...args }: RadioProps) {\n return (\n <AriaRadio\n {...args}\n className={cn(\n 'fg-default-light flex items-center gap-m dtk-disabled:text-interactive-disabled',\n className,\n )}\n >\n {(props) => (\n <>\n <div\n className={cn(\n radioStyles({\n isDisabled: props.isDisabled,\n isFocused: props.isFocused,\n isHovered: props.isHovered,\n isSelected: props.isSelected,\n }),\n )}\n aria-hidden\n />\n {typeof children === 'function' ? children(props) : children}\n </>\n )}\n </AriaRadio>\n );\n}\n\nexport interface RadioGroupProps extends AriaRadioGroupProps {\n // children: React.JSX.Element;\n label?: string | React.JSX.Element;\n}\n\nfunction RadioGroup({ children, className, label, ...props }: RadioGroupProps) {\n return (\n <AriaRadioGroup\n {...props}\n className={composeRenderProps(className, (className, renderProps) =>\n cn(\n 'fg-default-light flex flex-col gap-m text-body-s',\n renderProps.orientation === 'horizontal' && 'flex-row items-center',\n\n className,\n ),\n )}\n >\n {(props) => (\n <>\n {label ? <Label>{label}</Label> : undefined}\n {typeof children === 'function' ? children(props) : children}\n </>\n )}\n </AriaRadioGroup>\n );\n}\n\nRadio.Group = RadioGroup;\n"]}
1
+ {"version":3,"sources":["../../../src/components/radio/index.tsx"],"names":["group","groupLabel","radio","control","RadioStyles","x","createContext","b","ref","props","useContextProps","children","classNames","label","isDisabled","AriaRadioGroup","N","composeRenderProps","className","isRequired","jsxs","Fragment","m","jsx","Label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,QAAAD,CAAU,CAAA,CAAA,GAAQ,CAAe,CACnE,CAAA,CAAA,OACGgB,GAAAA,CAAAC,KACE,CAAA,CAAA,GACD,WAAWX,CAAmBL,kBAAAA,CAAAA,CAAY,OAAQM,CAAAA,CAChDhB,EAAM,CAAE,CAAA,CAAA,SAAU,CAAC,CACrB,CAAA,CAEC,CAAA,CAAA,SAAmBS,kBAAAA,CAAWA,CAAAA,CAAAA,CAC7BS,EAAAC,IAAAA,CAAAC,QACE,CAAA,CAAA,QAAAC,EAACM,GAAA,CAAA,MAAK,CAAA,CAAA,SAAW1B,CAAQ,CAAE,CAAA,CAAA,SAAWS,CAAAA,CAAY,SAAS,CAAG,EAC9DW,CAAAA,CAACM,GAAA,CAAA,MAAK,WAAWhB,CAAM,CAAE,CAAA,CAAA,SAAWD,CAAAA,CAAY,EAAA,MAC7C,CAAA,CAAA,QAAAD,CACH,CAAA,CAAA,CACF,CACD,CAAA,CACH,CAEJ,CACAmB,CAAAA,CAAM,CAAA,CAAA,WAAc,CAAA,OACpBA,CAAM,CAAA,CAAA,KAAQJ,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Radio as AriaRadio,\n RadioGroup as AriaRadioGroup,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { RadioStyles } from './styles';\nimport type { RadioGroupProps, RadioProps } from './types';\n\nconst { group, groupLabel, radio, control, label } = RadioStyles();\n\nexport const RadioContext =\n createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\n\nfunction RadioGroup({ ref, ...props }: RadioGroupProps) {\n [props, ref] = useContextProps(props, ref ?? null, RadioContext);\n\n const { children, classNames, label, isDisabled, isRequired, ...rest } =\n props;\n\n return (\n <AriaRadioGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.group, (className) =>\n group({ className }),\n )}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {composeRenderProps(children, (children) => (\n <>\n {label && (\n <Label\n className={groupLabel({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n {children}\n </>\n ))}\n </AriaRadioGroup>\n );\n}\nRadioGroup.displayName = 'Radio.Group';\n\nexport function Radio({ classNames, children, ...rest }: RadioProps) {\n return (\n <AriaRadio\n {...rest}\n className={composeRenderProps(classNames?.radio, (className) =>\n radio({ className }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={control({ className: classNames?.control })} />\n <span className={label({ className: classNames?.label })}>\n {children}\n </span>\n </>\n ))}\n </AriaRadio>\n );\n}\nRadio.displayName = 'Radio';\nRadio.Group = RadioGroup;\n"]}
@@ -0,0 +1,53 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+
3
+ declare const RadioStyles: tailwind_variants.TVReturnType<{
4
+ [key: string]: {
5
+ [key: string]: tailwind_variants.ClassValue | {
6
+ group?: tailwind_variants.ClassValue;
7
+ radio?: tailwind_variants.ClassValue;
8
+ label?: tailwind_variants.ClassValue;
9
+ groupLabel?: tailwind_variants.ClassValue;
10
+ control?: tailwind_variants.ClassValue;
11
+ };
12
+ };
13
+ } | {
14
+ [x: string]: {
15
+ [x: string]: tailwind_variants.ClassValue | {
16
+ group?: tailwind_variants.ClassValue;
17
+ radio?: tailwind_variants.ClassValue;
18
+ label?: tailwind_variants.ClassValue;
19
+ groupLabel?: tailwind_variants.ClassValue;
20
+ control?: tailwind_variants.ClassValue;
21
+ };
22
+ };
23
+ } | {}, {
24
+ group: string[];
25
+ groupLabel: string;
26
+ radio: string[];
27
+ control: string[];
28
+ label: string[];
29
+ }, undefined, {
30
+ [key: string]: {
31
+ [key: string]: tailwind_variants.ClassValue | {
32
+ group?: tailwind_variants.ClassValue;
33
+ radio?: tailwind_variants.ClassValue;
34
+ label?: tailwind_variants.ClassValue;
35
+ groupLabel?: tailwind_variants.ClassValue;
36
+ control?: tailwind_variants.ClassValue;
37
+ };
38
+ };
39
+ } | {}, {
40
+ group: string[];
41
+ groupLabel: string;
42
+ radio: string[];
43
+ control: string[];
44
+ label: string[];
45
+ }, tailwind_variants.TVReturnType<unknown, {
46
+ group: string[];
47
+ groupLabel: string;
48
+ radio: string[];
49
+ control: string[];
50
+ label: string[];
51
+ }, undefined, unknown, unknown, undefined>>;
52
+
53
+ export { RadioStyles };
@@ -0,0 +1,2 @@
1
+ import {tv}from'./../../lib/utils.js';var r=tv({slots:{group:["group/radio-group flex gap-xs","orientation-horizontal:flex-wrap","orientation-vertical:flex-col"],groupLabel:"w-full",radio:["group/radio flex cursor-pointer items-center gap-m group-orientation-horizontal/radio-group:grow group-orientation-horizontal/radio-group:basis-1/3","disabled:cursor-not-allowed"],control:["my-xxs flex size-l items-center justify-center rounded-full outline outline-interactive before:block before:size-s before:rounded-full","group-enabled/radio:group-focus/radio:outline-interactive-hover","group-enabled/radio:group-hover/radio:outline-interactive-hover","group-enabled/radio:group-selected/radio:outline-highlight group-enabled/radio:group-selected/radio:before:bg-highlight","group-enabled/radio:group-selected/radio:group-focus/radio:outline-interactive-hover","group-enabled/radio:group-selected/radio:group-hover/radio:outline-interactive-hover","group-disabled/radio:outline-interactive-disabled","group-disabled/radio:group-selected/radio:before:bg-interactive-disabled"],label:["text-body-s text-interactive-default","group-disabled/radio:text-interactive-disabled"]}});export{r as RadioStyles};//# sourceMappingURL=styles.js.map
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/radio/styles.ts"],"names":["e"],"mappings":"sCAeE,IAAA,CAAA,CAAAA,EAAA,CAAO,CACL,KAAA,CAAO,CACL,KAAA,CAAA,CAAA,+BACA,CAAA,kEAGF,CAAA,CAAA,mBACO,CACL,KAAA,CAAA,CAAA,qJACA,CAAA,6BAEF,CAAA,CAAA,iJAEE,CAAA,iEACA,CAAA,2LAEA,CAAA,sFACA,CAAA,sFACA,CAAA,mDACA,CAAA,0EAEF,CAAO,CACL,6CACA,CAAA,gDAGL,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const RadioStyles = tv({\n slots: {\n group: [\n 'group/radio-group flex gap-xs',\n 'orientation-horizontal:flex-wrap',\n 'orientation-vertical:flex-col',\n ],\n groupLabel: 'w-full',\n radio: [\n 'group/radio flex cursor-pointer items-center gap-m group-orientation-horizontal/radio-group:grow group-orientation-horizontal/radio-group:basis-1/3',\n 'disabled:cursor-not-allowed',\n ],\n control: [\n 'my-xxs flex size-l items-center justify-center rounded-full outline outline-interactive before:block before:size-s before:rounded-full',\n 'group-enabled/radio:group-focus/radio:outline-interactive-hover',\n 'group-enabled/radio:group-hover/radio:outline-interactive-hover',\n 'group-enabled/radio:group-selected/radio:outline-highlight group-enabled/radio:group-selected/radio:before:bg-highlight',\n 'group-enabled/radio:group-selected/radio:group-focus/radio:outline-interactive-hover',\n 'group-enabled/radio:group-selected/radio:group-hover/radio:outline-interactive-hover',\n 'group-disabled/radio:outline-interactive-disabled',\n 'group-disabled/radio:group-selected/radio:before:bg-interactive-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled/radio:text-interactive-disabled',\n ],\n },\n});\n"]}
@@ -0,0 +1,21 @@
1
+ import { RefAttributes, PropsWithChildren } from 'react';
2
+ import { RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1 } from 'react-aria-components';
3
+ import { LabelProps } from '../label/types.js';
4
+
5
+ type RadioGroupProps = Omit<RadioGroupProps$1, 'className'> & RefAttributes<HTMLDivElement> & {
6
+ classNames?: {
7
+ group?: RadioGroupProps$1['className'];
8
+ label?: LabelProps['className'];
9
+ };
10
+ label?: string;
11
+ };
12
+ type RadioProps = Omit<RadioProps$1, 'className'> & RefAttributes<HTMLLabelElement> & {
13
+ classNames?: {
14
+ radio?: RadioProps$1['className'];
15
+ control?: string;
16
+ label?: string;
17
+ };
18
+ };
19
+ type RadioProviderProps = PropsWithChildren<RadioGroupProps>;
20
+
21
+ export type { RadioGroupProps, RadioProps, RadioProviderProps };
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import {Search,Loop,CancelFill}from'@accelint/icons';import {cva}from'cva';import {SearchField,Input,Button}from'react-aria-components';import {Icon}from'../icon/index.js';import {jsxs,jsx}from'react/jsx-runtime';var v=cva(["hide-cancel block w-full rounded-round p-s pr-[30px] pl-[35px] font-display text-body-s outline"],{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"},variant:{filled:"bg-surface-raised outline-static-dark",outlined:"outline-interactive"}}}),g=({className:i,placeholder:l="Search",variant:o="outlined",isLoading:r=false,...s})=>jsxs(SearchField,{className:cn("group relative",i),...s,children:[jsx(Icon,{className:"fg-interactive-hover absolute top-[6px] left-[7px]",children:jsx(Search,{})}),jsx(Input,{placeholder:l,className:({isDisabled:d})=>cn(v({isDisabled:d,variant:o}))}),r?jsx(Icon,{className:"fg-interactive-hover absolute top-[6px] right-[8px] animate-spin",children:jsx(Loop,{className:"scale-x-[-1]"})}):jsx(Button,{className:"fg-default-dark hover:fg-interactive-hover absolute top-[8px] right-[8px] cursor-pointer group-dtk-disabled:hidden group-dtk-empty:hidden",children:jsx(Icon,{size:"small",children:jsx(CancelFill,{})})})]});g.displayName="SearchField";export{g as SearchField};//# sourceMappingURL=index.js.map
1
+ import {cn}from'./../../lib/utils.js';import {Search,Loop,CancelFill}from'@accelint/icons';import'client-only';import {cva}from'cva';import {SearchField,Input,Button}from'react-aria-components';import {Icon}from'../icon/index.js';import {jsxs,jsx}from'react/jsx-runtime';var v=cva(["hide-cancel block w-full rounded-round p-s pr-[30px] pl-[35px] font-display text-body-s outline"],{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"},variant:{filled:"bg-surface-raised outline-static-dark",outlined:"outline-interactive"}}}),g=({className:i,placeholder:l="Search",variant:o="outlined",isLoading:r=false,...s})=>jsxs(SearchField,{className:cn("group relative",i),...s,children:[jsx(Icon,{className:"fg-interactive-hover absolute top-[6px] left-[7px]",children:jsx(Search,{})}),jsx(Input,{placeholder:l,className:({isDisabled:c})=>cn(v({isDisabled:c,variant:o}))}),r?jsx(Icon,{className:"fg-interactive-hover absolute top-[6px] right-[8px] animate-spin",children:jsx(Loop,{className:"scale-x-[-1]"})}):jsx(Button,{className:"fg-default-dark hover:fg-interactive-hover absolute top-[8px] right-[8px] cursor-pointer group-empty:hidden group-disabled:hidden",children:jsx(Icon,{size:"small",children:jsx(CancelFill,{})})})]});g.displayName="SearchField";export{g as SearchField};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/search-field/index.tsx"],"names":["h","variant","rest","jsxs","AriaSearchField","x","u","t","e","a","jsx","Input","m","textFieldStyles","isLoading","Icon","n","Button","f","c","SearchField"],"mappings":"2PAwCI,IAAA,CAAA,CAAAA,GAAA,CAAA,CAAA,iGAGA,CAAA,CAAA,CAAA,QACE,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,sEAEJ,CAAA,KAAA,CAAA,4GAEK,OACP,CAAQ,CAAA,MAAA,CAAA,uCACR,CAAA,8BAMoB,CAC1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,uBACc,CAAA,CAAA,CAAA,QACd,CAAAC,oBACA,CAAA,SACA,CAAGC,CACL,CAAA,KAAA,CAEIC,GAACC,CAAA,CAAgB,GAAAC,IAAA,CAAAC,WAAA,CAAA,CAAA,SAAc,CAAAC,EAAA,CAAA,gBAAkCL,CAC/D,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,QAAM,CAAA,CAAAM,GAAA,CAAAC,IAAA,CAAA,CAAA,SAAU,CAAA,oDACd,CAAA,QAAY,CACdD,GAAA,CACAE,OAACC,EAAA,CACC,CAAA,CAAA,CAAAH,GAAA,CAAAI,KAAA,CAAA,CAAA,uBACc,CAAA,CAAA,CAAA,UACTC,CAAAA,CAAgB,CAAE,GAAAN,EAAA,CAAA,CAAA,CAAA,CAAA,UAAY,CAAA,CAAA,CAAAN,OAGpCa,CAAAA,CACCJ,CAAAA,CAACK,CAAAA,CAAA,CAAK,CAAA,CAAA,CAAAP,GAAA,CAAAC,IAAA,CAAA,CAAA,SAAU,CAAA,kEACd,CAAA,QAAU,CAAAD,GAAA,CAAAQ,IAAA,CAAA,CAAA,SAAU,CAAA,cAGrBC,CAAA,CAAO,CAAA,CAAA,CAAAT,GAAA,CAAAU,MAAA,CAAA,CAAA,qJACN,CAAA,aAAWT,IAAA,CAAA,CAAA,IAAA,CACT,OAAA,CAAA,QAAY,CACdD,GAAA,CACFW,UAAA,CAAA,EAEJ,CAIJC,EAAY,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,WAAc,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 {\n CancelFill,\n Loop as LoopIcon,\n Search as SearchIcon,\n} from '@accelint/icons';\nimport { cva } from 'cva';\nimport {\n SearchField as AriaSearchField,\n Button,\n Input,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\n\nexport interface SearchFieldProps {\n className?: string;\n /** Disables the input field. */\n isDisabled?: boolean;\n /** Displays a loading spinner. */\n isLoading?: boolean;\n /** Displays placeholder text. */\n placeholder?: string;\n /** Whether the input has a filled background or outlined. */\n variant?: 'filled' | 'outlined';\n}\n\nconst textFieldStyles = cva(\n [\n 'hide-cancel block w-full rounded-round p-s pr-[30px] pl-[35px] font-display text-body-s outline',\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 variant: {\n filled: 'bg-surface-raised outline-static-dark',\n outlined: 'outline-interactive',\n },\n },\n },\n);\n\nexport const SearchField = ({\n className,\n placeholder = 'Search',\n variant = 'outlined',\n isLoading = false,\n ...rest\n}: SearchFieldProps) => {\n return (\n <AriaSearchField className={cn('group relative', className)} {...rest}>\n <Icon className='fg-interactive-hover absolute top-[6px] left-[7px]'>\n <SearchIcon />\n </Icon>\n <Input\n placeholder={placeholder}\n className={({ isDisabled }) =>\n cn(textFieldStyles({ isDisabled, variant }))\n }\n />\n {isLoading ? (\n <Icon className='fg-interactive-hover absolute top-[6px] right-[8px] animate-spin'>\n <LoopIcon className='scale-x-[-1]' />\n </Icon>\n ) : (\n <Button className='fg-default-dark hover:fg-interactive-hover absolute top-[8px] right-[8px] cursor-pointer group-dtk-disabled:hidden group-dtk-empty:hidden'>\n <Icon size='small'>\n <CancelFill />\n </Icon>\n </Button>\n )}\n </AriaSearchField>\n );\n};\n\nSearchField.displayName = 'SearchField';\n"]}
1
+ {"version":3,"sources":["../../../src/components/search-field/index.tsx"],"names":["h","variant","rest","jsxs","AriaSearchField","x","u","t","e","a","jsx","Input","m","textFieldStyles","isLoading","Icon","d","Button","f","n","SearchField"],"mappings":"+QA0CI,IAAA,CAAA,CAAAA,GAAA,CAAA,CAAA,iGAGA,CAAA,CAAA,CAAA,QACE,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,sEAEJ,CAAA,KAAA,CAAA,0GAEJ,CAAA,CAAS,OACP,CAAQ,CAAA,MAAA,CAAA,gDACE,CAAA,qBAMU,CAC1B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,WAAc,CAAA,CAAA,CAAA,QACd,CAAAC,OAAU,CAAA,CAAA,CAAA,UACV,CAAA,UACGC,CACL,CAAA,KAAA,CAEIC,GAACC,CAAA,CAAgB,GAAAC,IAAA,CAAAC,WAAA,CAAA,CAAA,SAAc,CAAAC,EAAA,CAAA,gBAAkCL,CAC/D,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,QAAM,CAAA,CAAAM,GAAA,CAAAC,IAAA,CAAA,CAAA,SAAU,CAAA,oDACd,CAAA,QAAY,CACdD,GAAA,CACAE,OAACC,EAAA,CACC,CAAA,CAAA,CAAAH,GAAA,CAAAI,KAAA,CAAA,CAAA,uBACc,CAAA,CAAA,CAAA,UACTC,CAAAA,CAAgB,CAAE,GAAAN,EAAA,CAAA,CAAA,CAAA,CAAA,UAAY,CAAA,CAAA,CAAAN,OAGpCa,CAAAA,CACCJ,CAAAA,CAACK,CAAAA,CAAA,CAAK,CAAA,CAAA,CAAAP,GAAA,CAAAC,IAAA,CAAA,CAAA,SAAU,CAAA,kEACd,CAAA,QAAU,CAAAD,GAAA,CAAAQ,IAAA,CAAA,CAAA,SAAU,CAAA,cAGrBC,CAAA,CAAO,CAAA,CAAA,CAAAT,GAAA,CAAAU,MAAA,CAAA,CAAA,6IACN,CAAA,aAAWT,IAAA,CAAA,CAAA,IAAA,CACT,OAAA,CAAA,QAAY,CACdD,GAAA,CACFW,UAAA,CAAA,EAEJ,CAIJC,EAAY,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,WAAc,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\n'use client';\nimport { cn } from '@/lib/utils';\nimport {\n CancelFill,\n Loop as LoopIcon,\n Search as SearchIcon,\n} from '@accelint/icons';\nimport 'client-only';\nimport { cva } from 'cva';\nimport {\n SearchField as AriaSearchField,\n Button,\n Input,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\n\nexport interface SearchFieldProps {\n className?: string;\n /** Disables the input field. */\n isDisabled?: boolean;\n /** Displays a loading spinner. */\n isLoading?: boolean;\n /** Displays placeholder text. */\n placeholder?: string;\n /** Whether the input has a filled background or outlined. */\n variant?: 'filled' | 'outlined';\n}\n\nconst textFieldStyles = cva(\n [\n 'hide-cancel block w-full rounded-round p-s pr-[30px] pl-[35px] font-display text-body-s outline',\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 variant: {\n filled: 'bg-surface-raised outline-static-dark',\n outlined: 'outline-interactive',\n },\n },\n },\n);\n\nexport const SearchField = ({\n className,\n placeholder = 'Search',\n variant = 'outlined',\n isLoading = false,\n ...rest\n}: SearchFieldProps) => {\n return (\n <AriaSearchField className={cn('group relative', className)} {...rest}>\n <Icon className='fg-interactive-hover absolute top-[6px] left-[7px]'>\n <SearchIcon />\n </Icon>\n <Input\n placeholder={placeholder}\n className={({ isDisabled }) =>\n cn(textFieldStyles({ isDisabled, variant }))\n }\n />\n {isLoading ? (\n <Icon className='fg-interactive-hover absolute top-[6px] right-[8px] animate-spin'>\n <LoopIcon className='scale-x-[-1]' />\n </Icon>\n ) : (\n <Button className='fg-default-dark hover:fg-interactive-hover absolute top-[8px] right-[8px] cursor-pointer group-empty:hidden group-disabled:hidden'>\n <Icon size='small'>\n <CancelFill />\n </Icon>\n </Button>\n )}\n </AriaSearchField>\n );\n};\n\nSearchField.displayName = 'SearchField';\n"]}
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import {cva}from'cva';import {useContext}from'react';import {Slider,Label,SliderTrack,SliderThumb,Text,SliderStateContext,useSlottedContext,LabelContext,NumberField,Input}from'react-aria-components';import {Tooltip}from'../tooltip/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var D=cva("grid gap-s",{variants:{layout:{stacked:"",inline:""},orientation:{vertical:"h-full w-fit",horizontal:"h-xl w-full"}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_auto]"},{layout:"inline",orientation:"horizontal",className:"grid-cols-[auto_auto_1fr_auto_auto] grid-rows-1 items-center"},{layout:"stacked",orientation:"vertical",className:"grid-cols-[auto_auto_auto] grid-rows-[auto_auto_1fr_auto]"},{layout:"inline",orientation:"vertical",className:"grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_1fr_auto]"}]}),M=cva("font-display text-body-m text-default-dark",{variants:{orientation:{horizontal:"",vertical:"col-start-1 row-start-4"},layout:{inline:"",stacked:""}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"col-start-1 row-start-3"},{layout:"inline",orientation:"horizontal",className:"order-2"},{layout:"stacked",orientation:"vertical",className:"self-end justify-self-end"},{layout:"inline",orientation:"vertical",className:"justify-self-center"}]}),q=cva("font-display text-body-m text-default-dark",{variants:{orientation:{horizontal:"",vertical:"col-start-1 row-start-2"},layout:{inline:"",stacked:""}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"col-start-3 row-start-3 justify-self-end"},{layout:"inline",orientation:"horizontal",className:"order-4"},{layout:"stacked",orientation:"vertical",className:"justify-self-end"}]}),E=cva("relative",{variants:{orientation:{horizontal:"h-s w-full",vertical:"h-full w-s"},layout:{inline:"",stacked:""}},compoundVariants:[{orientation:"horizontal",layout:"stacked",className:"col-span-3 row-start-2"},{orientation:"horizontal",layout:"inline",className:"order-3"},{orientation:"vertical",layout:"stacked",className:"col-start-2 row-span-3 row-start-2"},{orientation:"vertical",layout:"inline",className:"col-start-1 row-start-3 justify-self-center"}]}),G=cva("flex gap-s",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col-reverse"},layout:{inline:"order-5",stacked:"col-start-3 row-start-1"}},compoundVariants:[{layout:"inline",orientation:"horizontal",className:"order-5"},{layout:"inline",orientation:"vertical",className:"col-span-3 col-start-1"},{layout:"stacked",orientation:"vertical",className:"row-start-4"}]}),H=cva("text-default-light",{variants:{orientation:{horizontal:"",vertical:""},layout:{inline:"order-1",stacked:"col-start-1"}},compoundVariants:[{layout:"stacked",orientation:"vertical",className:"col-span-2"},{layout:"inline",orientation:"vertical",className:"col-span-3"}]}),J=cva("h-m w-m rounded-full bg-highlight-bold outline-highlight-bold/40 hover:outline-4 focus:outline-4",{variants:{orientation:{horizontal:"translate-y-[50%]",vertical:"translate-x-[40%]"}}}),K=cva("absolute rounded-full bg-default-light/40",{variants:{orientation:{horizontal:"top-[50%] h-xxs w-full translate-y-[50%]",vertical:"left-[50%] h-full w-xxs "}}}),Q=cva("absolute rounded-full bg-highlight",{variants:{orientation:{horizontal:"top-1/2 h-xxs translate-y-1/2",vertical:"left-1/2 w-xxs"}}}),U=({children:s,className:i,showInput:o=false,showLabel:d=true,layout:l="stacked",value:m,defaultValue:N,label:k,defaultRangeValue:w,rangeValue:S,minValue:p=0,maxValue:g=100,isRange:v=false,orientation:t="horizontal",...z})=>{let T=v?S:m,_=v?w:N;return jsxs(Slider,{className:cn(D({orientation:t,layout:l})),minValue:p,maxValue:g,orientation:t,value:T,defaultValue:_,...z,children:[d&&jsx(Label,{className:H({orientation:t,layout:l}),children:k}),o&&jsx("div",{className:G({orientation:t,layout:l}),children:jsx(W,{})}),jsx(SliderTrack,{className:E({layout:l,orientation:t}),children:({state:r})=>{let n=r.getThumbPercent(0),P=r.getThumbPercent(1)||n,y=`${(r.values.length===2?P-n:n)*100}%`,b=r.values.length===2?`${Math.floor(n*100)}%`:"0";return jsxs(Fragment,{children:[jsx("div",{className:K({orientation:t})}),r.values.map((X,u)=>jsxs(Fragment,{children:[jsx("div",{className:Q({orientation:t}),style:t==="horizontal"?{left:b,width:y}:{bottom:b,height:y}},`slider-${u===0?"min":"max"}`),jsx(SliderThumb,{index:u,className:J({orientation:t}),children:!o&&jsxs(Tooltip,{children:[jsx(Tooltip.Trigger,{children:jsx("div",{className:"size-full"})}),jsx(Tooltip.Body,{placement:"top",children:r.getThumbValue(u)})]})},`slider-thumb-${u===0?"min":"max"}`)]}))]})}}),jsx(Text,{slot:"min",className:M({layout:l,orientation:t}),children:p}),jsx(Text,{slot:"max",className:q({layout:l,orientation:t}),children:g})]})},la=({defaultValue:s,value:i,...o})=>jsx(U,{...o,isRange:true,defaultRangeValue:s,rangeValue:i});function W({className:s}){let i=useContext(SliderStateContext),o=useSlottedContext(LabelContext);return jsx(Fragment,{children:i?.values.map((d,l)=>jsx(NumberField,{"aria-labelledby":o?.id,value:d,onChange:m=>i.setThumbValue(0,m),children:jsx(Input,{className:cn("w-[50px] rounded-medium border border-interactive px-s py-xs font-display text-body-m text-default-light",s)})},`number-field-${l===0?"min":"max"}`))})}export{la as RangeSlider,U as Slider};//# sourceMappingURL=index.js.map
1
+ import {cn}from'./../../lib/utils.js';import'client-only';import {cva}from'cva';import {useContext}from'react';import {Slider,Label,SliderTrack,SliderThumb,Text,SliderStateContext,useSlottedContext,LabelContext,NumberField,Input}from'react-aria-components';import {Tooltip}from'../tooltip/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var D=cva("grid gap-s",{variants:{layout:{stacked:"",inline:""},orientation:{vertical:"h-full w-fit",horizontal:"h-xl w-full"}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_auto]"},{layout:"inline",orientation:"horizontal",className:"grid-cols-[auto_auto_1fr_auto_auto] grid-rows-1 items-center"},{layout:"stacked",orientation:"vertical",className:"grid-cols-[auto_auto_auto] grid-rows-[auto_auto_1fr_auto]"},{layout:"inline",orientation:"vertical",className:"grid-cols-[auto_1fr_auto] grid-rows-[auto_auto_1fr_auto]"}]}),M=cva("font-display text-body-m text-default-dark",{variants:{orientation:{horizontal:"",vertical:"col-start-1 row-start-4"},layout:{inline:"",stacked:""}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"col-start-1 row-start-3"},{layout:"inline",orientation:"horizontal",className:"order-2"},{layout:"stacked",orientation:"vertical",className:"self-end justify-self-end"},{layout:"inline",orientation:"vertical",className:"justify-self-center"}]}),q=cva("font-display text-body-m text-default-dark",{variants:{orientation:{horizontal:"",vertical:"col-start-1 row-start-2"},layout:{inline:"",stacked:""}},compoundVariants:[{layout:"stacked",orientation:"horizontal",className:"col-start-3 row-start-3 justify-self-end"},{layout:"inline",orientation:"horizontal",className:"order-4"},{layout:"stacked",orientation:"vertical",className:"justify-self-end"}]}),E=cva("relative",{variants:{orientation:{horizontal:"h-s w-full",vertical:"h-full w-s"},layout:{inline:"",stacked:""}},compoundVariants:[{orientation:"horizontal",layout:"stacked",className:"col-span-3 row-start-2"},{orientation:"horizontal",layout:"inline",className:"order-3"},{orientation:"vertical",layout:"stacked",className:"col-start-2 row-span-3 row-start-2"},{orientation:"vertical",layout:"inline",className:"col-start-1 row-start-3 justify-self-center"}]}),G=cva("flex gap-s",{variants:{orientation:{horizontal:"flex-row",vertical:"flex-col-reverse"},layout:{inline:"order-5",stacked:"col-start-3 row-start-1"}},compoundVariants:[{layout:"inline",orientation:"horizontal",className:"order-5"},{layout:"inline",orientation:"vertical",className:"col-span-3 col-start-1"},{layout:"stacked",orientation:"vertical",className:"row-start-4"}]}),H=cva("text-default-light",{variants:{orientation:{horizontal:"",vertical:""},layout:{inline:"order-1",stacked:"col-start-1"}},compoundVariants:[{layout:"stacked",orientation:"vertical",className:"col-span-2"},{layout:"inline",orientation:"vertical",className:"col-span-3"}]}),J=cva("h-m w-m rounded-full bg-highlight-bold outline-highlight-bold/40 hover:outline-4 focus:outline-4",{variants:{orientation:{horizontal:"translate-y-[50%]",vertical:"translate-x-[40%]"}}}),K=cva("absolute rounded-full bg-default-light/40",{variants:{orientation:{horizontal:"top-[50%] h-xxs w-full translate-y-[50%]",vertical:"left-[50%] h-full w-xxs "}}}),Q=cva("absolute rounded-full bg-highlight",{variants:{orientation:{horizontal:"top-1/2 h-xxs translate-y-1/2",vertical:"left-1/2 w-xxs"}}}),U=({children:s,className:i,showInput:o=false,showLabel:d=true,layout:l="stacked",value:m,defaultValue:N,label:k,defaultRangeValue:w,rangeValue:S,minValue:p=0,maxValue:g=100,isRange:v=false,orientation:t="horizontal",...z})=>{let T=v?S:m,_=v?w:N;return jsxs(Slider,{className:cn(D({orientation:t,layout:l})),minValue:p,maxValue:g,orientation:t,value:T,defaultValue:_,...z,children:[d&&jsx(Label,{className:H({orientation:t,layout:l}),children:k}),o&&jsx("div",{className:G({orientation:t,layout:l}),children:jsx(W,{})}),jsx(SliderTrack,{className:E({layout:l,orientation:t}),children:({state:r})=>{let n=r.getThumbPercent(0),P=r.getThumbPercent(1)||n,y=`${(r.values.length===2?P-n:n)*100}%`,b=r.values.length===2?`${Math.floor(n*100)}%`:"0";return jsxs(Fragment,{children:[jsx("div",{className:K({orientation:t})}),r.values.map((X,u)=>jsxs(Fragment,{children:[jsx("div",{className:Q({orientation:t}),style:t==="horizontal"?{left:b,width:y}:{bottom:b,height:y}},`slider-${u===0?"min":"max"}`),jsx(SliderThumb,{index:u,className:J({orientation:t}),children:!o&&jsxs(Tooltip,{children:[jsx(Tooltip.Trigger,{children:jsx("div",{className:"size-full"})}),jsx(Tooltip.Body,{placement:"top",children:r.getThumbValue(u)})]})},`slider-thumb-${u===0?"min":"max"}`)]}))]})}}),jsx(Text,{slot:"min",className:M({layout:l,orientation:t}),children:p}),jsx(Text,{slot:"max",className:q({layout:l,orientation:t}),children:g})]})},oa=({defaultValue:s,value:i,...o})=>jsx(U,{...o,isRange:true,defaultRangeValue:s,rangeValue:i});function W({className:s}){let i=useContext(SliderStateContext),o=useSlottedContext(LabelContext);return jsx(Fragment,{children:i?.values.map((d,l)=>jsx(NumberField,{"aria-labelledby":o?.id,value:d,onChange:m=>i.setThumbValue(0,m),children:jsx(Input,{className:cn("w-[50px] rounded-medium border border-interactive px-s py-xs font-display text-body-m text-default-light",s)})},`number-field-${l===0?"min":"max"}`))})}export{oa as RangeSlider,U as Slider};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map