@accelint/design-toolkit 2.2.0 → 2.2.1

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 (52) hide show
  1. package/dist/components/accordion/index.js +1 -1
  2. package/dist/components/accordion/index.js.map +1 -1
  3. package/dist/components/avatar/index.js +1 -1
  4. package/dist/components/avatar/index.js.map +1 -1
  5. package/dist/components/button/index.js +1 -1
  6. package/dist/components/button/index.js.map +1 -1
  7. package/dist/components/checkbox/index.js +1 -1
  8. package/dist/components/checkbox/index.js.map +1 -1
  9. package/dist/components/chip/index.js +1 -1
  10. package/dist/components/chip/index.js.map +1 -1
  11. package/dist/components/color-picker/index.js +1 -1
  12. package/dist/components/color-picker/index.js.map +1 -1
  13. package/dist/components/combobox/index.js +1 -1
  14. package/dist/components/combobox/index.js.map +1 -1
  15. package/dist/components/date-field/index.js +1 -1
  16. package/dist/components/date-field/index.js.map +1 -1
  17. package/dist/components/dialog/index.js +1 -1
  18. package/dist/components/dialog/index.js.map +1 -1
  19. package/dist/components/floating-button/index.js +1 -1
  20. package/dist/components/floating-button/index.js.map +1 -1
  21. package/dist/components/icon/index.js +1 -1
  22. package/dist/components/icon/index.js.map +1 -1
  23. package/dist/components/icon-button/index.js +1 -1
  24. package/dist/components/icon-button/index.js.map +1 -1
  25. package/dist/components/label/index.js +1 -1
  26. package/dist/components/label/index.js.map +1 -1
  27. package/dist/components/options/index.js +1 -1
  28. package/dist/components/options/index.js.map +1 -1
  29. package/dist/components/options-item/index.js +1 -1
  30. package/dist/components/options-item/index.js.map +1 -1
  31. package/dist/components/popover/index.js +1 -1
  32. package/dist/components/popover/index.js.map +1 -1
  33. package/dist/components/query-builder/index.js +1 -1
  34. package/dist/components/query-builder/index.js.map +1 -1
  35. package/dist/components/radio/index.js +1 -1
  36. package/dist/components/radio/index.js.map +1 -1
  37. package/dist/components/search-field/index.js +1 -1
  38. package/dist/components/search-field/index.js.map +1 -1
  39. package/dist/components/slider/index.js +1 -1
  40. package/dist/components/slider/index.js.map +1 -1
  41. package/dist/components/switch/index.js +1 -1
  42. package/dist/components/switch/index.js.map +1 -1
  43. package/dist/components/tabs/index.js +1 -1
  44. package/dist/components/tabs/index.js.map +1 -1
  45. package/dist/components/text-area/index.js.map +1 -1
  46. package/dist/components/text-field/index.js.map +1 -1
  47. package/dist/components/toggle-icon-button/index.js +1 -1
  48. package/dist/components/toggle-icon-button/index.js.map +1 -1
  49. package/dist/components/tooltip/index.js +1 -1
  50. package/dist/components/tooltip/index.js.map +1 -1
  51. package/dist/metafile-esm.json +1 -1
  52. package/package.json +2 -2
@@ -1,2 +1,2 @@
1
- import {useContextProps,Disclosure,composeRenderProps,DisclosureGroup,DisclosureStateContext,Heading,Button,DisclosurePanel}from'react-aria-components';import {isSlottedContextValue}from'./../../lib/utils.js';import {ChevronDown}from'@accelint/icons';import {createContext,useContext}from'react';import {Icon}from'../icon/index.js';import {AccordionStyles,AccordionStylesDefaults}from'./styles.js';import {jsx,jsxs}from'react/jsx-runtime';var {group:I,accordion:V,header:B,heading:k,trigger:w,panel:z}=AccordionStyles(),l=createContext(null);function f({ref:r,children:e,className:n,variant:o=AccordionStylesDefaults.variant,isDisabled:i,...c}){return jsx(l.Provider,{value:{variant:o,isDisabled:i},children:jsx(DisclosureGroup,{...c,ref:r,className:composeRenderProps(n,a=>I({className:a,variant:o,isDisabled:i})),children:e})})}f.displayName="Accordion.Group";function v({ref:r,children:e,className:n}){let o=useContext(l),i=useContext(DisclosureStateContext),c=(isSlottedContextValue(o)?void 0:o?.variant)??AccordionStylesDefaults.variant,a=(isSlottedContextValue(o)?void 0:o?.isDisabled)??AccordionStylesDefaults.isDisabled,d=i?.isExpanded??AccordionStylesDefaults.isExpanded;return jsx(Icon.Provider,{size:c==="compact"?"small":"large",children:jsx("div",{ref:r,className:B({className:n,variant:c,isDisabled:a,isExpanded:d}),children:e})})}v.displayName="Accordion.Header";function x({ref:r,children:e,classNames:n}){let o=useContext(l),i=useContext(DisclosureStateContext),c=(isSlottedContextValue(o)?void 0:o?.variant)??AccordionStylesDefaults.variant,a=(isSlottedContextValue(o)?void 0:o?.isDisabled)??AccordionStylesDefaults.isDisabled,d=i?.isExpanded??AccordionStylesDefaults.isExpanded;return jsx(Heading,{ref:r,className:k({className:n?.heading,variant:c,isDisabled:a,isExpanded:d}),children:jsxs(Button,{slot:"trigger",className:composeRenderProps(n?.trigger,N=>w({className:N,variant:c,isExpanded:d})),children:[jsx(Icon,{children:jsx(ChevronDown,{className:"transform group-dtk-expanded:rotate-180"})}),e]})})}x.displayName="Accordion.Trigger";function D({ref:r,children:e,className:n,...o}){return jsx(DisclosurePanel,{...o,ref:r,className:composeRenderProps(n,i=>z({className:i})),children:e})}D.displayName="Accordion.Panel";function p({ref:r,...e}){[e,r]=useContextProps(e,r??null,l);let{children:n,className:o,variant:i=AccordionStylesDefaults.variant,isDisabled:c,...a}=e;return jsx(l.Provider,{value:{variant:i,isDisabled:c},children:jsx(Disclosure,{...a,className:composeRenderProps(o,d=>V({className:d})),isDisabled:c,children:n})})}p.displayName="Accordion";p.Group=f;p.Header=v;p.Trigger=x;p.Panel=D;export{p as Accordion,l as AccordionContext};//# sourceMappingURL=index.js.map
1
+ import'client-only';import {useContextProps,Disclosure,composeRenderProps,DisclosureGroup,DisclosureStateContext,Heading,Button,DisclosurePanel}from'react-aria-components';import {isSlottedContextValue}from'./../../lib/utils.js';import {ChevronDown}from'@accelint/icons';import {createContext,useContext}from'react';import {Icon}from'../icon/index.js';import {AccordionStyles,AccordionStylesDefaults}from'./styles.js';import {jsx,jsxs}from'react/jsx-runtime';var {group:I,accordion:V,header:B,heading:k,trigger:w,panel:z}=AccordionStyles(),l=createContext(null);function f({ref:r,children:e,className:n,variant:o=AccordionStylesDefaults.variant,isDisabled:i,...c}){return jsx(l.Provider,{value:{variant:o,isDisabled:i},children:jsx(DisclosureGroup,{...c,ref:r,className:composeRenderProps(n,a=>I({className:a,variant:o,isDisabled:i})),children:e})})}f.displayName="Accordion.Group";function v({ref:r,children:e,className:n}){let o=useContext(l),i=useContext(DisclosureStateContext),c=(isSlottedContextValue(o)?void 0:o?.variant)??AccordionStylesDefaults.variant,a=(isSlottedContextValue(o)?void 0:o?.isDisabled)??AccordionStylesDefaults.isDisabled,d=i?.isExpanded??AccordionStylesDefaults.isExpanded;return jsx(Icon.Provider,{size:c==="compact"?"small":"large",children:jsx("div",{ref:r,className:B({className:n,variant:c,isDisabled:a,isExpanded:d}),children:e})})}v.displayName="Accordion.Header";function x({ref:r,children:e,classNames:n}){let o=useContext(l),i=useContext(DisclosureStateContext),c=(isSlottedContextValue(o)?void 0:o?.variant)??AccordionStylesDefaults.variant,a=(isSlottedContextValue(o)?void 0:o?.isDisabled)??AccordionStylesDefaults.isDisabled,d=i?.isExpanded??AccordionStylesDefaults.isExpanded;return jsx(Heading,{ref:r,className:k({className:n?.heading,variant:c,isDisabled:a,isExpanded:d}),children:jsxs(Button,{slot:"trigger",className:composeRenderProps(n?.trigger,N=>w({className:N,variant:c,isExpanded:d})),children:[jsx(Icon,{children:jsx(ChevronDown,{className:"transform group-dtk-expanded:rotate-180"})}),e]})})}x.displayName="Accordion.Trigger";function D({ref:r,children:e,className:n,...o}){return jsx(DisclosurePanel,{...o,ref:r,className:composeRenderProps(n,i=>z({className:i})),children:e})}D.displayName="Accordion.Panel";function p({ref:r,...e}){[e,r]=useContextProps(e,r??null,l);let{children:n,className:o,variant:i=AccordionStylesDefaults.variant,isDisabled:c,...a}=e;return jsx(l.Provider,{value:{variant:i,isDisabled:c},children:jsx(Disclosure,{...a,className:composeRenderProps(o,d=>V({className:d})),isDisabled:c,children:n})})}p.displayName="Accordion";p.Group=f;p.Header=v;p.Trigger=x;p.Panel=D;export{p as Accordion,l as AccordionContext};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/accordion/index.tsx"],"names":["group","header","heading","trigger","panel","AccordionStyles","AccordionContext","createContext","h","AccordionGroup","children","variant","jsx","s","rest","H","ref","A","AccordionHeader","context","useContext","DisclosureStateContext","isSlottedContextValue","P","u","t","isDisabled","Icon","AccordionTrigger","Heading","E","jsxs","C","className","g","T","AccordionPanel","DisclosurePanel","b","Accordion","props","useContextProps","G","y","accordion"],"mappings":"ubAuCQA,IAAO,CAAA,KAAA,CAAA,CAAA,CAAA,UAAWC,CAAAA,CAAQ,MAAA,CAAA,CAAAC,QAAS,CAAA,CAAAC,CAAAA,OAASC,CAAM,CAAA,CAAIC,KAEjDC,CACXC,CAAAA,CAA4D,kBAAI,CAAA,CAElE,CAAAC,aAAA,CAAA,IAAA,EAASC,SAEP,SAAAC,QACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAAC,CAAAA,iCACA,CAAA,OAAA,CAAA,UAEsB,CACtB,OACEC,CAAAA,CAACN,OAAiBO,GAAA,CAAA,CAAA,CAAjB,QAAmC,QAAAF,CAAAA,OAAS,CAAA,CAAA,CAAA,UAC3C,CAAA,CAAA,CAAA,CAAAC,QACME,CAAAA,GACJ,CAAAC,eAAA,CAAA,CAAKC,GACL,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,UACQC,kBACJ,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAAN,CAAAA,OACA,CAAA,CAAA,CAAA,UAIH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAD,QAKM,oBAAc,CAAA,iBAE7B,CAASQ,SAAuB,SAAAR,QAAU,CAAA,CAAA,CAAA,SAClCS,EAAUC,CAAAA,CAAWd,CAAgB,IAC7Bc,CAAAA,CAAWC,UAAsB,EACzCV,CAAAA,CAAAA,CACHW,CAAAA,UAAsBH,CAAOI,sBAAA,CAAI,CAAA,CAAA,CAAA,CAAAC,qBAAA,CAAA,CAAYL,CAAAA,CAAAA,iBACtB,GAAAM,uBACpBC,CAAAA,OAC8B,2BAAYP,CAAAA,CAAAA,MAAS,CAAA,CAAA,EAAA,UAC/B,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CAAA6B,UAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SACEC,CAAU3B,kBACR,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,SAGJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAEC,CAAA,CAAA,CAAAP,QAKC,oBAAc,CAAA,WACND,CAAAA,CAClB8B,CAAAA,KAAU,CAAA,CAAA,CAASrB,EACnBqB,MAAU,CAAA,CAAA,CAAA,CAAUX,CAAAA,OACV,CAAA,CAAQQ,CAAAA,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\n'use client';\n\nimport {\n Button,\n type ContextValue,\n Disclosure,\n DisclosureGroup,\n DisclosurePanel,\n DisclosureStateContext,\n Heading,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\n\nimport { isSlottedContextValue } from '@/lib/utils';\nimport { ChevronDown } from '@accelint/icons';\nimport { createContext, useContext } from 'react';\nimport { Icon } from '../icon';\nimport { AccordionStyles, AccordionStylesDefaults } from './styles';\nimport type {\n AccordionGroupProps,\n AccordionHeaderProps,\n AccordionPanelProps,\n AccordionProps,\n AccordionTriggerProps,\n} from './types';\n\nconst { group, accordion, header, heading, trigger, panel } = AccordionStyles();\n\nexport const AccordionContext =\n createContext<ContextValue<AccordionProps, HTMLDivElement>>(null);\n\nfunction AccordionGroup({\n ref,\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n}: AccordionGroupProps) {\n return (\n <AccordionContext.Provider value={{ variant, isDisabled }}>\n <DisclosureGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n group({\n className,\n variant,\n isDisabled,\n }),\n )}\n >\n {children}\n </DisclosureGroup>\n </AccordionContext.Provider>\n );\n}\nAccordionGroup.displayName = 'Accordion.Group';\n\nfunction AccordionHeader({ ref, children, className }: AccordionHeaderProps) {\n const context = useContext(AccordionContext);\n const state = useContext(DisclosureStateContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n const isDisabled =\n (isSlottedContextValue(context) ? undefined : context?.isDisabled) ??\n AccordionStylesDefaults.isDisabled;\n const isExpanded = state?.isExpanded ?? AccordionStylesDefaults.isExpanded;\n\n return (\n <Icon.Provider size={variant === 'compact' ? 'small' : 'large'}>\n <div\n ref={ref}\n className={header({\n className,\n variant,\n isDisabled,\n isExpanded,\n })}\n >\n {children}\n </div>\n </Icon.Provider>\n );\n}\nAccordionHeader.displayName = 'Accordion.Header';\n\nfunction AccordionTrigger({\n ref,\n children,\n classNames,\n}: AccordionTriggerProps) {\n const context = useContext(AccordionContext);\n const state = useContext(DisclosureStateContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n const isDisabled =\n (isSlottedContextValue(context) ? undefined : context?.isDisabled) ??\n AccordionStylesDefaults.isDisabled;\n const isExpanded = state?.isExpanded ?? AccordionStylesDefaults.isExpanded;\n\n return (\n <Heading\n ref={ref}\n className={heading({\n className: classNames?.heading,\n variant,\n isDisabled,\n isExpanded,\n })}\n >\n <Button\n slot='trigger'\n className={composeRenderProps(classNames?.trigger, (className) =>\n trigger({\n className,\n variant,\n isExpanded,\n }),\n )}\n >\n <Icon>\n <ChevronDown className='transform group-dtk-expanded:rotate-180' />\n </Icon>\n {children}\n </Button>\n </Heading>\n );\n}\nAccordionTrigger.displayName = 'Accordion.Trigger';\n\nfunction AccordionPanel({\n ref,\n children,\n className,\n ...rest\n}: AccordionPanelProps) {\n return (\n <DisclosurePanel\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n panel({ className }),\n )}\n >\n {children}\n </DisclosurePanel>\n );\n}\nAccordionPanel.displayName = 'Accordion.Panel';\n\nexport function Accordion({ ref, ...props }: AccordionProps) {\n [props, ref] = useContextProps(props, ref ?? null, AccordionContext);\n\n const {\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n } = props;\n\n return (\n <AccordionContext.Provider\n value={{\n variant,\n isDisabled,\n }}\n >\n <Disclosure\n {...rest}\n className={composeRenderProps(className, (className) =>\n accordion({\n className,\n }),\n )}\n isDisabled={isDisabled}\n >\n {children}\n </Disclosure>\n </AccordionContext.Provider>\n );\n}\nAccordion.displayName = 'Accordion';\nAccordion.Group = AccordionGroup;\nAccordion.Header = AccordionHeader;\nAccordion.Trigger = AccordionTrigger;\nAccordion.Panel = AccordionPanel;\n"]}
1
+ {"version":3,"sources":["../../../src/components/accordion/index.tsx"],"names":["group","header","heading","trigger","panel","AccordionStyles","AccordionContext","createContext","S","h","AccordionGroup","children","variant","s","jsx","t","rest","H","ref","A","AccordionHeader","context","useContext","DisclosureStateContext","isSlottedContextValue","P","u","isDisabled","Icon","g","AccordionTrigger","Heading","E","jsxs","L","C","className","T","AccordionPanel","DisclosurePanel","b","Accordion","props","useContextProps","y","accordion"],"mappings":"2cAuCQA,IAAO,CAAA,KAAA,CAAA,CAAA,CAAA,SAAW,CAAAC,CAAAA,CAAQ,QAAAC,CAAAA,OAAS,CAAA,CAAAC,QAASC,CAAM,CAAA,CAAIC,KAEjDC,CACXC,EAA4D,CAAAC,eAAA,EAAI,CAAA,CAElE,CAAAC,aAAA,CAAA,IAAA,EAASC,SAEP,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAAC,QACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAAC,CAAAA,OAAkC,CAAA,CAAA,CAAAC,uBAClC,CAAA,OAAA,CAAA,UAE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B,eAAA,CAAA,CAAKtB,GACL,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,SACEd,CAAMe,kBAAE,kBAGT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAR,QAIQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,iBAEtB,CAAS8B,SAAiB,CAAA,CAAA,CAAGC,GAAyB,CAC3D,CAACA,CAAAA,GAAU,CAAIC,CAAAA,CAAgBD,CAAAA,CAAOxB,CAAAA,CAAAA,CAAO,mBAAMZ,CAAgB,CAAA,EAEnE,IACE,CAAA,CAAA,CAAA,CAAA,GAAA,CAAAK,oBAEA,CAAA,CAAAC,CAAAA,OAAkC,CAAA,CAAA,CAAAC,uBAClC,CAAA,OAAA,CAAA,UAEE6B,CAAAA,CAEJ,CAAA,GAAA,CAAA,CAAA,CACE5B,CAAAA,CAACR,OAAiBS,GAAA,CAAA,CAAA,CAAjB,QAEG,CAAA,CAAA,KAAA,CAAAH,CAAAA,oBAIF,CAAA,CAAA,CAAA,CAAAE,QACME,CAAAA,GACJ,CAAA4B,UAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SACEC,CAAU1B,kBACR,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,SAGJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,UAEC,CAAA,CAAA,CAAAR,QAKC,oBAAc,CAAA,WACND,CAAAA,CAClB+B,CAAAA,KAAU,CAAA,CAAA,CAASrB,EACnBqB,MAAU,CAAA,CAAA,CAAA,CAAUX,CAAAA,OACV,CAAA,CAAQQ,CAAAA,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\n'use client';\nimport 'client-only';\nimport {\n Button,\n type ContextValue,\n Disclosure,\n DisclosureGroup,\n DisclosurePanel,\n DisclosureStateContext,\n Heading,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\n\nimport { isSlottedContextValue } from '@/lib/utils';\nimport { ChevronDown } from '@accelint/icons';\nimport { createContext, useContext } from 'react';\nimport { Icon } from '../icon';\nimport { AccordionStyles, AccordionStylesDefaults } from './styles';\nimport type {\n AccordionGroupProps,\n AccordionHeaderProps,\n AccordionPanelProps,\n AccordionProps,\n AccordionTriggerProps,\n} from './types';\n\nconst { group, accordion, header, heading, trigger, panel } = AccordionStyles();\n\nexport const AccordionContext =\n createContext<ContextValue<AccordionProps, HTMLDivElement>>(null);\n\nfunction AccordionGroup({\n ref,\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n}: AccordionGroupProps) {\n return (\n <AccordionContext.Provider value={{ variant, isDisabled }}>\n <DisclosureGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n group({\n className,\n variant,\n isDisabled,\n }),\n )}\n >\n {children}\n </DisclosureGroup>\n </AccordionContext.Provider>\n );\n}\nAccordionGroup.displayName = 'Accordion.Group';\n\nfunction AccordionHeader({ ref, children, className }: AccordionHeaderProps) {\n const context = useContext(AccordionContext);\n const state = useContext(DisclosureStateContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n const isDisabled =\n (isSlottedContextValue(context) ? undefined : context?.isDisabled) ??\n AccordionStylesDefaults.isDisabled;\n const isExpanded = state?.isExpanded ?? AccordionStylesDefaults.isExpanded;\n\n return (\n <Icon.Provider size={variant === 'compact' ? 'small' : 'large'}>\n <div\n ref={ref}\n className={header({\n className,\n variant,\n isDisabled,\n isExpanded,\n })}\n >\n {children}\n </div>\n </Icon.Provider>\n );\n}\nAccordionHeader.displayName = 'Accordion.Header';\n\nfunction AccordionTrigger({\n ref,\n children,\n classNames,\n}: AccordionTriggerProps) {\n const context = useContext(AccordionContext);\n const state = useContext(DisclosureStateContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n const isDisabled =\n (isSlottedContextValue(context) ? undefined : context?.isDisabled) ??\n AccordionStylesDefaults.isDisabled;\n const isExpanded = state?.isExpanded ?? AccordionStylesDefaults.isExpanded;\n\n return (\n <Heading\n ref={ref}\n className={heading({\n className: classNames?.heading,\n variant,\n isDisabled,\n isExpanded,\n })}\n >\n <Button\n slot='trigger'\n className={composeRenderProps(classNames?.trigger, (className) =>\n trigger({\n className,\n variant,\n isExpanded,\n }),\n )}\n >\n <Icon>\n <ChevronDown className='transform group-dtk-expanded:rotate-180' />\n </Icon>\n {children}\n </Button>\n </Heading>\n );\n}\nAccordionTrigger.displayName = 'Accordion.Trigger';\n\nfunction AccordionPanel({\n ref,\n children,\n className,\n ...rest\n}: AccordionPanelProps) {\n return (\n <DisclosurePanel\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n panel({ className }),\n )}\n >\n {children}\n </DisclosurePanel>\n );\n}\nAccordionPanel.displayName = 'Accordion.Panel';\n\nexport function Accordion({ ref, ...props }: AccordionProps) {\n [props, ref] = useContextProps(props, ref ?? null, AccordionContext);\n\n const {\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n } = props;\n\n return (\n <AccordionContext.Provider\n value={{\n variant,\n isDisabled,\n }}\n >\n <Disclosure\n {...rest}\n className={composeRenderProps(className, (className) =>\n accordion({\n className,\n }),\n )}\n isDisabled={isDisabled}\n >\n {children}\n </Disclosure>\n </AccordionContext.Provider>\n );\n}\nAccordion.displayName = 'Accordion';\nAccordion.Group = AccordionGroup;\nAccordion.Header = AccordionHeader;\nAccordion.Trigger = AccordionTrigger;\nAccordion.Panel = AccordionPanel;\n"]}
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import {Person}from'@accelint/icons';import*as t from'@radix-ui/react-avatar';import'client-only';import {cva}from'cva';import {jsxs,jsx}from'react/jsx-runtime';var l=cva("fg-default-dark flex items-center justify-center overflow-hidden rounded-full bg-surface-overlay",{variants:{size:{medium:"size-[32px] **:[svg]:size-xl",small:"size-xl **:[svg]:size-l"}},defaultVariants:{size:"medium"}}),g=cn(["relative inline-block","[--badge-empty-inset:0_0_auto_auto] [--badge-inset:calc(var(--spacing-xxs)*-1)_calc(var(--spacing-xxs)*-1)_auto_auto] [--badge-position:absolute]"]),v=({className:e,children:i,fallback:s,fallbackDelay:m=0,source:a,size:p="medium",...c})=>jsxs("div",{className:g,children:[jsxs(t.Root,{className:cn("pointer-events-none inline-block",l({size:p,className:e})),role:"img",children:[typeof a=="string"&&jsx(t.Image,{className:"size-full object-cover object-center",src:typeof a=="string"?a:void 0,...c}),a&&typeof a!="string"?a:jsx(t.Fallback,{delayMs:m,children:s||jsx(Person,{})})]}),i]});v.displayAs="Avatar";v.as=(e,i)=>cn(l({...e,className:i}));export{v as Avatar};//# sourceMappingURL=index.js.map
1
+ import {cn}from'./../../lib/utils.js';import {Person}from'@accelint/icons';import*as t from'@radix-ui/react-avatar';import'client-only';import {cva}from'cva';import {jsxs,jsx}from'react/jsx-runtime';var l=cva("fg-default-dark flex items-center justify-center overflow-hidden rounded-full bg-surface-overlay",{variants:{size:{medium:"size-[32px] **:[svg]:size-xl",small:"size-xl **:[svg]:size-l"}},defaultVariants:{size:"medium"}}),g=cn(["relative inline-block","[--badge-empty-inset:0_0_auto_auto] [--badge-inset:calc(var(--spacing-xxs)*-1)_calc(var(--spacing-xxs)*-1)_auto_auto] [--badge-position:absolute]"]),v=({className:e,children:i,fallback:o,fallbackDelay:m=0,source:a,size:p="medium",...c})=>jsxs("div",{className:g,children:[jsxs(t.Root,{className:cn("pointer-events-none inline-block",l({size:p,className:e})),role:"img",children:[typeof a=="string"&&jsx(t.Image,{className:"size-full object-cover object-center",src:typeof a=="string"?a:void 0,...c}),a&&typeof a!="string"?a:jsx(t.Fallback,{delayMs:m,children:o||jsx(Person,{})})]}),i]});v.displayAs="Avatar";v.as=(e,i)=>cn(l({...e,className:i}));export{v as Avatar};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/avatar/index.tsx"],"names":["d","cn","o","source","size","n","Person","r","children","Avatar","props","className","avatarStyles"],"mappings":"uMAoBE,IAAA,CAAA,CAAAA,GAAA,CAAA,4GAGU,CACJ,CAAA,IAAA,CAAA,CAAQ,qCACD,CAAA,KAAA,CAAA,yBAGX,CAAA,CAAA,CAAA,eACQ,CAAA,CAAA,IAAA,CAAA,QAKgBC,CAAG,CAC7B,CAAA,CAAA,CAAA,CAAAC,EAAA,CAAA,CAAA,uBACA,CAAA,mJAmBA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,wBAEA,CAAA,CAAA,CAAA,CAAA,CAAAC,OACAC,CAAAA,CAAO,IAAA,CAAA,CAAA,CAAA,YAGN,CAAA,CAAA,GAAAC,IAAA,CAAI,KAAA,CAAA,CAAA,SACH,CAAA,CAAA,CAAA,QAAiB,CAAA,CAAAA,IAAA,CAAhB,CACC,gBACE,CAAAH,EAAA,CAAA,kCACe,CAAA,CAAAE,CAAAA,CAAM,IAAA,CAAA,CAAA,CAAA,SAEvB,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,IAEJ,CAAA,KAAA,CAAA,QAAA,CAAA,CAAOD,OAAW,CAAA,EAAA,eAChB,CACC,KAAA,CAAA,CAAA,SAAU,CAAA,2CACEA,OAAW,CAAA,EAAA,QAAoB,CAAA,CAAA,CAC1C,MACH,CAEDA,GAAU,CAAA,CAAA,CAAA,CAAA,CAAA,EAAOA,OAAW,CAAA,EAAA,yBAGD,CAAA,CAAA,OACvB,CAAA,CAAA,CAAA,QAAuBG,CAAA,CAAA,EAAOC,GACjC,QAEJ,EACCC,CAAAA,CAAAA,CACH,CAAA,CAEFC,CAAAA,CAAO,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,SAAY,CAAA,QAEjBC,CAAAA,CACAC,CAAAA,EAAAA,CACGV,CAAAA,CAAGW,CAAAA,CAAa,GAAEV,EAAGQ,CAAAA,CAAO,CAAA,CAAA,GAAA,CAAA,CAAA,SAAY,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { cn } from '@/lib/utils';\nimport { Person } from '@accelint/icons';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport 'client-only';\nimport { type VariantProps, cva } from 'cva';\nimport type React from 'react';\n\nconst avatarStyles = cva(\n 'fg-default-dark flex items-center justify-center overflow-hidden rounded-full bg-surface-overlay',\n {\n variants: {\n size: {\n medium: 'size-[32px] **:[svg]:size-xl',\n small: 'size-xl **:[svg]:size-l',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\nconst avatarWrapperStyles = cn([\n 'relative inline-block',\n '[--badge-empty-inset:0_0_auto_auto] [--badge-inset:calc(var(--spacing-xxs)*-1)_calc(var(--spacing-xxs)*-1)_auto_auto] [--badge-position:absolute]',\n]);\n\nexport interface AvatarProps\n extends React.ComponentProps<typeof AvatarPrimitive.Image>,\n VariantProps<typeof avatarStyles> {\n /**\n * The fallback that the avatar will render if it cannot load the provided source.\n *\n * Accepts any React component.\n */\n fallback?: React.ReactNode;\n /** How long the system should wait before it shows the fallback component. By default there is no delay. */\n fallbackDelay?: number;\n /** The source of an avatar can either be a URL representing an image or a React component (such as an SVG or an icon from a library). */\n source?: string | React.ReactNode;\n}\n\nexport const Avatar = ({\n className,\n children,\n fallback,\n fallbackDelay = 0,\n source,\n size = 'medium',\n ...props\n}: AvatarProps) => (\n <div className={avatarWrapperStyles}>\n <AvatarPrimitive.Root\n className={cn(\n 'pointer-events-none inline-block',\n avatarStyles({ size, className }),\n )}\n role='img'\n >\n {typeof source === 'string' && (\n <AvatarPrimitive.Image\n className='size-full object-cover object-center'\n src={typeof source === 'string' ? source : undefined}\n {...props}\n />\n )}\n {source && typeof source !== 'string' ? (\n source\n ) : (\n <AvatarPrimitive.Fallback delayMs={fallbackDelay}>\n {fallback ? fallback : <Person />}\n </AvatarPrimitive.Fallback>\n )}\n </AvatarPrimitive.Root>\n {children}\n </div>\n);\nAvatar.displayAs = 'Avatar';\nAvatar.as = (\n props: VariantProps<typeof avatarStyles>,\n className?: string | string[],\n) => cn(avatarStyles({ ...props, className }));\n"]}
1
+ {"version":3,"sources":["../../../src/components/avatar/index.tsx"],"names":["d","cn","s","source","size","n","Person","r","children","Avatar","props","className","avatarStyles"],"mappings":"uMAqBE,IAAA,CAAA,CAAAA,GAAA,CAAA,4GAGU,CACJ,CAAA,IAAA,CAAA,CAAQ,qCACD,CAAA,KAAA,CAAA,yBAGX,CAAA,CAAA,CAAA,eACQ,CAAA,CAAA,IAAA,CAAA,QAKgBC,CAAG,CAC7B,CAAA,CAAA,CAAA,CAAAC,EAAA,CAAA,CAAA,uBACA,CAAA,mJAmBA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,wBAEA,CAAA,CAAA,CAAA,CAAA,CAAAC,OACAC,CAAAA,CAAO,IAAA,CAAA,CAAA,CAAA,YAGN,CAAA,CAAA,GAAAC,IAAA,CAAI,KAAA,CAAA,CAAA,SACH,CAAA,CAAA,CAAA,QAAiB,CAAA,CAAAA,IAAA,CAAhB,CACC,gBACE,CAAAH,EAAA,CAAA,kCACe,CAAA,CAAAE,CAAAA,CAAM,IAAA,CAAA,CAAA,CAAA,SAEvB,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,IAEJ,CAAA,KAAA,CAAA,QAAA,CAAA,CAAOD,OAAW,CAAA,EAAA,eAChB,CACC,KAAA,CAAA,CAAA,SAAU,CAAA,2CACEA,OAAW,CAAA,EAAA,QAAoB,CAAA,CAAA,CAC1C,MACH,CAEDA,GAAU,CAAA,CAAA,CAAA,CAAA,CAAA,EAAOA,OAAW,CAAA,EAAA,yBAGD,CAAA,CAAA,OACvB,CAAA,CAAA,CAAA,QAAuBG,CAAA,CAAA,EAAOC,GACjC,QAEJ,EACCC,CAAAA,CAAAA,CACH,CAAA,CAEFC,CAAAA,CAAO,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,SAAY,CAAA,QAEjBC,CAAAA,CACAC,CAAAA,EAAAA,CACGV,CAAAA,CAAGW,CAAAA,CAAa,GAAEV,EAAGQ,CAAAA,CAAO,CAAA,CAAA,GAAA,CAAA,CAAA,SAAY,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport { Person } from '@accelint/icons';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport 'client-only';\nimport { type VariantProps, cva } from 'cva';\nimport type React from 'react';\n\nconst avatarStyles = cva(\n 'fg-default-dark flex items-center justify-center overflow-hidden rounded-full bg-surface-overlay',\n {\n variants: {\n size: {\n medium: 'size-[32px] **:[svg]:size-xl',\n small: 'size-xl **:[svg]:size-l',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\nconst avatarWrapperStyles = cn([\n 'relative inline-block',\n '[--badge-empty-inset:0_0_auto_auto] [--badge-inset:calc(var(--spacing-xxs)*-1)_calc(var(--spacing-xxs)*-1)_auto_auto] [--badge-position:absolute]',\n]);\n\nexport interface AvatarProps\n extends React.ComponentProps<typeof AvatarPrimitive.Image>,\n VariantProps<typeof avatarStyles> {\n /**\n * The fallback that the avatar will render if it cannot load the provided source.\n *\n * Accepts any React component.\n */\n fallback?: React.ReactNode;\n /** How long the system should wait before it shows the fallback component. By default there is no delay. */\n fallbackDelay?: number;\n /** The source of an avatar can either be a URL representing an image or a React component (such as an SVG or an icon from a library). */\n source?: string | React.ReactNode;\n}\n\nexport const Avatar = ({\n className,\n children,\n fallback,\n fallbackDelay = 0,\n source,\n size = 'medium',\n ...props\n}: AvatarProps) => (\n <div className={avatarWrapperStyles}>\n <AvatarPrimitive.Root\n className={cn(\n 'pointer-events-none inline-block',\n avatarStyles({ size, className }),\n )}\n role='img'\n >\n {typeof source === 'string' && (\n <AvatarPrimitive.Image\n className='size-full object-cover object-center'\n src={typeof source === 'string' ? source : undefined}\n {...props}\n />\n )}\n {source && typeof source !== 'string' ? (\n source\n ) : (\n <AvatarPrimitive.Fallback delayMs={fallbackDelay}>\n {fallback ? fallback : <Person />}\n </AvatarPrimitive.Fallback>\n )}\n </AvatarPrimitive.Root>\n {children}\n </div>\n);\nAvatar.displayAs = 'Avatar';\nAvatar.as = (\n props: VariantProps<typeof avatarStyles>,\n className?: string | string[],\n) => cn(avatarStyles({ ...props, className }));\n"]}
@@ -1,2 +1,2 @@
1
- import {expectsIconWrapper}from'./../../lib/react.js';import {cn}from'./../../lib/utils.js';import {cva}from'cva';import {Button,composeRenderProps}from'react-aria-components';import {jsx}from'react/jsx-runtime';var n=cva("inline-flex cursor-pointer items-center justify-center whitespace-nowrap [--icon-size:20px]",{variants:{variant:{primary:"fg-inverse-light rounded-medium bg-interactive-default dtk-pressed:bg-interactive-hover-light outline-none hover:bg-interactive-hover-light focus:bg-interactive-hover-light",outline:"fg-default-light rounded-medium outline dtk-pressed:outline-interactive-hover outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover",flat:"fg-default-light rounded-medium bg-transparent dtk-pressed:bg-interactive-hover-dark outline-none hover:bg-interactive-hover-dark focus:bg-interactive-hover-dark",destructive:"fg-inverse-light rounded-medium bg-serious-bold dtk-pressed:bg-serious-hover outline-none hover:bg-serious-hover focus:bg-serious-hover",critical:"fg-default-light rounded-medium bg-critical-bold dtk-pressed:bg-critical-hover outline-none hover:bg-critical-hover focus:bg-critical-hover"},size:{large:"min-h-xxl gap-xs rounded-medium px-l py-s text-button-l [--icon-size:24px]",medium:"min-h-[32px] gap-xs rounded-medium px-l py-xs text-button-m [--icon-size:20px]",small:"min-h-xl gap-xxs p-s text-button-s [--icon-size:16px]",xsmall:"min-h-[20px] gap-xxs px-s py-xs text-button-xs [--icon-size:12px]"},isDisabled:{true:"fg-disabled hover:fg-disabled cursor-not-allowed bg-interactive-disabled hover:bg-interactive-disabled focus:bg-interactive-disabled",false:""}},compoundVariants:[{variant:"outline",isDisabled:true,className:"fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent outline outline-interactive-disabled hover:bg-transparent focus:bg-transparent"},{variant:"flat",isDisabled:true,className:"fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent hover:bg-transparent focus:bg-transparent"}],defaultVariants:{isDisabled:false,variant:"primary",size:"medium"}}),i=({className:t,isDisabled:e,variant:s="primary",size:a="medium",...r})=>(expectsIconWrapper({children:r.children,componentName:i.displayName}),jsx(Button,{className:composeRenderProps(t,d=>cn("w-content",n({isDisabled:e,variant:s,size:a,className:d}))),isDisabled:e,...r}));i.displayName="Button";i.as=(t,e)=>cn(n({...t,className:e}));export{i as Button};//# sourceMappingURL=index.js.map
1
+ import {expectsIconWrapper}from'./../../lib/react.js';import {cn}from'./../../lib/utils.js';import'client-only';import {cva}from'cva';import {Button,composeRenderProps}from'react-aria-components';import {jsx}from'react/jsx-runtime';var n=cva("inline-flex cursor-pointer items-center justify-center whitespace-nowrap [--icon-size:20px]",{variants:{variant:{primary:"fg-inverse-light rounded-medium bg-interactive-default dtk-pressed:bg-interactive-hover-light outline-none hover:bg-interactive-hover-light focus:bg-interactive-hover-light",outline:"fg-default-light rounded-medium outline dtk-pressed:outline-interactive-hover outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover",flat:"fg-default-light rounded-medium bg-transparent dtk-pressed:bg-interactive-hover-dark outline-none hover:bg-interactive-hover-dark focus:bg-interactive-hover-dark",destructive:"fg-inverse-light rounded-medium bg-serious-bold dtk-pressed:bg-serious-hover outline-none hover:bg-serious-hover focus:bg-serious-hover",critical:"fg-default-light rounded-medium bg-critical-bold dtk-pressed:bg-critical-hover outline-none hover:bg-critical-hover focus:bg-critical-hover"},size:{large:"min-h-xxl gap-xs rounded-medium px-l py-s text-button-l [--icon-size:24px]",medium:"min-h-[32px] gap-xs rounded-medium px-l py-xs text-button-m [--icon-size:20px]",small:"min-h-xl gap-xxs p-s text-button-s [--icon-size:16px]",xsmall:"min-h-[20px] gap-xxs px-s py-xs text-button-xs [--icon-size:12px]"},isDisabled:{true:"fg-disabled hover:fg-disabled cursor-not-allowed bg-interactive-disabled hover:bg-interactive-disabled focus:bg-interactive-disabled",false:""}},compoundVariants:[{variant:"outline",isDisabled:true,className:"fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent outline outline-interactive-disabled hover:bg-transparent focus:bg-transparent"},{variant:"flat",isDisabled:true,className:"fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent hover:bg-transparent focus:bg-transparent"}],defaultVariants:{isDisabled:false,variant:"primary",size:"medium"}}),i=({className:t,isDisabled:e,variant:s="primary",size:a="medium",...r})=>(expectsIconWrapper({children:r.children,componentName:i.displayName}),jsx(Button,{className:composeRenderProps(t,d=>cn("w-content",n({isDisabled:e,variant:s,size:a,className:d}))),isDisabled:e,...r}));i.displayName="Button";i.as=(t,e)=>cn(n({...t,className:e}));export{i as Button};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["u","Button","className","isDisabled","props","l","jsx","b","composeRenderProps","p","buttonStyles","cn","o"],"mappings":"oNAqBE,IAAA,CAAA,CAAAA,GAAA,CAAA,6FAGI,CAAA,CAAA,QACE,CAAA,CAAA,+LAGE,CAAA,OAAA,CAAA,mKACI,CAAA,IAAA,CAAA,mKAEJ,CAAA,WAAA,CAAA,yIAEA,CAAA,QAAA,CAAA,6IAIA,CAAA,CAAA,IAAA,CAAA,CAAA,KAAA,CAAA,oKAGK,CAAA,KAAA,CAAA,uDAEL,CAAA,MAAA,CAAA,mEAGF,CAAA,CAAA,UAAM,CAAA,CAAA,IAAA,CAAA,sIAIV,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,gBAEa,CAAA,CAAA,CAAA,OACT,CAAA,UACA,UACE,CAAA,IAAA,CAAA,SAAA,CAAA,kKAGO,CAAA,CAAA,CAAA,OACT,CAAA,OACA,UACE,CAAA,IAAA,CAAA,SAAA,CAAA,6HAGN,CAAA,CAAA,CAAA,iBAEE,UAAS,CAAA,KAAA,CAAA,OACT,CAAA,SACF,CACF,IAgBWC,CAAS,QACpB,CAAA,CAAA,CAAA,CAAAC,CAAAA,CACA,CAAA,CAAA,SAAAC,CAAAA,CACA,WAAU,CAAA,CAAA,CAAA,OACV,CAAA,CAAA,CAAA,cACA,CAAGC,CACL,CAAA,QAEI,CAAA,GAAA,CAAA,CAAA,IAAgBC,kBAAA,CAAA,CAAA,QAChB,CAAA,CAAA,CAAA,QAAA,CAAeJ,aACjB,CAAC,EAGCK,WACE,CAAA,CAAA,CAAAC,GAAWC,CAAAA,MAAmBN,CAAAA,CAAYA,SAEtC,CAAAO,kBAAA,CAAA,CAAA,CAAA,CAAA,EACAC,EAAAA,CAAa,WACX,CAAAP,EACA,CAAA,UACA,CAAA,CAAA,CAAA,cAEF,CAAC,CACH,CACF,SACA,CAAA,CAAA,CAAA,CAAYA,CAAAA,CACX,CAAA,UAIA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAc,CAAA,CAAA,YACT,QAGPQ,CAAGD,EAAa,EAAE,CAAA,CAAGN,EAAO,CAAA,GAAAQ,EAAA,CAAA,CAAA,CAAA,CAAA,GAAW,CAAC,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["import { expectsIconWrapper } from '@/lib/react';\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 */\nimport { cn } from '@/lib/utils';\nimport { type VariantProps, cva } from 'cva';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n composeRenderProps,\n} from 'react-aria-components';\n\nconst buttonStyles = cva(\n 'inline-flex cursor-pointer items-center justify-center whitespace-nowrap [--icon-size:20px]',\n {\n variants: {\n variant: {\n primary:\n 'fg-inverse-light rounded-medium bg-interactive-default dtk-pressed:bg-interactive-hover-light outline-none hover:bg-interactive-hover-light focus:bg-interactive-hover-light',\n outline:\n 'fg-default-light rounded-medium outline dtk-pressed:outline-interactive-hover outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n flat: 'fg-default-light rounded-medium bg-transparent dtk-pressed:bg-interactive-hover-dark outline-none hover:bg-interactive-hover-dark focus:bg-interactive-hover-dark',\n destructive:\n 'fg-inverse-light rounded-medium bg-serious-bold dtk-pressed:bg-serious-hover outline-none hover:bg-serious-hover focus:bg-serious-hover',\n critical:\n 'fg-default-light rounded-medium bg-critical-bold dtk-pressed:bg-critical-hover outline-none hover:bg-critical-hover focus:bg-critical-hover',\n },\n size: {\n large:\n 'min-h-xxl gap-xs rounded-medium px-l py-s text-button-l [--icon-size:24px]',\n medium:\n 'min-h-[32px] gap-xs rounded-medium px-l py-xs text-button-m [--icon-size:20px]',\n small: 'min-h-xl gap-xxs p-s text-button-s [--icon-size:16px]',\n xsmall:\n 'min-h-[20px] gap-xxs px-s py-xs text-button-xs [--icon-size:12px]',\n },\n isDisabled: {\n true: 'fg-disabled hover:fg-disabled cursor-not-allowed bg-interactive-disabled hover:bg-interactive-disabled focus:bg-interactive-disabled',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n isDisabled: true,\n className:\n 'fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent outline outline-interactive-disabled hover:bg-transparent focus:bg-transparent',\n },\n {\n variant: 'flat',\n isDisabled: true,\n className:\n 'fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent hover:bg-transparent focus:bg-transparent',\n },\n ],\n defaultVariants: {\n isDisabled: false,\n variant: 'primary',\n size: 'medium',\n },\n },\n);\n\nexport interface ButtonProps\n extends Omit<AriaButtonProps, 'children' | 'isDisabled'>,\n VariantProps<typeof buttonStyles> {\n /**\n * Used to add text to the badge, such as the number of unread notifications.\n *\n * Can also receive a function which will be called with the parameters mentioned\n * {@link https://react-spectrum.adobe.com/react-aria/Button.html#styling:~:text=are%20documented%20below.-,Name,-CSS%20Selector here}\n */\n children?: AriaButtonProps['children'];\n isDisabled?: boolean;\n}\n\nexport const Button = ({\n className,\n isDisabled,\n variant = 'primary',\n size = 'medium',\n ...props\n}: ButtonProps) => {\n expectsIconWrapper({\n children: props.children,\n componentName: Button.displayName,\n });\n\n return (\n <AriaButton\n className={composeRenderProps(className, (className) =>\n cn(\n 'w-content',\n buttonStyles({\n isDisabled,\n variant,\n size,\n className,\n }),\n ),\n )}\n isDisabled={isDisabled}\n {...props}\n />\n );\n};\nButton.displayName = 'Button';\nButton.as = (\n props: VariantProps<typeof buttonStyles>,\n className?: string | string[],\n) => cn(buttonStyles({ ...props, className }));\n"]}
1
+ {"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["Button","className","isDisabled","props","l","jsx","b","composeRenderProps","p","buttonStyles","cn","o"],"mappings":"+UA2BM,CAAA,CAAA,QACE,CAAA,CAAA,OACE,CAAA,CAAA,OAAA,CAAA,8KAEA,CAAA,OAAA,CAAA,4UAGA,CAAA,WAAA,CAAA,yIAEA,CAAA,QAAA,CAAA,6IAIA,CAAA,CAAA,IAAA,CAAA,CAAA,KAAA,CAAA,4EAEA,CAAA,MAAA,CAAA,gFACK,CAAA,KAAA,CAAA,kIAKP,CAAA,CAAA,mLAMS,CAAA,CAAA,CAAA,iBACG,CACZ,UACE,CAAA,IAAA,CAAA,SAAA,CAAA,kKAGO,CAAA,CAAA,CAAA,cACG,CACZ,UACE,6IAGN,CAAA,CAAA,CAAA,eACc,CAAA,CACZ,UAAS,CAAA,KAAA,CAAA,OACT,CAAA,SACF,CACF,IAgBWA,CAAS,QACpB,CAAA,CAAA,CAAA,CAAAC,CAAAA,CACA,CAAA,CAAA,SAAAC,EACA,CAAA,UAAU,CAAA,CAAA,CAAA,OACV,CAAA,CAAA,CAAA,SAAO,CAAA,IACP,CAAGC,CACL,CAAA,QAEI,CAAA,GAAA,CAAA,CAAA,IAAgBC,kBAAA,CAAA,CAAA,oBACDJ,aACjB,CAAC,CAAA,CAGCK,WACE,CAAA,CAAA,CAAAC,GAAWC,CAAAA,MAAmBN,CAAAA,CAAYA,SAEtC,CAAAO,kBAAA,CAAA,CAAA,CAAA,CAAA,EACAC,EAAAA,CAAa,YACXP,CAAAA,CACA,CAAA,UACA,CAAA,CAAA,CAAA,OACA,CAAA,CAAA,CAAA,IACF,CAAC,CACH,CACF,SACA,CAAA,CAAA,CAAA,CAAYA,CAAAA,CACX,CAAA,UAIA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAc,CAAA,CAAA,YACT,QAGPQ,CAAGD,EAAa,EAAE,CAAA,CAAGN,EAAO,CAAA,GAAAQ,EAAA,CAAA,CAAA,CAAA,CAAA,GAAW,CAAC,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { expectsIconWrapper } from '@/lib/react';\nimport { cn } from '@/lib/utils';\nimport 'client-only';\nimport { type VariantProps, cva } from 'cva';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n composeRenderProps,\n} from 'react-aria-components';\n\nconst buttonStyles = cva(\n 'inline-flex cursor-pointer items-center justify-center whitespace-nowrap [--icon-size:20px]',\n {\n variants: {\n variant: {\n primary:\n 'fg-inverse-light rounded-medium bg-interactive-default dtk-pressed:bg-interactive-hover-light outline-none hover:bg-interactive-hover-light focus:bg-interactive-hover-light',\n outline:\n 'fg-default-light rounded-medium outline dtk-pressed:outline-interactive-hover outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n flat: 'fg-default-light rounded-medium bg-transparent dtk-pressed:bg-interactive-hover-dark outline-none hover:bg-interactive-hover-dark focus:bg-interactive-hover-dark',\n destructive:\n 'fg-inverse-light rounded-medium bg-serious-bold dtk-pressed:bg-serious-hover outline-none hover:bg-serious-hover focus:bg-serious-hover',\n critical:\n 'fg-default-light rounded-medium bg-critical-bold dtk-pressed:bg-critical-hover outline-none hover:bg-critical-hover focus:bg-critical-hover',\n },\n size: {\n large:\n 'min-h-xxl gap-xs rounded-medium px-l py-s text-button-l [--icon-size:24px]',\n medium:\n 'min-h-[32px] gap-xs rounded-medium px-l py-xs text-button-m [--icon-size:20px]',\n small: 'min-h-xl gap-xxs p-s text-button-s [--icon-size:16px]',\n xsmall:\n 'min-h-[20px] gap-xxs px-s py-xs text-button-xs [--icon-size:12px]',\n },\n isDisabled: {\n true: 'fg-disabled hover:fg-disabled cursor-not-allowed bg-interactive-disabled hover:bg-interactive-disabled focus:bg-interactive-disabled',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n isDisabled: true,\n className:\n 'fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent outline outline-interactive-disabled hover:bg-transparent focus:bg-transparent',\n },\n {\n variant: 'flat',\n isDisabled: true,\n className:\n 'fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent hover:bg-transparent focus:bg-transparent',\n },\n ],\n defaultVariants: {\n isDisabled: false,\n variant: 'primary',\n size: 'medium',\n },\n },\n);\n\nexport interface ButtonProps\n extends Omit<AriaButtonProps, 'children' | 'isDisabled'>,\n VariantProps<typeof buttonStyles> {\n /**\n * Used to add text to the badge, such as the number of unread notifications.\n *\n * Can also receive a function which will be called with the parameters mentioned\n * {@link https://react-spectrum.adobe.com/react-aria/Button.html#styling:~:text=are%20documented%20below.-,Name,-CSS%20Selector here}\n */\n children?: AriaButtonProps['children'];\n isDisabled?: boolean;\n}\n\nexport const Button = ({\n className,\n isDisabled,\n variant = 'primary',\n size = 'medium',\n ...props\n}: ButtonProps) => {\n expectsIconWrapper({\n children: props.children,\n componentName: Button.displayName,\n });\n\n return (\n <AriaButton\n className={composeRenderProps(className, (className) =>\n cn(\n 'w-content',\n buttonStyles({\n isDisabled,\n variant,\n size,\n className,\n }),\n ),\n )}\n isDisabled={isDisabled}\n {...props}\n />\n );\n};\nButton.displayName = 'Button';\nButton.as = (\n props: VariantProps<typeof buttonStyles>,\n className?: string | string[],\n) => cn(buttonStyles({ ...props, className }));\n"]}
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import {CheckboxIndeterminate,CheckboxSelected}from'@accelint/icons';import {cva}from'cva';import {Checkbox,CheckboxGroup}from'react-aria-components';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var f=cva("fg-inverse-light size-l rounded-small outline outline-interactive",{variants:{isIndeterminate:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isSelected:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isHovered:{true:"outline-interactive-hover"},isFocused:{true:"outline-interactive-hover"},isDisabled:{true:"outline-interactive-disabled hover:outline-interactive-disabled"},isReadOnly:{true:"outline-interactive-disabled hover:outline-interactive-disabled"}},compoundVariants:[{isDisabled:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isDisabled:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"}],defaultVariants:{isIndeterminate:false,isSelected:false}});function k({className:e,children:r,...t}){return jsx(Checkbox,{...t,className:cn("fg-default-light flex items-center gap-m dtk-disabled:text-interactive-disabled text-body-s",e),children:({isDisabled:o,isFocused:a,isHovered:d,isIndeterminate:s,isReadOnly:h,isSelected:n})=>jsxs(Fragment,{children:[jsxs("div",{className:cn(f({isDisabled:o,isFocused:a,isHovered:d,isIndeterminate:s,isReadOnly:h,isSelected:n})),"aria-hidden":true,children:[s&&!n&&jsx(CheckboxIndeterminate,{}),n&&!s&&jsx(CheckboxSelected,{})]}),r]})})}function C({children:e,className:r,label:t,...o}){return jsx(CheckboxGroup,{...o,className:cn("fg-default-light flex flex-col gap-m text-body-s",r),children:a=>jsxs(Fragment,{children:[t?jsx(Label,{children:t}):void 0,typeof e=="function"?e(a):e]})})}k.Group=C;export{k as Checkbox};//# sourceMappingURL=index.js.map
1
+ import {cn}from'./../../lib/utils.js';import {CheckboxIndeterminate,CheckboxSelected}from'@accelint/icons';import'client-only';import {cva}from'cva';import {Checkbox,CheckboxGroup}from'react-aria-components';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var f=cva("fg-inverse-light size-l rounded-small outline outline-interactive",{variants:{isIndeterminate:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isSelected:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isHovered:{true:"outline-interactive-hover"},isFocused:{true:"outline-interactive-hover"},isDisabled:{true:"outline-interactive-disabled hover:outline-interactive-disabled"},isReadOnly:{true:"outline-interactive-disabled hover:outline-interactive-disabled"}},compoundVariants:[{isDisabled:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isDisabled:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"}],defaultVariants:{isIndeterminate:false,isSelected:false}});function k({className:e,children:r,...t}){return jsx(Checkbox,{...t,className:cn("fg-default-light flex items-center gap-m dtk-disabled:text-interactive-disabled text-body-s",e),children:({isDisabled:o,isFocused:a,isHovered:d,isIndeterminate:s,isReadOnly:h,isSelected:n})=>jsxs(Fragment,{children:[jsxs("div",{className:cn(f({isDisabled:o,isFocused:a,isHovered:d,isIndeterminate:s,isReadOnly:h,isSelected:n})),"aria-hidden":true,children:[s&&!n&&jsx(CheckboxIndeterminate,{}),n&&!s&&jsx(CheckboxSelected,{})]}),r]})})}function C({children:e,className:r,label:t,...o}){return jsx(CheckboxGroup,{...o,className:cn("fg-default-light flex flex-col gap-m text-body-s",r),children:a=>jsxs(Fragment,{children:[t?jsx(Label,{children:t}):void 0,typeof e=="function"?e(a):e]})})}k.Group=C;export{k as Checkbox};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/checkbox/index.tsx"],"names":["v","jsx","args","x","c","Fragment","l","u","isSelected","CheckboxIndeterminate","isIndeterminate","CheckboxSelected","i","p","children","label","props","g","m","Checkbox","CheckboxGroup"],"mappings":"oRAyBE,IAAA,CAAA,CAAAA,GAAA,CAAA,mEAEE,CAAA,CAAA,QACE,CAAA,CAAA,eACQ,CAAA,CAAA,IAAA,CAAA,gGAER,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,gGAER,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,2BAER,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,2BAER,CAAA,CAAA,kFAGA,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,iEAGV,CAAA,CAAA,CAAA,gBAEI,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,UACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,eACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,yBACW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,eACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGf,CAAA,CAAA,CAAA,eACE,CAAA,CAAA,eACA,CAAA,KAAA,CAAA,UAUC,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,SAAoB,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,C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AiB,CAAA,CAAA,CAAA,CACjC,CAAA,MAAOJ,CAAAA,OAAa,CAAA,EAAA,UAA+BA,CACtD,CAAA,CAEJ,CAEJ,CAEAK,CAAAA,CAAS,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 { CheckboxIndeterminate, CheckboxSelected } from '@accelint/icons';\nimport { cva } from 'cva';\nimport type React from 'react';\nimport {\n Checkbox as AriaCheckbox,\n CheckboxGroup as AriaCheckboxGroup,\n type CheckboxGroupProps as AriaCheckboxGroupProps,\n type CheckboxProps as AriaCheckboxProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\n\nconst checkboxStyles = cva(\n 'fg-inverse-light size-l rounded-small outline outline-interactive',\n {\n variants: {\n isIndeterminate: {\n true: 'bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover',\n },\n isSelected: {\n true: 'bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover',\n },\n isHovered: {\n true: 'outline-interactive-hover',\n },\n isFocused: {\n true: 'outline-interactive-hover',\n },\n isDisabled: {\n true: 'outline-interactive-disabled hover:outline-interactive-disabled',\n },\n isReadOnly: {\n true: 'outline-interactive-disabled hover:outline-interactive-disabled',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isSelected: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isDisabled: true,\n isIndeterminate: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isReadOnly: true,\n isSelected: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isReadOnly: true,\n isIndeterminate: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n ],\n defaultVariants: {\n isIndeterminate: false,\n isSelected: false,\n },\n },\n);\n\n/**\n * This is a checkbox.\n */\nexport interface CheckboxProps extends AriaCheckboxProps {}\n\nexport function Checkbox({ className, children, ...args }: CheckboxProps) {\n return (\n <AriaCheckbox\n {...args}\n className={cn(\n 'fg-default-light flex items-center gap-m dtk-disabled:text-interactive-disabled text-body-s',\n className,\n )}\n >\n {({\n isDisabled,\n isFocused,\n isHovered,\n isIndeterminate,\n isReadOnly,\n isSelected,\n }) => (\n <>\n <div\n className={cn(\n checkboxStyles({\n isDisabled,\n isFocused,\n isHovered,\n isIndeterminate,\n isReadOnly,\n isSelected,\n }),\n )}\n aria-hidden\n >\n {isIndeterminate && !isSelected && <CheckboxIndeterminate />}\n {isSelected && !isIndeterminate && <CheckboxSelected />}\n </div>\n {children}\n </>\n )}\n </AriaCheckbox>\n );\n}\n\nexport interface CheckboxGroupProps extends AriaCheckboxGroupProps {\n // children: React.JSX.Element;\n label?: string | React.JSX.Element;\n}\n\nfunction CheckboxGroup({\n children,\n className,\n label,\n ...props\n}: CheckboxGroupProps) {\n return (\n <AriaCheckboxGroup\n {...props}\n className={cn(\n 'fg-default-light flex flex-col gap-m text-body-s',\n className,\n )}\n >\n {(props) => (\n <>\n {label ? <Label>{label}</Label> : undefined}\n {typeof children === 'function' ? children(props) : children}\n </>\n )}\n </AriaCheckboxGroup>\n );\n}\n\nCheckbox.Group = CheckboxGroup;\n"]}
1
+ {"version":3,"sources":["../../../src/components/checkbox/index.tsx"],"names":["v","jsx","args","x","c","Fragment","l","u","isSelected","CheckboxIndeterminate","isIndeterminate","CheckboxSelected","i","p","children","label","props","m","g","Checkbox","CheckboxGroup"],"mappings":"wSA2BE,IAAA,CAAA,CAA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,CAAA,CAAA,SAEI,CAAAF,EAAA,CAAA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,eACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UAGJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,aAEC,CAAA,IAAA,CAAA,QAAoBI,CAAcP,CAAAA,CAACQ,EAAA,CAAA,CAAsB,EACzDD,yBAAc,CAACE,EAAAA,CAAmBT,CAAAA,CAACU,EAAA,CAAA,CAAiB,EAAAC,GACvD,CAAAC,gBACCC,CAAAA,EACH,CAAA,CAEJ,CAEJ,CAOA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SACA,CAAAC,CAAAA,CACA,KACF,CAAuB,CACrB,CAAA,GAAA,CAAA,CAAA,CACEd,CAAAA,OACMe,GAAAA,CACJC,aAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SACE,CAAAb,EAAA,CAAA,kDAID,CAAA,CAAA,CAAA,CAAA,QACC,CACG,CAAA,EAAAE,IAAA,CAAAC,QAAA,CAAA,CAAA,QAAS,CAAO,CAAA,CAAA,CAAAK,GAAA,CAAAM,KAAA,CAAA,CAAA,QAAiB,CAAA,CAAA,CAAA,CACjC,CAAA,MAAOJ,CAAAA,OAAa,CAAA,EAAA,UAA+BA,CACtD,CAAA,CAEJ,CAEJ,CAEAK,CAAAA,CAAS,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\n'use client';\nimport { cn } from '@/lib/utils';\nimport { CheckboxIndeterminate, CheckboxSelected } from '@accelint/icons';\nimport 'client-only';\nimport { cva } from 'cva';\nimport type React from 'react';\nimport {\n Checkbox as AriaCheckbox,\n CheckboxGroup as AriaCheckboxGroup,\n type CheckboxGroupProps as AriaCheckboxGroupProps,\n type CheckboxProps as AriaCheckboxProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\n\nconst checkboxStyles = cva(\n 'fg-inverse-light size-l rounded-small outline outline-interactive',\n {\n variants: {\n isIndeterminate: {\n true: 'bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover',\n },\n isSelected: {\n true: 'bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover',\n },\n isHovered: {\n true: 'outline-interactive-hover',\n },\n isFocused: {\n true: 'outline-interactive-hover',\n },\n isDisabled: {\n true: 'outline-interactive-disabled hover:outline-interactive-disabled',\n },\n isReadOnly: {\n true: 'outline-interactive-disabled hover:outline-interactive-disabled',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isSelected: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isDisabled: true,\n isIndeterminate: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isReadOnly: true,\n isSelected: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isReadOnly: true,\n isIndeterminate: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n ],\n defaultVariants: {\n isIndeterminate: false,\n isSelected: false,\n },\n },\n);\n\n/**\n * This is a checkbox.\n */\nexport interface CheckboxProps extends AriaCheckboxProps {}\n\nexport function Checkbox({ className, children, ...args }: CheckboxProps) {\n return (\n <AriaCheckbox\n {...args}\n className={cn(\n 'fg-default-light flex items-center gap-m dtk-disabled:text-interactive-disabled text-body-s',\n className,\n )}\n >\n {({\n isDisabled,\n isFocused,\n isHovered,\n isIndeterminate,\n isReadOnly,\n isSelected,\n }) => (\n <>\n <div\n className={cn(\n checkboxStyles({\n isDisabled,\n isFocused,\n isHovered,\n isIndeterminate,\n isReadOnly,\n isSelected,\n }),\n )}\n aria-hidden\n >\n {isIndeterminate && !isSelected && <CheckboxIndeterminate />}\n {isSelected && !isIndeterminate && <CheckboxSelected />}\n </div>\n {children}\n </>\n )}\n </AriaCheckbox>\n );\n}\n\nexport interface CheckboxGroupProps extends AriaCheckboxGroupProps {\n // children: React.JSX.Element;\n label?: string | React.JSX.Element;\n}\n\nfunction CheckboxGroup({\n children,\n className,\n label,\n ...props\n}: CheckboxGroupProps) {\n return (\n <AriaCheckboxGroup\n {...props}\n className={cn(\n 'fg-default-light flex flex-col gap-m text-body-s',\n className,\n )}\n >\n {(props) => (\n <>\n {label ? <Label>{label}</Label> : undefined}\n {typeof children === 'function' ? children(props) : children}\n </>\n )}\n </AriaCheckboxGroup>\n );\n}\n\nCheckbox.Group = CheckboxGroup;\n"]}
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import {CancelFill}from'@accelint/icons';import {cva}from'cva';import {createContext,useContext}from'react';import {Tag,Button,TagGroup,TagList}from'react-aria-components';import {Icon}from'../icon/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var m=cva(cn(["fg-default-light inline-flex w-content items-center justify-center gap-xxs rounded-full outline"]),{variants:{variant:{advisory:"bg-advisory-subtle outline-advisory-bold",critical:"bg-critical-subtle outline-critical",serious:"bg-serious-subtle outline-serious",normal:"bg-normal-subtle outline-normal",info:"bg-info-subtle outline-info-bold"},size:{medium:"px-s py-xs text-body-s",small:"px-s py-xs text-body-xs"}},defaultVariants:{size:"medium",variant:"info"}}),f=createContext(false),r=({className:e,size:t="medium",variant:a="info",...o})=>{let n=useContext(f)?Tag:"span";return jsx(Icon.Provider,{size:t==="medium"?"small":"xsmall",children:jsx(n,{className:cn(m({size:t,variant:a,className:e})),...o})})};r.displayName="Chip";r.as=(e,t)=>cn(m({...e,className:t}));function b({children:e,className:t,items:a,renderEmptyState:o,...l}){return jsx(f.Provider,{value:true,children:jsx(TagGroup,{...l,children:jsx(TagList,{items:a,renderEmptyState:o,className:cn("flex flex-wrap gap-xs",t),children:e})})})}b.displayName="Chip.List";r.List=b;var A=cva(cn(["fg-default-light inline-flex w-content items-center justify-center rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover","dtk-selected:bg-highlight-subtle dtk-selected:outline-highlight"]),{variants:{isDisabled:{true:"fg-disabled dtk-selected:bg-transparent dtk-selected:outline-interactive-disabled outline-interactive-disabled hover:outline-interactive-disabled focus:outline-interactive-disabled",false:"cursor-pointer"},size:{medium:"px-s py-xs text-body-s",small:"px-s py-xs text-body-xs"}},defaultVariants:{isDisabled:false,size:"medium"}}),g=({className:e,isDisabled:t=false,size:a="medium",...o})=>jsx(Tag,{className:cn(A({isDisabled:t,size:a,className:e})),...o});g.displayName="Chip.Selectable";r.Selectable=g;var N=cva(cn(["fg-default-light group inline-flex w-content items-center justify-center gap-xs rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover"]),{variants:{isDisabled:{true:"fg-disabled outline-interactive-disabled hover:outline-interactive-disabled",false:""},size:{medium:"p-xs pl-m text-body-s",small:"p-xs pl-s text-body-xs"}},defaultVariants:{isDisabled:false,size:"medium"}}),h=({children:e,className:t,isDisabled:a=false,size:o="medium",textValue:l,...n})=>{let x=l??(typeof e=="string"?e:void 0);return jsx(Tag,{className:cn(N({isDisabled:a,size:o,className:t})),textValue:x,...n,children:({allowsRemoving:c,...y})=>{if(!c)throw new Error("You have a <Chip.Deletable> in a <Chip.List> does not specify an onRemove handler.");return jsxs(Fragment,{children:[typeof e=="function"?e({allowsRemoving:c,...y}):e,jsx(Button,{slot:"remove",className:cn(["icon-default-dark group-hover:icon-default-light group-focus:icon-default-light cursor-pointer",a&&"icon-disabled group-hover:icon-disabled cursor-not-allowed"]),children:jsx(Icon,{size:"small",children:jsx(CancelFill,{})})})]})}})};h.displayName="Chip.Deletable";r.Deletable=h;export{r as Chip,h as DeletableChip,g as SelectableChip};//# sourceMappingURL=index.js.map
1
+ import {cn}from'./../../lib/utils.js';import {CancelFill}from'@accelint/icons';import'client-only';import {cva}from'cva';import {createContext,useContext}from'react';import {Tag,Button,TagGroup,TagList}from'react-aria-components';import {Icon}from'../icon/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var m=cva(cn(["fg-default-light inline-flex w-content items-center justify-center gap-xxs rounded-full outline"]),{variants:{variant:{advisory:"bg-advisory-subtle outline-advisory-bold",critical:"bg-critical-subtle outline-critical",serious:"bg-serious-subtle outline-serious",normal:"bg-normal-subtle outline-normal",info:"bg-info-subtle outline-info-bold"},size:{medium:"px-s py-xs text-body-s",small:"px-s py-xs text-body-xs"}},defaultVariants:{size:"medium",variant:"info"}}),f=createContext(false),r=({className:e,size:t="medium",variant:a="info",...o})=>{let n=useContext(f)?Tag:"span";return jsx(Icon.Provider,{size:t==="medium"?"small":"xsmall",children:jsx(n,{className:cn(m({size:t,variant:a,className:e})),...o})})};r.displayName="Chip";r.as=(e,t)=>cn(m({...e,className:t}));function b({children:e,className:t,items:a,renderEmptyState:o,...l}){return jsx(f.Provider,{value:true,children:jsx(TagGroup,{...l,children:jsx(TagList,{items:a,renderEmptyState:o,className:cn("flex flex-wrap gap-xs",t),children:e})})})}b.displayName="Chip.List";r.List=b;var A=cva(cn(["fg-default-light inline-flex w-content items-center justify-center rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover","dtk-selected:bg-highlight-subtle dtk-selected:outline-highlight"]),{variants:{isDisabled:{true:"fg-disabled dtk-selected:bg-transparent dtk-selected:outline-interactive-disabled outline-interactive-disabled hover:outline-interactive-disabled focus:outline-interactive-disabled",false:"cursor-pointer"},size:{medium:"px-s py-xs text-body-s",small:"px-s py-xs text-body-xs"}},defaultVariants:{isDisabled:false,size:"medium"}}),g=({className:e,isDisabled:t=false,size:a="medium",...o})=>jsx(Tag,{className:cn(A({isDisabled:t,size:a,className:e})),...o});g.displayName="Chip.Selectable";r.Selectable=g;var N=cva(cn(["fg-default-light group inline-flex w-content items-center justify-center gap-xs rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover"]),{variants:{isDisabled:{true:"fg-disabled outline-interactive-disabled hover:outline-interactive-disabled",false:""},size:{medium:"p-xs pl-m text-body-s",small:"p-xs pl-s text-body-xs"}},defaultVariants:{isDisabled:false,size:"medium"}}),h=({children:e,className:t,isDisabled:a=false,size:o="medium",textValue:l,...n})=>{let x=l??(typeof e=="string"?e:void 0);return jsx(Tag,{className:cn(N({isDisabled:a,size:o,className:t})),textValue:x,...n,children:({allowsRemoving:c,...y})=>{if(!c)throw new Error("You have a <Chip.Deletable> in a <Chip.List> does not specify an onRemove handler.");return jsxs(Fragment,{children:[typeof e=="function"?e({allowsRemoving:c,...y}):e,jsx(Button,{slot:"remove",className:cn(["icon-default-dark group-hover:icon-default-light group-focus:icon-default-light cursor-pointer",a&&"icon-disabled group-hover:icon-disabled cursor-not-allowed"]),children:jsx(Icon,{size:"small",children:jsx(CancelFill,{})})})]})}})};h.displayName="Chip.Deletable";r.Deletable=h;export{r as Chip,h as DeletableChip,g as SelectableChip};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/chip/index.tsx"],"names":["p","s","Chip","P","size","variant","Component","useContext","Coordinator","AriaTag","C","d","jsx","i","u","props","className","cn","chipStyles","items","T","ChipList","selectableChipStyles","cva","SelectableChip","deletableChipStyles","internalTextValue","textValue","children","allowsRemoving","jsxs","V","D","Button","L","v","DeletableChip"],"mappings":"wSA8BI,IAAA,CAAA,CAAAA,GAAA,CAAAC,EAAA,CAAA,CAAA,iGAGA,CAAA,CAAA,CAAA,CAAA,QACE,CAAA,CAAS,iBACG,CAAA,0CACV,CAAA,8CACA,CAAS,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A,SACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAAG,KAAO,gBACP,CAAA,SAEF,CAAA,CAAA,CAA0B,KAClBsB,GACJC,CAAAA,IAAc,CAAA,CAAA,CAAA,GAAOC,OAAa,CAAA,EAAA,WAEpC,MAAA,CACEhB,CAAAA,OACEC,GAAA,CAAAF,GAAA,CAAA,CAAA,SAEI,CAAAV,EAAA,CAAA,CAAA,CAAA,CAAA,UACAG,CAAAA,CACA,CAAA,IAAA,CAAA,CAAA,CAAA,SAGJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SAGC,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,QAAG,CAAA,CAAA,CAAA,iBAA+B,GACjC,CAAI,CAACyB,GACH,CAAA,GAAA,CAAM,CAAA,CAAA,UACJ,KAAA,CAAA,qFAKFC,CAAAA,OACGC,IAAA,CAAAC,QAAA,CAAA,CAAA,QAAA,CAAOJ,CAAAA,OAAa,CAAA,EAAA,UACN,CAAA,CAAA,CAAA,CAAA,cAA0B,CAAA,CACrCA,CAAAA,GACHK,EAAA,CACC,CAAA,CAAA,CAAApB,GAAA,CAAKqB,MAAA,CAAA,CAAA,IAAA,CAAA,QACL,CAAA,8GAGI,CAAA,CAAA,EAAA,4DAGJ,CAAA,CAAA,CAAA,QAAM,CAAArB,GAAA,CAAKC,IAAA,CAAA,CAAA,IAAA,CACT,OAAA,CAAA,QAAY,CACdD,GAAA,CACFsB,UAAA,CAAA,EAGN,CAAA,CACF,CAEJ,EACAC,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,WAAc,CAAA,gBACvB,CAAA,CAAA,CAAA,SAAYA,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 { CancelFill } from '@accelint/icons';\nimport { type VariantProps, cva } from 'cva';\nimport type React from 'react';\nimport { type ReactNode, createContext, useContext } from 'react';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n type TagGroupProps as AriaTagGroupProps,\n TagList as AriaTagList,\n type TagListProps as AriaTagListProps,\n type TagProps as AriaTagProps,\n Button,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\n\nconst chipStyles = cva(\n cn([\n 'fg-default-light inline-flex w-content items-center justify-center gap-xxs rounded-full outline',\n ]),\n {\n variants: {\n variant: {\n advisory: 'bg-advisory-subtle outline-advisory-bold',\n critical: 'bg-critical-subtle outline-critical',\n serious: 'bg-serious-subtle outline-serious',\n normal: 'bg-normal-subtle outline-normal',\n info: 'bg-info-subtle outline-info-bold',\n },\n size: {\n medium: 'px-s py-xs text-body-s',\n small: 'px-s py-xs text-body-xs',\n },\n },\n defaultVariants: {\n size: 'medium',\n variant: 'info',\n },\n },\n);\n\nexport interface ChipProps\n extends VariantProps<typeof chipStyles>,\n Omit<React.HTMLProps<HTMLSpanElement>, 'children' | 'size'> {\n className?: string;\n /** Used to add text to the badge, such as the number of unread notifications. */\n children?: ReactNode;\n}\n\n// This coordinator is used as a way for the `<Chip>` component to understand\n// whether or not it is being rendered inside of a `<Chip.List>`. This allows\n// us to opt-into using an `<AriaTag>` or a `<span>` to ensure standalone\n// functionality.\nconst Coordinator = createContext(false);\n\nexport const Chip = ({\n className,\n size = 'medium',\n variant = 'info',\n ...props\n}: ChipProps) => {\n const context = useContext(Coordinator);\n\n // If any context was returned from the `Coordinator` context, then\n // we are being rendered inside of a `Chip.List` and need to render\n // an `<AriaTag>`.\n const Component = context ? AriaTag : 'span';\n\n return (\n <Icon.Provider size={size === 'medium' ? 'small' : 'xsmall'}>\n <Component\n className={cn(\n chipStyles({\n size,\n variant,\n className,\n }),\n )}\n {...props}\n />\n </Icon.Provider>\n );\n};\nChip.displayName = 'Chip';\nChip.as = (\n props: VariantProps<typeof chipStyles>,\n className?: string | string[],\n) => cn(chipStyles({ ...props, className }));\n\nexport interface ChipListProps<T>\n extends Omit<AriaTagGroupProps, 'children'>,\n Pick<AriaTagListProps<T>, 'items' | 'children' | 'renderEmptyState'> {}\n\nfunction ChipList<T extends object>({\n children,\n className,\n items,\n renderEmptyState,\n ...props\n}: ChipListProps<T>) {\n return (\n <Coordinator.Provider value={true}>\n <AriaTagGroup {...props}>\n <AriaTagList<T>\n items={items}\n renderEmptyState={renderEmptyState}\n className={cn('flex flex-wrap gap-xs', className)}\n >\n {children}\n </AriaTagList>\n </AriaTagGroup>\n </Coordinator.Provider>\n );\n}\nChipList.displayName = 'Chip.List';\nChip.List = ChipList;\n\nconst selectableChipStyles = cva(\n cn([\n 'fg-default-light inline-flex w-content items-center justify-center rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n 'dtk-selected:bg-highlight-subtle dtk-selected:outline-highlight',\n ]),\n {\n variants: {\n isDisabled: {\n true: 'fg-disabled dtk-selected:bg-transparent dtk-selected:outline-interactive-disabled outline-interactive-disabled hover:outline-interactive-disabled focus:outline-interactive-disabled',\n false: 'cursor-pointer',\n },\n size: {\n medium: 'px-s py-xs text-body-s',\n small: 'px-s py-xs text-body-xs',\n },\n },\n defaultVariants: {\n isDisabled: false,\n size: 'medium',\n },\n },\n);\n\ninterface SelectableChipProps\n extends VariantProps<typeof selectableChipStyles>,\n Omit<AriaTagProps, 'isDisabled'> {}\n\nexport const SelectableChip = ({\n className,\n isDisabled = false,\n size = 'medium',\n ...props\n}: SelectableChipProps) => (\n <AriaTag\n className={cn(\n selectableChipStyles({\n isDisabled,\n size,\n className,\n }),\n )}\n {...props}\n />\n);\nSelectableChip.displayName = 'Chip.Selectable';\nChip.Selectable = SelectableChip;\n\nconst deletableChipStyles = cva(\n cn([\n 'fg-default-light group inline-flex w-content items-center justify-center gap-xs rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n ]),\n {\n variants: {\n isDisabled: {\n true: 'fg-disabled outline-interactive-disabled hover:outline-interactive-disabled',\n false: '',\n },\n size: {\n medium: 'p-xs pl-m text-body-s',\n small: 'p-xs pl-s text-body-xs',\n },\n },\n defaultVariants: {\n isDisabled: false,\n size: 'medium',\n },\n },\n);\n\ninterface DeletableChipProps\n extends VariantProps<typeof deletableChipStyles>,\n Omit<AriaTagProps, 'isDisabled'> {}\n\nexport const DeletableChip = ({\n children,\n className,\n isDisabled = false,\n size = 'medium',\n textValue,\n ...props\n}: DeletableChipProps) => {\n const internalTextValue =\n textValue ?? (typeof children === 'string' ? children : undefined);\n\n return (\n <AriaTag\n className={cn(\n deletableChipStyles({\n isDisabled,\n size,\n className,\n }),\n )}\n textValue={internalTextValue}\n {...props}\n >\n {({ allowsRemoving, ...props }) => {\n if (!allowsRemoving) {\n throw new Error(\n 'You have a <Chip.Deletable> in a <Chip.List> does not specify an onRemove handler.',\n );\n }\n\n return (\n <>\n {typeof children === 'function'\n ? children({ allowsRemoving, ...props })\n : children}\n <Button\n slot='remove'\n className={cn([\n 'icon-default-dark group-hover:icon-default-light group-focus:icon-default-light cursor-pointer',\n isDisabled &&\n 'icon-disabled group-hover:icon-disabled cursor-not-allowed',\n ])}\n >\n <Icon size='small'>\n <CancelFill />\n </Icon>\n </Button>\n </>\n );\n }}\n </AriaTag>\n );\n};\nDeletableChip.displayName = 'Chip.Deletable';\nChip.Deletable = DeletableChip;\n"]}
1
+ {"version":3,"sources":["../../../src/components/chip/index.tsx"],"names":["p","s","Chip","P","size","variant","Component","useContext","Coordinator","AriaTag","jsx","i","u","props","className","cn","chipStyles","items","T","S","ChipList","selectableChipStyles","cva","d","SelectableChip","deletableChipStyles","internalTextValue","textValue","children","allowsRemoving","jsxs","V","D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AAA,CAAA,CAAA,SAAYA,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 { cn } from '@/lib/utils';\nimport { CancelFill } from '@accelint/icons';\nimport 'client-only';\nimport { type VariantProps, cva } from 'cva';\nimport type React from 'react';\nimport { type ReactNode, createContext, useContext } from 'react';\nimport {\n Tag as AriaTag,\n TagGroup as AriaTagGroup,\n type TagGroupProps as AriaTagGroupProps,\n TagList as AriaTagList,\n type TagListProps as AriaTagListProps,\n type TagProps as AriaTagProps,\n Button,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\n\nconst chipStyles = cva(\n cn([\n 'fg-default-light inline-flex w-content items-center justify-center gap-xxs rounded-full outline',\n ]),\n {\n variants: {\n variant: {\n advisory: 'bg-advisory-subtle outline-advisory-bold',\n critical: 'bg-critical-subtle outline-critical',\n serious: 'bg-serious-subtle outline-serious',\n normal: 'bg-normal-subtle outline-normal',\n info: 'bg-info-subtle outline-info-bold',\n },\n size: {\n medium: 'px-s py-xs text-body-s',\n small: 'px-s py-xs text-body-xs',\n },\n },\n defaultVariants: {\n size: 'medium',\n variant: 'info',\n },\n },\n);\n\nexport interface ChipProps\n extends VariantProps<typeof chipStyles>,\n Omit<React.HTMLProps<HTMLSpanElement>, 'children' | 'size'> {\n className?: string;\n /** Used to add text to the badge, such as the number of unread notifications. */\n children?: ReactNode;\n}\n\n// This coordinator is used as a way for the `<Chip>` component to understand\n// whether or not it is being rendered inside of a `<Chip.List>`. This allows\n// us to opt-into using an `<AriaTag>` or a `<span>` to ensure standalone\n// functionality.\nconst Coordinator = createContext(false);\n\nexport const Chip = ({\n className,\n size = 'medium',\n variant = 'info',\n ...props\n}: ChipProps) => {\n const context = useContext(Coordinator);\n\n // If any context was returned from the `Coordinator` context, then\n // we are being rendered inside of a `Chip.List` and need to render\n // an `<AriaTag>`.\n const Component = context ? AriaTag : 'span';\n\n return (\n <Icon.Provider size={size === 'medium' ? 'small' : 'xsmall'}>\n <Component\n className={cn(\n chipStyles({\n size,\n variant,\n className,\n }),\n )}\n {...props}\n />\n </Icon.Provider>\n );\n};\nChip.displayName = 'Chip';\nChip.as = (\n props: VariantProps<typeof chipStyles>,\n className?: string | string[],\n) => cn(chipStyles({ ...props, className }));\n\nexport interface ChipListProps<T>\n extends Omit<AriaTagGroupProps, 'children'>,\n Pick<AriaTagListProps<T>, 'items' | 'children' | 'renderEmptyState'> {}\n\nfunction ChipList<T extends object>({\n children,\n className,\n items,\n renderEmptyState,\n ...props\n}: ChipListProps<T>) {\n return (\n <Coordinator.Provider value={true}>\n <AriaTagGroup {...props}>\n <AriaTagList<T>\n items={items}\n renderEmptyState={renderEmptyState}\n className={cn('flex flex-wrap gap-xs', className)}\n >\n {children}\n </AriaTagList>\n </AriaTagGroup>\n </Coordinator.Provider>\n );\n}\nChipList.displayName = 'Chip.List';\nChip.List = ChipList;\n\nconst selectableChipStyles = cva(\n cn([\n 'fg-default-light inline-flex w-content items-center justify-center rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n 'dtk-selected:bg-highlight-subtle dtk-selected:outline-highlight',\n ]),\n {\n variants: {\n isDisabled: {\n true: 'fg-disabled dtk-selected:bg-transparent dtk-selected:outline-interactive-disabled outline-interactive-disabled hover:outline-interactive-disabled focus:outline-interactive-disabled',\n false: 'cursor-pointer',\n },\n size: {\n medium: 'px-s py-xs text-body-s',\n small: 'px-s py-xs text-body-xs',\n },\n },\n defaultVariants: {\n isDisabled: false,\n size: 'medium',\n },\n },\n);\n\ninterface SelectableChipProps\n extends VariantProps<typeof selectableChipStyles>,\n Omit<AriaTagProps, 'isDisabled'> {}\n\nexport const SelectableChip = ({\n className,\n isDisabled = false,\n size = 'medium',\n ...props\n}: SelectableChipProps) => (\n <AriaTag\n className={cn(\n selectableChipStyles({\n isDisabled,\n size,\n className,\n }),\n )}\n {...props}\n />\n);\nSelectableChip.displayName = 'Chip.Selectable';\nChip.Selectable = SelectableChip;\n\nconst deletableChipStyles = cva(\n cn([\n 'fg-default-light group inline-flex w-content items-center justify-center gap-xs rounded-full outline outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n ]),\n {\n variants: {\n isDisabled: {\n true: 'fg-disabled outline-interactive-disabled hover:outline-interactive-disabled',\n false: '',\n },\n size: {\n medium: 'p-xs pl-m text-body-s',\n small: 'p-xs pl-s text-body-xs',\n },\n },\n defaultVariants: {\n isDisabled: false,\n size: 'medium',\n },\n },\n);\n\ninterface DeletableChipProps\n extends VariantProps<typeof deletableChipStyles>,\n Omit<AriaTagProps, 'isDisabled'> {}\n\nexport const DeletableChip = ({\n children,\n className,\n isDisabled = false,\n size = 'medium',\n textValue,\n ...props\n}: DeletableChipProps) => {\n const internalTextValue =\n textValue ?? (typeof children === 'string' ? children : undefined);\n\n return (\n <AriaTag\n className={cn(\n deletableChipStyles({\n isDisabled,\n size,\n className,\n }),\n )}\n textValue={internalTextValue}\n {...props}\n >\n {({ allowsRemoving, ...props }) => {\n if (!allowsRemoving) {\n throw new Error(\n 'You have a <Chip.Deletable> in a <Chip.List> does not specify an onRemove handler.',\n );\n }\n\n return (\n <>\n {typeof children === 'function'\n ? children({ allowsRemoving, ...props })\n : children}\n <Button\n slot='remove'\n className={cn([\n 'icon-default-dark group-hover:icon-default-light group-focus:icon-default-light cursor-pointer',\n isDisabled &&\n 'icon-disabled group-hover:icon-disabled cursor-not-allowed',\n ])}\n >\n <Icon size='small'>\n <CancelFill />\n </Icon>\n </Button>\n </>\n );\n }}\n </AriaTag>\n );\n};\nDeletableChip.displayName = 'Chip.Deletable';\nChip.Deletable = DeletableChip;\n"]}
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import {useControlledState}from'@react-stately/utils';import {createContext,useMemo,useContext,useEffect}from'react';import {ColorSwatch,parseColor,useContextProps,ColorSwatchPickerContext,ListBox,useLocale,ListBoxItem,ColorSwatchContext}from'react-aria-components';import {jsx}from'react/jsx-runtime';var C=o=>{if(typeof o=="string")try{return parseColor(o)}catch{return}return o};function A(o){let l=useMemo(()=>C(o.value),[o.value]),r=useMemo(()=>C(o.defaultValue||"#000000"),[o.defaultValue]),[e,t]=useControlledState(l||null,r,o.onChange);return {color:e,setColor(c){t(c);}}}function I({ref:o=null,color:l,...r}){let e=l||"#0000",t=useMemo(()=>typeof e=="string"?parseColor(e):e,[e]),{locale:c}=useLocale(),a=useContext(d);return useEffect(()=>{let s=t.toString("hexa");return a?.set(s,t),()=>{a?.delete(s);}},[t,a]),jsx(ListBoxItem,{...r,ref:o,id:t.toString("hexa"),textValue:t.getColorName(c),className:"w-fit outline-none outline outline-offset-1 hover:outline-interactive-hover hover:outline-solid focus:outline-interactive-hover focus:outline-solid data-selected:outline-highlight data-selected:outline-solid",children:jsx(ColorSwatchContext.Provider,{value:{color:t},children:r.children})})}var d=createContext(null);function L({ref:o=null,className:l,children:r,...e}){[e,o]=useContextProps(e,o,ColorSwatchPickerContext);let t=A(e),c=useMemo(()=>new Map,[]);return jsx(ListBox,{className:cn("flex flex-wrap gap-s",l),style:e.style,layout:e.layout||"grid",selectionMode:"single",selectedKeys:t.color?[t.color.toString("hexa")]:void 0,onSelectionChange:a=>{a!=="all"&&(a.size>0?t.setColor(c.get([...a][0])):t.setColor(null));},...e,children:jsx(d.Provider,{value:c,children:r})})}function M({options:o,className:l,...r}){return jsx(L,{className:cn("flex flex-wrap gap-s",l),...r,children:o.map(e=>jsx(I,{color:e,children:jsx(ColorSwatch,{className:"h-[16px] w-[16px]"})},e.toString()))})}M.displayName="ColorPicker";export{M as ColorPicker,A as useColorPickerState};//# sourceMappingURL=index.js.map
1
+ import {cn}from'./../../lib/utils.js';import {useControlledState}from'@react-stately/utils';import'client-only';import {createContext,useMemo,useContext,useEffect}from'react';import {ColorSwatch,parseColor,useContextProps,ColorSwatchPickerContext,ListBox,useLocale,ListBoxItem,ColorSwatchContext}from'react-aria-components';import {jsx}from'react/jsx-runtime';var C=o=>{if(typeof o=="string")try{return parseColor(o)}catch{return}return o};function A(o){let l=useMemo(()=>C(o.value),[o.value]),r=useMemo(()=>C(o.defaultValue||"#000000"),[o.defaultValue]),[e,t]=useControlledState(l||null,r,o.onChange);return {color:e,setColor(c){t(c);}}}function I({ref:o=null,color:l,...r}){let e=l||"#0000",t=useMemo(()=>typeof e=="string"?parseColor(e):e,[e]),{locale:c}=useLocale(),i=useContext(d);return useEffect(()=>{let s=t.toString("hexa");return i?.set(s,t),()=>{i?.delete(s);}},[t,i]),jsx(ListBoxItem,{...r,ref:o,id:t.toString("hexa"),textValue:t.getColorName(c),className:"w-fit outline-none outline outline-offset-1 hover:outline-interactive-hover hover:outline-solid focus:outline-interactive-hover focus:outline-solid data-selected:outline-highlight data-selected:outline-solid",children:jsx(ColorSwatchContext.Provider,{value:{color:t},children:r.children})})}var d=createContext(null);function L({ref:o=null,className:l,children:r,...e}){[e,o]=useContextProps(e,o,ColorSwatchPickerContext);let t=A(e),c=useMemo(()=>new Map,[]);return jsx(ListBox,{className:cn("flex flex-wrap gap-s",l),style:e.style,layout:e.layout||"grid",selectionMode:"single",selectedKeys:t.color?[t.color.toString("hexa")]:void 0,onSelectionChange:i=>{i!=="all"&&(i.size>0?t.setColor(c.get([...i][0])):t.setColor(null));},...e,children:jsx(d.Provider,{value:c,children:r})})}function M({options:o,className:l,...r}){return jsx(L,{className:cn("flex flex-wrap gap-s",l),...r,children:o.map(e=>jsx(I,{color:e,children:jsx(ColorSwatch,{className:"h-[16px] w-[16px]"})},e.toString()))})}M.displayName="ColorPicker";export{M as ColorPicker,A as useColorPickerState};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/color-picker/index.tsx"],"names":["value","parseColor","P","useMemo","parseColorFromProp","props","useControlledState","f","defaultValue","color","ref","colorFromProps","propColor","n","locale","map","useContext","ColorMapContext","useEffect","p","key","jsx","AriaListBoxItem","i","S","createContext","useContextProps","ColorSwatchPickerContext","v","state","useColorPickerState","colorMap","u","keys","x","ColorPicker"],"mappings":"oVA2C4BA,MACtB,CAAA,EAAA,CAAA,GAAOA,OAAU,CAAA,EAAA,QAEjB,CAAA,GAAA,CAAOC,OACTC,UAAA,CAAA,CAAQ,CACN,CAAA,KACF,CAEF,OAAOF,mBAMP,CAAA,CAAMA,CAAAA,CAAQG,KAAQ,CAAMC,CAAAA,OAAmBC,KAAM,CAAA,CAAK,CAAA,CAAG,KAAO,CAAA,CAAA,CAAK,CAAC,CAAA,KAGxE,CAAA,CAAA,CAAA,CAAMD,CAAAA,OAAmBC,KAAM,CAAA,CAAA,CAAA,CAAA,YAAgB,EAAA,0BAG3B,CAAA,CAAIC,CAAAA,CACxBN,GAAS,CAAA,CAAAO,kBAAA,CAAA,CACTC,EACAH,IAAM,CAAA,CAAA,CAAA,CAAA,CAAA,SAGD,CACL,OAAAI,MACA,CAAA,CAAA,CAAA,QACgB,CAChB,CACF,CACF,CAeA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,SACEC,CAAAA,CAAM,KACN,CAAA,CAAA,IAAOC,CAAAA,KAET,CAAA,CAGG,CACD,GAAA,CAAMC,CAAAA,CAAYD,KAAkB,CAAA,CAAA,CAAA,EAAA,OAElC,CAAA,CAAO,CAAAE,OAAA,CAAA,IAAOD,OAAc,CAAA,EAAA,QAAmCA,CAC/DV,UAACU,CAAS,CACZ,CAAA,CACM,CAAE,OAAAE,MAAqB,CACvBC,CAAAA,CAAMC,UAAWC,EAAe,CAOtC,gBAAAC,OACEC,SAAA,CAAA,IAAYV,KAAM,CA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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,QAGZ,CAAA,IACIxB,CAAAA,EAEJ,CAAA,CAAA,GAAA,CAAA,CAAA,QAAiB,CAAAkB,GAAA,CAAA,CAAA,CAAA,QAAS,CAAOQ,CAAAA,gBAOhC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,mBAEL,CAAA,CAAA,CAAA,SAEF,EAAqB,CACnB,GAAA,CAAA,CAAA,CAAA,CACEV,uBACgB,CAAAW,EAAA,CAAA,sBACV3B,EAEH,CAAA,CAAA,GAAA,CAAA,CAAA,QAAaI,CAAAA,CAAAA,CACZY,IAAC,CAA6C,EAAAE,GAAA,CAAA,CAAA,CAAOd,MACnD,CAAA,CAAA,CAAA,QAAiB,CAAAc,GAAA,CAAAW,WAAA,CAAA,CAAA,2CAM3BC,EAAY,CAAA,CAAA,CAAA,CAAA,CAAA,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 { useControlledState } from '@react-stately/utils';\nimport {\n type ForwardedRef,\n type ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n ColorSwatch as AriaColorSwatch,\n ColorSwatchContext as AriaColorSwatchContext,\n type ColorSwatchPickerItemProps as AriaColorSwatchPickerItemProps,\n type ColorSwatchPickerProps as AriaColorSwatchPickerProps,\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n type Color,\n ColorSwatchPickerContext,\n parseColor,\n useContextProps,\n useLocale,\n} from 'react-aria-components';\n\ninterface ColorPickerState {\n /** The current color value of the color picker. */\n color: Color | null;\n /** Sets the current color value of the color picker. */\n setColor(color: Color | null): void;\n}\n\nconst parseColorFromProp = (value?: Color | string) => {\n if (typeof value === 'string') {\n try {\n return parseColor(value);\n } catch {\n return undefined;\n }\n }\n return value;\n};\n\nexport function useColorPickerState(\n props: AriaColorSwatchPickerProps,\n): ColorPickerState {\n const value = useMemo(() => parseColorFromProp(props.value), [props.value]);\n\n const defaultValue = useMemo(\n () => parseColorFromProp(props.defaultValue || '#000000'),\n [props.defaultValue],\n );\n const [color, setColor] = useControlledState(\n value || null,\n defaultValue as Color,\n props.onChange,\n );\n\n return {\n color,\n setColor(color) {\n setColor(color);\n },\n };\n}\n\n/**\n * Renders a single color swatch item for use within a color picker list.\n *\n * This component manages the registration of its color value in a shared color map context,\n * and provides the color value to its children via context. It also handles accessibility\n * and styling for selection and focus states.\n\n *\n * @remarks\n * - The component registers its color in a shared `ColorMapContext` on mount and removes it on unmount.\n * - The color is parsed and memoized for performance.\n * - The swatch item is rendered as an accessible list box item.\n */\nfunction ColorSwatchPickerItem({\n ref = null,\n color: colorFromProps,\n ...props\n}: Omit<AriaColorSwatchPickerItemProps, 'style'> & {\n children: ReactNode;\n ref?: ForwardedRef<HTMLDivElement>;\n}) {\n const propColor = colorFromProps || '#0000';\n const color = useMemo(\n () => (typeof propColor === 'string' ? parseColor(propColor) : propColor),\n [propColor],\n );\n const { locale } = useLocale();\n const map = useContext(ColorMapContext);\n\n // Register the color in the map context on mount and remove it on unmount.\n // This allows the color picker to manage its own state and selection.\n // The key is the color's hex representation, ensuring uniqueness.\n // The color is also provided to the context for use by children components.\n // This is useful for rendering the swatch or any related UI elements.\n useEffect(() => {\n const key = color.toString('hexa');\n map?.set(key, color);\n return () => {\n map?.delete(key);\n };\n }, [color, map]);\n\n return (\n <AriaListBoxItem\n {...props}\n ref={ref}\n id={color.toString('hexa')}\n textValue={color.getColorName(locale)}\n className='w-fit outline-none outline outline-offset-1 hover:outline-interactive-hover hover:outline-solid focus:outline-interactive-hover focus:outline-solid data-selected:outline-highlight data-selected:outline-solid'\n >\n <AriaColorSwatchContext.Provider value={{ color }}>\n {props.children}\n </AriaColorSwatchContext.Provider>\n </AriaListBoxItem>\n );\n}\n\nconst ColorMapContext = createContext<Map<string, Color> | null>(null);\n\nexport interface ColorPickerProps extends AriaColorSwatchPickerProps {\n options: AriaColorSwatchPickerItemProps['color'][];\n ref?: ForwardedRef<HTMLDivElement>;\n}\n\ninterface ColorSwatchPickerProps extends Omit<ColorPickerProps, 'options'> {\n children?: ReactNode;\n}\n\nfunction ColorSwatchPicker({\n ref = null,\n className,\n children,\n ...props\n}: ColorSwatchPickerProps) {\n [props, ref] = useContextProps(props, ref, ColorSwatchPickerContext);\n const state = useColorPickerState(props);\n const colorMap = useMemo(() => new Map(), []);\n return (\n <AriaListBox\n className={cn('flex flex-wrap gap-s', className)}\n style={props.style}\n layout={props.layout || 'grid'}\n selectionMode='single'\n selectedKeys={state.color ? [state.color.toString('hexa')] : undefined}\n onSelectionChange={(keys) => {\n // single select, 'all' cannot occur.\n if (keys !== 'all') {\n if (keys.size > 0) {\n state.setColor(colorMap.get([...keys][0]));\n } else {\n // If no keys are selected, we can set the color to null or a default value\n state.setColor(null);\n }\n }\n }}\n {...props}\n >\n <ColorMapContext.Provider value={colorMap}>\n {children}\n </ColorMapContext.Provider>\n </AriaListBox>\n );\n}\n\nexport function ColorPicker({\n options,\n className,\n ...props\n}: ColorPickerProps) {\n return (\n <ColorSwatchPicker\n className={cn('flex flex-wrap gap-s', className)}\n {...props}\n >\n {options.map((color) => (\n <ColorSwatchPickerItem key={color.toString()} color={color}>\n <AriaColorSwatch className='h-[16px] w-[16px]' />\n </ColorSwatchPickerItem>\n ))}\n </ColorSwatchPicker>\n );\n}\nColorPicker.displayName = 'ColorPicker';\n"]}
1
+ {"version":3,"sources":["../../../src/components/color-picker/index.tsx"],"names":["value","parseColor","P","useMemo","parseColorFromProp","props","useControlledState","defaultValue","color","ref","colorFromProps","propColor","n","locale","map","useContext","ColorMapContext","m","useEffect","p","key","jsx","AriaListBoxItem","a","S","createContext","h","useContextProps","ColorSwatchPickerContext","v","state","useColorPickerState","colorMap","w","u","x","ColorPicker"],"mappings":"4WA8CE,CAAA,CAAI,CAAA,EAAA,CAAA,GAAOA,uBAEAC,OACTC,UAAA,CAAA,CAAQ,CACN,MACF,CAEF,MAAA,CAAOF,OAGF,CAAA,CAAA,CAAA,WAGCA,CAAAA,CAAQG,CAAAA,KAAcC,CAAAA,OAAmBC,CAAAA,MAAW,CAAA,CAAG,KAAO,CAAA,CAAA,CAAK,CAAC,MAGxE,IAAMD,CAAAA,OAAmBC,CAAAA,oBAAsB,EAAA,SACxC,CAAA,CAAA,CAAA,CAAA,CAAA,YAEa,EAAIC,CAAAA,CACxBN,CAAAA,CAAAA,CAAS,sBACTO,EACAF,iBAGF,CAAO,CACL,OAAAG,CAAAA,gBAEgB,CAChB,CACF,CACF,CAeA,iBACEC,CAAAA,CAAM,CAAA,GAAA,CACN,MAAOC,CAAAA,KAET,CAAA,CAGG,CACD,IAAMC,CAAAA,CAAYD,CAAAA,kBAET,CAAAE,OAAA,CAAA,IAAOD,kBAAiDA,CAC/DT,UAACS,CAAS,CACZ,CAAA,CACM,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAE,MAAqB,CACvBC,EAAMC,CAAAA,SAAWC,GAOvB,CAAA,CAAAC,UAAA,CAAA,CAAA,CAAA,CAAAC,OACEC,SAAA,CAAA,IAAYX,CAAAA,IAAM,CAAA,CAAA,CAAA,CAAA,QAAe,CAAA,MACjC,CAAA,CAAAM,OAASM,CAAAA,EAAU,GACZ,CAAA,CAAA,CAAM,CACXN,CAAAA,CAAAA,IAAK,CAAA,CAAA,EAAOM,MAEZZ,CAAAA,CAAOM,EAAG,CAAC,CAAA,CAGbO,EAACC,CAAAA,CAAA,CACE,CAAA,CAAAC,GAAGlB,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,MACnD,CAAA,CAAA,CAAA,QAAiB,CAAAe,GAAA,CAAAY,WAAA,CAAA,CAAA,2CAM3BC,EAAY,CAAA,CAAA,CAAA,CAAA,CAAA,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 { useControlledState } from '@react-stately/utils';\nimport 'client-only';\nimport {\n type ForwardedRef,\n type ReactNode,\n createContext,\n useContext,\n useEffect,\n useMemo,\n} from 'react';\nimport {\n ColorSwatch as AriaColorSwatch,\n ColorSwatchContext as AriaColorSwatchContext,\n type ColorSwatchPickerItemProps as AriaColorSwatchPickerItemProps,\n type ColorSwatchPickerProps as AriaColorSwatchPickerProps,\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n type Color,\n ColorSwatchPickerContext,\n parseColor,\n useContextProps,\n useLocale,\n} from 'react-aria-components';\n\ninterface ColorPickerState {\n /** The current color value of the color picker. */\n color: Color | null;\n /** Sets the current color value of the color picker. */\n setColor(color: Color | null): void;\n}\n\nconst parseColorFromProp = (value?: Color | string) => {\n if (typeof value === 'string') {\n try {\n return parseColor(value);\n } catch {\n return undefined;\n }\n }\n return value;\n};\n\nexport function useColorPickerState(\n props: AriaColorSwatchPickerProps,\n): ColorPickerState {\n const value = useMemo(() => parseColorFromProp(props.value), [props.value]);\n\n const defaultValue = useMemo(\n () => parseColorFromProp(props.defaultValue || '#000000'),\n [props.defaultValue],\n );\n const [color, setColor] = useControlledState(\n value || null,\n defaultValue as Color,\n props.onChange,\n );\n\n return {\n color,\n setColor(color) {\n setColor(color);\n },\n };\n}\n\n/**\n * Renders a single color swatch item for use within a color picker list.\n *\n * This component manages the registration of its color value in a shared color map context,\n * and provides the color value to its children via context. It also handles accessibility\n * and styling for selection and focus states.\n\n *\n * @remarks\n * - The component registers its color in a shared `ColorMapContext` on mount and removes it on unmount.\n * - The color is parsed and memoized for performance.\n * - The swatch item is rendered as an accessible list box item.\n */\nfunction ColorSwatchPickerItem({\n ref = null,\n color: colorFromProps,\n ...props\n}: Omit<AriaColorSwatchPickerItemProps, 'style'> & {\n children: ReactNode;\n ref?: ForwardedRef<HTMLDivElement>;\n}) {\n const propColor = colorFromProps || '#0000';\n const color = useMemo(\n () => (typeof propColor === 'string' ? parseColor(propColor) : propColor),\n [propColor],\n );\n const { locale } = useLocale();\n const map = useContext(ColorMapContext);\n\n // Register the color in the map context on mount and remove it on unmount.\n // This allows the color picker to manage its own state and selection.\n // The key is the color's hex representation, ensuring uniqueness.\n // The color is also provided to the context for use by children components.\n // This is useful for rendering the swatch or any related UI elements.\n useEffect(() => {\n const key = color.toString('hexa');\n map?.set(key, color);\n return () => {\n map?.delete(key);\n };\n }, [color, map]);\n\n return (\n <AriaListBoxItem\n {...props}\n ref={ref}\n id={color.toString('hexa')}\n textValue={color.getColorName(locale)}\n className='w-fit outline-none outline outline-offset-1 hover:outline-interactive-hover hover:outline-solid focus:outline-interactive-hover focus:outline-solid data-selected:outline-highlight data-selected:outline-solid'\n >\n <AriaColorSwatchContext.Provider value={{ color }}>\n {props.children}\n </AriaColorSwatchContext.Provider>\n </AriaListBoxItem>\n );\n}\n\nconst ColorMapContext = createContext<Map<string, Color> | null>(null);\n\nexport interface ColorPickerProps extends AriaColorSwatchPickerProps {\n options: AriaColorSwatchPickerItemProps['color'][];\n ref?: ForwardedRef<HTMLDivElement>;\n}\n\ninterface ColorSwatchPickerProps extends Omit<ColorPickerProps, 'options'> {\n children?: ReactNode;\n}\n\nfunction ColorSwatchPicker({\n ref = null,\n className,\n children,\n ...props\n}: ColorSwatchPickerProps) {\n [props, ref] = useContextProps(props, ref, ColorSwatchPickerContext);\n const state = useColorPickerState(props);\n const colorMap = useMemo(() => new Map(), []);\n return (\n <AriaListBox\n className={cn('flex flex-wrap gap-s', className)}\n style={props.style}\n layout={props.layout || 'grid'}\n selectionMode='single'\n selectedKeys={state.color ? [state.color.toString('hexa')] : undefined}\n onSelectionChange={(keys) => {\n // single select, 'all' cannot occur.\n if (keys !== 'all') {\n if (keys.size > 0) {\n state.setColor(colorMap.get([...keys][0]));\n } else {\n // If no keys are selected, we can set the color to null or a default value\n state.setColor(null);\n }\n }\n }}\n {...props}\n >\n <ColorMapContext.Provider value={colorMap}>\n {children}\n </ColorMapContext.Provider>\n </AriaListBox>\n );\n}\n\nexport function ColorPicker({\n options,\n className,\n ...props\n}: ColorPickerProps) {\n return (\n <ColorSwatchPicker\n className={cn('flex flex-wrap gap-s', className)}\n {...props}\n >\n {options.map((color) => (\n <ColorSwatchPickerItem key={color.toString()} color={color}>\n <AriaColorSwatch className='h-[16px] w-[16px]' />\n </ColorSwatchPickerItem>\n ))}\n </ColorSwatchPicker>\n );\n}\nColorPicker.displayName = 'ColorPicker';\n"]}
@@ -1,2 +1,2 @@
1
- import'client-only';import {ComboBox,Button,Text,Popover,Virtualizer,ListLayout,ListBoxSection,Header,Collection,Input}from'react-aria-components';import {cn}from'./../../lib/utils.js';import k from'@accelint/icons/chevron-down';import {cva}from'cva';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {Options}from'../options/index.js';import {OptionsItem}from'../options-item/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var M=cva(["block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive","not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight"},isInvalid:{true:"outline-serious"},size:{medium:"text-body-s",small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"}],defaultVariants:{size:"medium"}}),f=({className:t,isReadOnly:o=false,size:i="medium",...l})=>jsx(Input,{...l,className:({isDisabled:s,isInvalid:a})=>cn(M({isDisabled:s,isInvalid:a,size:i,className:t}))});f.displayName="ComboBox.Input";function n({children:t,className:o,description:i,errorMessage:l,isDisabled:s,isInvalid:a,isReadOnly:r,label:c,placeholder:A,layoutOptions:h,size:u="medium",...x}){let b=u==="small",B=!(b||a)||s,I=a&&!s&&!r,P=!b&&c;return jsx(ComboBox,{...x,isDisabled:s,isInvalid:a,isReadOnly:r,className:"flex flex-col gap-xs",children:({isDisabled:d,isOpen:g})=>jsxs(Fragment,{children:[P&&jsx(Label,{className:"empty:hidden",isDisabled:d,isOptional:!x.isRequired,children:c}),jsxs("div",{className:"relative flex items-center",children:[jsx(f,{className:o,isReadOnly:r,placeholder:A,size:u}),jsx(Button,{className:cn(["fg-default-light absolute right-xs transform",d&&"fg-disabled",g&&"rotate-180",r&&"hidden"]),children:jsx(Icon,{className:"block",size:"large",children:jsx(k,{})})})]}),B&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",d&&"fg-disabled"]),slot:"description",children:i}),I&&jsx(Text,{className:"fg-serious text-body-xs empty:hidden",slot:"errorMessage",children:l}),jsx(Popover,{className:"w-(--trigger-width)",children:jsx(Virtualizer,{layout:ListLayout,layoutOptions:h,children:jsx(Options,{children:t})})})]})})}n.displayName="ComboBox";n.Item=OptionsItem;function q({children:t,header:o,items:i}){return jsxs(ListBoxSection,{id:o,className:"col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none",children:[jsx(Header,{className:"col-span-2 m-xs my-s text-default-dark text-header-xs",children:o}),jsx(Collection,{items:i,children:t})]})}n.displayName="ComboBox.Section";n.Section=q;export{n as ComboBox,q as ComboBoxSection};//# sourceMappingURL=index.js.map
1
+ import'client-only';import {ComboBox,Button,Text,Popover,Virtualizer,ListLayout,ListBoxSection,Header,Collection,Input}from'react-aria-components';import {cn}from'./../../lib/utils.js';import {ChevronDown}from'@accelint/icons';import {cva}from'cva';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {Options}from'../options/index.js';import {OptionsItem}from'../options-item/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var M=cva(["block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive","not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight"},isInvalid:{true:"outline-serious"},size:{medium:"text-body-s",small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"}],defaultVariants:{size:"medium"}}),f=({className:t,isReadOnly:o=false,size:i="medium",...l})=>jsx(Input,{...l,className:({isDisabled:s,isInvalid:a})=>cn(M({isDisabled:s,isInvalid:a,size:i,className:t}))});f.displayName="ComboBox.Input";function n({children:t,className:o,description:i,errorMessage:l,isDisabled:s,isInvalid:a,isReadOnly:r,label:c,placeholder:A,layoutOptions:h,size:u="medium",...x}){let b=u==="small",B=!(b||a)||s,I=a&&!s&&!r,P=!b&&c;return jsx(ComboBox,{...x,isDisabled:s,isInvalid:a,isReadOnly:r,className:"flex flex-col gap-xs",children:({isDisabled:d,isOpen:g})=>jsxs(Fragment,{children:[P&&jsx(Label,{className:"empty:hidden",isDisabled:d,isOptional:!x.isRequired,children:c}),jsxs("div",{className:"relative flex items-center",children:[jsx(f,{className:o,isReadOnly:r,placeholder:A,size:u}),jsx(Button,{className:cn(["fg-default-light absolute right-xs transform",d&&"fg-disabled",g&&"rotate-180",r&&"hidden"]),children:jsx(Icon,{className:"block",size:"large",children:jsx(ChevronDown,{})})})]}),B&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",d&&"fg-disabled"]),slot:"description",children:i}),I&&jsx(Text,{className:"fg-serious text-body-xs empty:hidden",slot:"errorMessage",children:l}),jsx(Popover,{className:"w-(--trigger-width)",children:jsx(Virtualizer,{layout:ListLayout,layoutOptions:h,children:jsx(Options,{children:t})})})]})})}n.displayName="ComboBox";n.Item=OptionsItem;function q({children:t,header:o,items:i}){return jsxs(ListBoxSection,{id:o,className:"col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none",children:[jsx(Header,{className:"col-span-2 m-xs my-s text-default-dark text-header-xs",children:o}),jsx(Collection,{items:i,children:t})]})}n.displayName="ComboBox.Section";n.Section=q;export{n as ComboBox,q as ComboBoxSection};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/combobox/index.tsx"],"names":["className","isReadOnly","size","AriaInput","props","e","O","isDisabled","isInvalid","p","ComboBox","children","isSmall","shouldShowDescription","shouldShowError","shouldShowLabel","label","jsx","AriaComboBox","D","m","AriaButton","L","cn","Icon","ChevronDown","AriaText","description","y","errorMessage","AriaVirtualizer","AriaListLayout","T","Options","F","ComboBoxSection","jsxs","AriaListBoxSection","S","C","header","items","v"],"mappings":"0jBA2CI,CAAA,6MAGA,CAAU,CACR,WAAY,uFAGR,CAAA,KAAA,CAAA,0GAEJ,CAAW,CACT,SAAM,CAAA,CAAA,IAAA,CAAA,iBAGN,CAAA,CAAA,0BACO,CAAA,KAAA,CAAA,cAGX,CAAA,CAAA,CAAA,gBAEI,CAAA,CAAA,CAAY,UACZ,CAAA,IAAW,CAAA,SACX,CAAA,IAAW,iEAOnB,SASE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAA,CAAAA,YACAC,UACAC,CAAAA,CAAO,CAAA,KAAA,C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ant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport 'client-only';\nimport {\n Button as AriaButton,\n ComboBox as AriaComboBox,\n type ComboBoxProps as AriaComboBoxProps,\n Header as AriaHeader,\n Input as AriaInput,\n type InputProps as AriaInputProps,\n Collection as AriaListBoxCollection,\n ListBoxSection as AriaListBoxSection,\n type ListBoxSectionProps as AriaListBoxSectionProps,\n ListLayout as AriaListLayout,\n type ListLayoutOptions as AriaListLayoutOptions,\n Popover as AriaPopover,\n Text as AriaText,\n Virtualizer as AriaVirtualizer,\n type VirtualizerProps as AriaVirtualizerProps,\n} from 'react-aria-components';\n\nimport { cn } from '@/lib/utils';\nimport ChevronDown from '@accelint/icons/chevron-down';\nimport { type VariantProps, cva } from 'cva';\nimport type { ReactNode } from 'react';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Options } from '../options';\nimport { type IOptionsItem, OptionsItem } from '../options-item';\n\nconst textFieldStyles = cva(\n [\n 'block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive',\n 'not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n size: {\n medium: 'text-body-s',\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface InputProps\n extends VariantProps<typeof textFieldStyles>,\n Omit<AriaInputProps, 'size'> {\n isReadOnly?: boolean;\n}\n\nconst Input = ({\n className,\n isReadOnly = false,\n size = 'medium',\n ...props\n}: InputProps) => {\n return (\n <AriaInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n textFieldStyles({\n isDisabled,\n isInvalid,\n size,\n className,\n }),\n )\n }\n />\n );\n};\nInput.displayName = 'ComboBox.Input';\n\nexport interface ComboBoxProps<T extends IOptionsItem>\n extends Omit<\n VariantProps<typeof textFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaComboBoxProps<T>, 'children'>,\n Pick<AriaVirtualizerProps<AriaListLayoutOptions>, 'layoutOptions'> {\n className?: string;\n children: ReactNode | ((item: T) => ReactNode);\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n}\n\nexport function ComboBox<T extends IOptionsItem>({\n children,\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n layoutOptions,\n size = 'medium',\n ...props\n}: ComboBoxProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription = !(isSmall || isInvalid) || isDisabled;\n const shouldShowError = isInvalid && !isDisabled && !isReadOnly;\n const shouldShowLabel = !isSmall && label;\n\n return (\n <AriaComboBox<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n className='flex flex-col gap-xs'\n >\n {({ isDisabled, isOpen }) => (\n <>\n {shouldShowLabel && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isOptional={!props.isRequired}\n >\n {label}\n </Label>\n )}\n <div className='relative flex items-center'>\n <Input\n className={className}\n isReadOnly={isReadOnly}\n placeholder={placeholder}\n size={size}\n />\n <AriaButton\n className={cn([\n 'fg-default-light absolute right-xs transform',\n isDisabled && 'fg-disabled',\n isOpen && 'rotate-180',\n isReadOnly && 'hidden',\n ])}\n >\n <Icon className='block' size='large'>\n <ChevronDown />\n </Icon>\n </AriaButton>\n </div>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <AriaText\n className='fg-serious text-body-xs empty:hidden'\n slot='errorMessage'\n >\n {errorMessage}\n </AriaText>\n )}\n <AriaPopover className='w-(--trigger-width)'>\n <AriaVirtualizer\n layout={AriaListLayout}\n layoutOptions={layoutOptions}\n >\n <Options>{children}</Options>\n </AriaVirtualizer>\n </AriaPopover>\n </>\n )}\n </AriaComboBox>\n );\n}\nComboBox.displayName = 'ComboBox';\n\nComboBox.Item = OptionsItem;\n\ninterface ComboBoxSectionProps<T extends IOptionsItem>\n extends AriaListBoxSectionProps<T> {\n header?: string;\n}\n\nexport function ComboBoxSection<T extends IOptionsItem>({\n children,\n header,\n items,\n}: ComboBoxSectionProps<T>) {\n return (\n <AriaListBoxSection\n id={header}\n className='col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none'\n >\n <AriaHeader className='col-span-2 m-xs my-s text-default-dark text-header-xs'>\n {header}\n </AriaHeader>\n <AriaListBoxCollection items={items}>{children}</AriaListBoxCollection>\n </AriaListBoxSection>\n );\n}\nComboBox.displayName = 'ComboBox.Section';\nComboBox.Section = ComboBoxSection;\n"]}
1
+ {"version":3,"sources":["../../../src/components/combobox/index.tsx"],"names":["w","className","isReadOnly","size","AriaInput","props","isDisabled","isInvalid","p","ComboBox","children","isSmall","shouldShowDescription","shouldShowError","shouldShowLabel","label","jsx","AriaComboBox","e","D","m","AriaButton","L","cn","Icon","ChevronDown","k","AriaText","description","y","errorMessage","AriaVirtualizer","AriaListLayout","T","Options","F","ComboBoxSection","jsxs","AriaListBoxSection","S","C","header","items","v"],"mappings":"kdA2CI,IAAA,CAAA,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,cAAA,CAAA,CAAA,EAAA,CAAA,CAAU,CAAA,SAAA,CAAA,0FAEVvB,CAAAA,QAAY,CAAA,CAAAE,GAAA,CAAAsB,MAAA,CAAU,CAAA,SAAA,CAAA,uDACnBC,CACH,aAC8BC,GAAAA,CAAQC,UAAA,CAAA,CAAA,KAAA,CAAAjC,EAAS,QAI5C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,kBACJ0B,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport 'client-only';\nimport {\n Button as AriaButton,\n ComboBox as AriaComboBox,\n type ComboBoxProps as AriaComboBoxProps,\n Header as AriaHeader,\n Input as AriaInput,\n type InputProps as AriaInputProps,\n Collection as AriaListBoxCollection,\n ListBoxSection as AriaListBoxSection,\n type ListBoxSectionProps as AriaListBoxSectionProps,\n ListLayout as AriaListLayout,\n type ListLayoutOptions as AriaListLayoutOptions,\n Popover as AriaPopover,\n Text as AriaText,\n Virtualizer as AriaVirtualizer,\n type VirtualizerProps as AriaVirtualizerProps,\n} from 'react-aria-components';\n\nimport { cn } from '@/lib/utils';\nimport { ChevronDown } from '@accelint/icons';\nimport { type VariantProps, cva } from 'cva';\nimport type { ReactNode } from 'react';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Options } from '../options';\nimport { type IOptionsItem, OptionsItem } from '../options-item';\n\nconst textFieldStyles = cva(\n [\n 'block w-full rounded-medium py-xs pr-[32px] pl-s font-display outline outline-interactive',\n 'not-disabled:read-only:rounded-none not-disabled:read-only:p-0 not-disabled:read-only:outline-transparent not-disabled:read-only:hover:outline-transparent not-disabled:read-only:focus:outline-transparent',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark hover:outline-interactive-hover focus:outline-highlight',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n size: {\n medium: 'text-body-s',\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface InputProps\n extends VariantProps<typeof textFieldStyles>,\n Omit<AriaInputProps, 'size'> {\n isReadOnly?: boolean;\n}\n\nconst Input = ({\n className,\n isReadOnly = false,\n size = 'medium',\n ...props\n}: InputProps) => {\n return (\n <AriaInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n textFieldStyles({\n isDisabled,\n isInvalid,\n size,\n className,\n }),\n )\n }\n />\n );\n};\nInput.displayName = 'ComboBox.Input';\n\nexport interface ComboBoxProps<T extends IOptionsItem>\n extends Omit<\n VariantProps<typeof textFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaComboBoxProps<T>, 'children'>,\n Pick<AriaVirtualizerProps<AriaListLayoutOptions>, 'layoutOptions'> {\n className?: string;\n children: ReactNode | ((item: T) => ReactNode);\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n}\n\nexport function ComboBox<T extends IOptionsItem>({\n children,\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n layoutOptions,\n size = 'medium',\n ...props\n}: ComboBoxProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription = !(isSmall || isInvalid) || isDisabled;\n const shouldShowError = isInvalid && !isDisabled && !isReadOnly;\n const shouldShowLabel = !isSmall && label;\n\n return (\n <AriaComboBox<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n className='flex flex-col gap-xs'\n >\n {({ isDisabled, isOpen }) => (\n <>\n {shouldShowLabel && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isOptional={!props.isRequired}\n >\n {label}\n </Label>\n )}\n <div className='relative flex items-center'>\n <Input\n className={className}\n isReadOnly={isReadOnly}\n placeholder={placeholder}\n size={size}\n />\n <AriaButton\n className={cn([\n 'fg-default-light absolute right-xs transform',\n isDisabled && 'fg-disabled',\n isOpen && 'rotate-180',\n isReadOnly && 'hidden',\n ])}\n >\n <Icon className='block' size='large'>\n <ChevronDown />\n </Icon>\n </AriaButton>\n </div>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <AriaText\n className='fg-serious text-body-xs empty:hidden'\n slot='errorMessage'\n >\n {errorMessage}\n </AriaText>\n )}\n <AriaPopover className='w-(--trigger-width)'>\n <AriaVirtualizer\n layout={AriaListLayout}\n layoutOptions={layoutOptions}\n >\n <Options>{children}</Options>\n </AriaVirtualizer>\n </AriaPopover>\n </>\n )}\n </AriaComboBox>\n );\n}\nComboBox.displayName = 'ComboBox';\n\nComboBox.Item = OptionsItem;\n\ninterface ComboBoxSectionProps<T extends IOptionsItem>\n extends AriaListBoxSectionProps<T> {\n header?: string;\n}\n\nexport function ComboBoxSection<T extends IOptionsItem>({\n children,\n header,\n items,\n}: ComboBoxSectionProps<T>) {\n return (\n <AriaListBoxSection\n id={header}\n className='col-span-2 mt-s grid grid-cols-[auto_1fr] border-default-dark border-t first:border-none'\n >\n <AriaHeader className='col-span-2 m-xs my-s text-default-dark text-header-xs'>\n {header}\n </AriaHeader>\n <AriaListBoxCollection items={items}>{children}</AriaListBoxCollection>\n </AriaListBoxSection>\n );\n}\nComboBox.displayName = 'ComboBox.Section';\nComboBox.Section = ComboBoxSection;\n"]}
@@ -1,2 +1,2 @@
1
- import'client-only';import {cn}from'./../../lib/utils.js';import y from'@accelint/icons/calendar';import {cva}from'cva';import {DateField,Text,FieldError,DateInput,DateSegment}from'react-aria-components';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var I=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],T=({value:e,isFocused:o,isPlaceholder:i,placeholder:t,isReadOnly:s,shortMonth:l})=>{if(i)return t;let r=`${e}`;return !s&&o?r=r.padStart(2,"0"):l&&(r=I[(e??0)-1]),r},R=({segment:e,shortMonth:o,...i})=>e.type==="literal"&&e.text!==":"?jsx(Fragment,{}):jsx(DateSegment,{segment:e,className:"focus:bg-highlight focus:text-inverse-light focus:outline-none",...i,children:e.type==="month"?t=>jsx(T,{...t,shortMonth:o}):e.text}),O=cva(["flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover"},isInvalid:{true:"outline-serious"},isReadOnly:{true:"rounded-none p-0 outline-none"},size:{medium:["text-body-s","pl-[32px]"],small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"},{isDisabled:false,size:"medium"}],defaultVariants:{size:"medium"}}),V=({className:e,ref:o=null,size:i="medium",isReadOnly:t,...s})=>jsxs("div",{className:"relative flex",children:[i==="medium"?jsx(Icon,{className:cn(["-translate-y-1/2 absolute top-1/2 left-s",s.isDisabled?"text-disabled":"text-default-light"]),children:jsx(y,{})}):null,jsx(DateInput,{...s,className:({isDisabled:l,isInvalid:r})=>cn(O({isDisabled:l,isInvalid:r,isReadOnly:t,size:i,className:e}))})]});function q({className:e,description:o,errorMessage:i,isDisabled:t,isInvalid:s,isReadOnly:l,label:r,placeholder:E,slot:c,size:d="medium",shortMonth:f=true,...m}){let p=d==="small",D=o&&(!(p||s)||t),h=i&&s&&!t&&!l;return jsxs(DateField,{...m,isDisabled:t,isInvalid:s,isReadOnly:l,slot:c,className:"flex flex-col gap-xs",children:[!p&&jsx(Label,{className:"empty:hidden",isDisabled:t,isOptional:!m.isRequired,children:r}),jsx(V,{className:e,isDisabled:t,size:d,isReadOnly:l,isInvalid:s,children:x=>jsx(R,{segment:x,shortMonth:f})}),D&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",t&&"fg-disabled"]),slot:"description",children:o}),h&&jsx(FieldError,{className:"fg-serious text-body-xs empty:hidden",children:i})]})}export{q as DateField};//# sourceMappingURL=index.js.map
1
+ import {cn}from'./../../lib/utils.js';import y from'@accelint/icons/calendar';import'client-only';import {cva}from'cva';import {DateField,Text,FieldError,DateInput,DateSegment}from'react-aria-components';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var I=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],T=({value:e,isFocused:o,isPlaceholder:i,placeholder:t,isReadOnly:s,shortMonth:l})=>{if(i)return t;let r=`${e}`;return !s&&o?r=r.padStart(2,"0"):l&&(r=I[(e??0)-1]),r},R=({segment:e,shortMonth:o,...i})=>e.type==="literal"&&e.text!==":"?jsx(Fragment,{}):jsx(DateSegment,{segment:e,className:"focus:bg-highlight focus:text-inverse-light focus:outline-none",...i,children:e.type==="month"?t=>jsx(T,{...t,shortMonth:o}):e.text}),O=cva(["flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive"],{variants:{isDisabled:{true:"text-disabled outline-interactive-disabled placeholder:text-disabled",false:"text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover"},isInvalid:{true:"outline-serious"},isReadOnly:{true:"rounded-none p-0 outline-none"},size:{medium:["text-body-s","pl-[32px]"],small:"text-body-xs"}},compoundVariants:[{isDisabled:true,isInvalid:true,className:"outline-interactive-disabled"},{isDisabled:false,size:"medium"}],defaultVariants:{size:"medium"}}),V=({className:e,ref:o=null,size:i="medium",isReadOnly:t,...s})=>jsxs("div",{className:"relative flex",children:[i==="medium"?jsx(Icon,{className:cn(["-translate-y-1/2 absolute top-1/2 left-s",s.isDisabled?"text-disabled":"text-default-light"]),children:jsx(y,{})}):null,jsx(DateInput,{...s,className:({isDisabled:l,isInvalid:r})=>cn(O({isDisabled:l,isInvalid:r,isReadOnly:t,size:i,className:e}))})]});function q({className:e,description:o,errorMessage:i,isDisabled:t,isInvalid:s,isReadOnly:l,label:r,placeholder:E,slot:c,size:d="medium",shortMonth:f=true,...m}){let p=d==="small",D=o&&(!(p||s)||t),h=i&&s&&!t&&!l;return jsxs(DateField,{...m,isDisabled:t,isInvalid:s,isReadOnly:l,slot:c,className:"flex flex-col gap-xs",children:[!p&&jsx(Label,{className:"empty:hidden",isDisabled:t,isOptional:!m.isRequired,children:r}),jsx(V,{className:e,isDisabled:t,size:d,isReadOnly:l,isInvalid:s,children:x=>jsx(R,{segment:x,shortMonth:f})}),D&&jsx(Text,{className:cn(["fg-default-dark text-body-xs empty:hidden",t&&"fg-disabled"]),slot:"description",children:o}),h&&jsx(FieldError,{className:"fg-serious text-body-xs empty:hidden",children:i})]})}export{q as DateField};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["value","isPlaceholder","placeholder","isReadOnly","displayValue","months","FormattedDateSegment","segment","Fragment","jsx","DateSegment","a","F","renderProps","dateFieldStyles","cva","g","jsxs","u","v","n","AriaDateInput","props","P","DateField","label","slot","size","isSmall","shouldShowDescription","isInvalid","isDisabled","shouldShowError","errorMessage","AriaDateField","N","AriaText","S","description","FieldError"],"mappings":"4UAmCE,CAAA,CAAA,CAAA,KAC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,EAAA,CACEd,CAAAA,CAACiB,OACKZ,IACJ,2BACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,UACMI,CACN,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,SAAW,CAAA,sBAEV,CAAA,SACE,CACC,CAAA,CAAA,EAAAf,GAAA,CAAAwB,KAAA,CAAA,CAAA,wBACA,CAAA,uBACmB,CAAA,CAAA,CAAA,CAAA,UAElB,CAAAV,QAIJ,CACC,oBACA,CAAA,CAAA,CAAA,UACME,CACN,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,YAEEpB,QACsB,CAAA,CAAA,EAAAI,GAAA,CAAA,CAAA,CAASJ,QAAS,CAAA,CAAA,CAAA,UAG3CsB,CACCpB,CAAAA,CAAC2B,EAAA,CACC,CAAA,CAAA,EAAAzB,GAAA,CAAA0B,IAAA,CAAA,CAAA,SACE,CAAAjB,EAAA,CAAA,CAAA,2CACc,CAAA,CAAA,EAAA,aAEX,CAAA,CAAA,CAAA,IAAA,CAAA,aAEJ,CAAAkB,SAIFC,CAAAA,CAAA,CAAW,6BAAU,CAAA,sCACnB,CAAAN,QAKX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport 'client-only';\nimport { cn } from '@/lib/utils';\nimport Calendar from '@accelint/icons/calendar';\nimport type { DateValue } from '@internationalized/date';\nimport type { DateSegment as TDateSegment } from '@react-stately/datepicker';\nimport { type VariantProps, cva } from 'cva';\nimport type { ForwardedRef } from 'react';\nimport {\n DateField as AriaDateField,\n type DateFieldProps as AriaDateFieldProps,\n DateInput as AriaDateInput,\n type DateInputProps as AriaDateInputProps,\n type DateSegmentProps as AriaDateSegmentProps,\n Text as AriaText,\n DateSegment,\n type DateSegmentRenderProps,\n FieldError,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\n\nconst months = [\n 'JAN',\n 'FEB',\n 'MAR',\n 'APR',\n 'MAY',\n 'JUN',\n 'JUL',\n 'AUG',\n 'SEP',\n 'OCT',\n 'NOV',\n 'DEC',\n];\n\nconst MonthDateSegment = ({\n value,\n isFocused,\n isPlaceholder,\n placeholder,\n isReadOnly,\n shortMonth,\n}: DateSegmentRenderProps & { shortMonth?: boolean }) => {\n if (isPlaceholder) {\n return placeholder;\n }\n\n let displayValue: string | undefined = `${value}`;\n\n if (!isReadOnly && isFocused) {\n displayValue = displayValue.padStart(2, '0');\n } else if (shortMonth) {\n displayValue = months[(value ?? 0) - 1];\n }\n\n return displayValue;\n};\n\ninterface FormattedDateSegmentProps extends AriaDateSegmentProps {\n segment: TDateSegment;\n shortMonth?: boolean;\n}\n\nconst FormattedDateSegment = ({\n segment,\n shortMonth,\n ...props\n}: FormattedDateSegmentProps) => {\n if (segment.type === 'literal' && segment.text !== ':') {\n return <></>;\n }\n\n return (\n <DateSegment\n segment={segment}\n className='focus:bg-highlight focus:text-inverse-light focus:outline-none' // Ensure caret color is visible, RAC sets the style prop and it is not overridable. Thanks for that.\n {...props}\n >\n {segment.type === 'month'\n ? (renderProps) => (\n <MonthDateSegment {...renderProps} shortMonth={shortMonth} />\n )\n : segment.text}\n </DateSegment>\n );\n};\n\nconst dateFieldStyles = cva(\n [\n 'flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n isReadOnly: {\n true: 'rounded-none p-0 outline-none',\n },\n size: {\n medium: ['text-body-s', 'pl-[32px]'],\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n {\n isDisabled: false,\n size: 'medium',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface DateInputProps\n extends VariantProps<typeof dateFieldStyles>,\n Omit<AriaDateInputProps, 'size'> {\n ref?: ForwardedRef<HTMLDivElement>;\n}\n\nconst DateInput = ({\n className,\n ref = null,\n size = 'medium',\n isReadOnly,\n ...props\n}: DateInputProps) => {\n return (\n <div className='relative flex'>\n {size === 'medium' ? (\n <Icon\n className={cn([\n '-translate-y-1/2 absolute top-1/2 left-s',\n props.isDisabled ? 'text-disabled' : 'text-default-light',\n ])}\n >\n <Calendar />\n </Icon>\n ) : null}\n <AriaDateInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n dateFieldStyles({\n isDisabled,\n isInvalid,\n isReadOnly: isReadOnly,\n size,\n className,\n }),\n )\n }\n />\n </div>\n );\n};\n\nexport interface DateFieldProps<T extends DateValue>\n extends Omit<\n VariantProps<typeof dateFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaDateFieldProps<T>, 'className' | 'style'>, // Exclude className to avoid conflict with cva\n Omit<AriaDateInputProps, 'className' | 'children' | 'style'> {\n isDisabled?: boolean;\n isInvalid?: boolean;\n isReadOnly?: boolean;\n size?: 'small' | 'medium';\n className?: string;\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n shortMonth?: boolean;\n}\n\nexport function DateField<T extends DateValue>({\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n slot,\n size = 'medium',\n shortMonth = true,\n ...props\n}: DateFieldProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription =\n description && (!(isSmall || isInvalid) || isDisabled);\n const shouldShowError =\n errorMessage && isInvalid && !isDisabled && !isReadOnly;\n\n return (\n <AriaDateField<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n slot={slot}\n className={'flex flex-col gap-xs'}\n >\n {!isSmall && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isOptional={!props.isRequired}\n >\n {label}\n </Label>\n )}\n\n <DateInput\n className={className}\n isDisabled={isDisabled}\n size={size}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n >\n {(segment) => (\n <FormattedDateSegment segment={segment} shortMonth={shortMonth} />\n )}\n </DateInput>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <FieldError className='fg-serious text-body-xs empty:hidden'>\n {errorMessage}\n </FieldError>\n )}\n </AriaDateField>\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/date-field/index.tsx"],"names":["value","isPlaceholder","placeholder","isReadOnly","displayValue","months","FormattedDateSegment","segment","Fragment","jsx","DateSegment","a","F","renderProps","dateFieldStyles","cva","g","jsxs","u","v","n","AriaDateInput","props","P","DateField","label","slot","size","isSmall","shouldShowDescription","isInvalid","isDisabled","shouldShowError","errorMessage","AriaDateField","N","AriaText","S","description","FieldError"],"mappings":"4UAoCE,CAAA,CAAA,CAAA,KACA,CAAA,KACA,CAAA,KACA,CAAA,KACA,CAAA,KACA,CAAA,WAEA,CAAA,KACA,CAAA,WAEA,CAAA,MAGuB,KACvB,CAAA,CAAA,CAAAA,CAAAA,CACA,CAAA,KAAA,CAAA,CAAA,CAAA,yBAEA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,uBAGA,CAAIC,CAAAA,CACF,GAAA,CAAA,GAAOC,EAGT,SAA0CF,IAE1C,MA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AIJ,CACC,oBACA,CAAA,CAAA,CAAA,UACME,CACN,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,YAEEpB,QACsB,CAAA,CAAA,EAAAI,GAAA,CAAA,CAAA,CAASJ,QAAS,CAAA,CAAA,CAAA,UAG3CsB,CACCpB,CAAAA,CAAC2B,EAAA,CACC,CAAA,CAAA,EAAAzB,GAAA,CAAA0B,IAAA,CAAA,CAAA,SACE,CAAAjB,EAAA,CAAA,CAAA,2CACc,CAAA,CAAA,EAAA,aAEX,CAAA,CAAA,CAAA,IAAA,CAAA,aAEJ,CAAAkB,SAIFC,CAAAA,CAAA,CAAW,6BAAU,CAAA,sCACnB,CAAAN,QAKX,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport { cn } from '@/lib/utils';\nimport Calendar from '@accelint/icons/calendar';\nimport type { DateValue } from '@internationalized/date';\nimport type { DateSegment as TDateSegment } from '@react-stately/datepicker';\nimport 'client-only';\nimport { type VariantProps, cva } from 'cva';\nimport type { ForwardedRef } from 'react';\nimport {\n DateField as AriaDateField,\n type DateFieldProps as AriaDateFieldProps,\n DateInput as AriaDateInput,\n type DateInputProps as AriaDateInputProps,\n type DateSegmentProps as AriaDateSegmentProps,\n Text as AriaText,\n DateSegment,\n type DateSegmentRenderProps,\n FieldError,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\n\nconst months = [\n 'JAN',\n 'FEB',\n 'MAR',\n 'APR',\n 'MAY',\n 'JUN',\n 'JUL',\n 'AUG',\n 'SEP',\n 'OCT',\n 'NOV',\n 'DEC',\n];\n\nconst MonthDateSegment = ({\n value,\n isFocused,\n isPlaceholder,\n placeholder,\n isReadOnly,\n shortMonth,\n}: DateSegmentRenderProps & { shortMonth?: boolean }) => {\n if (isPlaceholder) {\n return placeholder;\n }\n\n let displayValue: string | undefined = `${value}`;\n\n if (!isReadOnly && isFocused) {\n displayValue = displayValue.padStart(2, '0');\n } else if (shortMonth) {\n displayValue = months[(value ?? 0) - 1];\n }\n\n return displayValue;\n};\n\ninterface FormattedDateSegmentProps extends AriaDateSegmentProps {\n segment: TDateSegment;\n shortMonth?: boolean;\n}\n\nconst FormattedDateSegment = ({\n segment,\n shortMonth,\n ...props\n}: FormattedDateSegmentProps) => {\n if (segment.type === 'literal' && segment.text !== ':') {\n return <></>;\n }\n\n return (\n <DateSegment\n segment={segment}\n className='focus:bg-highlight focus:text-inverse-light focus:outline-none' // Ensure caret color is visible, RAC sets the style prop and it is not overridable. Thanks for that.\n {...props}\n >\n {segment.type === 'month'\n ? (renderProps) => (\n <MonthDateSegment {...renderProps} shortMonth={shortMonth} />\n )\n : segment.text}\n </DateSegment>\n );\n};\n\nconst dateFieldStyles = cva(\n [\n 'flex w-full gap-xs rounded-medium px-s py-xs font-display outline outline-interactive',\n ],\n {\n variants: {\n isDisabled: {\n true: 'text-disabled outline-interactive-disabled placeholder:text-disabled',\n false:\n 'text-default-light placeholder:text-default-dark focus-within:outline-highlight hover:outline-interactive-hover',\n },\n isInvalid: {\n true: 'outline-serious',\n },\n isReadOnly: {\n true: 'rounded-none p-0 outline-none',\n },\n size: {\n medium: ['text-body-s', 'pl-[32px]'],\n small: 'text-body-xs',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isInvalid: true,\n className: 'outline-interactive-disabled',\n },\n {\n isDisabled: false,\n size: 'medium',\n },\n ],\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\ninterface DateInputProps\n extends VariantProps<typeof dateFieldStyles>,\n Omit<AriaDateInputProps, 'size'> {\n ref?: ForwardedRef<HTMLDivElement>;\n}\n\nconst DateInput = ({\n className,\n ref = null,\n size = 'medium',\n isReadOnly,\n ...props\n}: DateInputProps) => {\n return (\n <div className='relative flex'>\n {size === 'medium' ? (\n <Icon\n className={cn([\n '-translate-y-1/2 absolute top-1/2 left-s',\n props.isDisabled ? 'text-disabled' : 'text-default-light',\n ])}\n >\n <Calendar />\n </Icon>\n ) : null}\n <AriaDateInput\n {...props}\n className={({ isDisabled, isInvalid }) =>\n cn(\n dateFieldStyles({\n isDisabled,\n isInvalid,\n isReadOnly: isReadOnly,\n size,\n className,\n }),\n )\n }\n />\n </div>\n );\n};\n\nexport interface DateFieldProps<T extends DateValue>\n extends Omit<\n VariantProps<typeof dateFieldStyles>,\n 'isDisabled' | 'isInvalid' | 'isReadOnly'\n >,\n Omit<AriaDateFieldProps<T>, 'className' | 'style'>, // Exclude className to avoid conflict with cva\n Omit<AriaDateInputProps, 'className' | 'children' | 'style'> {\n isDisabled?: boolean;\n isInvalid?: boolean;\n isReadOnly?: boolean;\n size?: 'small' | 'medium';\n className?: string;\n description?: string;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n shortMonth?: boolean;\n}\n\nexport function DateField<T extends DateValue>({\n className,\n description,\n errorMessage,\n isDisabled,\n isInvalid,\n isReadOnly,\n label,\n placeholder,\n slot,\n size = 'medium',\n shortMonth = true,\n ...props\n}: DateFieldProps<T>) {\n const isSmall = size === 'small';\n const shouldShowDescription =\n description && (!(isSmall || isInvalid) || isDisabled);\n const shouldShowError =\n errorMessage && isInvalid && !isDisabled && !isReadOnly;\n\n return (\n <AriaDateField<T>\n {...props}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isReadOnly={isReadOnly}\n slot={slot}\n className={'flex flex-col gap-xs'}\n >\n {!isSmall && (\n <Label\n className='empty:hidden'\n isDisabled={isDisabled}\n isOptional={!props.isRequired}\n >\n {label}\n </Label>\n )}\n\n <DateInput\n className={className}\n isDisabled={isDisabled}\n size={size}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n >\n {(segment) => (\n <FormattedDateSegment segment={segment} shortMonth={shortMonth} />\n )}\n </DateInput>\n {shouldShowDescription && (\n <AriaText\n className={cn([\n 'fg-default-dark text-body-xs empty:hidden',\n isDisabled && 'fg-disabled',\n ])}\n slot='description'\n >\n {description}\n </AriaText>\n )}\n {shouldShowError && (\n <FieldError className='fg-serious text-body-xs empty:hidden'>\n {errorMessage}\n </FieldError>\n )}\n </AriaDateField>\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {cn}from'./../../lib/utils.js';import {useIsSSR}from'@react-aria/ssr';import {cva}from'cva';import {createContext,forwardRef,useState,useEffect,useContext}from'react';import {ModalOverlay,Modal,Dialog,DialogTrigger,Heading}from'react-aria-components';import {Button}from'../button/index.js';import {jsx}from'react/jsx-runtime';var M=cva("flex flex-col align-end font-light text-body-m text-default-dark",{variants:{size:{sm:"min-w-[280px] max-w-[280px] rounded-medium p-l",lg:"min-w-[320px] max-w-[720px] rounded-large p-xl"},defaultVariants:{size:"sm"}}}),E={sm:"small",lg:"medium"},b=createContext({size:"sm"}),r=()=>{let e=useContext(b);if(!e)throw new Error("Dialog components must be used within <Dialog>");return e},l=({children:e,size:t,isOpen:o,onOpenChange:i,isDismissable:a=true,isKeyboardDismissDisabled:m=true,parentRef:p})=>jsx(DialogTrigger,{children:jsx(b.Provider,{value:{size:t??"sm",isDismissable:a,isOpen:o,onOpenChange:i,parentRef:p,isKeyboardDismissDisabled:m},children:e})});l.displayName="Dialog";var x=forwardRef(({children:e,...t},o)=>{let{size:i,isDismissable:a,isOpen:m,onOpenChange:p,parentRef:c,isKeyboardDismissDisabled:C}=r(),d=useIsSSR(),[u,D]=useState(d?null:document.body);return useEffect(()=>{let f=c?.current,g=d?null:document.createElement("div");return f&&g&&(f.appendChild(g),D(g)),()=>{g?.remove(),D(d?null:document.body);}},[d,c]),u?jsx(ModalOverlay,{UNSTABLE_portalContainer:u,isKeyboardDismissDisabled:!a&&C,isOpen:m,onOpenChange:p,isDismissable:a,className:"absolute inset-0 flex items-center justify-center",...t,children:jsx(Modal,{ref:o,className:cn("flex flex-col justify-center bg-surface-overlay align-start",i==="sm"&&"rounded-medium",i==="lg"&&"rounded-large"),children:jsx(Dialog,{className:M({size:i}),children:e})})}):null});x.displayName="DialogBody";var H=({children:e,className:t})=>{let{size:o}=r();return jsx("div",{className:cn("flex flex-col",o==="sm"&&"gap-xs",o==="lg"&&"gap-l",t),children:e})},j=({children:e,className:t})=>{let{size:o}=r();return jsx(Heading,{slot:"title",className:cn("text-default-light",o==="sm"&&"mb-s text-header-m",o==="lg"&&"mb-m text-header-l",t),children:e})},K=({children:e,className:t,...o})=>{let{size:i}=r(),a=E[i];return jsx(Button,{size:a,...o,className:cn("dtk-pressed:bg-initial",t),children:e})},L=({children:e,className:t})=>{let{size:o}=r();return jsx("div",{className:cn("flex justify-end gap-xs",o==="sm"&&"mt-l",o==="lg"&&"mt-xl",t),children:e})};l.Button=K;l.Content=H;l.Footer=L;l.Title=j;l.Body=x;export{l as Dialog,j as DialogTitle};//# sourceMappingURL=index.js.map
1
+ import {cn}from'./../../lib/utils.js';import {useIsSSR}from'@react-aria/ssr';import'client-only';import {cva}from'cva';import {createContext,forwardRef,useState,useEffect,useContext}from'react';import {ModalOverlay,Modal,Dialog,DialogTrigger,Heading}from'react-aria-components';import {Button}from'../button/index.js';import {jsx}from'react/jsx-runtime';var M=cva("flex flex-col align-end font-light text-body-m text-default-dark",{variants:{size:{sm:"min-w-[280px] max-w-[280px] rounded-medium p-l",lg:"min-w-[320px] max-w-[720px] rounded-large p-xl"},defaultVariants:{size:"sm"}}}),E={sm:"small",lg:"medium"},b=createContext({size:"sm"}),r=()=>{let e=useContext(b);if(!e)throw new Error("Dialog components must be used within <Dialog>");return e},l=({children:e,size:t,isOpen:o,onOpenChange:i,isDismissable:a=true,isKeyboardDismissDisabled:m=true,parentRef:p})=>jsx(DialogTrigger,{children:jsx(b.Provider,{value:{size:t??"sm",isDismissable:a,isOpen:o,onOpenChange:i,parentRef:p,isKeyboardDismissDisabled:m},children:e})});l.displayName="Dialog";var x=forwardRef(({children:e,...t},o)=>{let{size:i,isDismissable:a,isOpen:m,onOpenChange:p,parentRef:c,isKeyboardDismissDisabled:C}=r(),d=useIsSSR(),[u,D]=useState(d?null:document.body);return useEffect(()=>{let f=c?.current,g=d?null:document.createElement("div");return f&&g&&(f.appendChild(g),D(g)),()=>{g?.remove(),D(d?null:document.body);}},[d,c]),u?jsx(ModalOverlay,{UNSTABLE_portalContainer:u,isKeyboardDismissDisabled:!a&&C,isOpen:m,onOpenChange:p,isDismissable:a,className:"absolute inset-0 flex items-center justify-center",...t,children:jsx(Modal,{ref:o,className:cn("flex flex-col justify-center bg-surface-overlay align-start",i==="sm"&&"rounded-medium",i==="lg"&&"rounded-large"),children:jsx(Dialog,{className:M({size:i}),children:e})})}):null});x.displayName="DialogBody";var H=({children:e,className:t})=>{let{size:o}=r();return jsx("div",{className:cn("flex flex-col",o==="sm"&&"gap-xs",o==="lg"&&"gap-l",t),children:e})},j=({children:e,className:t})=>{let{size:o}=r();return jsx(Heading,{slot:"title",className:cn("text-default-light",o==="sm"&&"mb-s text-header-m",o==="lg"&&"mb-m text-header-l",t),children:e})},K=({children:e,className:t,...o})=>{let{size:i}=r(),a=E[i];return jsx(Button,{size:a,...o,className:cn("dtk-pressed:bg-initial",t),children:e})},L=({children:e,className:t})=>{let{size:o}=r();return jsx("div",{className:cn("flex justify-end gap-xs",o==="sm"&&"mt-l",o==="lg"&&"mt-xl",t),children:e})};l.Button=K;l.Content=H;l.Footer=L;l.Title=j;l.Body=x;export{l as Dialog,j as DialogTitle};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map