@accelint/design-toolkit 5.2.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/catalog-info.yaml +44 -0
  2. package/dist/components/accordion/index.js +1 -1
  3. package/dist/components/accordion/index.js.map +1 -1
  4. package/dist/components/accordion/styles.d.ts +3 -3
  5. package/dist/components/accordion/styles.js +1 -1
  6. package/dist/components/accordion/styles.js.map +1 -1
  7. package/dist/components/action-bar/index.d.ts +11 -0
  8. package/dist/components/action-bar/index.js.map +1 -1
  9. package/dist/components/breadcrumbs/index.d.ts +12 -0
  10. package/dist/components/breadcrumbs/index.js.map +1 -1
  11. package/dist/components/button/styles.js +1 -1
  12. package/dist/components/button/styles.js.map +1 -1
  13. package/dist/components/clock/index.d.ts +39 -0
  14. package/dist/components/clock/index.js +4 -0
  15. package/dist/components/clock/index.js.map +1 -0
  16. package/dist/components/clock/types.d.ts +7 -0
  17. package/dist/components/clock/types.js +2 -0
  18. package/dist/components/clock/types.js.map +1 -0
  19. package/dist/components/combobox-field/index.d.ts +11 -0
  20. package/dist/components/combobox-field/index.js.map +1 -1
  21. package/dist/components/combobox-field/styles.js +1 -1
  22. package/dist/components/combobox-field/styles.js.map +1 -1
  23. package/dist/components/dialog/index.js +1 -1
  24. package/dist/components/dialog/index.js.map +1 -1
  25. package/dist/components/drawer/index.d.ts +36 -1
  26. package/dist/components/drawer/index.js +1 -1
  27. package/dist/components/drawer/index.js.map +1 -1
  28. package/dist/components/lines/index.d.ts +9 -0
  29. package/dist/components/lines/index.js.map +1 -1
  30. package/dist/components/link/index.d.ts +9 -0
  31. package/dist/components/link/index.js.map +1 -1
  32. package/dist/components/link/styles.js +1 -1
  33. package/dist/components/link/styles.js.map +1 -1
  34. package/dist/components/notice/events.d.ts +10 -0
  35. package/dist/components/notice/events.js +2 -0
  36. package/dist/components/notice/events.js.map +1 -0
  37. package/dist/components/notice/index.d.ts +20 -0
  38. package/dist/components/notice/index.js +4 -0
  39. package/dist/components/notice/index.js.map +1 -0
  40. package/dist/components/notice/styles.d.ts +60 -0
  41. package/dist/components/notice/styles.js +2 -0
  42. package/dist/components/notice/styles.js.map +1 -0
  43. package/dist/components/notice/types.d.ts +75 -0
  44. package/dist/components/notice/types.js +2 -0
  45. package/dist/components/notice/types.js.map +1 -0
  46. package/dist/components/query-builder/index.js +1 -1
  47. package/dist/components/query-builder/index.js.map +1 -1
  48. package/dist/components/sidenav/index.d.ts +56 -0
  49. package/dist/components/sidenav/index.js +1 -1
  50. package/dist/components/sidenav/index.js.map +1 -1
  51. package/dist/components/slider/index.js +1 -1
  52. package/dist/components/slider/index.js.map +1 -1
  53. package/dist/components/slider/styles.js +1 -1
  54. package/dist/components/slider/styles.js.map +1 -1
  55. package/dist/components/table/index.d.ts +9 -0
  56. package/dist/components/table/index.js +1 -1
  57. package/dist/components/table/index.js.map +1 -1
  58. package/dist/components/tabs/styles.js +1 -1
  59. package/dist/components/tabs/styles.js.map +1 -1
  60. package/dist/components/time-field/index.d.ts +9 -0
  61. package/dist/components/time-field/index.js.map +1 -1
  62. package/dist/components/tooltip/index.d.ts +23 -34
  63. package/dist/components/tooltip/index.js +1 -1
  64. package/dist/components/tooltip/index.js.map +1 -1
  65. package/dist/components/tooltip/types.d.ts +5 -6
  66. package/dist/components/tree/index.d.ts +22 -1
  67. package/dist/components/tree/index.js +1 -1
  68. package/dist/components/tree/index.js.map +1 -1
  69. package/dist/components/tree/styles.js +1 -1
  70. package/dist/components/tree/styles.js.map +1 -1
  71. package/dist/components/view-stack/index.d.ts +42 -2
  72. package/dist/components/view-stack/index.js +1 -1
  73. package/dist/components/view-stack/index.js.map +1 -1
  74. package/dist/index.css +5 -3
  75. package/dist/index.d.ts +12 -5
  76. package/dist/index.js +1 -1
  77. package/dist/metafile-esm.json +1 -1
  78. package/dist/providers/portal.d.ts +9 -0
  79. package/dist/providers/portal.js +2 -0
  80. package/dist/providers/portal.js.map +1 -0
  81. package/dist/providers/theme-provider.d.ts +6 -6
  82. package/dist/providers/theme-provider.js +1 -1
  83. package/dist/providers/theme-provider.js.map +1 -1
  84. package/dist/styles.css +372 -128
  85. package/package.json +33 -17
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/drawer/index.tsx"],"names":["DrawerStyles","menu","item","bus","Broadcast","DrawerContext","createContext","oe","ae","K","DrawerEventHandlers","_","ViewStackEventHandlers","view","q","P","DrawerTrigger","children","parent","handlePress","events","event","id","y","isUUID","type","jsx","Pressable","Q","r","Z","Icon","Cancel","b","h","DrawerBack","X","stack","useContext","ViewStackContext","Button","w","ChevronLeft","Y","className","rest","DrawerLayoutMain","DrawerLayout","layout","push","tooltipPlacementMap","DrawerMenuItem","textValue","placement","action","toggle","useRef","Tooltip","G","C","classNames","te","H","composeRenderProps","tooltipRef","DrawerMenu","R","position","DrawerPanel","panel","register","useEffect","unregister","ViewStack","B","U","DrawerView","level","Heading","re","ne","DrawerHeader","title","header","jsxs","Fragment","ee","Drawer","ye","DrawerHeaderTitle","DrawerContent","content","DrawerFooter","size","onChange","activeView","setActiveView","useState","defaultView","handleOpen","useCallback","data","views","E","ViewStackEventTypes","j","handleToggle","v","listeners","DrawerEventTypes","off","drawer","DrawerClose"],"mappings":"60BAsDmD,MAAA,CAAA,MAAS,CAAA,EAAA,CAAA,IAAO,CACjEA,EAAAA,CAAa,MACP,CAAA,EAAAC,CAAAA,KAAM,CAAAC,EAAK,KAAqB,CAAA,EAClCC,CAAMC,MAAU,CAAA,EAAA,CAAA,OAETC,CAAgBC,EAAkC,CAC7D,MAAA,CAAA,EAAU,CAAA,CAAAC,YAAG,EAAA,CACb,CAAA,IAAA,CAAA,EAAA,CAAA,IAAY,CAAA,EAAG,CAAA,CACfC,gBAAA,EAAA,CAAA,CAAA,CAAAC,SAAA,CAAA,WAGWC,EAAsB,CACjC,CAAA,CAAAC,aAAGC,CAAAA,CACH,QAA8B,CAAA,IAAA,CAC9B,CAAA,CAAA,UAA8B,CA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CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { Broadcast } from '@accelint/bus';\nimport { isUUID, type UniqueId } from '@accelint/core';\nimport { Cancel, ChevronLeft } from '@accelint/icons';\nimport { Pressable } from '@react-aria/interactions';\nimport {\n type ComponentPropsWithRef,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { composeRenderProps, Header, Heading } from 'react-aria-components';\nimport { containsExactChildren } from '@/lib/react';\nimport { Button, ToggleButton } from '../button';\nimport { Icon } from '../icon';\nimport { Tooltip } from '../tooltip';\nimport {\n ViewStack,\n ViewStackContext,\n ViewStackEventHandlers,\n} from '../view-stack';\nimport { ViewStackEventTypes } from '../view-stack/events';\nimport { DrawerEventTypes } from './events';\nimport { DrawerMenuStyles, DrawerStyles, DrawerTitleStyles } from './styles';\nimport type { ViewStackViewProps } from '../view-stack/types';\nimport type {\n DrawerContextValue,\n DrawerEvent,\n DrawerLayoutProps,\n DrawerMenuItemProps,\n DrawerMenuProps,\n DrawerOpenEvent,\n DrawerProps,\n DrawerTitleProps,\n DrawerToggleEvent,\n DrawerTriggerProps,\n} from './types';\n\nconst { layout, main, drawer, panel, view, header, content, footer } =\n DrawerStyles();\nconst { menu, item } = DrawerMenuStyles();\nconst bus = Broadcast.getInstance<DrawerEvent>();\n\nexport const DrawerContext = createContext<DrawerContextValue>({\n register: () => undefined,\n unregister: () => undefined,\n placement: 'left',\n});\n\nexport const DrawerEventHandlers = {\n ...ViewStackEventHandlers,\n close: ViewStackEventHandlers.clear,\n open: (view: UniqueId) => bus.emit(DrawerEventTypes.open, { view }),\n toggle: (view: UniqueId) => bus.emit(DrawerEventTypes.toggle, { view }),\n} as const;\n\nfunction DrawerTrigger({ children, for: events }: DrawerTriggerProps) {\n const { parent } = useContext(ViewStackContext);\n\n function handlePress() {\n for (const type of Array.isArray(events) ? events : [events]) {\n let [event, id] = (isUUID(type) ? ['push', type] : type.split(':')) as [\n 'back' | 'clear' | 'close' | 'open' | 'push' | 'reset' | 'toggle',\n UniqueId | undefined | null,\n ];\n\n id ??= parent;\n\n if (!id) {\n continue;\n }\n\n DrawerEventHandlers[event](id);\n }\n }\n\n return <Pressable onPress={handlePress}>{children}</Pressable>;\n}\nDrawerTrigger.displayName = 'Drawer.Trigger';\n\nfunction DrawerClose() {\n return (\n <Drawer.Trigger for='close'>\n <Button variant='icon'>\n <Icon>\n <Cancel />\n </Icon>\n </Button>\n </Drawer.Trigger>\n );\n}\n\nDrawerClose.displayName = 'Drawer.Close';\n\nfunction DrawerBack() {\n const { stack } = useContext(ViewStackContext);\n return stack.length > 1 ? (\n <Drawer.Trigger for='back'>\n <Button variant='icon'>\n <Icon>\n <ChevronLeft />\n </Icon>\n </Button>\n </Drawer.Trigger>\n ) : null;\n}\n\nDrawerBack.displayName = 'Drawer.Back';\n\nfunction DrawerLayoutMain({\n className,\n ...rest\n}: ComponentPropsWithRef<'main'>) {\n return <main {...rest} className={main({ className })} />;\n}\nDrawerLayoutMain.displayName = 'Drawer.Layout.Main';\n\nfunction DrawerLayout({\n className,\n extend = 'left right',\n push,\n ...rest\n}: DrawerLayoutProps) {\n return (\n <div\n {...rest}\n className={layout({ className })}\n data-extend={extend}\n data-push={push}\n />\n );\n}\nDrawerLayout.displayName = 'Drawer.Layout';\nDrawerLayout.Main = DrawerLayoutMain;\n\nconst tooltipPlacementMap = {\n left: 'right',\n right: 'left',\n top: 'bottom',\n bottom: 'top',\n} as const;\n\nfunction DrawerMenuItem({\n for: id,\n children,\n classNames,\n toggle,\n textValue,\n ...rest\n}: DrawerMenuItemProps) {\n const { parent, stack } = useContext(ViewStackContext);\n const { placement } = useContext(DrawerContext);\n const view = stack.at(-1);\n const action = toggle ? 'toggle' : 'open';\n const tooltipRef = useRef(null);\n\n if (!parent) {\n return null;\n }\n\n return (\n <Tooltip>\n <Tooltip.Trigger>\n <DrawerTrigger for={`${action}:${id}`}>\n <ToggleButton\n {...rest}\n ref={tooltipRef}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className }),\n )}\n role='tab'\n variant='icon'\n isSelected={id === view || (stack.length > 1 && stack.includes(id))}\n >\n {composeRenderProps(children, (children) => (\n <Icon>{children}</Icon>\n ))}\n </ToggleButton>\n </DrawerTrigger>\n </Tooltip.Trigger>\n <Tooltip.Body\n triggerRef={tooltipRef}\n placement={tooltipPlacementMap[placement]}\n offset={6}\n className={classNames?.tooltip}\n >\n {textValue}\n </Tooltip.Body>\n </Tooltip>\n );\n}\nDrawerMenuItem.displayName = 'Drawer.Menu.Item';\n\nfunction DrawerMenu({\n className,\n position = 'center',\n children,\n ...rest\n}: DrawerMenuProps) {\n containsExactChildren({\n children,\n componentName: DrawerMenu.displayName,\n restrictions: [\n [DrawerMenuItem, { min: 1 }],\n [DrawerTrigger, { min: 0, max: 0 }],\n ],\n });\n return (\n <nav\n {...rest}\n className={menu({\n position,\n className,\n })}\n >\n {children}\n </nav>\n );\n}\nDrawerMenu.displayName = 'Drawer.Menu';\nDrawerMenu.Item = DrawerMenuItem;\n\nfunction DrawerPanel({ className, ...rest }: ComponentPropsWithRef<'div'>) {\n return <div {...rest} className={panel({ className })} />;\n}\nDrawerPanel.displayName = 'Drawer.Panel';\n\nfunction DrawerView({\n id,\n children,\n className,\n ...rest\n}: ViewStackViewProps & ComponentPropsWithRef<'div'>) {\n const { register, unregister } = useContext(DrawerContext);\n\n useEffect(() => {\n register(id);\n\n () => unregister(id);\n }, [register, unregister, id]);\n\n return (\n <ViewStack.View id={id}>\n <div {...rest} className={view({ className })} role='tabpanel'>\n {children}\n </div>\n </ViewStack.View>\n );\n}\nDrawerView.displayName = 'Drawer.View';\n\n/**\n * To change size of title, use the `level` prop: `1`-`3` (large), `4`-`6` (medium).\n *\n * `level` also changes the semantic heading tag number `h1`-`h6`\n */\nfunction DrawerHeaderTitle({ className, level, ...rest }: DrawerTitleProps) {\n return (\n <Heading\n {...rest}\n className={DrawerTitleStyles({ className, level })}\n level={level}\n />\n );\n}\nDrawerHeaderTitle.displayName = 'Drawer.Title';\n\nfunction DrawerHeader({\n className,\n title,\n children,\n ...rest\n}: ComponentPropsWithRef<'header'>) {\n const { stack } = useContext(ViewStackContext);\n const level = stack.length > 1 ? 4 : 1;\n\n return (\n <Header {...rest} className={header({ className })}>\n {title ? (\n <>\n <Drawer.Back />\n <Drawer.Header.Title level={level} className='w-fit'>\n {title}\n </Drawer.Header.Title>\n <Drawer.Close />\n </>\n ) : (\n children\n )}\n </Header>\n );\n}\n\nDrawerHeader.displayName = 'Drawer.Header';\nDrawerHeader.Title = DrawerHeaderTitle;\n\nfunction DrawerContent({ className, ...rest }: ComponentPropsWithRef<'div'>) {\n return <div {...rest} className={content({ className })} />;\n}\nDrawerContent.displayName = 'Drawer.Content';\n\nfunction DrawerFooter({ className, ...rest }: ComponentPropsWithRef<'footer'>) {\n return <footer {...rest} className={footer({ className })} />;\n}\nDrawerFooter.displayName = 'Drawer.Footer';\n\nexport function Drawer({\n id,\n children,\n className,\n defaultView,\n placement = 'left',\n size = 'medium',\n onChange,\n ...rest\n}: DrawerProps) {\n containsExactChildren({\n children,\n componentName: Drawer.displayName,\n restrictions: [\n [DrawerMenu, { min: 0, max: 1 }],\n [DrawerPanel, { min: 1, max: 1 }],\n ],\n });\n\n const views = useRef(new Set<UniqueId>());\n const [activeView, setActiveView] = useState<UniqueId | null>(\n defaultView || null,\n );\n\n const handleOpen = useCallback(\n (data: DrawerOpenEvent) => {\n if (views.current.has(data?.payload?.view)) {\n bus.emit(ViewStackEventTypes.clear, { stack: id });\n bus.emit(ViewStackEventTypes.push, data.payload);\n }\n },\n [id],\n );\n const handleToggle = useCallback(\n (data: DrawerToggleEvent) => {\n if (views.current.has(data?.payload?.view)) {\n bus.emit(ViewStackEventTypes.clear, { stack: id });\n if (activeView !== data?.payload?.view) {\n bus.emit(ViewStackEventTypes.push, data.payload);\n }\n }\n },\n [id, activeView],\n );\n\n useEffect(() => {\n const listeners = [\n bus.on(DrawerEventTypes.open, handleOpen),\n bus.on(DrawerEventTypes.toggle, handleToggle),\n ];\n\n return () => {\n for (const off of listeners) {\n off();\n }\n };\n }, [handleOpen, handleToggle]);\n\n return (\n <DrawerContext.Provider\n value={{\n register: (view: UniqueId) => views.current.add(view),\n unregister: (view: UniqueId) => views.current.delete(view),\n placement,\n }}\n >\n <ViewStack\n id={id}\n defaultView={defaultView}\n onChange={(view) => {\n setActiveView(view);\n onChange?.(view);\n }}\n >\n <div\n {...rest}\n className={drawer({ className })}\n data-open={!!activeView || null}\n data-placement={placement}\n data-size={size}\n >\n {children}\n </div>\n </ViewStack>\n </DrawerContext.Provider>\n );\n}\nDrawer.displayName = 'Drawer';\n\nDrawer.Layout = DrawerLayout;\nDrawer.Menu = DrawerMenu;\nDrawer.Panel = DrawerPanel;\nDrawer.View = DrawerView;\nDrawer.Header = DrawerHeader;\nDrawer.Content = DrawerContent;\nDrawer.Footer = DrawerFooter;\nDrawer.Trigger = DrawerTrigger;\nDrawer.Close = DrawerClose;\nDrawer.Back = DrawerBack;\n"]}
1
+ {"version":3,"sources":["../../../src/components/drawer/index.tsx"],"names":["footer","DrawerMenuStyles","DrawerContext","ie","oe","DrawerEventHandlers","bus","DrawerEventTypes","view","w","viewStackEmit","emitOpen","useEmit","emitToggle","b","E","DrawerTrigger","children","useContext","drawerEmit","useDrawerEmit","handlePress","type","events","event","id","jsx","Pressable","X","t","_","DrawerClose","Drawer","Button","H","N","Y","stack","ViewStackContext","v","DrawerBack","DrawerLayoutMain","Z","className","rest","layout","push","DrawerMenuItem","toggle","tooltipRef","useRef","parent","jsxs","Tooltip","x","J","R","composeRenderProps","classNames","item","M","tooltipPlacementMap","placement","textValue","containsExactChildren","menu","position","DrawerMenu","DrawerPanel","DrawerView","unregister","register","ee","q","level","DrawerTitleStyles","DrawerHeaderTitle","se","DrawerHeader","title","Header","u","te","Pe","DrawerContent","DrawerFooter","onChange","activeView","setActiveView","useState","defaultView","useViewStackEmit","handleOpen","useCallback","data","views","re","S","useOn","V","ViewStack","size"],"mappings":"o1BAuDmD,MAAA,CAAA,SAAS,CAAA,IAAA,CAAAA,EAAO,CAAA,MAE7D,CAAE,EAAA,CAAA,KAAM,QAAK,CAAIC,EAAAA,CAAiB,MAElB,CAAA,EAAA,CAAA,OAAA,CAAyB,EAElCC,OACX,CAAA,EAAA,CAAA,CAAAC,YAAU,EAAA,CAAA,CAAG,IACb,CAAA,EAAA,CAAA,IAAA,CAAA,EAAY,CAAA,CAAAC,gBAAG,EACf,wBACF,EAAC,CAEYC,CAAAA,CAAAA,aAAsB,CACjC,CAAA,QACA,CAAA,IAA8B,CAAA,CAAA,CAAA,UACJC,CAAAA,IAAI,CAAA,CAAKC,CAAAA,SAAyB,CAAA,MAC5D,CAAA,CAAA,CAAA,EAAA,CAAA,CAASC,GAAmBF,sBAAAA,CAAI,KAAKC,uBAAiB,CAAA,KAAA,CAAQ,IAAE,CAAA,CAAAC,EAAM,CACxE,CAAA,IAEO,CAAAC,gBAAA,CAAA,UACL,CAAA,CAAA,CAAA,CAAMC,CAAAA,MACAC,CAAWC,CAAAA,EAAqBL,CAAiB,KAAI,CACrDM,gBAAAA,CAAaD,MAAsC,CAAA,CAAA,IAEzD,CAAA,CAAA,CAAA,CAAA,EAAO,SAEL,EAAA,EAAOF,CAAc,MACrB,CAAA,CAAAI,gBAAA,EAAON,CAAAA,CAAAA,CAAmBG,OAAAA,CAASF,g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A,CAAA,CAAA,CAAAqB,GAAA,CAAA,CAAarB,CAAAA,QAAyB,CAAA,CAAA,eACtC,CAAA,CAAA,EAAA,CAAA,CAAA,OAGF,CAAA,GAAA,CAAA,CAAAkB,CAAAA,CAAC0E,UAEC,CAAA,CAAA,EAAA,CAAA,CAAA,OACA,CAAA,MAAA,CAAW5F,CAAAA,CAAAA,CAAS,SAElB8E,CAAW9E,CAAI,CACjB,CAAA,QAEA,CAAAqB,GAAAH,CAAAA,SAAC,CAAA,CAAA,EAAA,CAAA,CAAA,CACE,WACD,CAAA,CAAA,CAAA,QAAoB,CAAA,CAAA,EAAA,CAAA,CAAA,CAAAiB,CAAU,CAAC,CAAA,CAC/B,gBAAa4C,CAAAA,GAAc,CAAA,KAC3B,CAAA,CAAA,GAAA,CAAA,CAAA,SAAgBzB,CAAAA,EAChB,CAAA,CAAA,SAAWuC,CAAAA,CAEV,cAEL,CACF,CAEJ,CACArE,CAAAA,EAAO,IAAA,CAAA,iBAEA,CAAA,CAAA,WACA,CAAA,CAAA,CAAOmC,QACP,CAAA,CAAQC,CAAAA,CACfpC,EAAO,CAAA,CAAA,CAAA,CAAA,CAAOqC,WACES,CAAAA,QACT,CAAA,CAAA,CAAUM,MACV,CAAA,CAAA,CAAA,CAAA,CAASC,IACT,CAAA,CAAA,CAAA,CAAA,CAAA,KACPrD,CAAAA,CAAO,CAAA,CAAA,CAAA,IAAQD,CACfC,EAAO,CAAA,CAAA,MAAOQ,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { Broadcast } from '@accelint/bus';\nimport { useEmit, useOn } from '@accelint/bus/react';\nimport { isUUID, type UniqueId } from '@accelint/core';\nimport { Cancel, ChevronLeft } from '@accelint/icons';\nimport { Pressable } from '@react-aria/interactions';\nimport {\n type ComponentPropsWithRef,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useRef,\n useState,\n} from 'react';\nimport { composeRenderProps, Header, Heading } from 'react-aria-components';\nimport { containsExactChildren } from '@/lib/react';\nimport { Button, ToggleButton } from '../button';\nimport { Icon } from '../icon';\nimport { Tooltip } from '../tooltip';\nimport {\n useViewStackEmit,\n ViewStack,\n ViewStackContext,\n ViewStackEventHandlers,\n} from '../view-stack';\nimport { DrawerEventTypes } from './events';\nimport { DrawerMenuStyles, DrawerStyles, DrawerTitleStyles } from './styles';\nimport type { ViewStackViewProps } from '../view-stack/types';\nimport type {\n DrawerContextValue,\n DrawerEvent,\n DrawerLayoutProps,\n DrawerMenuItemProps,\n DrawerMenuProps,\n DrawerOpenEvent,\n DrawerProps,\n DrawerTitleProps,\n DrawerToggleEvent,\n DrawerTriggerProps,\n} from './types';\n\nconst { layout, main, drawer, panel, view, header, content, footer } =\n DrawerStyles();\nconst { menu, item } = DrawerMenuStyles();\n\nconst bus = Broadcast.getInstance<DrawerEvent>();\n\nexport const DrawerContext = createContext<DrawerContextValue>({\n register: () => undefined,\n unregister: () => undefined,\n placement: 'left',\n});\n\nexport const DrawerEventHandlers = {\n ...ViewStackEventHandlers,\n close: ViewStackEventHandlers.clear,\n open: (view: UniqueId) => bus.emit(DrawerEventTypes.open, { view }),\n toggle: (view: UniqueId) => bus.emit(DrawerEventTypes.toggle, { view }),\n} as const;\n\nexport function useDrawerEmit() {\n const viewStackEmit = useViewStackEmit();\n const emitOpen = useEmit<DrawerEvent>(DrawerEventTypes.open);\n const emitToggle = useEmit<DrawerEvent>(DrawerEventTypes.toggle);\n\n return {\n ...viewStackEmit,\n close: viewStackEmit.clear,\n open: (view: UniqueId) => emitOpen({ view }),\n toggle: (view: UniqueId) => emitToggle({ view }),\n } as const;\n}\n\nfunction DrawerTrigger({ children, for: events }: DrawerTriggerProps) {\n const { parent } = useContext(ViewStackContext);\n const drawerEmit = useDrawerEmit();\n\n function handlePress() {\n for (const type of Array.isArray(events) ? events : [events]) {\n let [event, id] = (isUUID(type) ? ['push', type] : type.split(':')) as [\n 'back' | 'clear' | 'close' | 'open' | 'push' | 'reset' | 'toggle',\n UniqueId | undefined | null,\n ];\n\n id ??= parent;\n\n if (!id) {\n continue;\n }\n\n drawerEmit[event](id);\n }\n }\n\n return <Pressable onPress={handlePress}>{children}</Pressable>;\n}\nDrawerTrigger.displayName = 'Drawer.Trigger';\n\nfunction DrawerClose() {\n return (\n <Drawer.Trigger for='close'>\n <Button variant='icon'>\n <Icon>\n <Cancel />\n </Icon>\n </Button>\n </Drawer.Trigger>\n );\n}\n\nDrawerClose.displayName = 'Drawer.Close';\n\nfunction DrawerBack() {\n const { stack } = useContext(ViewStackContext);\n return stack.length > 1 ? (\n <Drawer.Trigger for='back'>\n <Button variant='icon'>\n <Icon>\n <ChevronLeft />\n </Icon>\n </Button>\n </Drawer.Trigger>\n ) : null;\n}\n\nDrawerBack.displayName = 'Drawer.Back';\n\nfunction DrawerLayoutMain({\n className,\n ...rest\n}: ComponentPropsWithRef<'main'>) {\n return <main {...rest} className={main({ className })} />;\n}\nDrawerLayoutMain.displayName = 'Drawer.Layout.Main';\n\nfunction DrawerLayout({\n className,\n extend = 'left right',\n push,\n ...rest\n}: DrawerLayoutProps) {\n return (\n <div\n {...rest}\n className={layout({ className })}\n data-extend={extend}\n data-push={push}\n />\n );\n}\nDrawerLayout.displayName = 'Drawer.Layout';\nDrawerLayout.Main = DrawerLayoutMain;\n\nconst tooltipPlacementMap = {\n left: 'right',\n right: 'left',\n top: 'bottom',\n bottom: 'top',\n} as const;\n\nfunction DrawerMenuItem({\n for: id,\n children,\n classNames,\n toggle,\n textValue,\n ...rest\n}: DrawerMenuItemProps) {\n const { parent, stack } = useContext(ViewStackContext);\n const { placement } = useContext(DrawerContext);\n const view = stack.at(-1);\n const action = toggle ? 'toggle' : 'open';\n const tooltipRef = useRef(null);\n\n if (!parent) {\n return null;\n }\n\n return (\n <Tooltip.Trigger>\n <DrawerTrigger for={`${action}:${id}`}>\n <ToggleButton\n {...rest}\n ref={tooltipRef}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className }),\n )}\n role='tab'\n variant='icon'\n isSelected={id === view || (stack.length > 1 && stack.includes(id))}\n >\n {composeRenderProps(children, (children) => (\n <Icon>{children}</Icon>\n ))}\n </ToggleButton>\n </DrawerTrigger>\n <Tooltip\n triggerRef={tooltipRef}\n placement={tooltipPlacementMap[placement]}\n offset={6}\n className={classNames?.tooltip}\n >\n {textValue}\n </Tooltip>\n </Tooltip.Trigger>\n );\n}\nDrawerMenuItem.displayName = 'Drawer.Menu.Item';\n\nfunction DrawerMenu({\n className,\n position = 'center',\n children,\n ...rest\n}: DrawerMenuProps) {\n containsExactChildren({\n children,\n componentName: DrawerMenu.displayName,\n restrictions: [\n [DrawerMenuItem, { min: 1 }],\n [DrawerTrigger, { min: 0, max: 0 }],\n ],\n });\n return (\n <nav\n {...rest}\n className={menu({\n position,\n className,\n })}\n >\n {children}\n </nav>\n );\n}\nDrawerMenu.displayName = 'Drawer.Menu';\nDrawerMenu.Item = DrawerMenuItem;\n\nfunction DrawerPanel({ className, ...rest }: ComponentPropsWithRef<'div'>) {\n return <div {...rest} className={panel({ className })} />;\n}\nDrawerPanel.displayName = 'Drawer.Panel';\n\nfunction DrawerView({\n id,\n children,\n className,\n ...rest\n}: ViewStackViewProps & ComponentPropsWithRef<'div'>) {\n const { register, unregister } = useContext(DrawerContext);\n\n useEffect(() => {\n register(id);\n\n return () => unregister(id);\n }, [register, unregister, id]);\n\n return (\n <ViewStack.View id={id}>\n <div {...rest} className={view({ className })} role='tabpanel'>\n {children}\n </div>\n </ViewStack.View>\n );\n}\nDrawerView.displayName = 'Drawer.View';\n\n/**\n * To change size of title, use the `level` prop: `1`-`3` (large), `4`-`6` (medium).\n *\n * `level` also changes the semantic heading tag number `h1`-`h6`\n */\nfunction DrawerHeaderTitle({ className, level, ...rest }: DrawerTitleProps) {\n return (\n <Heading\n {...rest}\n className={DrawerTitleStyles({ className, level })}\n level={level}\n />\n );\n}\nDrawerHeaderTitle.displayName = 'Drawer.Title';\n\nfunction DrawerHeader({\n className,\n title,\n children,\n ...rest\n}: ComponentPropsWithRef<'header'>) {\n const { stack } = useContext(ViewStackContext);\n const level = stack.length > 1 ? 4 : 1;\n\n return (\n <Header {...rest} className={header({ className })}>\n {title ? (\n <>\n <Drawer.Back />\n <Drawer.Header.Title level={level} className='w-fit'>\n {title}\n </Drawer.Header.Title>\n <Drawer.Close />\n </>\n ) : (\n children\n )}\n </Header>\n );\n}\n\nDrawerHeader.displayName = 'Drawer.Header';\nDrawerHeader.Title = DrawerHeaderTitle;\n\nfunction DrawerContent({ className, ...rest }: ComponentPropsWithRef<'div'>) {\n return <div {...rest} className={content({ className })} />;\n}\nDrawerContent.displayName = 'Drawer.Content';\n\nfunction DrawerFooter({ className, ...rest }: ComponentPropsWithRef<'footer'>) {\n return <footer {...rest} className={footer({ className })} />;\n}\nDrawerFooter.displayName = 'Drawer.Footer';\n\n/**\n * Drawer - Slide-in panel for navigation or contextual content\n *\n * A flexible panel that slides in from the viewport edge and supports\n * stacked views, headers, footers, and programmatic triggers.\n *\n * @example\n * const ids = { drawer: uuid(), a: uuid() };\n *\n * <Drawer.Layout push=\"left\">\n * <Drawer.Layout.Main>\n * <Drawer.Trigger for={`open:${ids.a}`}>\n * <Button variant=\"icon\">Open</Button>\n * </Drawer.Trigger>\n * </Drawer.Layout.Main>\n *\n * <Drawer id={ids.drawer} defaultView={ids.a}>\n * <Drawer.Panel>\n * <Drawer.View id={ids.a}>\n * <Drawer.Header title=\"Title A\" />\n * <Drawer.Content>Content for View A</Drawer.Content>\n * </Drawer.View>\n * </Drawer.Panel>\n * </Drawer>\n * </Drawer.Layout>\n */\nexport function Drawer({\n id,\n children,\n className,\n defaultView,\n placement = 'left',\n size = 'medium',\n onChange,\n ...rest\n}: DrawerProps) {\n containsExactChildren({\n children,\n componentName: Drawer.displayName,\n restrictions: [\n [DrawerMenu, { min: 0, max: 1 }],\n [DrawerPanel, { min: 1, max: 1 }],\n ],\n });\n\n const views = useRef(new Set<UniqueId>());\n const [activeView, setActiveView] = useState<UniqueId | null>(\n defaultView || null,\n );\n\n const viewStackEmit = useViewStackEmit();\n\n const handleOpen = useCallback(\n (data: DrawerOpenEvent) => {\n if (views.current.has(data?.payload?.view)) {\n viewStackEmit.clear(id);\n viewStackEmit.push(data.payload.view);\n }\n },\n [id, viewStackEmit.clear, viewStackEmit.push],\n );\n const handleToggle = useCallback(\n (data: DrawerToggleEvent) => {\n if (views.current.has(data?.payload?.view)) {\n viewStackEmit.clear(id);\n if (activeView !== data?.payload?.view) {\n viewStackEmit.push(data.payload.view);\n }\n }\n },\n [id, activeView, viewStackEmit.clear, viewStackEmit.push],\n );\n\n useOn(DrawerEventTypes.open, handleOpen);\n useOn(DrawerEventTypes.toggle, handleToggle);\n\n return (\n <DrawerContext.Provider\n value={{\n register: (view: UniqueId) => views.current.add(view),\n unregister: (view: UniqueId) => views.current.delete(view),\n placement,\n }}\n >\n <ViewStack\n id={id}\n defaultView={defaultView}\n onChange={(view) => {\n setActiveView(view);\n onChange?.(view);\n }}\n >\n <div\n {...rest}\n className={drawer({ className })}\n data-open={!!activeView || null}\n data-placement={placement}\n data-size={size}\n >\n {children}\n </div>\n </ViewStack>\n </DrawerContext.Provider>\n );\n}\nDrawer.displayName = 'Drawer';\n\nDrawer.Layout = DrawerLayout;\nDrawer.Menu = DrawerMenu;\nDrawer.Panel = DrawerPanel;\nDrawer.View = DrawerView;\nDrawer.Header = DrawerHeader;\nDrawer.Content = DrawerContent;\nDrawer.Footer = DrawerFooter;\nDrawer.Trigger = DrawerTrigger;\nDrawer.Close = DrawerClose;\nDrawer.Back = DrawerBack;\n"]}
@@ -4,6 +4,15 @@ import 'react';
4
4
  import 'tailwind-variants';
5
5
  import './styles.js';
6
6
 
7
+ /**
8
+ * Lines - Decorative rule/connector lines used by components like Tree
9
+ *
10
+ * Renders horizontal or vertical rule lines used for visual grouping and
11
+ * tree branch connectors. Visibility and variant control the appearance.
12
+ *
13
+ * @example
14
+ * <Lines variant="branch" />
15
+ */
7
16
  declare function Lines({ className, size, variant, isVisible, }: LinesProps): react_jsx_runtime.JSX.Element;
8
17
 
9
18
  export { Lines };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/lines/index.tsx"],"names":["t","r"],"mappings":"0EAeO,SACL,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,IAAO,CAAA,CAAA,CAAA,QACP,CAAA,OACA,CAAA,CAAA,CAAA,SAAY,CACd,CAAA,CAAe,IACb,CAAA,CAAA,CAAA,OACGA,GAAA,CAAA,KACC,CAAA,CAAA,SAAyB,CAAAC,WAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,OAAS,CAAA,CAAA,CAAA,SAAW,CACxD,CAAA,CAAA,CAAA,CAAA,WAGN,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 { LinesStyles } from './styles';\nimport type { LinesProps } from './types';\n\nexport function Lines({\n className,\n size = 'medium',\n variant,\n isVisible = true,\n}: LinesProps) {\n return (\n <div\n className={LinesStyles({ className, variant, isVisible })}\n data-size={size}\n />\n );\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/lines/index.tsx"],"names":["t","r"],"mappings":"0EAwBO,SACL,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,IAAO,CAAA,CAAA,CAAA,QACP,CAAA,OACA,CAAA,CAAA,CAAA,SAAY,CACd,CAAA,CAAe,IACb,CAAA,CAAA,CAAA,OACGA,GAAA,CAAA,KACC,CAAA,CAAA,SAAyB,CAAAC,WAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,OAAS,CAAA,CAAA,CAAA,SAAW,CACxD,CAAA,CAAA,CAAA,CAAA,WAGN,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 { LinesStyles } from './styles';\nimport type { LinesProps } from './types';\n\n/**\n * Lines - Decorative rule/connector lines used by components like Tree\n *\n * Renders horizontal or vertical rule lines used for visual grouping and\n * tree branch connectors. Visibility and variant control the appearance.\n *\n * @example\n * <Lines variant=\"branch\" />\n */\nexport function Lines({\n className,\n size = 'medium',\n variant,\n isVisible = true,\n}: LinesProps) {\n return (\n <div\n className={LinesStyles({ className, variant, isVisible })}\n data-size={size}\n />\n );\n}\n"]}
@@ -8,6 +8,15 @@ declare function LinkProvider({ children, ...props }: ProviderProps<LinkProps>):
8
8
  declare namespace LinkProvider {
9
9
  var displayName: string;
10
10
  }
11
+ /**
12
+ * Link - Accessible anchor/link component with optional visited state
13
+ *
14
+ * A flexible link component that handles visited state, external anchors, and
15
+ * icon integration while providing ARIA-compatible behavior.
16
+ *
17
+ * @example
18
+ * <Link href="/dashboard">Go to Dashboard</Link>
19
+ */
11
20
  declare function Link({ ref, ...props }: LinkProps): react_jsx_runtime.JSX.Element;
12
21
  declare namespace Link {
13
22
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/link/index.tsx"],"names":["props","t","LinkProvider","ref","useContextProps","e","rest","className","LinkStyles","L","isVisited","Link"],"mappings":"qLAwBA,SAAwB,CAAA,CAAA,CAAA,QAAU,CAAA,CAAGA,CAAM,GACzC,WAAoBC,wBAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAC9C,CACAC,CAAAA,CAAa,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,eAEpB,CAAA,YAAgBC,GAAK,CAAA,CAAGH,CAAM,GACnC,CAACA,EAAOG,CAAG,CAAA,CAAIC,EAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,QAE7C,CAAAE,WAAA,CAAA,CAAA,KACE,CAAA,eACA,CAAA,KAAA,CAAA,SACA,CAAA,CAAA,CAAA,SAAY,CAAA,CACZ,CAAA,KAAGC,CACL,GAAIN,CAEJ,CAAA,CAAA,CAAA,CAAA,OACGC,GACE,MAAGK,CAAAA,GACJ,CAAA,CAAKH,GACL,CAAA,CAAA,CAAA,UAA0CI,kBAAAA,CAAAA,CACxCC,CAAAA,CAAW,EAAEC,UAAA,CAAA,CAAA,SACf,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,cAAgCC,CAAAA,CAAAA,EAAc,CAAA,EAAA,IAIpDC,CAAK,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,MACd,CAAA,CAAA,CAAA,QAAWT,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport {\n Link as AriaLink,\n composeRenderProps,\n LinkContext,\n useContextProps,\n} from 'react-aria-components';\nimport { LinkStyles } from './styles';\nimport type { ProviderProps } from '@/lib/types';\nimport type { LinkProps } from './types';\n\nfunction LinkProvider({ children, ...props }: ProviderProps<LinkProps>) {\n return <LinkContext.Provider value={props}>{children}</LinkContext.Provider>;\n}\nLinkProvider.displayName = 'Link.Provider';\n\nexport function Link({ ref, ...props }: LinkProps) {\n [props, ref] = useContextProps(props, ref ?? null, LinkContext);\n\n const {\n allowsVisited = false,\n className,\n isVisited = false,\n ...rest\n } = props;\n\n return (\n <AriaLink\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n LinkStyles({ className }),\n )}\n data-visited={(allowsVisited && isVisited) || null}\n />\n );\n}\nLink.displayName = 'Link';\nLink.Provider = LinkProvider;\n"]}
1
+ {"version":3,"sources":["../../../src/components/link/index.tsx"],"names":["props","t","LinkProvider","ref","useContextProps","e","rest","className","LinkStyles","L","isVisited","Link"],"mappings":"qLAwBA,SAAwB,CAAA,CAAA,CAAA,QAAU,CAAA,CAAGA,CAAM,GACzC,WAAoBC,wBAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAC9C,CACAC,CAAAA,CAAa,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,eAWpB,CAAA,YAAgBC,GAAK,CAAA,CAAGH,CAAM,GACnC,CAACA,EAAOG,CAAG,CAAA,CAAIC,EAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,QAE7C,CAAAE,WAAA,CAAA,CAAA,KACE,CAAA,eACA,CAAA,KAAA,CAAA,SACA,CAAA,CAAA,CAAA,SAAY,CAAA,CACZ,CAAA,KAAGC,CACL,GAAIN,CAEJ,CAAA,CAAA,CAAA,CAAA,OACGC,GACE,MAAGK,CAAAA,GACJ,CAAA,CAAKH,GACL,CAAA,CAAA,CAAA,UAA0CI,kBAAAA,CAAAA,CACxCC,CAAAA,CAAW,EAAEC,UAAA,CAAA,CAAA,SACf,CAAA,CACA,CAAA,CAAA,CAAA,CAAA,cAAgCC,CAAAA,CAAAA,EAAc,CAAA,EAAA,IAIpDC,CAAK,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,MACd,CAAA,CAAA,CAAA,QAAWT,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport {\n Link as AriaLink,\n composeRenderProps,\n LinkContext,\n useContextProps,\n} from 'react-aria-components';\nimport { LinkStyles } from './styles';\nimport type { ProviderProps } from '@/lib/types';\nimport type { LinkProps } from './types';\n\nfunction LinkProvider({ children, ...props }: ProviderProps<LinkProps>) {\n return <LinkContext.Provider value={props}>{children}</LinkContext.Provider>;\n}\nLinkProvider.displayName = 'Link.Provider';\n\n/**\n * Link - Accessible anchor/link component with optional visited state\n *\n * A flexible link component that handles visited state, external anchors, and\n * icon integration while providing ARIA-compatible behavior.\n *\n * @example\n * <Link href=\"/dashboard\">Go to Dashboard</Link>\n */\nexport function Link({ ref, ...props }: LinkProps) {\n [props, ref] = useContextProps(props, ref ?? null, LinkContext);\n\n const {\n allowsVisited = false,\n className,\n isVisited = false,\n ...rest\n } = props;\n\n return (\n <AriaLink\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n LinkStyles({ className }),\n )}\n data-visited={(allowsVisited && isVisited) || null}\n />\n );\n}\nLink.displayName = 'Link';\nLink.Provider = LinkProvider;\n"]}
@@ -1,2 +1,2 @@
1
- import {tv}from'./../../lib/utils.js';const a=tv({base:["inline-flex cursor-pointer items-center gap-[0.5ch] px-[0.5ch] align-bottom","enabled:fg-accent-primary-bold","enabled:hover:fg-accent-primary-hover enabled:hover:bg-interactive-bold-hover","enabled:focus-visible:fg-accent-primary-hover enabled:focus-visible:bg-interactive-bold-hover","enabled:pressed:fg-accent-primary-pressed enabled:pressed:bg-interactive-bold-pressed","disabled:fg-disabled disabled:cursor-not-allowed"]});export{a as LinkStyles};//# sourceMappingURL=styles.js.map
1
+ import {tv}from'./../../lib/utils.js';const a=tv({base:["inline-flex cursor-pointer items-center gap-[0.5ch] px-[0.5ch] align-bottom","enabled:fg-accent-primary-bold","enabled:hover:fg-accent-primary-hover enabled:hover:bg-accent-primary-muted","enabled:focus-visible:fg-accent-primary-hover enabled:focus-visible:bg-accent-primary-muted","enabled:pressed:fg-accent-primary-pressed enabled:pressed:bg-accent-primary-muted","disabled:fg-disabled disabled:cursor-not-allowed"]});export{a as LinkStyles};//# sourceMappingURL=styles.js.map
2
2
  //# sourceMappingURL=styles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/link/styles.tsx"],"names":["e"],"mappings":"sCAeE,MAAM,CACJ,CAAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,8GAEA,CAAA,+EACA,CAAA,+FACA,CAAA,uFACA,CAAA,kDAEH,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const LinkStyles = tv({\n base: [\n 'inline-flex cursor-pointer items-center gap-[0.5ch] px-[0.5ch] align-bottom',\n 'enabled:fg-accent-primary-bold',\n 'enabled:hover:fg-accent-primary-hover enabled:hover:bg-interactive-bold-hover',\n 'enabled:focus-visible:fg-accent-primary-hover enabled:focus-visible:bg-interactive-bold-hover',\n 'enabled:pressed:fg-accent-primary-pressed enabled:pressed:bg-interactive-bold-pressed',\n 'disabled:fg-disabled disabled:cursor-not-allowed',\n ],\n});\n"]}
1
+ {"version":3,"sources":["../../../src/components/link/styles.tsx"],"names":["e"],"mappings":"sCAeE,MAAM,CACJ,CAAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,8GAEA,CAAA,6EACA,CAAA,6FACA,CAAA,mFACA,CAAA,kDAEH,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const LinkStyles = tv({\n base: [\n 'inline-flex cursor-pointer items-center gap-[0.5ch] px-[0.5ch] align-bottom',\n 'enabled:fg-accent-primary-bold',\n 'enabled:hover:fg-accent-primary-hover enabled:hover:bg-accent-primary-muted',\n 'enabled:focus-visible:fg-accent-primary-hover enabled:focus-visible:bg-accent-primary-muted',\n 'enabled:pressed:fg-accent-primary-pressed enabled:pressed:bg-accent-primary-muted',\n 'disabled:fg-disabled disabled:cursor-not-allowed',\n ],\n});\n"]}
@@ -0,0 +1,10 @@
1
+ declare const NoticeEventNamespace = "Notice";
2
+ declare const NoticeEventTypes: {
3
+ readonly queue: "Notice:queue";
4
+ readonly dequeue: "Notice:dequeue";
5
+ readonly actionPrimary: "Notice:action:primary";
6
+ readonly actionSecondary: "Notice:action:secondary";
7
+ readonly close: "Notice:close";
8
+ };
9
+
10
+ export { NoticeEventNamespace, NoticeEventTypes };
@@ -0,0 +1,2 @@
1
+ const e="Notice",o={queue:`${e}:queue`,dequeue:`${e}:dequeue`,actionPrimary:`${e}:action:primary`,actionSecondary:`${e}:action:secondary`,close:`${e}:close`};export{e as NoticeEventNamespace,o as NoticeEventTypes};//# sourceMappingURL=events.js.map
2
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/notice/events.ts"],"names":["NoticeEventNamespace","NoticeEventTypes"],"mappings":"AAYO,MAAMA,CAAAA,CAAuB,SAEvBC,CAAAA,CAAmB,CAC9B,MAAO,CAAA,EAAGD,CAAoB,CAAA,MAAA,CAAA,CAC9B,OAAA,CAAS,CAAA,EAAGA,CAAoB,WAChC,aAAA,CAAe,CAAA,EAAGA,CAAoB,CAAA,eAAA,CAAA,CACtC,eAAA,CAAiB,CAAA,EAAGA,CAAoB,CAAA,iBAAA,CAAA,CACxC,KAAA,CAAO,CAAA,EAAGA,CAAoB,CAAA,MAAA,CAChC","file":"events.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\nexport const NoticeEventNamespace = 'Notice';\n\nexport const NoticeEventTypes = {\n queue: `${NoticeEventNamespace}:queue`,\n dequeue: `${NoticeEventNamespace}:dequeue`,\n actionPrimary: `${NoticeEventNamespace}:action:primary`,\n actionSecondary: `${NoticeEventNamespace}:action:secondary`,\n close: `${NoticeEventNamespace}:close`,\n} as const;\n"]}
@@ -0,0 +1,20 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { NoticeProps, NoticeListProps } from './types.js';
3
+ import '@accelint/bus';
4
+ import '@accelint/core';
5
+ import 'react-aria-components';
6
+ import '../button/types.js';
7
+ import 'tailwind-variants';
8
+ import '../../lib/types.js';
9
+ import 'react';
10
+ import '../button/styles.js';
11
+ import 'tailwind-merge';
12
+ import './events.js';
13
+
14
+ declare function Notice({ id, classNames, color, message, primary, secondary, hideIcon, showClose, shouldCloseOnAction, size, onPrimaryAction, onSecondaryAction, onClose, }: NoticeProps): react_jsx_runtime.JSX.Element;
15
+ declare namespace Notice {
16
+ var List: typeof NoticeList;
17
+ }
18
+ declare function NoticeList({ id, classNames, defaultColor, defaultTimeout, hideClearAll, limit, global, placement, size, ...rest }: NoticeListProps): react_jsx_runtime.JSX.Element;
19
+
20
+ export { Notice };
@@ -0,0 +1,4 @@
1
+ 'use client';
2
+
3
+ import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useMemo,useState,useRef,useEffect,createElement}from'react';import'client-only';import {useBus}from'@accelint/bus/react';import {uuid}from'@accelint/core';import {Cancel,Information,Success,Warning,Problem}from'@accelint/icons';import {useToastRegion}from'@react-aria/toast';import {useToastQueue}from'@react-stately/toast';import {isEqual}from'lodash';import {UNSTABLE_Toast,UNSTABLE_ToastContent,Text,UNSTABLE_ToastQueue,composeRenderProps,UNSTABLE_ToastList,UNSTABLE_ToastRegion,UNSTABLE_ToastStateContext}from'react-aria-components';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {NoticeEventTypes}from'./events.js';import {NoticeStyles}from'./styles.js';const{notice:no,content:io,list:so,actions:co,region:R,message:ro}=NoticeStyles();function ao({color:n="info",size:t}){return jsxs(Icon,{size:t==="small"?"medium":"large",children:[n==="info"&&jsx(Information,{}),n==="advisory"&&jsx(Information,{}),n==="normal"&&jsx(Success,{}),n==="serious"&&jsx(Warning,{}),n==="critical"&&jsx(Problem,{})]})}const E={normal:"mono-bold",advisory:"mono-bold",info:"mono-bold",serious:"serious",critical:"critical"};function Q({id:n,classNames:t,color:s="info",message:r,primary:m,secondary:a,hideIcon:T,showClose:d,shouldCloseOnAction:p,size:c="medium",onPrimaryAction:i,onSecondaryAction:y,onClose:u}){return jsx(UNSTABLE_Toast,{className:no({className:t?.notice}),toast:{key:n,content:r,onClose:u},"data-color":s,"data-size":c,children:jsxs(UNSTABLE_ToastContent,{className:io({className:t?.content}),children:[!T&&c==="medium"&&jsx(ao,{color:s,size:c}),jsx(Text,{slot:"description",className:ro({className:t?.message}),children:r}),(m||a)&&jsxs("div",{className:co({className:t?.actions}),children:[m&&jsx(Button,{color:E[s],variant:"filled",...m,size:c,onPress:()=>{i?.(),p&&u?.();}}),a&&jsx(Button,{color:E[s],variant:"outline",...a,size:c,onPress:()=>{y?.(),p&&u?.();}})]}),d&&jsx(Button,{color:E[s],variant:"icon",onPress:u,children:jsx(Icon,{children:jsx(Cancel,{})})})]})})}function uo(n,t){return t?Object.entries(n).every(([s,r])=>s in t&&isEqual(t[s],r)):false}function mo({id:n,classNames:t,defaultColor:s,defaultTimeout:r,hideClearAll:m,limit:a=3,global:T,placement:d,size:p="medium",...c}){const i=useMemo(()=>new UNSTABLE_ToastQueue({maxVisibleToasts:a}),[a]),y=useToastQueue(i),[u,h]=useState(false),C=useRef(null),{regionProps:I}=useToastRegion(c,i,C),{useEmit:v,useOn:S}=useBus(),k=v(NoticeEventTypes.actionPrimary),x=v(NoticeEventTypes.actionSecondary),U=v(NoticeEventTypes.close);S(NoticeEventTypes.queue,o=>{(n&&o.payload.target===n||!n)&&i.add({...o.payload,id:o.payload.id||uuid(),color:s||o.payload.color},{timeout:r??o.payload.timeout});}),S(NoticeEventTypes.dequeue,o=>{const L=i.queue,P=L.filter(g=>uo(o.payload,g.content));if(P.length&&P.length===L.length)i.clear();else for(const g of P)i.close(g.key);}),useEffect(()=>{i.subscribe(()=>{h(i.visibleToasts.length>0);});});const B=jsxs(Fragment,{children:[!m&&u&&jsx(Button,{className:composeRenderProps(t?.button,o=>o??""),variant:"outline",onPress:i.clear,children:"Clear All"}),jsx(UNSTABLE_ToastList,{className:composeRenderProps(t?.list,o=>so({className:o})),children:({toast:o})=>createElement(Q,{...o.content,key:o.key,showClose:!(o.timeout&&o.content.primary&&o.content.secondary),classNames:t?.notice,size:p,onPrimaryAction:()=>k({id:o.content.id}),onSecondaryAction:()=>x({id:o.content.id}),onClose:()=>{o.onClose?.(),i.close(o.key),U({id:o.content.id});}})})]});return T?jsx(UNSTABLE_ToastRegion,{className:R({className:t?.region}),"data-placement":d,queue:i,children:B}):jsx("div",{...I,className:R({className:t?.region}),"data-placement":d,ref:C,children:jsx(UNSTABLE_ToastStateContext.Provider,{value:y,children:B})})}Q.List=mo;export{Q as Notice};//# sourceMappingURL=index.js.map
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/notice/index.tsx"],"names":["actions","region","description","NoticeIcon","color","Icon","size","f","q","Information","e","A","Warning","D","Problem","H","id","classNames","primary","onPrimaryAction","onClose","notice","ToastContent","content","jsx","Text","K","secondary","Button","ButtonColorMap","shouldCloseOnAction","N","onSecondaryAction","Cancel","matchesMetadata","payload","metadata","key","value","isEqual","W","defaultColor","F","limit","state","useToastQueue","ref","useRef","V","regionProps","useToastRegion","rest","queue","useOn","O","useBus","emitActionPrimary","useEmit","NoticeEventTypes","emitActionSecondary","l","data","uuid","w","defaultTimeout","queuedNotices","dequeue","toast","setHasNotices","j","hideClearAll","hasNotices","po","className","list","b","createElement","Notice","lo","emitClose","global","placement","eo","children","NoticeList"],"mappings":"ivBA0DE,YACA,CAAA,EAAAA,CAAAA,UACAC,CACA,IAAA,CAAA,EAAA,CAASC,OACM,GAEjB,CAAA,MAAA,CAASC,CAAAA,CAAAA,OAAa,CAAAC,EAAQ,iBAAQ,SACpC,SACGC,CAAAA,CAAA,CAAK,MAAMC,CAAAA,gBAAmBC,IAAA,CAAAC,IAAW,CAAA,CAAA,IAAA,CAAA,CACvC,UAAAJ,CAAAA,QAAU,CAAA,OAAW,CAAY,QACvB,CAAA,CAAA,CAAA,GAAA,MAAeK,EAAAC,GAAA,CAAYC,WAAA,CACrCP,EAAAA,CAAAA,CAAU,cAAa,EAAQM,GAAA,CAC/BN,WAAAA,CAAAA,EAAU,cAAcQ,KAAQ,CAAAC,OAChCT,CAAAA,EAAAA,CAAU,cAAeU,EAAAJ,IAAQK,OAAA,CAAA,EAGxC,CAEA,CAAA,CAAA,GAAA,UACE,qBACA,MAAA,CAAA,CAAA,CAAU,MAAA,CAAA,WACJ,CAAA,QAAA,CAAA,4BAEI,CAAA,OAAA,CAAA,SAGL,CAAA,QACLC,CAAAA,YACAC,UACQ,CAAA,CAAA,EAAA,CAAA,CAAA,CACR,UACA,CAAA,CAAA,CAAA,KAAAC,EACA,CAAA,MAAA,CAAA,iBAEA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,WACAZ,CAAAA,0BACAa,CAAAA,CACA,CAAA,QAAA,CAAA,eACA,CAAA,CAAA,CAAAC,iBAII,CAAA,CAAA,CAAA,OAAWC,CAAAA,CAAO,CAAE,CAAA,CAAA,OAAAX,GAAWO,CAAAA,cAAAA,CAAY,eACpC,SAAW,CAAA,CAAA,EAAA,cAA0B,CAC5C,cAAYb,CACZ,CA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,CACdA,OAAM,EAAA,CAAQ,CAAA,OAAA,CAAA,kBAGM,CAAA,SAClB7D,CAAAA,CACN,UAAA,CAAA,CAAA,EAAA,MAAuBkD,CAAAA,IAAoB,CAAIW,CAAAA,CAAM,eACrD,CAAA,IAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,OACER,GAAsB,CAAA,CAAA,CAAIQ,iBAE5B,CAAA,IAAA,CAAS,IAAM,CACbA,CAAAA,CAAM,OAAA,CAAA,EAAU,CAAA,CAChBf,QAAYe,CAAAA,IAAS,CAAA,CACrBY,CAAAA,OAAsB,YACxB,CAAA,CACF,CAAA,IAGN,CAAA,CAGF,CAAA,CAAA,EAAA,CAAA,CAAA,CAAOC,OACJ,CACC,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW/E,EAAO,CAAE,OAAA,CAAA,CAAAS,GAAWO,qBAAY,CAAA,CAAA,SAC3C,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,CAAgBgE,EAChB,MAAO7B,CAAAA,CAEN,CAAA,wBAIGH,CAAAA,CACJ,UAAWhD,CAAAA,CAAO,CAAE,YAAWgB,GAAY,CAAA,CAAA,SAC3C,CAAA,CAAA,CAAA,CAAA,SAAA,CAAA,CAAgBgE,EAChB,MAEA,yBAA4B,CAAA,CAAA,CAAA,QACzB,CAAAvE,GAAA,CAAAwE,0BAAAC,CAAAA,QAMF,CAAA,CAAA,KAAOC,CAAAA,CAAAA,CAAAA,QAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,CAAAA,EAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport { useBus } from '@accelint/bus/react';\nimport { uuid } from '@accelint/core';\nimport {\n Cancel,\n Information,\n Problem,\n Success,\n Warning,\n} from '@accelint/icons';\nimport { useToastRegion } from '@react-aria/toast';\nimport { useToastQueue } from '@react-stately/toast';\nimport { isEqual } from 'lodash';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport {\n composeRenderProps,\n type QueuedToast,\n Text,\n UNSTABLE_Toast as Toast,\n UNSTABLE_ToastContent as ToastContent,\n UNSTABLE_ToastList as ToastList,\n UNSTABLE_ToastQueue as ToastQueue,\n UNSTABLE_ToastRegion as ToastRegion,\n UNSTABLE_ToastStateContext as ToastStateContext,\n} from 'react-aria-components';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { NoticeEventTypes } from './events';\nimport { NoticeStyles } from './styles';\nimport type { ButtonProps } from '../button/types';\nimport type {\n NoticeActionEvent,\n NoticeColor,\n NoticeContent,\n NoticeDequeueEvent,\n NoticeIconProps,\n NoticeListProps,\n NoticeProps,\n NoticeQueueEvent,\n} from './types';\n\nconst {\n notice,\n content,\n list,\n actions,\n region,\n message: description,\n} = NoticeStyles();\n\nfunction NoticeIcon({ color = 'info', size }: NoticeIconProps) {\n return (\n <Icon size={size === 'small' ? 'medium' : 'large'}>\n {color === 'info' && <Information />}\n {color === 'advisory' && <Information />}\n {color === 'normal' && <Success />}\n {color === 'serious' && <Warning />}\n {color === 'critical' && <Problem />}\n </Icon>\n );\n}\n\nconst ButtonColorMap: Record<NoticeColor, ButtonProps['color']> = {\n normal: 'mono-bold',\n advisory: 'mono-bold',\n info: 'mono-bold',\n serious: 'serious',\n critical: 'critical',\n};\n\nexport function Notice({\n id,\n classNames,\n color = 'info',\n message,\n primary,\n secondary,\n hideIcon,\n showClose,\n shouldCloseOnAction,\n size = 'medium',\n onPrimaryAction,\n onSecondaryAction,\n onClose,\n}: NoticeProps) {\n return (\n <Toast\n className={notice({ className: classNames?.notice })}\n toast={{ key: id, content: message, onClose }}\n data-color={color}\n data-size={size}\n >\n <ToastContent className={content({ className: classNames?.content })}>\n {!hideIcon && size === 'medium' && (\n <NoticeIcon color={color} size={size} />\n )}\n <Text\n slot='description'\n className={description({ className: classNames?.message })}\n >\n {message}\n </Text>\n {(primary || secondary) && (\n <div className={actions({ className: classNames?.actions })}>\n {primary && (\n <Button\n color={ButtonColorMap[color]}\n variant='filled'\n {...primary}\n size={size}\n onPress={() => {\n onPrimaryAction?.();\n\n if (shouldCloseOnAction) {\n onClose?.();\n }\n }}\n />\n )}\n {secondary && (\n <Button\n color={ButtonColorMap[color]}\n variant='outline'\n {...secondary}\n size={size}\n onPress={() => {\n onSecondaryAction?.();\n\n if (shouldCloseOnAction) {\n onClose?.();\n }\n }}\n />\n )}\n </div>\n )}\n {showClose && (\n <Button\n color={ButtonColorMap[color]}\n variant='icon'\n onPress={onClose}\n >\n <Icon>\n <Cancel />\n </Icon>\n </Button>\n )}\n </ToastContent>\n </Toast>\n );\n}\n\nfunction matchesMetadata(\n payload: Record<string, unknown>,\n metadata?: Record<string, unknown>,\n) {\n if (!metadata) {\n return false;\n }\n\n return Object.entries(payload).every(\n ([key, value]) => key in metadata && isEqual(metadata[key], value),\n );\n}\n\nfunction NoticeList({\n id,\n classNames,\n defaultColor,\n defaultTimeout,\n hideClearAll,\n limit = 3,\n global,\n placement,\n size = 'medium',\n ...rest\n}: NoticeListProps) {\n const queue = useMemo(\n () => new ToastQueue<NoticeContent>({ maxVisibleToasts: limit }),\n [limit],\n );\n const state = useToastQueue(queue);\n\n const [hasNotices, setHasNotices] = useState(false);\n const ref = useRef(null);\n const { regionProps } = useToastRegion(rest, queue, ref);\n\n const { useEmit, useOn } = useBus<\n NoticeQueueEvent | NoticeDequeueEvent | NoticeActionEvent\n >();\n const emitActionPrimary = useEmit(NoticeEventTypes.actionPrimary);\n const emitActionSecondary = useEmit(NoticeEventTypes.actionSecondary);\n const emitClose = useEmit(NoticeEventTypes.close);\n\n useOn(NoticeEventTypes.queue, (data) => {\n if ((id && data.payload.target === id) || !id) {\n queue.add(\n {\n ...data.payload,\n id: data.payload.id || uuid(),\n color: defaultColor || data.payload.color,\n },\n {\n timeout: defaultTimeout ?? data.payload.timeout,\n },\n );\n }\n });\n\n useOn(NoticeEventTypes.dequeue, (data) => {\n // @ts-expect-error : queue.queue exists, but is not currently documented\n const queuedNotices = queue.queue;\n\n const dequeue = queuedNotices.filter((toast: QueuedToast<NoticeContent>) =>\n matchesMetadata(data.payload, toast.content),\n );\n\n if (dequeue.length && dequeue.length === queuedNotices.length) {\n queue.clear();\n } else {\n for (const toast of dequeue) {\n queue.close(toast.key);\n }\n }\n });\n\n useEffect(() => {\n queue.subscribe(() => {\n setHasNotices(queue.visibleToasts.length > 0);\n });\n });\n\n const children = (\n <>\n {!hideClearAll && hasNotices && (\n <Button\n className={composeRenderProps(\n classNames?.button,\n (className) => className ?? '',\n )}\n variant='outline'\n onPress={queue.clear}\n >\n Clear All\n </Button>\n )}\n <ToastList\n className={composeRenderProps(classNames?.list, (className) =>\n list({ className }),\n )}\n >\n {({ toast }: { toast: QueuedToast<NoticeContent> }) => (\n <Notice\n {...toast.content}\n key={toast.key}\n showClose={\n !(\n toast.timeout &&\n toast.content.primary &&\n toast.content.secondary\n )\n }\n classNames={classNames?.notice}\n size={size}\n onPrimaryAction={() => emitActionPrimary({ id: toast.content.id })}\n onSecondaryAction={() =>\n emitActionSecondary({ id: toast.content.id })\n }\n onClose={() => {\n toast.onClose?.();\n queue.close(toast.key);\n emitClose({ id: toast.content.id });\n }}\n />\n )}\n </ToastList>\n </>\n );\n\n return global ? (\n <ToastRegion\n className={region({ className: classNames?.region })}\n data-placement={placement}\n queue={queue}\n >\n {children}\n </ToastRegion>\n ) : (\n <div\n {...regionProps}\n className={region({ className: classNames?.region })}\n data-placement={placement}\n ref={ref}\n >\n <ToastStateContext.Provider value={state}>\n {children}\n </ToastStateContext.Provider>\n </div>\n );\n}\n\nNotice.List = NoticeList;\n"]}
@@ -0,0 +1,60 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import * as tailwind_merge from 'tailwind-merge';
3
+
4
+ declare const NoticeStyles: tailwind_variants.TVReturnType<{
5
+ [key: string]: {
6
+ [key: string]: tailwind_merge.ClassNameValue | {
7
+ content?: tailwind_merge.ClassNameValue;
8
+ list?: tailwind_merge.ClassNameValue;
9
+ region?: tailwind_merge.ClassNameValue;
10
+ message?: tailwind_merge.ClassNameValue;
11
+ actions?: tailwind_merge.ClassNameValue;
12
+ notice?: tailwind_merge.ClassNameValue;
13
+ };
14
+ };
15
+ } | {
16
+ [x: string]: {
17
+ [x: string]: tailwind_merge.ClassNameValue | {
18
+ content?: tailwind_merge.ClassNameValue;
19
+ list?: tailwind_merge.ClassNameValue;
20
+ region?: tailwind_merge.ClassNameValue;
21
+ message?: tailwind_merge.ClassNameValue;
22
+ actions?: tailwind_merge.ClassNameValue;
23
+ notice?: tailwind_merge.ClassNameValue;
24
+ };
25
+ };
26
+ } | {}, {
27
+ notice: string[];
28
+ content: string[];
29
+ message: string;
30
+ region: string[];
31
+ list: string[];
32
+ actions: string;
33
+ }, undefined, {
34
+ [key: string]: {
35
+ [key: string]: tailwind_merge.ClassNameValue | {
36
+ content?: tailwind_merge.ClassNameValue;
37
+ list?: tailwind_merge.ClassNameValue;
38
+ region?: tailwind_merge.ClassNameValue;
39
+ message?: tailwind_merge.ClassNameValue;
40
+ actions?: tailwind_merge.ClassNameValue;
41
+ notice?: tailwind_merge.ClassNameValue;
42
+ };
43
+ };
44
+ } | {}, {
45
+ notice: string[];
46
+ content: string[];
47
+ message: string;
48
+ region: string[];
49
+ list: string[];
50
+ actions: string;
51
+ }, tailwind_variants.TVReturnType<unknown, {
52
+ notice: string[];
53
+ content: string[];
54
+ message: string;
55
+ region: string[];
56
+ list: string[];
57
+ actions: string;
58
+ }, undefined, unknown, unknown>>;
59
+
60
+ export { NoticeStyles };
@@ -0,0 +1,2 @@
1
+ import {tv}from'./../../lib/utils.js';const l=tv({slots:{notice:["group/notice fg-primary-bold flex rounded-medium text-body-s shadow-elevation-overlay outline","size-small:flex-col size-small:flex-wrap size-small:gap-m size-small:p-s group-data-placement/region:size-small:min-w-[120px] group-data-placement/region:size-small:max-w-[320px]","size-medium:gap-l size-medium:p-l group-data-placement/region:size-medium:min-w-[200px] group-data-placement/region:size-medium:max-w-[640px]","color-info:bg-info-muted color-info:outline-info-bold","color-advisory:bg-advisory-muted color-advisory:outline-accent-primary-bold","color-normal:bg-normal-muted color-normal:outline-normal-bold","color-serious:bg-serious-muted color-serious:outline-serious-bold","color-critical:bg-critical-muted color-critical:outline-critical-bold"],content:["flex flex-1 items-center group-size-medium/notice:gap-l group-size-small/notice:gap-m"],message:"flex-1 group-size-small/notice:basis-10/12",region:["group/region flex flex-col gap-y-s","data-placement:absolute","data-[placement=top]:-translate-x-1/2 placement-top:top-0 data-[placement=top]:left-1/2","data-[placement=bottom]:-translate-x-1/2 placement-bottom:bottom-0 data-[placement=bottom]:left-1/2","placement-right:right-0 data-[placement=right]:top-1/2","placement-left:left-0 data-[placement=left]:top-1/2"],list:["flex flex-col gap-y-s"],actions:"flex flex-row-reverse items-center gap-s group-size-small/notice:grow-1 group-size-small/notice:basis-1 group-size-small/notice:justify-start"}});export{l as NoticeStyles};//# sourceMappingURL=styles.js.map
2
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/components/notice/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,SACE,CAAA,CAAA,MAAA,CAAA,CAAA,oRAEA,CAAA,+IACA,CAAA,qIAEA,CAAA,+DACA,CAAA,2IAGO,CACP,CAAA,OAAA,CAAA,CAAA,uFAEO,CAAA,CAAA,OAAA,CAAA,4CAEP,CAAA,MAAA,CAAA,CAAA,8DAEA,CAAA,yFACA,CAAA,8JAEA,CAAA,qDAEK,CAAA,CAAA,IAAA,CAAA,CAAA,uBAEL,CAAA,CAAA,OAAA,CAAA,+IAEL,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const NoticeStyles = tv({\n slots: {\n notice: [\n 'group/notice fg-primary-bold flex rounded-medium text-body-s shadow-elevation-overlay outline',\n 'size-small:flex-col size-small:flex-wrap size-small:gap-m size-small:p-s group-data-placement/region:size-small:min-w-[120px] group-data-placement/region:size-small:max-w-[320px]',\n 'size-medium:gap-l size-medium:p-l group-data-placement/region:size-medium:min-w-[200px] group-data-placement/region:size-medium:max-w-[640px]',\n 'color-info:bg-info-muted color-info:outline-info-bold',\n 'color-advisory:bg-advisory-muted color-advisory:outline-accent-primary-bold',\n 'color-normal:bg-normal-muted color-normal:outline-normal-bold',\n 'color-serious:bg-serious-muted color-serious:outline-serious-bold',\n 'color-critical:bg-critical-muted color-critical:outline-critical-bold',\n ],\n content: [\n 'flex flex-1 items-center group-size-medium/notice:gap-l group-size-small/notice:gap-m',\n ],\n message: 'flex-1 group-size-small/notice:basis-10/12',\n region: [\n 'group/region flex flex-col gap-y-s',\n 'data-placement:absolute',\n 'data-[placement=top]:-translate-x-1/2 placement-top:top-0 data-[placement=top]:left-1/2',\n 'data-[placement=bottom]:-translate-x-1/2 placement-bottom:bottom-0 data-[placement=bottom]:left-1/2',\n 'placement-right:right-0 data-[placement=right]:top-1/2',\n 'placement-left:left-0 data-[placement=left]:top-1/2',\n ],\n list: ['flex flex-col gap-y-s'],\n actions:\n 'flex flex-row-reverse items-center gap-s group-size-small/notice:grow-1 group-size-small/notice:basis-1 group-size-small/notice:justify-start',\n },\n});\n"]}
@@ -0,0 +1,75 @@
1
+ import { Payload } from '@accelint/bus';
2
+ import { UniqueId } from '@accelint/core';
3
+ import { ToastListProps } from 'react-aria-components';
4
+ import { ButtonProps } from '../button/types.js';
5
+ import { NoticeEventTypes } from './events.js';
6
+ import 'tailwind-variants';
7
+ import '../../lib/types.js';
8
+ import 'react';
9
+ import '../button/styles.js';
10
+ import 'tailwind-merge';
11
+
12
+ type NoticeColor = 'info' | 'advisory' | 'normal' | 'serious' | 'critical';
13
+ type ActionButtonProps = Pick<ButtonProps, 'color' | 'variant'> & {
14
+ children: string;
15
+ };
16
+ type NoticeContent = {
17
+ id: UniqueId;
18
+ message: string;
19
+ color?: NoticeColor;
20
+ primary?: ActionButtonProps;
21
+ secondary?: ActionButtonProps;
22
+ timeout?: number;
23
+ target?: UniqueId;
24
+ metadata?: Record<string, unknown>;
25
+ };
26
+ type NoticeIconProps = {
27
+ color?: NoticeColor;
28
+ size: 'small' | 'medium';
29
+ };
30
+ type NoticeListProps = {
31
+ id?: UniqueId;
32
+ placement?: 'top left' | 'top' | 'top right' | 'right' | 'bottom right' | 'bottom' | 'bottom left' | 'left';
33
+ limit?: number;
34
+ defaultColor?: NoticeColor;
35
+ defaultTimeout?: number;
36
+ hideClearAll?: boolean;
37
+ size?: 'small' | 'medium';
38
+ global?: boolean;
39
+ classNames?: {
40
+ region?: string;
41
+ list?: ToastListProps<NoticeContent>['className'];
42
+ button?: ButtonProps['className'];
43
+ notice?: NoticeProps['classNames'];
44
+ };
45
+ };
46
+ type NoticeProps = Omit<NoticeContent, 'metadata' | 'timeout' | 'target'> & {
47
+ id: UniqueId;
48
+ classNames?: {
49
+ notice?: string;
50
+ content?: string;
51
+ message?: string;
52
+ actions?: string;
53
+ };
54
+ hideIcon?: boolean;
55
+ showClose?: boolean;
56
+ shouldCloseOnAction?: boolean;
57
+ size?: 'small' | 'medium';
58
+ onPrimaryAction?: () => void;
59
+ onSecondaryAction?: () => void;
60
+ onClose?: () => void;
61
+ };
62
+ type NoticeQueueEvent = Payload<typeof NoticeEventTypes.queue, Omit<NoticeContent, 'id'> & {
63
+ id?: UniqueId;
64
+ }>;
65
+ type NoticeDequeueEvent = Payload<typeof NoticeEventTypes.dequeue, {
66
+ id?: UniqueId;
67
+ target?: UniqueId;
68
+ color?: NoticeColor;
69
+ metadata?: Record<string, unknown>;
70
+ }>;
71
+ type NoticeActionEvent = Payload<typeof NoticeEventTypes.actionPrimary | typeof NoticeEventTypes.actionSecondary | typeof NoticeEventTypes.close, {
72
+ id: UniqueId;
73
+ }>;
74
+
75
+ export type { NoticeActionEvent, NoticeColor, NoticeContent, NoticeDequeueEvent, NoticeIconProps, NoticeListProps, NoticeProps, NoticeQueueEvent };
@@ -0,0 +1,2 @@
1
+ //# sourceMappingURL=types.js.map
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -1,2 +1,2 @@
1
- import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {LockFill,Delete,Duplicate}from'@accelint/icons';import {useMemo,createContext,useCallback}from'react';import {QueryBuilder}from'react-querybuilder';import {cn}from'../../lib/utils.js';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {Radio}from'../radio/index.js';import {Tooltip}from'../tooltip/index.js';import {ActionElement}from'./action-element.js';import {RuleGroup,RuleGroupHeaderComponent,RuleGroupFooterComponent}from'./group.js';import {Rule}from'./rule.js';import {getValidationResult,pressToMouseEvent}from'./utils.js';import {ValueEditor}from'./value-editor.js';import {ValueSelector}from'./value-selector.js';const w={AND:"All rules below must be true for a match",OR:"One of the rules below must be true for a match"};function x({options:r,value:n,handleOnChange:l}){return jsxs(Radio.Group,{value:n,onChange:l,orientation:"horizontal",children:[jsx(Label,{children:"Combinator"}),r.map(e=>jsx(Radio,{value:e.label,children:jsxs(Tooltip,{children:[jsx(Tooltip.Trigger,{children:jsx("span",{children:e.label})}),jsx(Tooltip.Body,{placement:"top",children:w[e.label]})]})},e.label))]})}function C({handleOnClick:r,className:n,...l}){const e=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:e,className:n,...l,children:jsx(Icon,{children:jsx(Delete,{})})})}function f({handleOnClick:r,className:n,...l}){const e=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:e,className:n,...l,children:jsx(Icon,{children:jsx(LockFill,{})})})}function d({handleOnClick:r,className:n,...l}){const e=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:e,className:n,...l,children:jsx(Icon,{children:jsx(Duplicate,{})})})}function t({controlClassnames:r,controlElements:n,orientation:l="horizontal",showRuleLines:e=true,...i}){const G=useMemo(()=>({combinatorSelector:x,cloneGroupAction:d,cloneRuleAction:d,removeRuleAction:C,lockGroupAction:f,lockRuleAction:f,ruleGroup:RuleGroup,rule:Rule,actionElement:ActionElement,valueSelector:ValueSelector,valueEditor:ValueEditor,...n}),[n]),g=useMemo(()=>({queryBuilder:"outline outline-transparent",ruleGroup:"group col-span-full flex flex-col gap-s p-s outline outline-info-bold rounded-medium",header:"flex gap-s",body:cn("group grid gap-x-s empty:hidden",e?"grid-cols-[10px_minmax(100px,_1fr)_min-content]":"grid-cols-[minmax(100px,_1fr)_min-content]"),combinators:"my-s",addRule:"",addGroup:"",cloneRule:"fg-info-bold hover:fg-info-hover",cloneGroup:"fg-info-bold hover:fg-info-hover",removeGroup:"",rule:cn("flex gap-xs py-s",l==="vertical"?"flex-col":"min-height-[50px] items-start"),fields:"w-full",operators:"",value:"w-full",removeRule:"",valid:"",invalid:"",disabled:"",lockRule:"fg-info-bold hover:fg-info-hover",lockGroup:"fg-info-bold hover:fg-info-hover",valueSource:"",valueListItem:""}),[l,e]),E=useMemo(()=>({...g,...r}),[r,g]),S=createContext({orientation:l,showRuleLines:e});return jsx(QueryBuilder,{showNotToggle:false,showShiftActions:false,enableDragAndDrop:false,controlClassnames:E,controlElements:G,context:S,listsAsArrays:true,...i})}t.CombinatorSelector=x,t.RemoveRuleAction=C,t.LockAction=f,t.CloneAction=d,t.ActionElement=ActionElement,t.Rule=Rule,t.RuleGroup=RuleGroup,t.RuleGroupHeaderComponent=RuleGroupHeaderComponent,t.RuleGroupFooterComponent=RuleGroupFooterComponent,t.getValidationResult=getValidationResult,t.ValueEditor=ValueEditor,t.ValueSelector=ValueSelector;export{t as QueryBuilder};//# sourceMappingURL=index.js.map
1
+ import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {LockFill,Delete,Duplicate}from'@accelint/icons';import {useMemo,createContext,useCallback}from'react';import {QueryBuilder}from'react-querybuilder';import {cn}from'../../lib/utils.js';import {Button}from'../button/index.js';import {Icon}from'../icon/index.js';import {Label}from'../label/index.js';import {Radio}from'../radio/index.js';import {Tooltip}from'../tooltip/index.js';import {ActionElement}from'./action-element.js';import {RuleGroup,RuleGroupHeaderComponent,RuleGroupFooterComponent}from'./group.js';import {Rule}from'./rule.js';import {getValidationResult,pressToMouseEvent}from'./utils.js';import {ValueEditor}from'./value-editor.js';import {ValueSelector}from'./value-selector.js';const w={AND:"All rules below must be true for a match",OR:"One of the rules below must be true for a match"};function x({options:r,value:n,handleOnChange:l}){return jsxs(Radio.Group,{value:n,onChange:l,orientation:"horizontal",children:[jsx(Label,{children:"Combinator"}),r.map(o=>jsx(Radio,{value:o.label,children:jsxs(Tooltip.Trigger,{children:[jsx("button",{type:"button",children:o.label}),jsx(Tooltip,{placement:"top",children:w[o.label]})]})},o.label))]})}function C({handleOnClick:r,className:n,...l}){const o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(Delete,{})})})}function c({handleOnClick:r,className:n,...l}){const o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(LockFill,{})})})}function f({handleOnClick:r,className:n,...l}){const o=useCallback(i=>r(pressToMouseEvent(i)),[r]);return jsx(Button,{size:"small",variant:"icon",onPress:o,className:n,...l,children:jsx(Icon,{children:jsx(Duplicate,{})})})}function t({controlClassnames:r,controlElements:n,orientation:l="horizontal",showRuleLines:o=true,...i}){const B=useMemo(()=>({combinatorSelector:x,cloneGroupAction:f,cloneRuleAction:f,removeRuleAction:C,lockGroupAction:c,lockRuleAction:c,ruleGroup:RuleGroup,rule:Rule,actionElement:ActionElement,valueSelector:ValueSelector,valueEditor:ValueEditor,...n}),[n]),d=useMemo(()=>({queryBuilder:"outline outline-transparent",ruleGroup:"group col-span-full flex flex-col gap-s p-s outline outline-info-bold rounded-medium",header:"flex gap-s",body:cn("group grid gap-x-s empty:hidden",o?"grid-cols-[10px_minmax(100px,_1fr)_min-content]":"grid-cols-[minmax(100px,_1fr)_min-content]"),combinators:"my-s",addRule:"",addGroup:"",cloneRule:"fg-info-bold hover:fg-info-hover",cloneGroup:"fg-info-bold hover:fg-info-hover",removeGroup:"",rule:cn("flex gap-xs py-s",l==="vertical"?"flex-col":"min-height-[50px] items-start"),fields:"w-full",operators:"",value:"w-full",removeRule:"",valid:"",invalid:"",disabled:"",lockRule:"fg-info-bold hover:fg-info-hover",lockGroup:"fg-info-bold hover:fg-info-hover",valueSource:"",valueListItem:""}),[l,o]),E=useMemo(()=>({...d,...r}),[r,d]),S=createContext({orientation:l,showRuleLines:o});return jsx(QueryBuilder,{showNotToggle:false,showShiftActions:false,enableDragAndDrop:false,controlClassnames:E,controlElements:B,context:S,listsAsArrays:true,...i})}t.CombinatorSelector=x,t.RemoveRuleAction=C,t.LockAction=c,t.CloneAction=f,t.ActionElement=ActionElement,t.Rule=Rule,t.RuleGroup=RuleGroup,t.RuleGroupHeaderComponent=RuleGroupHeaderComponent,t.RuleGroupFooterComponent=RuleGroupFooterComponent,t.getValidationResult=getValidationResult,t.ValueEditor=ValueEditor,t.ValueSelector=ValueSelector;export{t as QueryBuilder};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/query-builder/index.tsx"],"names":["jsx","Label","B","b","options","Radio","jsxs","Tooltip","o","z","p","operatorDescriptions","option","RemoveRuleAction","className","event","handleOnClick","pressToMouseEvent","handlePress","rest","c","Icon","a","LockAction","useCallback","T","CloneAction","k","QueryBuilder","m","Q","mergedElements","CombinatorSelector","u","defaultClassnames","R","A","y","P","h","v","orientation","mergedClassnames","useMemo","RQBBuilder","D","V","Rule","RuleGroupFooterComponent","getValidationResult","N","ValueSelector"],"mappings":"4vBA2CM,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,0CAKJ,CAAA,EAAA,CAAA,iDAMI,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,OAAA,CAAY,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,cAEZA,CAACC,CAAAA,CAAA,CAAM,CAAA,OAAAC,IAAA,CAAAC,KAAA,CAAA,KAAA,CAAA,CAAA,KACNC,CAAAA,CAAQ,CAAA,QACNC,CAAAA,CAAA,CAAyB,WAAc,CAAA,YACtCC,CAACC,QACC,CAAA,CAAAC,GAAA,CAAAC,KAAAT,CAAAA,CAACO,QAAQ,CAAA,YACPP,CAAC,CAAA,CAAA,CAAA,CAAA,GAAA,CAAM,CAAA,EAAAQ,GAAA,CAAAL,KAAA,CAAA,CAAA,KAAO,CAAA,CAAA,CAAA,KAEhBH,CAAAA,QAAC,CAAaE,IAAA,CAAAQ,OAAA,CAAA,CAAA,QAAU,CAAA,CAAAF,GACrB,CAAAE,OAAA,CAAA,OAAAC,CAAqBC,CAAAA,QACxB,CAAAJ,GAAA,CACF,MARiB,CAAA,CAAA,QAe3B,CAAA,CAAA,CAAA,K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AA,CAAA,WACA,CAAA,CAAA,CAAA,CAAA,CAAA,aAAA,CAAAS,aAAA,CAAA,CAA2BW,CAAAA,IAC3B,CAAAZ,IAAA,CAAA,CAAA,CAAA,SAAA,CAAAD,SAAA,CAAA,CAAA,CAAsBc,wBAEtB,CAAAC,wBAAA,CAAA,CAAA,CAAA,wBAAgBC,CAAAA,wBAAAA,CAAAA,CAAAA,CAAAA,mBAAAA,CAAAA,mBAAAA,CAAAA,CAAAA,CAAAA,WAAAA,CAAAA,WAAAA,CAAAA,CAAAA,CAAAA,aAAAA,CAAAA,aAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { Delete, Duplicate, LockFill } from '@accelint/icons';\nimport { createContext, useCallback, useMemo } from 'react';\nimport {\n type ActionProps,\n type Classnames,\n type CombinatorSelectorProps,\n QueryBuilder as RQBBuilder,\n} from 'react-querybuilder';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Radio } from '../radio';\nimport { Tooltip } from '../tooltip';\nimport { ActionElement } from './action-element';\nimport {\n RuleGroup,\n RuleGroupFooterComponent,\n RuleGroupHeaderComponent,\n} from './group';\nimport { Rule } from './rule';\nimport { getValidationResult, pressToMouseEvent } from './utils';\nimport { ValueEditor } from './value-editor';\nimport { ValueSelector } from './value-selector';\nimport type { PressEvent } from '@react-types/shared';\nimport type { QueryBuilderContextType, QueryBuilderProps } from './types';\n\nconst operatorDescriptions: Record<string, string> = {\n AND: 'All rules below must be true for a match',\n OR: 'One of the rules below must be true for a match',\n};\n\nfunction CombinatorSelector({\n options,\n value,\n handleOnChange,\n}: CombinatorSelectorProps) {\n return (\n <Radio.Group\n value={value}\n onChange={handleOnChange}\n orientation='horizontal'\n >\n <Label>Combinator</Label>\n {options.map((option) => (\n <Radio key={option.label} value={option.label}>\n <Tooltip>\n <Tooltip.Trigger>\n <span>{option.label}</span>\n </Tooltip.Trigger>\n <Tooltip.Body placement='top'>\n {operatorDescriptions[option.label]}\n </Tooltip.Body>\n </Tooltip>\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nfunction RemoveRuleAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Delete />\n </Icon>\n </Button>\n );\n}\n\nfunction LockAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <LockFill />\n </Icon>\n </Button>\n );\n}\n\nfunction CloneAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Duplicate />\n </Icon>\n </Button>\n );\n}\n\n/**\n * QueryBuilder - A visual interface for building complex database queries\n *\n * Provides an intuitive drag-and-drop interface for constructing database queries\n * with support for multiple conditions, operators, and logical grouping. Enables\n * users to build complex filters without writing SQL or code.\n *\n * @example\n * // Basic query builder\n * <QueryBuilder\n * fields={[\n * // { name, label, type, inputType, operators },\n * ]}\n * query={\n * // { combinator, rules }\n * }\n * onQueryChange={handleQueryChange}\n * controlElements={{\n * addRuleAction: CustomAddButton,\n * removeRuleAction: CustomRemoveButton\n * }}\n * orientation=\"vertical\"\n * />\n */\nexport function QueryBuilder({\n controlClassnames,\n controlElements,\n orientation = 'horizontal',\n showRuleLines = true,\n ...rest\n}: QueryBuilderProps) {\n /**\n * Represents the list of available controls that the component can use as a custom\n * component override.Passed in as a map of our custom defaults, but can be\n * overridden by using the controlElements prop\n */\n const mergedElements = useMemo(\n () => ({\n combinatorSelector: CombinatorSelector,\n cloneGroupAction: CloneAction,\n cloneRuleAction: CloneAction,\n removeRuleAction: RemoveRuleAction,\n lockGroupAction: LockAction,\n lockRuleAction: LockAction,\n ruleGroup: RuleGroup,\n rule: Rule,\n actionElement: ActionElement,\n valueSelector: ValueSelector,\n valueEditor: ValueEditor,\n ...controlElements,\n }),\n [controlElements],\n );\n\n /**\n * Represents the list of available classnames that the component will recognize.\n * Passed in as a map as all the default styling, but can be overridden by using the\n * controlClassnames prop\n */\n const defaultClassnames: Partial<Classnames> = useMemo(\n () => ({\n queryBuilder: 'outline outline-transparent',\n ruleGroup:\n 'group col-span-full flex flex-col gap-s p-s outline outline-info-bold rounded-medium',\n header: 'flex gap-s',\n body: cn(\n 'group grid gap-x-s empty:hidden',\n showRuleLines\n ? 'grid-cols-[10px_minmax(100px,_1fr)_min-content]'\n : 'grid-cols-[minmax(100px,_1fr)_min-content]',\n ),\n combinators: 'my-s',\n addRule: '',\n addGroup: '',\n cloneRule: 'fg-info-bold hover:fg-info-hover',\n cloneGroup: 'fg-info-bold hover:fg-info-hover',\n removeGroup: '',\n rule: cn(\n 'flex gap-xs py-s',\n orientation === 'vertical'\n ? 'flex-col'\n : 'min-height-[50px] items-start',\n ),\n fields: 'w-full',\n operators: '',\n value: 'w-full',\n removeRule: '',\n valid: '',\n invalid: '',\n disabled: '',\n lockRule: 'fg-info-bold hover:fg-info-hover',\n lockGroup: 'fg-info-bold hover:fg-info-hover',\n valueSource: '',\n valueListItem: '',\n }),\n [orientation, showRuleLines],\n );\n\n const mergedClassnames = useMemo(() => {\n return {\n ...defaultClassnames,\n ...controlClassnames,\n };\n }, [controlClassnames, defaultClassnames]);\n\n const QueryBuilderContext = createContext<QueryBuilderContextType>({\n orientation,\n showRuleLines,\n });\n\n return (\n <RQBBuilder\n showNotToggle={false}\n showShiftActions={false}\n enableDragAndDrop={false}\n controlClassnames={mergedClassnames}\n controlElements={mergedElements}\n context={QueryBuilderContext}\n listsAsArrays\n {...rest}\n />\n );\n}\n\nQueryBuilder.CombinatorSelector = CombinatorSelector;\nQueryBuilder.RemoveRuleAction = RemoveRuleAction;\nQueryBuilder.LockAction = LockAction;\nQueryBuilder.CloneAction = CloneAction;\nQueryBuilder.ActionElement = ActionElement;\nQueryBuilder.Rule = Rule;\nQueryBuilder.RuleGroup = RuleGroup;\nQueryBuilder.RuleGroupHeaderComponent = RuleGroupHeaderComponent;\nQueryBuilder.RuleGroupFooterComponent = RuleGroupFooterComponent;\nQueryBuilder.getValidationResult = getValidationResult;\nQueryBuilder.ValueEditor = ValueEditor;\nQueryBuilder.ValueSelector = ValueSelector;\n"]}
1
+ {"version":3,"sources":["../../../src/components/query-builder/index.tsx"],"names":["jsx","Label","G","v","options","Radio","jsxs","Tooltip","e","z","b","operatorDescriptions","option","RemoveRuleAction","className","event","handleOnClick","pressToMouseEvent","handlePress","rest","p","Icon","a","LockAction","useCallback","T","CloneAction","k","QueryBuilder","Q","mergedElements","CombinatorSelector","s","defaultClassnames","y","A","R","P","h","g","orientation","mergedClassnames","useMemo","RQBBuilder","D","V","Rule","RuleGroupFooterComponent","getValidationResult","N","ValueSelector"],"mappings":"4vBA2CM,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,0CAKJ,CAAA,EAAA,CAAA,iDAMI,CAAA,CAAA,SACA,C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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAY,aAAA,CAAA,CAAkB,WAClB,CAAA,CAAA,CAAA,aACA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAApC,GAAA,CAAAqC,YAAmBJ,CAAAA,CACnB,aAAA,CAAA,KAAiBX,CAAAA,gBAEjB,CAAA,KAAA,CAAA,iBAMO,CAAA,KAAA,CAAA,iBACbF,CAAAA,CAAa,CAAA,eAAA,CAAmBf,CAAAA,CAChCe,OAAa,CAAA,CAAA,CAAA,aACA,CAAA,IAAA,CAAA,GAAcF,CAC3BE,CAAAA,CAAa,CAAA,CAAA,CAAA,kBACA,CAAA,CAAOkB,CAAAA,CACpBlB,CAAAA,gBACa,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,CAAA,CAAA,aAAA,CAAAQ,aAAA,CAAA,CAA2BW,CAAAA,IAC3B,CAAAZ,IAAA,CAAA,CAAA,CAAA,SAAA,CAAAD,SAAA,CAAA,CAAA,CAAsBc,wBAEtB,CAAAC,wBAAA,CAAA,CAAA,CAAA,wBAAgBC,CAAAA,wBAAAA,CAAAA,CAAAA,CAAAA,mBAAAA,CAAAA,mBAAAA,CAAAA,CAAAA,CAAAA,WAAAA,CAAAA,WAAAA,CAAAA,CAAAA,CAAAA,aAAAA,CAAAA,aAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { Delete, Duplicate, LockFill } from '@accelint/icons';\nimport { createContext, useCallback, useMemo } from 'react';\nimport {\n type ActionProps,\n type Classnames,\n type CombinatorSelectorProps,\n QueryBuilder as RQBBuilder,\n} from 'react-querybuilder';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Radio } from '../radio';\nimport { Tooltip } from '../tooltip';\nimport { ActionElement } from './action-element';\nimport {\n RuleGroup,\n RuleGroupFooterComponent,\n RuleGroupHeaderComponent,\n} from './group';\nimport { Rule } from './rule';\nimport { getValidationResult, pressToMouseEvent } from './utils';\nimport { ValueEditor } from './value-editor';\nimport { ValueSelector } from './value-selector';\nimport type { PressEvent } from '@react-types/shared';\nimport type { QueryBuilderContextType, QueryBuilderProps } from './types';\n\nconst operatorDescriptions: Record<string, string> = {\n AND: 'All rules below must be true for a match',\n OR: 'One of the rules below must be true for a match',\n};\n\nfunction CombinatorSelector({\n options,\n value,\n handleOnChange,\n}: CombinatorSelectorProps) {\n return (\n <Radio.Group\n value={value}\n onChange={handleOnChange}\n orientation='horizontal'\n >\n <Label>Combinator</Label>\n {options.map((option) => (\n <Radio key={option.label} value={option.label}>\n <Tooltip.Trigger>\n <button type='button'>{option.label}</button>\n <Tooltip placement='top'>\n {operatorDescriptions[option.label]}\n </Tooltip>\n </Tooltip.Trigger>\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nfunction RemoveRuleAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Delete />\n </Icon>\n </Button>\n );\n}\n\nfunction LockAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <LockFill />\n </Icon>\n </Button>\n );\n}\n\nfunction CloneAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Duplicate />\n </Icon>\n </Button>\n );\n}\n\n/**\n * QueryBuilder - A visual interface for building complex database queries\n *\n * Provides an intuitive drag-and-drop interface for constructing database queries\n * with support for multiple conditions, operators, and logical grouping. Enables\n * users to build complex filters without writing SQL or code.\n *\n * @example\n * // Basic query builder\n * <QueryBuilder\n * fields={[\n * // { name, label, type, inputType, operators },\n * ]}\n * query={\n * // { combinator, rules }\n * }\n * onQueryChange={handleQueryChange}\n * controlElements={{\n * addRuleAction: CustomAddButton,\n * removeRuleAction: CustomRemoveButton\n * }}\n * orientation=\"vertical\"\n * />\n */\nexport function QueryBuilder({\n controlClassnames,\n controlElements,\n orientation = 'horizontal',\n showRuleLines = true,\n ...rest\n}: QueryBuilderProps) {\n /**\n * Represents the list of available controls that the component can use as a custom\n * component override.Passed in as a map of our custom defaults, but can be\n * overridden by using the controlElements prop\n */\n const mergedElements = useMemo(\n () => ({\n combinatorSelector: CombinatorSelector,\n cloneGroupAction: CloneAction,\n cloneRuleAction: CloneAction,\n removeRuleAction: RemoveRuleAction,\n lockGroupAction: LockAction,\n lockRuleAction: LockAction,\n ruleGroup: RuleGroup,\n rule: Rule,\n actionElement: ActionElement,\n valueSelector: ValueSelector,\n valueEditor: ValueEditor,\n ...controlElements,\n }),\n [controlElements],\n );\n\n /**\n * Represents the list of available classnames that the component will recognize.\n * Passed in as a map as all the default styling, but can be overridden by using the\n * controlClassnames prop\n */\n const defaultClassnames: Partial<Classnames> = useMemo(\n () => ({\n queryBuilder: 'outline outline-transparent',\n ruleGroup:\n 'group col-span-full flex flex-col gap-s p-s outline outline-info-bold rounded-medium',\n header: 'flex gap-s',\n body: cn(\n 'group grid gap-x-s empty:hidden',\n showRuleLines\n ? 'grid-cols-[10px_minmax(100px,_1fr)_min-content]'\n : 'grid-cols-[minmax(100px,_1fr)_min-content]',\n ),\n combinators: 'my-s',\n addRule: '',\n addGroup: '',\n cloneRule: 'fg-info-bold hover:fg-info-hover',\n cloneGroup: 'fg-info-bold hover:fg-info-hover',\n removeGroup: '',\n rule: cn(\n 'flex gap-xs py-s',\n orientation === 'vertical'\n ? 'flex-col'\n : 'min-height-[50px] items-start',\n ),\n fields: 'w-full',\n operators: '',\n value: 'w-full',\n removeRule: '',\n valid: '',\n invalid: '',\n disabled: '',\n lockRule: 'fg-info-bold hover:fg-info-hover',\n lockGroup: 'fg-info-bold hover:fg-info-hover',\n valueSource: '',\n valueListItem: '',\n }),\n [orientation, showRuleLines],\n );\n\n const mergedClassnames = useMemo(() => {\n return {\n ...defaultClassnames,\n ...controlClassnames,\n };\n }, [controlClassnames, defaultClassnames]);\n\n const QueryBuilderContext = createContext<QueryBuilderContextType>({\n orientation,\n showRuleLines,\n });\n\n return (\n <RQBBuilder\n showNotToggle={false}\n showShiftActions={false}\n enableDragAndDrop={false}\n controlClassnames={mergedClassnames}\n controlElements={mergedElements}\n context={QueryBuilderContext}\n listsAsArrays\n {...rest}\n />\n );\n}\n\nQueryBuilder.CombinatorSelector = CombinatorSelector;\nQueryBuilder.RemoveRuleAction = RemoveRuleAction;\nQueryBuilder.LockAction = LockAction;\nQueryBuilder.CloneAction = CloneAction;\nQueryBuilder.ActionElement = ActionElement;\nQueryBuilder.Rule = Rule;\nQueryBuilder.RuleGroup = RuleGroup;\nQueryBuilder.RuleGroupHeaderComponent = RuleGroupHeaderComponent;\nQueryBuilder.RuleGroupFooterComponent = RuleGroupFooterComponent;\nQueryBuilder.getValidationResult = getValidationResult;\nQueryBuilder.ValueEditor = ValueEditor;\nQueryBuilder.ValueSelector = ValueSelector;\n"]}
@@ -6,6 +6,62 @@ import 'react';
6
6
  import 'react-aria-components';
7
7
  import './events.js';
8
8
 
9
+ /**
10
+ * Sidenav - Collapsible side navigation panel
11
+ *
12
+ * Provides a hierarchical collapsible side navigation intended to be used
13
+ * inside a Drawer.Layout. Supports headers, avatars, nested menus, and items.
14
+ *
15
+ * @example
16
+ * <Drawer.Layout push="left">
17
+ * <Drawer.Layout.Main className="col-start-2">
18
+ * <Sidenav.Trigger>
19
+ * <Button variant="icon" size="large">
20
+ * <Icon>
21
+ * <MenuIcon />
22
+ * </Icon>
23
+ * </Button>
24
+ * </Sidenav.Trigger>
25
+ * </Drawer.Layout.Main>
26
+ * <Sidenav>
27
+ * <Sidenav.Header>
28
+ * <Sidenav.Avatar>
29
+ * <Icon><AppLogo /></Icon>
30
+ * <Heading>Application Header</Heading>
31
+ * <Text>subheader</Text>
32
+ * </Sidenav.Avatar>
33
+ * </Sidenav.Header>
34
+ * <Sidenav.Content>
35
+ * <Heading>Navigation</Heading>
36
+ * <Sidenav.Item>
37
+ * <Icon><HomeIcon /></Icon>
38
+ * <Text>Home</Text>
39
+ * </Sidenav.Item>
40
+ * <Divider />
41
+ * <Sidenav.Item isSelected>
42
+ * <Icon><SettingsIcon /></Icon>
43
+ * <Text>Settings</Text>
44
+ * </Sidenav.Item>
45
+ * <Divider />
46
+ * <Sidenav.Menu title="More Options" icon={<Icon><MenuIcon /></Icon>}>
47
+ * <Sidenav.Menu.Item>
48
+ * <Text>Sub Item 1</Text>
49
+ * </Sidenav.Menu.Item>
50
+ * <Sidenav.Menu.Item>
51
+ * <Text>Sub Item 2</Text>
52
+ * </Sidenav.Menu.Item>
53
+ * </Sidenav.Menu>
54
+ * </Sidenav.Content>
55
+ * <Sidenav.Footer>
56
+ * <Sidenav.Avatar>
57
+ * <Icon><UserIcon /></Icon>
58
+ * <Heading>User Name</Heading>
59
+ * <Text>john@example.com</Text>
60
+ * </Sidenav.Avatar>
61
+ * </Sidenav.Footer>
62
+ * </Sidenav>
63
+ * </Drawer.Layout>
64
+ */
9
65
  declare function Sidenav({ id, className, isHiddenWhenClosed, children, ...rest }: SidenavProps): react_jsx_runtime.JSX.Element | null;
10
66
  declare namespace Sidenav {
11
67
  var displayName: string;