@accelint/design-toolkit 2.6.0 → 3.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.
- package/dist/components/accordion/index.d.ts +42 -0
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/avatar/index.d.ts +29 -0
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.d.ts +24 -0
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/button/index.d.ts +104 -0
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +28 -106
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +6 -4
- package/dist/components/checkbox/index.d.ts +33 -0
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/styles.d.ts +3 -3
- package/dist/components/checkbox/styles.js +1 -1
- package/dist/components/checkbox/styles.js.map +1 -1
- package/dist/components/chip/index.d.ts +34 -0
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.js +1 -1
- package/dist/components/chip/styles.js.map +1 -1
- package/dist/components/classification-badge/index.d.ts +15 -0
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-banner/index.d.ts +11 -0
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/color-picker/styles.js +1 -1
- package/dist/components/color-picker/styles.js.map +1 -1
- package/dist/components/combobox-field/index.d.ts +1 -0
- package/dist/components/combobox-field/styles.d.ts +3 -3
- package/dist/components/combobox-field/styles.js +1 -1
- package/dist/components/combobox-field/styles.js.map +1 -1
- package/dist/components/combobox-field/types.d.ts +1 -0
- package/dist/components/date-field/index.d.ts +44 -0
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.d.ts +3 -3
- package/dist/components/date-field/styles.js +1 -1
- package/dist/components/date-field/styles.js.map +1 -1
- package/dist/components/dialog/index.d.ts +26 -4
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/drawer/events.d.ts +8 -0
- package/dist/components/drawer/events.js +2 -0
- package/dist/components/drawer/events.js.map +1 -0
- package/dist/components/drawer/index.d.ts +89 -43
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/styles.d.ts +50 -16
- package/dist/components/drawer/styles.js +1 -1
- package/dist/components/drawer/styles.js.map +1 -1
- package/dist/components/drawer/types.d.ts +154 -238
- package/dist/components/drawer/types.js +1 -1
- package/dist/components/drawer/types.js.map +1 -1
- package/dist/components/hotkey/index.d.ts +32 -1
- package/dist/components/hotkey/index.js +1 -1
- package/dist/components/hotkey/index.js.map +1 -1
- package/dist/components/icon/index.d.ts +29 -0
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/input/index.d.ts +19 -0
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.js +1 -1
- package/dist/components/input/styles.js.map +1 -1
- package/dist/components/input/types.d.ts +1 -0
- package/dist/components/label/index.d.ts +19 -0
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +69 -7
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/styles.d.ts +10 -37
- package/dist/components/menu/styles.js +1 -1
- package/dist/components/menu/styles.js.map +1 -1
- package/dist/components/menu/types.d.ts +11 -16
- package/dist/components/options/index.d.ts +41 -0
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/styles.d.ts +3 -3
- package/dist/components/options/styles.js +1 -1
- package/dist/components/options/styles.js.map +1 -1
- package/dist/components/popover/index.d.ts +36 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +24 -0
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/radio/index.d.ts +31 -0
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.d.ts +3 -3
- package/dist/components/radio/styles.js +1 -1
- package/dist/components/radio/styles.js.map +1 -1
- package/dist/components/search-field/styles.js +1 -1
- package/dist/components/search-field/styles.js.map +1 -1
- package/dist/components/search-field/types.d.ts +1 -0
- package/dist/components/select-field/index.d.ts +44 -0
- package/dist/components/select-field/index.js +1 -1
- package/dist/components/select-field/index.js.map +1 -1
- package/dist/components/select-field/styles.d.ts +3 -3
- package/dist/components/select-field/styles.js +1 -1
- package/dist/components/select-field/styles.js.map +1 -1
- package/dist/components/select-field/types.d.ts +1 -0
- package/dist/components/slider/index.d.ts +36 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +36 -0
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +23 -21
- package/dist/components/switch/styles.js +1 -1
- package/dist/components/switch/styles.js.map +1 -1
- package/dist/components/switch/types.d.ts +1 -0
- package/dist/components/tabs/index.d.ts +46 -0
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +20 -0
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.d.ts +3 -3
- package/dist/components/text-area-field/styles.js +1 -1
- package/dist/components/text-area-field/styles.js.map +1 -1
- package/dist/components/text-field/index.d.ts +62 -0
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.d.ts +3 -3
- package/dist/components/text-field/types.d.ts +1 -0
- package/dist/components/tooltip/index.d.ts +42 -0
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/view-stack/events.d.ts +9 -0
- package/dist/components/view-stack/events.js +2 -0
- package/dist/components/view-stack/events.js.map +1 -0
- package/dist/components/view-stack/index.d.ts +13 -10
- package/dist/components/view-stack/index.js +1 -1
- package/dist/components/view-stack/index.js.map +1 -1
- package/dist/components/view-stack/types.d.ts +13 -9
- package/dist/index.d.ts +15 -15
- package/dist/index.js +1 -1
- package/dist/lib/types.d.ts +6 -2
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +922 -609
- package/dist/variants/variants.css +6 -5
- package/package.json +5 -5
- package/dist/components/box/index.d.ts +0 -19
- package/dist/components/box/index.js +0 -2
- package/dist/components/box/index.js.map +0 -1
- package/dist/components/drawer/context.d.ts +0 -13
- package/dist/components/drawer/context.js +0 -2
- package/dist/components/drawer/context.js.map +0 -1
- package/dist/components/drawer/state.d.ts +0 -26
- package/dist/components/drawer/state.js +0 -2
- package/dist/components/drawer/state.js.map +0 -1
|
@@ -23,6 +23,48 @@ declare function AccordionPanel({ ref, children, className, ...rest }: Accordion
|
|
|
23
23
|
declare namespace AccordionPanel {
|
|
24
24
|
var displayName: string;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Accordion - A collapsible content component with expandable sections
|
|
28
|
+
*
|
|
29
|
+
* Provides an accessible accordion interface for organizing content into
|
|
30
|
+
* collapsible sections. Supports both compact and full variants with
|
|
31
|
+
* integrated controls for expanding/collapsing content areas.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* // Basic accordion
|
|
35
|
+
* <Accordion>
|
|
36
|
+
* <Accordion.Header>
|
|
37
|
+
* <Accordion.Trigger>Section Title</Accordion.Trigger>
|
|
38
|
+
* </Accordion.Header>
|
|
39
|
+
* <Accordion.Panel>Content goes here</Accordion.Panel>
|
|
40
|
+
* </Accordion>
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* // Compact variant
|
|
44
|
+
* <Accordion variant="compact">
|
|
45
|
+
* <Accordion.Header>
|
|
46
|
+
* <Accordion.Trigger>Compact Section</Accordion.Trigger>
|
|
47
|
+
* </Accordion.Header>
|
|
48
|
+
* <Accordion.Panel>Compact content</Accordion.Panel>
|
|
49
|
+
* </Accordion>
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // Multiple accordions in a group
|
|
53
|
+
* <Accordion.Group>
|
|
54
|
+
* <Accordion>
|
|
55
|
+
* <Accordion.Header>
|
|
56
|
+
* <Accordion.Trigger>First Section</Accordion.Trigger>
|
|
57
|
+
* </Accordion.Header>
|
|
58
|
+
* <Accordion.Panel>First content</Accordion.Panel>
|
|
59
|
+
* </Accordion>
|
|
60
|
+
* <Accordion>
|
|
61
|
+
* <Accordion.Header>
|
|
62
|
+
* <Accordion.Trigger>Second Section</Accordion.Trigger>
|
|
63
|
+
* </Accordion.Header>
|
|
64
|
+
* <Accordion.Panel>Second content</Accordion.Panel>
|
|
65
|
+
* </Accordion>
|
|
66
|
+
* </Accordion.Group>
|
|
67
|
+
*/
|
|
26
68
|
declare function Accordion({ ref, ...props }: AccordionProps): react_jsx_runtime.JSX.Element;
|
|
27
69
|
declare namespace Accordion {
|
|
28
70
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/accordion/index.tsx"],"names":["AccordionContext","AccordionGroup","ref","w","C","children","variant","AccordionStylesDefaults","isDisabled","l","r","jsx","rest","group","H","className","d","context","useContext","isSlottedContextValue","p","T","V","ButtonContext","Icon","S","A","Header","header","b","Heading","classNames","Button","B","ChevronDown","D","composeRenderProps","panel","G","AccordionPanel","props","I","y","Accordion"],"mappings":"ihBAuC2C,CAAA,CAAA,CAAA,SAAS,CAAA,CAAA,CAAA,MAA0B,CAAA,CAEjEA,CAAAA,OACqD,CAAA,CAElE,CAAA,OAAA,CAASC,EAAe,KACtBC,CAAAA,CACA,CAAA,CAAAC,eAAA,EAAA,CAAA,CAAA,CAAAC,aAAAC,CAAAA,IACA,EAAA,SACA,CAAA,CAAA,CAAA,GAAAC,CAAAA,CAAUC,CAAAA,QAAwB,CAClC,CAAA,CAAA,SAAAC,CAAAA,CACA,QAEA,CAAA,CAAA,CAAAC,uBAAA,CAAA,kBAC6B,CAAA,CAAA,CAAO,GAAE,CAAA,CAAA,CAA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AA,CAAA,CAEtB,CAAA,CAAA,CAAA,CAAA,YAAqBrC,iBACKsC,CAAAA,SAAoBxC,CAAgB,CAAA,CAEnE,GAAA,CAAA,CAAM,CACJ,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAK,CAAAA,CACA,CAAA,CAAAoC,eAAA,CAAA,CAAA,CAAA,CAAA,EAAA,IACA,CAAA,CAAA,CAAA,CAAA,KAAUlC,CAAAA,QAAwB,CAClC,CAAA,CAAA,SAAAC,CAAAA,CACA,QAGF,CAAA,CAAA,CAAAC,uBAAA,CAAA,OACoB,CAAA,UAChB,CAAA,CAAA,CAAA,GACE,CAAA,CAAA,CAAA,CAAA,CAAA,qBAIF,CAAA,CAAA,KAAA,CAAAE,CAAAA,OACMC,CAAAA,CACJ,CAAA,UAAWwB,CAAmBrB,CAAAA,CAAYA,CAAAA,QAEtC,CAAAL,GAAA,CAAAgC,UAAA,CAAA,CAAA,GACD,CACH,CAAA,SACA,CAAA1B,kBAAA,CAAYR,EAEX,CAAA,EAAA,CAAA,CAAA,CAAA,SAKTmC,CAAAA,CAAU,cAAc,CAAA,CAAA,CAAA,QACxBA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ1C,CAAAA,CAClB0C,WACAA,CAAAA,WACAA,CAAAA,CAAU,CAAA,KAAQJ,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { isSlottedContextValue } from '@/lib/utils';\nimport { ChevronDown, Kebab } from '@accelint/icons';\nimport { createContext, useContext } from 'react';\nimport {\n type ContextValue,\n Disclosure,\n DisclosureGroup,\n DisclosurePanel,\n Header,\n Heading,\n Provider,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Button, ButtonContext } from '../button';\nimport { Icon, IconContext } from '../icon';\nimport { AccordionStyles, AccordionStylesDefaults } from './styles';\nimport type {\n AccordionGroupProps,\n AccordionHeaderProps,\n AccordionPanelProps,\n AccordionProps,\n AccordionTriggerProps,\n} from './types';\n\nconst { group, accordion, header, heading, trigger, panel } = AccordionStyles();\n\nexport const AccordionContext =\n createContext<ContextValue<AccordionProps, HTMLDivElement>>(null);\n\nfunction AccordionGroup({\n ref,\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n}: AccordionGroupProps) {\n return (\n <AccordionContext.Provider value={{ variant, isDisabled }}>\n <DisclosureGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n group({\n className,\n variant,\n }),\n )}\n >\n {children}\n </DisclosureGroup>\n </AccordionContext.Provider>\n );\n}\nAccordionGroup.displayName = 'Accordion.Group';\n\nfunction AccordionHeader({ ref, children, className }: AccordionHeaderProps) {\n const context = useContext(AccordionContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n const isDisabled =\n (isSlottedContextValue(context) ? undefined : context?.isDisabled) ?? false;\n\n return (\n <Provider\n values={[\n [IconContext, { size: variant === 'compact' ? 'small' : 'large' }],\n [\n ButtonContext,\n {\n children: (\n <Icon>\n <Kebab />\n </Icon>\n ),\n variant: 'icon',\n isDisabled,\n },\n ],\n ]}\n >\n <Header\n ref={ref}\n className={header({\n className,\n variant,\n })}\n >\n {children}\n </Header>\n </Provider>\n );\n}\nAccordionHeader.displayName = 'Accordion.Header';\n\nfunction AccordionTrigger({\n ref,\n children,\n classNames,\n}: AccordionTriggerProps) {\n const context = useContext(AccordionContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n\n return (\n <Heading\n ref={ref}\n className={heading({\n className: classNames?.heading,\n variant,\n })}\n >\n <Button\n slot='trigger'\n className={composeRenderProps(classNames?.trigger, (className) =>\n trigger({\n className,\n variant,\n }),\n )}\n variant='flat'\n >\n <Icon>\n <ChevronDown className='transform group-expanded/accordion:rotate-180' />\n </Icon>\n {children}\n </Button>\n </Heading>\n );\n}\nAccordionTrigger.displayName = 'Accordion.Trigger';\n\nfunction AccordionPanel({\n ref,\n children,\n className,\n ...rest\n}: AccordionPanelProps) {\n return (\n <DisclosurePanel\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n panel({ className }),\n )}\n >\n {children}\n </DisclosurePanel>\n );\n}\nAccordionPanel.displayName = 'Accordion.Panel';\n\nexport function Accordion({ ref, ...props }: AccordionProps) {\n [props, ref] = useContextProps(props, ref ?? null, AccordionContext);\n\n const {\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n } = props;\n\n return (\n <AccordionContext.Provider\n value={{\n variant,\n isDisabled,\n }}\n >\n <Disclosure\n {...rest}\n className={composeRenderProps(className, (className) =>\n accordion({\n className,\n }),\n )}\n isDisabled={isDisabled}\n >\n {children}\n </Disclosure>\n </AccordionContext.Provider>\n );\n}\nAccordion.displayName = 'Accordion';\nAccordion.Group = AccordionGroup;\nAccordion.Header = AccordionHeader;\nAccordion.Trigger = AccordionTrigger;\nAccordion.Panel = AccordionPanel;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/accordion/index.tsx"],"names":["AccordionContext","AccordionGroup","ref","w","C","children","variant","AccordionStylesDefaults","isDisabled","l","r","jsx","rest","group","H","className","d","context","useContext","isSlottedContextValue","p","T","V","ButtonContext","Icon","S","A","Header","header","b","Heading","classNames","Button","B","ChevronDown","D","composeRenderProps","panel","G","AccordionPanel","props","I","y","Accordion"],"mappings":"ihBAuC2C,CAAA,CAAA,CAAA,SAAS,CAAA,CAAA,CAAA,MAA0B,CAAA,CAEjEA,CAAAA,OACqD,CAAA,CAElE,CAAA,OAAA,CAASC,EAAe,KACtBC,CAAAA,CACA,CAAA,CAAAC,eAAA,EAAA,CAAA,CAAA,CAAAC,aAAAC,CAAAA,IACA,EAAA,SACA,CAAA,CAAA,CAAA,GAAAC,CAAAA,CAAUC,CAAAA,QAAwB,CAClC,CAAA,CAAA,SAAAC,CAAAA,CACA,QAEA,CAAA,CAAA,CAAAC,uBAAA,CAAA,kBAC6B,CAAA,CAAA,CAAO,GAAE,CAAA,CAAA,CAAA,CAAA,OAASC,GAAA,CAAA,CAAA,CAAA,QAC3C,CAAA,CAAA,KAAA,CAAAC,QACMC,CAAAA,CACJ,CAAA,UACA,CAAA,CAAA,CAAA,CAAA,QACEC,CAAAA,GAAM,CACJC,eAAA,CAAA,CAAA,GAAA,CAAA,CAAA,GAAAC,CACA,CAAA,CAAA,SAEJ,CAAAC,kBAEC,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAAX,SAKM,CAAA,CAAA,CAAA,OAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAE7B,CAAA,CAAA,CAAA,CAAA,YAA2BH,iBAAe,CAAA,SACxC,CAAA,CAAA,CAAA,GAAMe,CAAAA,CAAUC,CAAAA,SAESD,CAAO,CAAA,SAAgBA,CAAAA,CAAS,CAAA,CAAA,CAAA,MAAA,CACvDV,CAAAA,UAAwB,4BACpBC,CAAAA,CAAAA,CACHW,CAAAA,MAAiC,CAAA,CAAA,EAAA,OAAqB,GAAAV,uBAAA,CAAA,OAAe,CAExE,CAAA,CAAA,CAAAW,qBAAA,CAAA,CAAA,CACET,CAAAA,oBAEoB,GAAML,KAAY,YAAYe,QAAA,CAAA,CAAA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ClB0C,WACAA,CAAAA,WACAA,CAAAA,CAAU,CAAA,KAAQJ,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { isSlottedContextValue } from '@/lib/utils';\nimport { ChevronDown, Kebab } from '@accelint/icons';\nimport { createContext, useContext } from 'react';\nimport {\n type ContextValue,\n Disclosure,\n DisclosureGroup,\n DisclosurePanel,\n Header,\n Heading,\n Provider,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Button, ButtonContext } from '../button';\nimport { Icon, IconContext } from '../icon';\nimport { AccordionStyles, AccordionStylesDefaults } from './styles';\nimport type {\n AccordionGroupProps,\n AccordionHeaderProps,\n AccordionPanelProps,\n AccordionProps,\n AccordionTriggerProps,\n} from './types';\n\nconst { group, accordion, header, heading, trigger, panel } = AccordionStyles();\n\nexport const AccordionContext =\n createContext<ContextValue<AccordionProps, HTMLDivElement>>(null);\n\nfunction AccordionGroup({\n ref,\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n}: AccordionGroupProps) {\n return (\n <AccordionContext.Provider value={{ variant, isDisabled }}>\n <DisclosureGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n group({\n className,\n variant,\n }),\n )}\n >\n {children}\n </DisclosureGroup>\n </AccordionContext.Provider>\n );\n}\nAccordionGroup.displayName = 'Accordion.Group';\n\nfunction AccordionHeader({ ref, children, className }: AccordionHeaderProps) {\n const context = useContext(AccordionContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n const isDisabled =\n (isSlottedContextValue(context) ? undefined : context?.isDisabled) ?? false;\n\n return (\n <Provider\n values={[\n [IconContext, { size: variant === 'compact' ? 'small' : 'large' }],\n [\n ButtonContext,\n {\n children: (\n <Icon>\n <Kebab />\n </Icon>\n ),\n variant: 'icon',\n isDisabled,\n },\n ],\n ]}\n >\n <Header\n ref={ref}\n className={header({\n className,\n variant,\n })}\n >\n {children}\n </Header>\n </Provider>\n );\n}\nAccordionHeader.displayName = 'Accordion.Header';\n\nfunction AccordionTrigger({\n ref,\n children,\n classNames,\n}: AccordionTriggerProps) {\n const context = useContext(AccordionContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n\n return (\n <Heading\n ref={ref}\n className={heading({\n className: classNames?.heading,\n variant,\n })}\n >\n <Button\n slot='trigger'\n className={composeRenderProps(classNames?.trigger, (className) =>\n trigger({\n className,\n variant,\n }),\n )}\n variant='flat'\n >\n <Icon>\n <ChevronDown className='transform group-expanded/accordion:rotate-180' />\n </Icon>\n {children}\n </Button>\n </Heading>\n );\n}\nAccordionTrigger.displayName = 'Accordion.Trigger';\n\nfunction AccordionPanel({\n ref,\n children,\n className,\n ...rest\n}: AccordionPanelProps) {\n return (\n <DisclosurePanel\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n panel({ className }),\n )}\n >\n {children}\n </DisclosurePanel>\n );\n}\nAccordionPanel.displayName = 'Accordion.Panel';\n\n/**\n * Accordion - A collapsible content component with expandable sections\n *\n * Provides an accessible accordion interface for organizing content into\n * collapsible sections. Supports both compact and full variants with\n * integrated controls for expanding/collapsing content areas.\n *\n * @example\n * // Basic accordion\n * <Accordion>\n * <Accordion.Header>\n * <Accordion.Trigger>Section Title</Accordion.Trigger>\n * </Accordion.Header>\n * <Accordion.Panel>Content goes here</Accordion.Panel>\n * </Accordion>\n *\n * @example\n * // Compact variant\n * <Accordion variant=\"compact\">\n * <Accordion.Header>\n * <Accordion.Trigger>Compact Section</Accordion.Trigger>\n * </Accordion.Header>\n * <Accordion.Panel>Compact content</Accordion.Panel>\n * </Accordion>\n *\n * @example\n * // Multiple accordions in a group\n * <Accordion.Group>\n * <Accordion>\n * <Accordion.Header>\n * <Accordion.Trigger>First Section</Accordion.Trigger>\n * </Accordion.Header>\n * <Accordion.Panel>First content</Accordion.Panel>\n * </Accordion>\n * <Accordion>\n * <Accordion.Header>\n * <Accordion.Trigger>Second Section</Accordion.Trigger>\n * </Accordion.Header>\n * <Accordion.Panel>Second content</Accordion.Panel>\n * </Accordion>\n * </Accordion.Group>\n */\nexport function Accordion({ ref, ...props }: AccordionProps) {\n [props, ref] = useContextProps(props, ref ?? null, AccordionContext);\n\n const {\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n } = props;\n\n return (\n <AccordionContext.Provider\n value={{\n variant,\n isDisabled,\n }}\n >\n <Disclosure\n {...rest}\n className={composeRenderProps(className, (className) =>\n accordion({\n className,\n }),\n )}\n isDisabled={isDisabled}\n >\n {children}\n </Disclosure>\n </AccordionContext.Provider>\n );\n}\nAccordion.displayName = 'Accordion';\nAccordion.Group = AccordionGroup;\nAccordion.Header = AccordionHeader;\nAccordion.Trigger = AccordionTrigger;\nAccordion.Panel = AccordionPanel;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'./../../lib/utils.js';const o={variant:"cozy"},t=tv({slots:{group:"group/accordion-group flex w-full flex-col",accordion:"group/accordion flex w-full flex-col bg-transparent",header:["fg-default-light flex w-full items-center gap-s rounded-medium px-s py-xs outline-none","group-enabled/accordion:
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const o={variant:"cozy"},t=tv({slots:{group:"group/accordion-group flex w-full flex-col",accordion:"group/accordion flex w-full flex-col bg-transparent",header:["fg-default-light flex w-full items-center gap-s rounded-medium px-s py-xs outline-none","group-enabled/accordion:focus-visible-within:bg-interactive-hover-dark group-enabled/accordion:hover:bg-interactive-hover-dark","group-disabled/accordion:fg-disabled group-disabled/accordion:cursor-not-allowed"],heading:"grow",trigger:["flex w-full cursor-pointer items-center justify-start size-medium:px-0 disabled:cursor-not-allowed"],panel:"p-s"},variants:{variant:{cozy:{trigger:"gap-s text-header-m"},compact:{trigger:"gap-xs text-header-s"}}},defaultVariants:o});export{t as AccordionStyles,o as AccordionStylesDefaults};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/accordion/styles.ts"],"names":["AccordionStyles","tv","e"],"mappings":"sCAeE,MAAA,CAAS,CAAA,CAAA,OAGEA,CAAkBC,MAC7B,CAAA,CAAA,CAAO,CACLC,EAAA,CAAA,CAAA,KAAO,CAAA,CAAA,KAAA,CAAA,4CACP,CAAW,SAAA,CAAA,qDAET,CAAA,MAAA,CAAA,CAAA,wFACA,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/accordion/styles.ts"],"names":["AccordionStyles","tv","e"],"mappings":"sCAeE,MAAA,CAAS,CAAA,CAAA,OAGEA,CAAkBC,MAC7B,CAAA,CAAA,CAAO,CACLC,EAAA,CAAA,CAAA,KAAO,CAAA,CAAA,KAAA,CAAA,4CACP,CAAW,SAAA,CAAA,qDAET,CAAA,MAAA,CAAA,CAAA,wFACA,CAAA,gIACA,CAAA,kFAEO,SACT,CAAA,MACE,CAAA,OAAA,CAAA,CAAA,oGAEK,CAAA,CAAA,KAET,CAAA,KAAA,CAAU,CACR,QAAS,CACP,CAAA,aACW,CAAA,CAAA,OAAA,CAAA,qBAEF,CACP,CAAA,OAAS,CAAA,CAAA,OAAA,CAAA,sBAIf,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const AccordionStylesDefaults = {\n variant: 'cozy',\n} as const;\n\nexport const AccordionStyles = tv({\n slots: {\n group: 'group/accordion-group flex w-full flex-col',\n accordion: 'group/accordion flex w-full flex-col bg-transparent',\n header: [\n 'fg-default-light flex w-full items-center gap-s rounded-medium px-s py-xs outline-none',\n 'group-enabled/accordion:focus-visible-within:bg-interactive-hover-dark group-enabled/accordion:hover:bg-interactive-hover-dark',\n 'group-disabled/accordion:fg-disabled group-disabled/accordion:cursor-not-allowed',\n ],\n heading: 'grow',\n trigger: [\n 'flex w-full cursor-pointer items-center justify-start size-medium:px-0 disabled:cursor-not-allowed',\n ],\n panel: 'p-s',\n },\n variants: {\n variant: {\n cozy: {\n trigger: 'gap-s text-header-m',\n },\n compact: {\n trigger: 'gap-xs text-header-s',\n },\n },\n },\n defaultVariants: AccordionStylesDefaults,\n});\n"]}
|
|
@@ -13,6 +13,35 @@ declare function AvatarProvider({ children, ...props }: ProviderProps<AvatarProp
|
|
|
13
13
|
declare namespace AvatarProvider {
|
|
14
14
|
var displayName: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Avatar - A user profile image component with fallback support
|
|
18
|
+
*
|
|
19
|
+
* Displays a user's profile image with automatic fallback to a default person icon
|
|
20
|
+
* when the image fails to load. Supports multiple sizes and can include status badges.
|
|
21
|
+
* Built on Radix UI Avatar for accessibility and reliability.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Basic avatar with image
|
|
25
|
+
* <Avatar imageProps={{ src: "/user.jpg", alt: "User Name" }} />
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Avatar with fallback and custom size
|
|
29
|
+
* <Avatar
|
|
30
|
+
* size="large"
|
|
31
|
+
* imageProps={{ src: "/user.jpg", alt: "User Name" }}
|
|
32
|
+
* fallbackProps={{ children: "UN" }}
|
|
33
|
+
* />
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Avatar with status badge
|
|
37
|
+
* <Avatar imageProps={{ src: "/user.jpg", alt: "User Name" }}>
|
|
38
|
+
* <Badge variant="success" />
|
|
39
|
+
* </Avatar>
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* // Avatar with only initials fallback
|
|
43
|
+
* <Avatar fallbackProps={{ children: "JD" }} />
|
|
44
|
+
*/
|
|
16
45
|
declare function Avatar({ ref, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
|
17
46
|
declare namespace Avatar {
|
|
18
47
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/avatar/index.tsx"],"names":["AvatarStyles","createContext","children","props","N","AvatarContext","a","Avatar","g","classNames","fallbackProps","imageProps","jsxs","Root","ref","h","A","Image","u","fallback","f","size","jsx","Person","Badge","m","P","y","d","AvatarProvider"],"mappings":"kZAyByC,MAAIA,CAAAA,MAG3CC,CAA0D,CAAA,CAAA,KAE5D,CAAA,CAAA,CAAA,QAA0B,UAAAC,CAAU,CAAA,CAAA,CAAGC,YAAM,EAA+B,CAC1E,CAAA,CAAAC,aAAA,CAAA,MACGC,SAAc,CAAd,CAAuB,CAAA,QAAe,CAAA,CAAA,CAAA,GAAA,CAAA,CAAAH,CAAAA,CAAS,OAGrCI,GAAA,CAAA,CAAA,CAAA,QAAc,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/avatar/index.tsx"],"names":["AvatarStyles","createContext","children","props","N","AvatarContext","a","Avatar","g","classNames","fallbackProps","imageProps","jsxs","Root","ref","h","A","Image","u","fallback","f","size","jsx","Person","Badge","m","P","y","d","AvatarProvider"],"mappings":"kZAyByC,MAAIA,CAAAA,MAG3CC,CAA0D,CAAA,CAAA,KAE5D,CAAA,CAAA,CAAA,QAA0B,UAAAC,CAAU,CAAA,CAAA,CAAGC,YAAM,EAA+B,CAC1E,CAAA,CAAAC,aAAA,CAAA,MACGC,SAAc,CAAd,CAAuB,CAAA,QAAe,CAAA,CAAA,CAAA,GAAA,CAAA,CAAAH,CAAAA,CAAS,OAGrCI,GAAA,CAAA,CAAA,CAAA,QAAc,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,QA+BtB,CAAA,CAAA,CAAA,CAAA,CAAA,CAASC,CAAAA,WAAiBJ,CAAM,2BAGrC,CAAA,CAAM,CACJ,GAAA,CAAA,CAAA,CAAA,GAAAD,CAAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAM,eAAA,CAAA,CAAAC,CAAAA,CACA,EAAA,IAAA,CAAA,CAAA,CAAA,CAAA,KAAAC,CACA,QAAA,CAAA,CAAA,CAAAC,0BAKF,CAAA,CAAA,CAAA,UACQ,CAAA,CAAA,CAAA,IAAL,CAAc,CAAA,CAAA,QAAe,CAAA,GAAA,CAAA,CAAA,CAAA,CAAW,CAAA,OAAUL,iBACjD,CAAA,CAAA,IAAAM,CAAAA,CAACC,GACE,QACD,CAAKC,OACL,CAAA,QAAoB,CAAA,QAAM,CAAAC,IAAA,CAAAC,IAAA,CAAA,CAAA,IAAuB,CAAA,GAAA,CAAA,CAAO,CAAC,SACpD,CAAA,CAAA,CAAA,CACL,IAAA,CAAA,CAAA,CAAA,SAEA,CAAA,CAAA,EAAA,MAACC,CAAAA,CAAA,CACE,IAAGN,CACJ,iBAAmB,CAAA,CAAA,CAAA,QAAuB,CAAA,CAAAL,GAAA,CAAOY,KAAA,CAAA,CAAA,GAAK,CAAC,CAAA,SAGtD,CAAA,CAAGR,EACJ,SAAA,CAAWS,CAAAA,EAAW,KAAA,CAAA,IAAWV,CAAAA,CAAAA,CAAY,CAAA,CAAA,CAAA,CAAAH,GAAA,CAAAc,QAAA,CAAA,CAAU,KAAAC,SAEtD,CAAA,CAAA,CAAA,CAAAX,SAAe,CAAA,CAAA,EACdY,QACE,CAAA,IAAA,CAAAA,CAAAA,CAACC,CAAAA,CAAA,QAIPD,CAAAA,CAACE,EAAM,QAAA,EAASlB,GAAA,CAAAmB,IAAA,CAAA,CAAA,QAAmB,CAAAnB,GAAA,CAAAoB,MAAA,CAAA,EAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAApB,GAAA,CAAAqB,KAAA,CAAA,QAC3C,CAAA,CAAAL,MAAC,CAAAM,SAAA,CAAA,SAAK,CAAA,WAAqB,CAAA,QAAuB,CAAAtB,GAAA,CAAA,MAAS,CAAAe,CAAK,SAC7D,CAAA,CAAA,CAAAnB,CAAAA,SAMb,CACAK,CAAAA,EAAO,OAAA,CAAA,IAAc,CAAA,CAAA,CAAA,CAAA,CAAA,QACd,CAAA,CAAA,CAAA,CAAA,CAAA,CAAWsB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,WAAAA,CAAAA,QAAAA,CAAAA,CAAAA,CAAAA,QAAAA,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 type { ProviderProps } from '@/lib/types';\nimport { spacingXs } from '@/tokens';\nimport { Person } from '@accelint/icons';\nimport { Fallback, Image, Root } from '@radix-ui/react-avatar';\nimport { createContext } from 'react';\nimport { type ContextValue, useContextProps } from 'react-aria-components';\nimport { Badge } from '../badge';\nimport { Icon } from '../icon';\nimport { AvatarStyles } from './styles';\nimport type { AvatarProps } from './types';\n\nconst { avatar, image, fallback, content } = AvatarStyles();\n\nexport const AvatarContext =\n createContext<ContextValue<AvatarProps, HTMLSpanElement>>(null);\n\nfunction AvatarProvider({ children, ...props }: ProviderProps<AvatarProps>) {\n return (\n <AvatarContext.Provider value={props}>{children}</AvatarContext.Provider>\n );\n}\nAvatarProvider.displayName = 'Avatar.Provider';\n\n/**\n * Avatar - A user profile image component with fallback support\n *\n * Displays a user's profile image with automatic fallback to a default person icon\n * when the image fails to load. Supports multiple sizes and can include status badges.\n * Built on Radix UI Avatar for accessibility and reliability.\n *\n * @example\n * // Basic avatar with image\n * <Avatar imageProps={{ src: \"/user.jpg\", alt: \"User Name\" }} />\n *\n * @example\n * // Avatar with fallback and custom size\n * <Avatar\n * size=\"large\"\n * imageProps={{ src: \"/user.jpg\", alt: \"User Name\" }}\n * fallbackProps={{ children: \"UN\" }}\n * />\n *\n * @example\n * // Avatar with status badge\n * <Avatar imageProps={{ src: \"/user.jpg\", alt: \"User Name\" }}>\n * <Badge variant=\"success\" />\n * </Avatar>\n *\n * @example\n * // Avatar with only initials fallback\n * <Avatar fallbackProps={{ children: \"JD\" }} />\n */\nexport function Avatar({ ref, ...props }: AvatarProps) {\n [props, ref] = useContextProps(props, ref ?? null, AvatarContext);\n\n const {\n children,\n classNames,\n fallbackProps,\n imageProps,\n size = 'medium',\n ...rest\n } = props;\n\n return (\n <Icon.Provider size={size === 'medium' ? 'large' : 'medium'}>\n <Root\n {...rest}\n ref={ref}\n className={avatar({ size, className: classNames?.avatar })}\n role='img'\n data-size={size}\n >\n <Image\n {...imageProps}\n className={image({ className: classNames?.image, size })}\n />\n <Fallback\n {...fallbackProps}\n className={fallback({ className: classNames?.fallback, size })}\n >\n {fallbackProps?.children || (\n <Icon>\n <Person />\n </Icon>\n )}\n </Fallback>\n <Badge.Provider offset={spacingXs} placement='top right'>\n <span className={content({ className: classNames?.content, size })}>\n {children}\n </span>\n </Badge.Provider>\n </Root>\n </Icon.Provider>\n );\n}\nAvatar.displayName = 'Avatar';\nAvatar.Provider = AvatarProvider;\n"]}
|
|
@@ -12,6 +12,30 @@ declare function BadgeProvider({ children, ...props }: ProviderProps<BadgeProps>
|
|
|
12
12
|
declare namespace BadgeProvider {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Badge - A small status indicator component for labeling and notifications
|
|
17
|
+
*
|
|
18
|
+
* Displays contextual information like status, counts, or labels. Supports various
|
|
19
|
+
* visual variants and can be positioned relative to other elements. Useful for
|
|
20
|
+
* indicating notifications, statuses, or providing supplementary information.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Basic badge
|
|
24
|
+
* <Badge>New</Badge>
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Status badges with different variants
|
|
28
|
+
* <Badge variant="success">Active</Badge>
|
|
29
|
+
* <Badge variant="warning">Pending</Badge>
|
|
30
|
+
* <Badge variant="serious">Error</Badge>
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Positioned badge (typically used with other components)
|
|
34
|
+
* <div className="relative">
|
|
35
|
+
* <Button>Messages</Button>
|
|
36
|
+
* <Badge placement='top right' offset={-spacingS}>3</Badge>
|
|
37
|
+
* </div>
|
|
38
|
+
*/
|
|
15
39
|
declare function Badge({ ref, ...props }: BadgeProps): react_jsx_runtime.JSX.Element;
|
|
16
40
|
declare namespace Badge {
|
|
17
41
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/badge/index.tsx"],"names":["createContext","m","props","d","BadgeProvider","ref","useContextProps","BadgeStylesDefaults","P","rest","offset","Badge"],"mappings":"wMAqBEA,MAAyD,CAAA,CAAAC,aAAA,CAAI,IAE/D,EAAA,SAAyB,CAAA,CAAA,CAAA,QAAU,CAAA,CAAGC,CAAM,GAC1C,CAAA,CAAA,CAAA,CAAA,OACgBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAE1C,CACAC,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/badge/index.tsx"],"names":["createContext","m","props","d","BadgeProvider","ref","useContextProps","BadgeStylesDefaults","P","rest","offset","Badge"],"mappings":"wMAqBEA,MAAyD,CAAA,CAAAC,aAAA,CAAI,IAE/D,EAAA,SAAyB,CAAA,CAAA,CAAA,QAAU,CAAA,CAAGC,CAAM,GAC1C,CAAA,CAAA,CAAA,CAAA,OACgBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAE1C,CACAC,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,gBA0BrB,CAAA,SAAiB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACpC,CAACA,CAAAA,CAAOG,CAAG,CAAA,CAAIC,CAAAA,CAAgBJ,EAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,CAAA,CAAA,CAAA,CAAA,KACE,CAAA,SACA,CAAA,CAAA,CAAA,MACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,OAAUE,CAAoB,CAAA,CAAAC,mBAAA,CAAA,OAC3BC,CACL,GAAIP,CAEJ,CAAA,CAAA,CAAA,CAAA,OACGC,GAAA,CAAA,MACE,CAAGM,CAAAA,GACJ,CAAA,CAAKJ,GACL,CAAA,CAAA,CAAA,SACE,uBACA,CAAA,CAAA,CAAA,OACD,CACD,CAAA,CAAA,CAAA,CAAA,eAAe,CAAA,OAAkB,CAAA,EAAA,QAAoBK,CAAAA,CAAQ,CAAA,CAC7D,EAAA,CAAA,CAAA,eAAe,CAAA,OAAkB,CAAA,EAAA,QAAoBA,CAAAA,CAAQ,CAAA,CAC7D,EAAA,CAAA,CAAA,gBAA6B,CAAA,CAAA,EAAA,IAInCC,CAAM,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,OACd,CAAA,CAAA,CAAA,QAAWP,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 type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport { type ContextValue, useContextProps } from 'react-aria-components';\nimport { BadgeStyles, BadgeStylesDefaults } from './styles';\nimport type { BadgeProps } from './types';\n\nexport const BadgeContext =\n createContext<ContextValue<BadgeProps, HTMLSpanElement>>(null);\n\nfunction BadgeProvider({ children, ...props }: ProviderProps<BadgeProps>) {\n return (\n <BadgeContext.Provider value={props}>{children}</BadgeContext.Provider>\n );\n}\nBadgeProvider.displayName = 'Badge.Provider';\n\n/**\n * Badge - A small status indicator component for labeling and notifications\n *\n * Displays contextual information like status, counts, or labels. Supports various\n * visual variants and can be positioned relative to other elements. Useful for\n * indicating notifications, statuses, or providing supplementary information.\n *\n * @example\n * // Basic badge\n * <Badge>New</Badge>\n *\n * @example\n * // Status badges with different variants\n * <Badge variant=\"success\">Active</Badge>\n * <Badge variant=\"warning\">Pending</Badge>\n * <Badge variant=\"serious\">Error</Badge>\n *\n * @example\n * // Positioned badge (typically used with other components)\n * <div className=\"relative\">\n * <Button>Messages</Button>\n * <Badge placement='top right' offset={-spacingS}>3</Badge>\n * </div>\n */\nexport function Badge({ ref, ...props }: BadgeProps) {\n [props, ref] = useContextProps(props, ref ?? null, BadgeContext);\n\n const {\n className,\n offset,\n placement,\n variant = BadgeStylesDefaults.variant,\n ...rest\n } = props;\n\n return (\n <span\n {...rest}\n ref={ref}\n className={BadgeStyles({\n className,\n variant,\n })}\n data-offset-x={typeof offset === 'number' ? offset : offset?.x}\n data-offset-y={typeof offset === 'number' ? offset : offset?.y}\n data-placement={placement || null}\n />\n );\n}\nBadge.displayName = 'Badge';\nBadge.Provider = BadgeProvider;\n"]}
|
|
@@ -12,6 +12,40 @@ declare function ButtonProvider({ children, ...props }: ProviderProps<ButtonProp
|
|
|
12
12
|
declare namespace ButtonProvider {
|
|
13
13
|
var displayName: string;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Button - A versatile interactive button component with multiple variants
|
|
17
|
+
*
|
|
18
|
+
* Provides accessible button functionality with support for different visual styles,
|
|
19
|
+
* sizes, and interactive states. Includes icon support and integrates with React Aria
|
|
20
|
+
* for keyboard navigation and accessibility features.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* // Basic button
|
|
24
|
+
* <Button>Click me</Button>
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Primary button with different sizes
|
|
28
|
+
* <Button variant="filled" size="large">Large Filled</Button>
|
|
29
|
+
* <Button variant="outline" size="small">Small Outline</Button>
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Button with icon
|
|
33
|
+
* <Button variant="flat">
|
|
34
|
+
* <Icon><Plus /></Icon>
|
|
35
|
+
* Add Item
|
|
36
|
+
* </Button>
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Icon-only button
|
|
40
|
+
* <Button variant="icon">
|
|
41
|
+
* <Icon><Settings /></Icon>
|
|
42
|
+
* </Button>
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Button with different colors
|
|
46
|
+
* <Button color="critical">Critical Button</Button>
|
|
47
|
+
* <Button color="serious">Delete</Button>
|
|
48
|
+
*/
|
|
15
49
|
declare function Button({ ref, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
16
50
|
declare namespace Button {
|
|
17
51
|
var displayName: string;
|
|
@@ -22,6 +56,40 @@ declare function LinkButtonProvider({ children, ...props }: ProviderProps<LinkBu
|
|
|
22
56
|
declare namespace LinkButtonProvider {
|
|
23
57
|
var displayName: string;
|
|
24
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* LinkButton - A button component that renders as a link element
|
|
61
|
+
*
|
|
62
|
+
* Provides accessible link functionality with button-like styling and visual feedback.
|
|
63
|
+
* Perfect for navigation actions that should look like buttons but behave as links.
|
|
64
|
+
* Includes icon support and integrates with React Aria for keyboard navigation and accessibility.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Basic link button
|
|
68
|
+
* <LinkButton href="/dashboard">Go to Dashboard</LinkButton>
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* // Link button with different variants and sizes
|
|
72
|
+
* <LinkButton variant="filled" size="large" href="/create">Create New</LinkButton>
|
|
73
|
+
* <LinkButton variant="outline" size="small" href="/settings">Settings</LinkButton>
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* // Link button with icon
|
|
77
|
+
* <LinkButton variant="flat" href="/profile">
|
|
78
|
+
* <Icon><User /></Icon>
|
|
79
|
+
* View Profile
|
|
80
|
+
* </LinkButton>
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* // Icon-only link button
|
|
84
|
+
* <LinkButton variant="icon" href="/help">
|
|
85
|
+
* <Icon><HelpCircle /></Icon>
|
|
86
|
+
* </LinkButton>
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* // Link button with different colors
|
|
90
|
+
* <LinkButton color="critical" href="/delete">Delete Account</LinkButton>
|
|
91
|
+
* <LinkButton color="serious" href="/reset">Reset Data</LinkButton>
|
|
92
|
+
*/
|
|
25
93
|
declare function LinkButton({ ref, ...props }: LinkButtonProps): react_jsx_runtime.JSX.Element;
|
|
26
94
|
declare namespace LinkButton {
|
|
27
95
|
var displayName: string;
|
|
@@ -32,6 +100,42 @@ declare function ToggleButtonProvider({ children, ...props }: ProviderProps<Togg
|
|
|
32
100
|
declare namespace ToggleButtonProvider {
|
|
33
101
|
var displayName: string;
|
|
34
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* ToggleButton - A button component that maintains pressed/unpressed state
|
|
105
|
+
*
|
|
106
|
+
* Provides accessible toggle functionality with visual feedback for the current state.
|
|
107
|
+
* Perfect for features like favorites, bookmarks, switches, or any binary state controls.
|
|
108
|
+
* Includes icon support and integrates with React Aria for keyboard navigation and accessibility.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* // Basic toggle button
|
|
112
|
+
* <ToggleButton>Toggle Feature</ToggleButton>
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* // Controlled toggle button with different variants
|
|
116
|
+
* <ToggleButton variant="filled" isSelected={isEnabled} onChange={setIsEnabled}>
|
|
117
|
+
* Enable Notifications
|
|
118
|
+
* </ToggleButton>
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* // Toggle button with icon and state
|
|
122
|
+
* <ToggleButton variant="outline" isSelected={isFavorite} onChange={setIsFavorite}>
|
|
123
|
+
* <Icon><Heart /></Icon>
|
|
124
|
+
* {isFavorite ? 'Favorite' : 'Add to Favorites'}
|
|
125
|
+
* </ToggleButton>
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* // Icon-only toggle button
|
|
129
|
+
* <ToggleButton variant="icon" isSelected={isBookmarked} onChange={setIsBookmarked}>
|
|
130
|
+
* <Icon><Bookmark /></Icon>
|
|
131
|
+
* </ToggleButton>
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* // Toggle button with different colors and sizes
|
|
135
|
+
* <ToggleButton color="critical" size="small" isSelected={isEnabled}>
|
|
136
|
+
* Critical Toggle
|
|
137
|
+
* </ToggleButton>
|
|
138
|
+
*/
|
|
35
139
|
declare function ToggleButton({ ref, ...props }: ToggleButtonProps): react_jsx_runtime.JSX.Element;
|
|
36
140
|
declare namespace ToggleButton {
|
|
37
141
|
var displayName: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Button,composeRenderProps,Link,ToggleButton}from'react-aria-components';import {Icon}from'../icon/index.js';import {ButtonStyles,LinkButtonStyles,ToggleButtonStyles}from'./styles.js';const
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Button,composeRenderProps,Link,ToggleButton}from'react-aria-components';import {Icon}from'../icon/index.js';import {ButtonStyles,LinkButtonStyles,ToggleButtonStyles}from'./styles.js';const m=createContext(null);function p({children:t,...o}){return jsx(m.Provider,{value:o,children:t})}p.displayName="Button.Provider";function v({ref:t,...o}){[o,t]=useContextProps(o,t??null,m);const{children:r,className:i,color:u="info",size:n="medium",variant:l,...s}=o;return jsx(Icon.Provider,{size:n,children:jsx(Button,{...s,ref:t,className:composeRenderProps(i,a=>ButtonStyles({className:a,variant:l})),"data-color":u,"data-size":n,children:r})})}v.displayName="Button",v.Provider=p;const g=createContext(null);function x({children:t,...o}){return jsx(g.Provider,{value:o,children:t})}x.displayName="LinkButton.Provider";function T({ref:t,...o}){[o,t]=useContextProps(o,t??null,g);const{children:r,className:i,color:u="info",size:n="medium",variant:l,...s}=o;return jsx(Icon.Provider,{size:n,children:jsx(Link,{...s,ref:t,className:composeRenderProps(i,a=>LinkButtonStyles({className:a,variant:l})),"data-color":u,"data-size":n,children:r})})}T.displayName="LinkButton",T.Provider=x;const L=createContext(null);function y({children:t,...o}){return jsx(L.Provider,{value:o,children:t})}y.displayName="ToggleButton.Provider";function k({ref:t,...o}){[o,t]=useContextProps(o,t??null,L);const{children:r,className:i,color:u="info",size:n="medium",variant:l,...s}=o;return jsx(Icon.Provider,{size:n,children:jsx(ToggleButton,{...s,ref:t,className:composeRenderProps(i,a=>ToggleButtonStyles({className:a,variant:l})),"data-color":u,"data-size":n,children:r})})}k.displayName="ToggleButton",k.Provider=y;export{v as Button,m as ButtonContext,T as LinkButton,g as LinkButtonContext,k as ToggleButton,L as ToggleButtonContext};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["P","props","jsx","ButtonContext","e","ButtonProvider","useContextProps","ref","B","className","size","rest","Icon","m","AriaButton","C","composeRenderProps","d","LinkButtonContext","LinkButtonProvider","Link","f","LinkButton","ToggleButtonContext","ToggleButtonProvider","AriaToggleButton","N"],"mappings":"ySA+BA,MAAA,CAAA,CAAAA,aAAA,CAAA,IAA0B,EAAA,SAAU,CAAA,CAAA,CAAGC,QACrC,CAAA,CAAA,CACEC,GAACC,CAAc,CAAA,CAAA,CAAA,OAASC,GAAA,CAAA,CAAA,CAAA,QAAe,CAAA,CAAA,KAAS,CAEpD,CACAC,CAAAA,aAA6B,CAAA,CAAA,WAAA,CAAA,iBAEJ,CAAA,SAAc,CAAgB,CACrD,CAACJ,GAAU,EAAIK,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMJ,CAAa,CAAAK,eAEhE,CAAA,CAAA,CAAA,CAAA,EACE,IAAA,CAAA,CAAA,CAAA,CAAA,cACAC,CACA,CAAA,CAAA,SACA,CAAA,CAAAC,MAAO,CAAA,CAAA,CAAA,IACP,CAAA,CAAA,CAAA,QACGC,CACL,OAEA,CAAA,CAAA,CAAA,GACGC,CAAAA,CAAK,UAASR,GAAA,CAAAS,IAAA,CAAA,Q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GP,MAAA,CAAA,CAAAtB,aAAA,CAAA,IACE,EAAA,SACA,CAAA,CAAA,CAAGC,QAEH,CAAA,CAAA,CACEC,GAACqB,CAAoB,CAAA,CAAA,CAAA,OAASnB,GAAA,CAAA,CAAA,CAAA,QAC3B,CAAA,CAAA,KACH,CAEJ,CACAoB,CAAAA,aAAmC,CAAA,CAAA,WAAA,CAAA,iCAEU,CAAsB,CACjE,CAACvB,GAAU,CAAA,CAAIK,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMgB,CAAmB,CAAAf,eAEtE,CAAA,CAAA,CAAA,CAAA,EACE,IAAA,CAAA,CAAA,CAAA,CAAA,KACA,CAAA,QAAAC,CACA,WACA,CAAA,CAAAC,MAAO,CAAA,CAAA,CAAA,IACP,CAAA,CAAA,CAAA,QACGC,CACL,aAGGC,CAAAA,CAAK,UAASR,GAAA,CAAAS,IAAA,CAAA,QACb,CAAA,CAAA,IAACY,CAAAA,CAAA,CACE,QACD,CAAKlB,IACLmB,YAAA,CAAA,CAAA,GAAA,CAAA,CAAA,GAAWV,CAAmBP,EAAYA,SAEtC,CAAAQ,kBAAA,CAAA,CAAA,CAAA,CAAA,oBACA,CAAA,CAAA,iBAGJ,CAAA,CACA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAWP,EAEV,WACH,EACF,CAEJ,QACa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,cACHc,CAAAA,CAAAA,CAAAA,QAAAA,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 type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n Button as AriaButton,\n ToggleButton as AriaToggleButton,\n type ContextValue,\n Link,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { ButtonStyles, LinkButtonStyles, ToggleButtonStyles } from './styles';\nimport type { ButtonProps, LinkButtonProps, ToggleButtonProps } from './types';\n\nexport const ButtonContext =\n createContext<ContextValue<ButtonProps, HTMLButtonElement>>(null);\n\nfunction ButtonProvider({ children, ...props }: ProviderProps<ButtonProps>) {\n return (\n <ButtonContext.Provider value={props}>{children}</ButtonContext.Provider>\n );\n}\nButtonProvider.displayName = 'Button.Provider';\n\nexport function Button({ ref, ...props }: ButtonProps) {\n [props, ref] = useContextProps(props, ref ?? null, ButtonContext);\n\n const {\n children,\n className,\n color,\n size = 'medium',\n variant,\n ...rest\n } = props;\n\n return (\n <Icon.Provider size={size}>\n <AriaButton\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n ButtonStyles({\n className,\n color,\n variant,\n }),\n )}\n data-size={size}\n >\n {children}\n </AriaButton>\n </Icon.Provider>\n );\n}\nButton.displayName = 'Button';\nButton.Provider = ButtonProvider;\n\nexport const LinkButtonContext =\n createContext<ContextValue<LinkButtonProps, HTMLAnchorElement>>(null);\n\nfunction LinkButtonProvider({\n children,\n ...props\n}: ProviderProps<LinkButtonProps>) {\n return (\n <LinkButtonContext.Provider value={props}>\n {children}\n </LinkButtonContext.Provider>\n );\n}\nLinkButtonProvider.displayName = 'LinkButton.Provider';\n\nexport function LinkButton({ ref, ...props }: LinkButtonProps) {\n [props, ref] = useContextProps(props, ref ?? null, LinkButtonContext);\n\n const {\n children,\n className,\n color,\n size = 'medium',\n variant,\n ...rest\n } = props;\n\n return (\n <Icon.Provider size={size}>\n <Link\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n LinkButtonStyles({\n className,\n color,\n variant,\n }),\n )}\n data-size={size}\n >\n {children}\n </Link>\n </Icon.Provider>\n );\n}\nLinkButton.displayName = 'LinkButton';\nLinkButton.Provider = LinkButtonProvider;\n\nexport const ToggleButtonContext =\n createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>(null);\n\nfunction ToggleButtonProvider({\n children,\n ...props\n}: ProviderProps<ToggleButtonProps>) {\n return (\n <ToggleButtonContext.Provider value={props}>\n {children}\n </ToggleButtonContext.Provider>\n );\n}\nToggleButtonProvider.displayName = 'ToggleButton.Provider';\n\nexport function ToggleButton({ ref, ...props }: ToggleButtonProps) {\n [props, ref] = useContextProps(props, ref ?? null, ToggleButtonContext);\n\n const {\n children,\n className,\n color,\n size = 'medium',\n variant,\n ...rest\n } = props;\n\n return (\n <Icon.Provider size={size}>\n <AriaToggleButton\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n ToggleButtonStyles({\n className,\n color,\n variant,\n }),\n )}\n data-size={size}\n >\n {children}\n </AriaToggleButton>\n </Icon.Provider>\n );\n}\nToggleButton.displayName = 'ToggleButton';\nToggleButton.Provider = ToggleButtonProvider;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["d","props","jsx","ButtonContext","e","ButtonProvider","useContextProps","ref","size","rest","Icon","c","AriaButton","f","composeRenderProps","className","P","color","LinkButtonProvider","LinkButtonContext","B","Link","N","LinkButton","ToggleButtonContext","ToggleButtonProvider","AriaToggleButton","C"],"mappings":"ySA+BA,MAAA,CAAA,CAAAA,aAAA,CAAA,IAA0B,EAAA,SAAU,CAAA,CAAA,CAAGC,QACrC,CAAA,CAAA,CACEC,GAACC,CAAc,CAAA,CAAA,CAAA,OAASC,GAAA,CAAA,CAAA,CAAA,QAAe,CAAA,CAAA,KAAS,CAEpD,CACAC,CAAAA,aAA6B,CAAA,CAAA,WAAA,CAAA,iBAoCJ,CAAA,SAAc,CAAgB,CACrD,CAAC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AA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,cACHiB,CAAAA,CAAAA,CAAAA,QAAAA,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 type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n Button as AriaButton,\n ToggleButton as AriaToggleButton,\n type ContextValue,\n Link,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { ButtonStyles, LinkButtonStyles, ToggleButtonStyles } from './styles';\nimport type { ButtonProps, LinkButtonProps, ToggleButtonProps } from './types';\n\nexport const ButtonContext =\n createContext<ContextValue<ButtonProps, HTMLButtonElement>>(null);\n\nfunction ButtonProvider({ children, ...props }: ProviderProps<ButtonProps>) {\n return (\n <ButtonContext.Provider value={props}>{children}</ButtonContext.Provider>\n );\n}\nButtonProvider.displayName = 'Button.Provider';\n\n/**\n * Button - A versatile interactive button component with multiple variants\n *\n * Provides accessible button functionality with support for different visual styles,\n * sizes, and interactive states. Includes icon support and integrates with React Aria\n * for keyboard navigation and accessibility features.\n *\n * @example\n * // Basic button\n * <Button>Click me</Button>\n *\n * @example\n * // Primary button with different sizes\n * <Button variant=\"filled\" size=\"large\">Large Filled</Button>\n * <Button variant=\"outline\" size=\"small\">Small Outline</Button>\n *\n * @example\n * // Button with icon\n * <Button variant=\"flat\">\n * <Icon><Plus /></Icon>\n * Add Item\n * </Button>\n *\n * @example\n * // Icon-only button\n * <Button variant=\"icon\">\n * <Icon><Settings /></Icon>\n * </Button>\n *\n * @example\n * // Button with different colors\n * <Button color=\"critical\">Critical Button</Button>\n * <Button color=\"serious\">Delete</Button>\n */\nexport function Button({ ref, ...props }: ButtonProps) {\n [props, ref] = useContextProps(props, ref ?? null, ButtonContext);\n\n const {\n children,\n className,\n color = 'info',\n size = 'medium',\n variant,\n ...rest\n } = props;\n\n return (\n <Icon.Provider size={size}>\n <AriaButton\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n ButtonStyles({\n className,\n variant,\n }),\n )}\n data-color={color}\n data-size={size}\n >\n {children}\n </AriaButton>\n </Icon.Provider>\n );\n}\nButton.displayName = 'Button';\nButton.Provider = ButtonProvider;\n\nexport const LinkButtonContext =\n createContext<ContextValue<LinkButtonProps, HTMLAnchorElement>>(null);\n\nfunction LinkButtonProvider({\n children,\n ...props\n}: ProviderProps<LinkButtonProps>) {\n return (\n <LinkButtonContext.Provider value={props}>\n {children}\n </LinkButtonContext.Provider>\n );\n}\nLinkButtonProvider.displayName = 'LinkButton.Provider';\n\n/**\n * LinkButton - A button component that renders as a link element\n *\n * Provides accessible link functionality with button-like styling and visual feedback.\n * Perfect for navigation actions that should look like buttons but behave as links.\n * Includes icon support and integrates with React Aria for keyboard navigation and accessibility.\n *\n * @example\n * // Basic link button\n * <LinkButton href=\"/dashboard\">Go to Dashboard</LinkButton>\n *\n * @example\n * // Link button with different variants and sizes\n * <LinkButton variant=\"filled\" size=\"large\" href=\"/create\">Create New</LinkButton>\n * <LinkButton variant=\"outline\" size=\"small\" href=\"/settings\">Settings</LinkButton>\n *\n * @example\n * // Link button with icon\n * <LinkButton variant=\"flat\" href=\"/profile\">\n * <Icon><User /></Icon>\n * View Profile\n * </LinkButton>\n *\n * @example\n * // Icon-only link button\n * <LinkButton variant=\"icon\" href=\"/help\">\n * <Icon><HelpCircle /></Icon>\n * </LinkButton>\n *\n * @example\n * // Link button with different colors\n * <LinkButton color=\"critical\" href=\"/delete\">Delete Account</LinkButton>\n * <LinkButton color=\"serious\" href=\"/reset\">Reset Data</LinkButton>\n */\nexport function LinkButton({ ref, ...props }: LinkButtonProps) {\n [props, ref] = useContextProps(props, ref ?? null, LinkButtonContext);\n\n const {\n children,\n className,\n color = 'info',\n size = 'medium',\n variant,\n ...rest\n } = props;\n\n return (\n <Icon.Provider size={size}>\n <Link\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n LinkButtonStyles({\n className,\n variant,\n }),\n )}\n data-color={color}\n data-size={size}\n >\n {children}\n </Link>\n </Icon.Provider>\n );\n}\nLinkButton.displayName = 'LinkButton';\nLinkButton.Provider = LinkButtonProvider;\n\nexport const ToggleButtonContext =\n createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>(null);\n\nfunction ToggleButtonProvider({\n children,\n ...props\n}: ProviderProps<ToggleButtonProps>) {\n return (\n <ToggleButtonContext.Provider value={props}>\n {children}\n </ToggleButtonContext.Provider>\n );\n}\nToggleButtonProvider.displayName = 'ToggleButton.Provider';\n\n/**\n * ToggleButton - A button component that maintains pressed/unpressed state\n *\n * Provides accessible toggle functionality with visual feedback for the current state.\n * Perfect for features like favorites, bookmarks, switches, or any binary state controls.\n * Includes icon support and integrates with React Aria for keyboard navigation and accessibility.\n *\n * @example\n * // Basic toggle button\n * <ToggleButton>Toggle Feature</ToggleButton>\n *\n * @example\n * // Controlled toggle button with different variants\n * <ToggleButton variant=\"filled\" isSelected={isEnabled} onChange={setIsEnabled}>\n * Enable Notifications\n * </ToggleButton>\n *\n * @example\n * // Toggle button with icon and state\n * <ToggleButton variant=\"outline\" isSelected={isFavorite} onChange={setIsFavorite}>\n * <Icon><Heart /></Icon>\n * {isFavorite ? 'Favorite' : 'Add to Favorites'}\n * </ToggleButton>\n *\n * @example\n * // Icon-only toggle button\n * <ToggleButton variant=\"icon\" isSelected={isBookmarked} onChange={setIsBookmarked}>\n * <Icon><Bookmark /></Icon>\n * </ToggleButton>\n *\n * @example\n * // Toggle button with different colors and sizes\n * <ToggleButton color=\"critical\" size=\"small\" isSelected={isEnabled}>\n * Critical Toggle\n * </ToggleButton>\n */\nexport function ToggleButton({ ref, ...props }: ToggleButtonProps) {\n [props, ref] = useContextProps(props, ref ?? null, ToggleButtonContext);\n\n const {\n children,\n className,\n color = 'info',\n size = 'medium',\n variant,\n ...rest\n } = props;\n\n return (\n <Icon.Provider size={size}>\n <AriaToggleButton\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n ToggleButtonStyles({\n className,\n variant,\n }),\n )}\n data-color={color}\n data-size={size}\n >\n {children}\n </AriaToggleButton>\n </Icon.Provider>\n );\n}\nToggleButton.displayName = 'ToggleButton';\nToggleButton.Provider = ToggleButtonProvider;\n"]}
|