@accelint/design-toolkit 5.1.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.
- package/catalog-info.yaml +44 -0
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.d.ts +3 -3
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/action-bar/index.d.ts +11 -0
- package/dist/components/action-bar/index.js.map +1 -1
- package/dist/components/breadcrumbs/index.d.ts +27 -0
- package/dist/components/breadcrumbs/index.js +4 -0
- package/dist/components/breadcrumbs/index.js.map +1 -0
- package/dist/components/breadcrumbs/styles.d.ts +48 -0
- package/dist/components/breadcrumbs/styles.js +2 -0
- package/dist/components/breadcrumbs/styles.js.map +1 -0
- package/dist/components/breadcrumbs/types.d.ts +20 -0
- package/dist/components/breadcrumbs/types.js +2 -0
- package/dist/components/breadcrumbs/types.js.map +1 -0
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +15 -15
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +7 -5
- package/dist/components/clock/index.d.ts +39 -0
- package/dist/components/clock/index.js +4 -0
- package/dist/components/clock/index.js.map +1 -0
- package/dist/components/clock/types.d.ts +7 -0
- package/dist/components/clock/types.js +2 -0
- package/dist/components/clock/types.js.map +1 -0
- package/dist/components/color-picker/styles.d.ts +3 -3
- package/dist/components/combobox-field/index.d.ts +11 -0
- package/dist/components/combobox-field/index.js.map +1 -1
- package/dist/components/combobox-field/styles.js +1 -1
- package/dist/components/combobox-field/styles.js.map +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/divider/index.d.ts +32 -0
- package/dist/components/divider/index.js +4 -0
- package/dist/components/divider/index.js.map +1 -0
- package/dist/components/divider/styles.d.ts +5 -0
- package/dist/components/divider/styles.js +2 -0
- package/dist/components/divider/styles.js.map +1 -0
- package/dist/components/divider/types.d.ts +11 -0
- package/dist/components/divider/types.js +2 -0
- package/dist/components/divider/types.js.map +1 -0
- package/dist/components/drawer/index.d.ts +48 -3
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/styles.js +1 -1
- package/dist/components/drawer/styles.js.map +1 -1
- package/dist/components/drawer/types.d.ts +13 -7
- package/dist/components/input/styles.js +1 -1
- package/dist/components/input/styles.js.map +1 -1
- package/dist/components/lines/index.d.ts +9 -0
- package/dist/components/lines/index.js.map +1 -1
- package/dist/components/link/index.d.ts +9 -0
- package/dist/components/link/index.js.map +1 -1
- package/dist/components/link/styles.js +1 -1
- package/dist/components/link/styles.js.map +1 -1
- package/dist/components/menu/styles.js +1 -1
- package/dist/components/menu/styles.js.map +1 -1
- package/dist/components/notice/events.d.ts +10 -0
- package/dist/components/notice/events.js +2 -0
- package/dist/components/notice/events.js.map +1 -0
- package/dist/components/notice/index.d.ts +20 -0
- package/dist/components/notice/index.js +4 -0
- package/dist/components/notice/index.js.map +1 -0
- package/dist/components/notice/styles.d.ts +60 -0
- package/dist/components/notice/styles.js +2 -0
- package/dist/components/notice/styles.js.map +1 -0
- package/dist/components/notice/types.d.ts +75 -0
- package/dist/components/notice/types.js +2 -0
- package/dist/components/notice/types.js.map +1 -0
- package/dist/components/query-builder/index.js +1 -1
- package/dist/components/query-builder/index.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/select-field/types.d.ts +0 -1
- package/dist/components/sidenav/index.d.ts +57 -6
- package/dist/components/sidenav/index.js +1 -1
- package/dist/components/sidenav/index.js.map +1 -1
- package/dist/components/sidenav/styles.js +1 -1
- package/dist/components/sidenav/styles.js.map +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/styles.js +1 -1
- package/dist/components/slider/styles.js.map +1 -1
- package/dist/components/table/context.d.ts +11 -0
- package/dist/components/table/context.js +2 -0
- package/dist/components/table/context.js.map +1 -0
- package/dist/components/table/index.d.ts +36 -0
- package/dist/components/table/index.js +4 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/styles.d.ts +134 -0
- package/dist/components/table/styles.js +2 -0
- package/dist/components/table/styles.js.map +1 -0
- package/dist/components/table/table-body.d.ts +12 -0
- package/dist/components/table/table-body.js +2 -0
- package/dist/components/table/table-body.js.map +1 -0
- package/dist/components/table/table-cell.d.ts +12 -0
- package/dist/components/table/table-cell.js +2 -0
- package/dist/components/table/table-cell.js.map +1 -0
- package/dist/components/table/table-header-cell.d.ts +12 -0
- package/dist/components/table/table-header-cell.js +2 -0
- package/dist/components/table/table-header-cell.js.map +1 -0
- package/dist/components/table/table-header.d.ts +12 -0
- package/dist/components/table/table-header.js +2 -0
- package/dist/components/table/table-header.js.map +1 -0
- package/dist/components/table/table-row.d.ts +12 -0
- package/dist/components/table/table-row.js +2 -0
- package/dist/components/table/table-row.js.map +1 -0
- package/dist/components/table/types.d.ts +185 -0
- package/dist/components/table/types.js +2 -0
- package/dist/components/table/types.js.map +1 -0
- package/dist/components/tabs/styles.js +1 -1
- package/dist/components/tabs/styles.js.map +1 -1
- package/dist/components/time-field/index.d.ts +19 -0
- package/dist/components/time-field/index.js +4 -0
- package/dist/components/time-field/index.js.map +1 -0
- package/dist/components/time-field/styles.d.ts +69 -0
- package/dist/components/time-field/styles.js +2 -0
- package/dist/components/time-field/styles.js.map +1 -0
- package/dist/components/time-field/types.d.ts +23 -0
- package/dist/components/time-field/types.js +2 -0
- package/dist/components/time-field/types.js.map +1 -0
- package/dist/components/tooltip/index.d.ts +23 -34
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/types.d.ts +5 -6
- package/dist/components/tree/index.d.ts +22 -1
- package/dist/components/tree/index.js +1 -1
- package/dist/components/tree/index.js.map +1 -1
- package/dist/components/tree/styles.js +1 -1
- package/dist/components/tree/styles.js.map +1 -1
- package/dist/components/view-stack/index.d.ts +42 -2
- package/dist/components/view-stack/index.js +1 -1
- package/dist/components/view-stack/index.js.map +1 -1
- package/dist/foundation/token-data.js +1 -1
- package/dist/foundation/token-data.js.map +1 -1
- package/dist/index.css +5 -3
- package/dist/index.d.ts +32 -6
- package/dist/index.js +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/providers/portal.d.ts +9 -0
- package/dist/providers/portal.js +2 -0
- package/dist/providers/portal.js.map +1 -0
- package/dist/providers/theme-provider.d.ts +6 -6
- package/dist/providers/theme-provider.js +1 -1
- package/dist/providers/theme-provider.js.map +1 -1
- package/dist/styles.css +3355 -974
- package/dist/tokens/themes.css +56 -24
- package/dist/tokens/tokens.css +8 -8
- package/dist/tokens/tokens.d.ts +18 -0
- package/dist/tokens/tokens.js +1 -1
- package/dist/tokens/tokens.js.map +1 -1
- package/dist/tokens/types.d.ts +9 -0
- package/dist/variants/variants.css +3 -0
- package/package.json +39 -17
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
apiVersion: backstage.io/v1alpha1
|
|
3
|
+
kind: Component
|
|
4
|
+
metadata:
|
|
5
|
+
name: "@accelint/design-toolkit"
|
|
6
|
+
title: Design Toolkit
|
|
7
|
+
description: >-
|
|
8
|
+
An open-source component library to serve as part of the entire ecosystem of
|
|
9
|
+
UX for Accelint.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Dependencies:
|
|
13
|
+
|
|
14
|
+
@accelint/biome-config@1.0.0, @accelint/bus@1.2.0,
|
|
15
|
+
@accelint/constellation-tracker@0.0.0, @accelint/core@0.4.0,
|
|
16
|
+
@accelint/icons@2.0.3, @accelint/temporal@0.1.0,
|
|
17
|
+
@accelint/typescript-config@0.1.2, @accelint/vitest-config@0.1.3
|
|
18
|
+
annotations:
|
|
19
|
+
backstage.io/edit-url: https://github.com/gohypergiant/standard-toolkit/design-toolkit/blob/main/design-toolkit/components/catalog-info.yaml
|
|
20
|
+
backstage.io/techdocs-ref: dir:.
|
|
21
|
+
package/version: 5.0.0
|
|
22
|
+
github.com/project-slug: gohypergiant/standard-toolkit/design-toolkit
|
|
23
|
+
links:
|
|
24
|
+
- url: https://github.com/gohypergiant/standard-toolkit/design-toolkit/tree/main/design-toolkit/components
|
|
25
|
+
title: Documentation
|
|
26
|
+
icon: docs
|
|
27
|
+
type: documentation
|
|
28
|
+
tags:
|
|
29
|
+
- design-tk
|
|
30
|
+
- ui
|
|
31
|
+
- tooling
|
|
32
|
+
spec:
|
|
33
|
+
type: library
|
|
34
|
+
lifecycle: production
|
|
35
|
+
owner: group:default/pathfinder
|
|
36
|
+
dependsOn:
|
|
37
|
+
- component:@accelint/biome-config
|
|
38
|
+
- component:@accelint/bus
|
|
39
|
+
- component:@accelint/constellation-tracker
|
|
40
|
+
- component:@accelint/core
|
|
41
|
+
- component:@accelint/icons
|
|
42
|
+
- component:@accelint/temporal
|
|
43
|
+
- component:@accelint/typescript-config
|
|
44
|
+
- component:@accelint/vitest-config
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {Kebab,ChevronDown}from'@accelint/icons';import {createContext,useContext}from'react';import {useContextProps,Disclosure,composeRenderProps,DisclosureGroup,Provider,Header,Heading,DisclosurePanel}from'react-aria-components';import {isSlottedContextValue}from'./../../lib/utils.js';import {ButtonContext,Button}from'../button/index.js';import {IconContext,Icon}from'../icon/index.js';import {AccordionStyles,AccordionStylesDefaults}from'./styles.js';const {group:
|
|
3
|
+
import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {Kebab,ChevronDown}from'@accelint/icons';import {createContext,useContext}from'react';import {useContextProps,Disclosure,composeRenderProps,DisclosureGroup,Provider,Header,Heading,DisclosurePanel}from'react-aria-components';import {isSlottedContextValue}from'./../../lib/utils.js';import {ButtonContext,Button}from'../button/index.js';import {IconContext,Icon}from'../icon/index.js';import {AccordionStyles,AccordionStylesDefaults}from'./styles.js';const {group:w,accordion:E,header:K,heading:L,trigger:M,panel:R}=AccordionStyles(),a=createContext(null);function v({ref:i,children:n,className:c,variant:o=AccordionStylesDefaults.variant,isDisabled:e,...t}){return jsx(a.Provider,{value:{variant:o,isDisabled:e},children:jsx(DisclosureGroup,{...t,ref:i,className:composeRenderProps(c,u=>w({className:u,variant:o})),children:n})})}v.displayName="Accordion.Group";function f({ref:i,children:n,className:c}){const o=useContext(a),e=(isSlottedContextValue(o)?void 0:o?.variant)??AccordionStylesDefaults.variant,t=(isSlottedContextValue(o)?void 0:o?.isDisabled)??false;return jsx(Provider,{values:[[IconContext,{size:e==="compact"?"small":"large"}],[ButtonContext,{children:jsx(Icon,{children:jsx(Kebab,{})}),variant:"icon",isDisabled:t}]],children:jsx(Header,{ref:i,className:K({className:c,variant:e}),children:n})})}f.displayName="Accordion.Header";function g({ref:i,children:n,classNames:c}){const o=useContext(a),e=(isSlottedContextValue(o)?void 0:o?.variant)??AccordionStylesDefaults.variant;return jsx(Heading,{ref:i,className:L({className:c?.heading,variant:e}),children:jsx(Button,{slot:"trigger",className:composeRenderProps(c?.trigger,t=>M({className:t,variant:e})),variant:"flat",children:jsxs(IconContext.Provider,{value:{size:e==="compact"?"small":"medium"},children:[jsx(Icon,{children:jsx(ChevronDown,{className:"transform group-expanded/accordion:rotate-180"})}),n]})})})}g.displayName="Accordion.Trigger";function x({ref:i,children:n,className:c,...o}){return jsx(DisclosurePanel,{...o,ref:i,className:composeRenderProps(c,e=>R({className:e})),children:n})}x.displayName="Accordion.Panel";function s({ref:i,...n}){[n,i]=useContextProps(n,i??null,a);const{children:c,className:o,variant:e=AccordionStylesDefaults.variant,isDisabled:t,...u}=n;return jsx(a.Provider,{value:{variant:e,isDisabled:t},children:jsx(Disclosure,{...u,className:composeRenderProps(o,C=>E({className:C})),isDisabled:t,children:c})})}s.displayName="Accordion",s.Group=v,s.Header=f,s.Trigger=g,s.Panel=x;export{s as Accordion,a as AccordionContext};//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -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,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,CA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A,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 { ChevronDown, Kebab } from '@accelint/icons';\nimport { createContext, useContext } from 'react';\nimport {\n type ContextValue,\n composeRenderProps,\n Disclosure,\n DisclosureGroup,\n DisclosurePanel,\n Header,\n Heading,\n Provider,\n useContextProps,\n} from 'react-aria-components';\nimport { isSlottedContextValue } from '@/lib/utils';\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
|
+
{"version":3,"sources":["../../../src/components/accordion/index.tsx"],"names":["AccordionContext","AccordionGroup","ref","z","y","children","variant","AccordionStylesDefaults","isDisabled","l","r","jsx","rest","group","G","d","context","useContext","isSlottedContextValue","p","I","A","ButtonContext","Icon","V","P","Header","header","className","h","Heading","classNames","Button","k","composeRenderProps","b","AccordionPanel","props","B","H","Accordion"],"mappings":"qgBAuCkC,MAAA,CAAA,KAAS,YAAS,CAAA,CAAA,CAAA,MAA0B,CAAA,CAEjEA,QACqD,CAAA,CAElE,CAAA,OAAA,CAASC,CAAAA,CAAe,KACtBC,CAAAA,CACA,CAAA,CAAAC,eAAA,EAAA,CAAA,CAAA,CAAAC,aAAAC,CAAAA,IACA,EAAA,SACA,CAAA,CAAA,CAAA,GAAAC,EAAUC,CAAAA,QAAwB,CAClC,CAAA,CAAA,SAAAC,CAAAA,CACA,CAAA,OAEA,CAAA,CAAA,CAAAC,uBAAA,CAAA,OACoB,CAAA,UAAS,CAAA,CAAA,CAAO,GAAE,CAAA,CAAA,CAAA,CAAA,OAASC,GAAA,CAAA,CAAA,CAAA,QAC3C,CAAA,CAAA,KAAA,CAAAC,QACMC,CAAAA,CACJ,CAAA,sBAEEC,CAAAA,GAAM,CACJC,eAAA,CAAA,CAAA,GAAA,CAAA,CAAA,IACA,CAAA,CAAA,SAEJ,CAAAC,kBAEC,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAAV,SAKM,CAAA,CAAA,CAAA,OAAA,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA,CAE7B,eAA2B,CAAAH,2BACzB,CAAA,CAAA,CAAA,GAAMc,CAAAA,CAAUC,CAAAA,QAEbC,CAAsBF,CAAO,CAAA,SAAgBA,CAAAA,CAAS,CAAA,CAAA,CAAA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AAAC,CAAAA,OACMC,CAAAA,CACJ,CAAA,UAAWsB,CAAmBN,CAAAA,CAAYA,CAAAA,QAEtC,CAAAlB,GAAA,CAAA6B,UAAA,CAAA,CAAA,GACD,CACH,CAAA,6BACY/B,CAAAA,CAEX,CAAA,EAAA,CAAA,CAAA,CAAA,SAKTgC,EAAU,CAAA,CAAA,CAAA,CAAA,UAAc,CAAA,CAAA,CAAA,QACxBA,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQvC,CAAAA,CAClBuC,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 { ChevronDown, Kebab } from '@accelint/icons';\nimport { createContext, useContext } from 'react';\nimport {\n type ContextValue,\n composeRenderProps,\n Disclosure,\n DisclosureGroup,\n DisclosurePanel,\n Header,\n Heading,\n Provider,\n useContextProps,\n} from 'react-aria-components';\nimport { isSlottedContextValue } from '@/lib/utils';\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 <IconContext.Provider\n value={{ size: variant === 'compact' ? 'small' : 'medium' }}\n >\n <Icon>\n <ChevronDown className='transform group-expanded/accordion:rotate-180' />\n </Icon>\n {children}\n </IconContext.Provider>\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"]}
|
|
@@ -17,7 +17,7 @@ declare const AccordionStyles: tailwind_variants.TVReturnType<{
|
|
|
17
17
|
accordion: string;
|
|
18
18
|
header: string[];
|
|
19
19
|
heading: string;
|
|
20
|
-
trigger: string
|
|
20
|
+
trigger: string;
|
|
21
21
|
panel: string;
|
|
22
22
|
}, undefined, {
|
|
23
23
|
variant: {
|
|
@@ -33,7 +33,7 @@ declare const AccordionStyles: tailwind_variants.TVReturnType<{
|
|
|
33
33
|
accordion: string;
|
|
34
34
|
header: string[];
|
|
35
35
|
heading: string;
|
|
36
|
-
trigger: string
|
|
36
|
+
trigger: string;
|
|
37
37
|
panel: string;
|
|
38
38
|
}, tailwind_variants.TVReturnType<{
|
|
39
39
|
variant: {
|
|
@@ -49,7 +49,7 @@ declare const AccordionStyles: tailwind_variants.TVReturnType<{
|
|
|
49
49
|
accordion: string;
|
|
50
50
|
header: string[];
|
|
51
51
|
heading: string;
|
|
52
|
-
trigger: string
|
|
52
|
+
trigger: string;
|
|
53
53
|
panel: string;
|
|
54
54
|
}, undefined, unknown, unknown>>;
|
|
55
55
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'./../../lib/utils.js';const
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const r={variant:"cozy"},i=tv({slots:{group:"group/accordion-group flex w-full flex-col",accordion:"group/accordion flex w-full flex-col bg-transparent",header:["fg-primary-bold flex w-full items-center gap-s rounded-medium px-s py-xs outline-none","group-enabled/accordion:focus-visible-within:bg-interactive-muted-hover group-enabled/accordion:hover:bg-interactive-muted-hover","group-enabled/accordion:pressed:bg-interactive-muted-pressed","group-disabled/accordion:fg-disabled group-disabled/accordion:cursor-not-allowed"],heading:"grow",trigger:"w-full cursor-pointer justify-start size-medium:px-0",panel:"p-s"},variants:{variant:{cozy:{trigger:"size-medium:gap-s size-medium:text-header-m"},compact:{trigger:"size-medium:gap-xs size-medium:text-header-s"}}},defaultVariants:r});export{i as AccordionStyles,r 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,uFACA,CAAA,kIACA,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,uFACA,CAAA,kIACA,CAAA,8DACA,CAAA,kFAEO,CAAA,CAAA,OACT,CAAA,qEACO,CAAA,KAET,CAAA,KAAA,CAAU,CACR,QAAS,CACP,CAAA,aACW,CAAA,CAAA,OAAA,CAAA,6CAEF,CACP,CAAA,OAAS,CAAA,CAAA,OAAA,CAAA,8CAIf,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-primary-bold flex w-full items-center gap-s rounded-medium px-s py-xs outline-none',\n 'group-enabled/accordion:focus-visible-within:bg-interactive-muted-hover group-enabled/accordion:hover:bg-interactive-muted-hover',\n 'group-enabled/accordion:pressed:bg-interactive-muted-pressed',\n 'group-disabled/accordion:fg-disabled group-disabled/accordion:cursor-not-allowed',\n ],\n heading: 'grow',\n trigger: 'w-full cursor-pointer justify-start size-medium:px-0',\n panel: 'p-s',\n },\n variants: {\n variant: {\n cozy: {\n trigger: 'size-medium:gap-s size-medium:text-header-m',\n },\n compact: {\n trigger: 'size-medium:gap-xs size-medium:text-header-s',\n },\n },\n },\n defaultVariants: AccordionStylesDefaults,\n});\n"]}
|
|
@@ -2,6 +2,17 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
|
2
2
|
import { ActionBarProps } from './types.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* ActionBar - Container for icon action buttons
|
|
7
|
+
*
|
|
8
|
+
* A container component that displays a collection of action buttons (typically icon-only)
|
|
9
|
+
* and provides consistent spacing and alignment for toolbar-style actions.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <ActionBar>
|
|
13
|
+
* <Button><Icon><Copy/></Icon></Button>
|
|
14
|
+
* </ActionBar>
|
|
15
|
+
*/
|
|
5
16
|
declare function ActionBar({ className, ...rest }: ActionBarProps): react_jsx_runtime.JSX.Element;
|
|
6
17
|
declare namespace ActionBar {
|
|
7
18
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/action-bar/index.tsx"],"names":["className","jsx","ButtonContext","i","n","a","rest","o","e"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/action-bar/index.tsx"],"names":["className","jsx","ButtonContext","i","n","a","rest","o","e"],"mappings":"kNA8B4B,SAAAA,CAAW,CAAA,CAAA,SACrC,CAAA,CAAA,CACEC,IAAC,CACC,CAAA,CAAA,OACGC,GAAAA,CAAeC,QAAE,CAAA,CAAA,MAAS,CAAA,CAAA,CAAAC,aAAA,CAAA,CAAO,OACV,CAAA,MAAA,CAAS,CAAA,CAAA,CAAAC,mBAAA,CAAA,CAAO,OAG1C,CAAA,MAAAJ,CAAC,CAAA,CAAA,CAAA,QAAQK,CAAMC,GAAA,CAAA,KAAA,CAAA,CAAA,GAA2B,CAAE,CAAA,SAAAP,CAAUQ,eAAC,CAAA,CAAG,SAItD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,WAAA","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 { Provider } from 'react-aria-components';\nimport { ButtonContext, ToggleButtonContext } from '../button';\nimport { ActionBarStyles } from './styles';\nimport type { ActionBarProps } from './types';\n\n/**\n * ActionBar - Container for icon action buttons\n *\n * A container component that displays a collection of action buttons (typically icon-only)\n * and provides consistent spacing and alignment for toolbar-style actions.\n *\n * @example\n * <ActionBar>\n * <Button><Icon><Copy/></Icon></Button>\n * </ActionBar>\n */\nexport function ActionBar({ className, ...rest }: ActionBarProps) {\n return (\n <Provider\n values={[\n [ButtonContext, { variant: 'icon' }],\n [ToggleButtonContext, { variant: 'icon' }],\n ]}\n >\n <nav {...rest} className={ActionBarStyles({ className })} />\n </Provider>\n );\n}\nActionBar.displayName = 'ActionBar';\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { BreadcrumbsProps, BreadcrumbProps } from 'react-aria-components';
|
|
3
|
+
import { BreadcrumbItemProps } from './types.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Breadcrumbs - Accessible breadcrumb navigation
|
|
7
|
+
*
|
|
8
|
+
* Displays the user's location within an application hierarchy and provides
|
|
9
|
+
* links back to parent pages. The final item represents the current page.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* <Breadcrumbs>
|
|
13
|
+
* <Breadcrumbs.Item linkProps={{ href: '/' }}>Home</Breadcrumbs.Item>
|
|
14
|
+
* <Breadcrumbs.Item>Current</Breadcrumbs.Item>
|
|
15
|
+
* </Breadcrumbs>
|
|
16
|
+
*/
|
|
17
|
+
declare function Breadcrumbs({ children, className, }: BreadcrumbsProps<BreadcrumbProps>): react_jsx_runtime.JSX.Element;
|
|
18
|
+
declare namespace Breadcrumbs {
|
|
19
|
+
var displayName: string;
|
|
20
|
+
var Item: typeof BreadcrumbItem;
|
|
21
|
+
}
|
|
22
|
+
declare function BreadcrumbItem({ children, classNames, linkProps, ...rest }: BreadcrumbItemProps): react_jsx_runtime.JSX.Element;
|
|
23
|
+
declare namespace BreadcrumbItem {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { Breadcrumbs };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import'client-only';import {ChevronRight}from'@accelint/icons';import {Breadcrumbs,Breadcrumb,composeRenderProps,Link}from'react-aria-components';import {containsExactChildren}from'./../../lib/react.js';import {Icon}from'../icon/index.js';import {BreadcrumbsStyles}from'./styles.js';const{list:y,item:I,link:N,separator:P}=BreadcrumbsStyles();function s({children:r,className:e}){return containsExactChildren({children:r,componentName:s.displayName,restrictions:[[c,{min:1}]]}),jsx(Breadcrumbs,{className:y({className:e}),children:r})}s.displayName="Breadcrumbs";function c({children:r,classNames:e,linkProps:a,...i}){return jsx(Breadcrumb,{...i,className:composeRenderProps(e?.item,t=>I({className:t})),children:composeRenderProps(a?null:r,t=>jsxs(Fragment,{children:[a?jsx(Link,{...a,className:composeRenderProps(e?.link,p=>N({className:p})),children:r}):t,jsx(Icon,{"aria-hidden":"true",className:P({className:e?.separator}),children:jsx(ChevronRight,{})})]}))})}c.displayName="Breadcrumbs.Item",s.Item=c;export{s as Breadcrumbs};//# sourceMappingURL=index.js.map
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/breadcrumbs/index.tsx"],"names":["separator","BreadcrumbsStyles","f","children","className","containsExactChildren","list","BreadcrumbItem","classNames","linkProps","rest","n","item","o","composeRenderProps","itemChildren","jsxs","Link","k","link","Icon","m","l","jsx","ChevronRight","u"],"mappings":"6UA4BoB,KAAM,CAAA,IAAA,CAAA,CAAA,CAAAA,IAAcC,CAAkB,EAcnD,IAAA,CAAA,CAAA,CAAA,SACL,CAAA,CAAA,CAAA,CAAAC,iBAAAC,EACA,UAAAC,CACF,CAAA,CAAsC,QACpCC,CAAAA,CAAsB,CACpB,SAAAF,CAAAA,CACA,yCAA2B,CAAA,CAAA,CAAA,2BACc,CAAC,qBAIdG,CAAK,CAAE,sBAAAF,CAAU,SAC1C,CAAA,CAAA,CAAAD,CAAAA,SAIK,CAAA,CAAA,CAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAEjBI,CAAAA,aAEP,CAAA,SAAA,CAAAC,EACA,QAAA,CAAA,CAAAC,CAAAA,UAGA,CAAA,CAAA,CAAA,SAEK,CAAGC,EACJ,GAAA,CAAA,CAAA,CAAA,CAAA,UAA0C,CAAAC,UAAA,CAAA,CAAA,GAAOP,CAC/CQ,UAAO,CAAAC,kBAAA,CAAAT,CAAU,EACnB,IAEC,CAAA,CAAA,EAAA,CAAA,CAAA,CAAAU,SAAsCX,CAAAA,CAAWY,GAChDC,CAAAA,QACG,CAAAH,kBAAA,CAAA,CAAA,CAAA,KACEI,CAAAA,CAAA,CACE,EAAAC,IAAGT,CAAAA,QACJ,UAAWK,CAAAA,CAAmBN,CAAAA,CAAAA,GAAY,UAAOJ,CAC/Ce,CAAAA,SAAO,CAAAN,kBAAA,CAAAT,CAAU,EACnB,WAECD,SAKJiB,CAAA,CACC,CAAA,CAAA,CAAA,CAAA,QAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAA,CAAAC,GAAA,CACZC,0BAAkCd,CAAAA,SAAY,CAAA,CAAU,CAAC,CAAA,SAEzD,CAAAe,GAACC,SAGN,EACH,CAEJ,QACe,CAAAH,GAAA,CAAAI,YAAA,CAAA,EAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAEjB,CAAA,kBAAOlB,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 { ChevronRight } from '@accelint/icons';\nimport {\n Breadcrumbs as AriaBreadcrumbs,\n Breadcrumb,\n type BreadcrumbProps,\n type BreadcrumbsProps,\n composeRenderProps,\n Link,\n} from 'react-aria-components';\nimport { containsExactChildren } from '@/lib/react';\nimport { Icon } from '../icon';\nimport { BreadcrumbsStyles } from './styles';\nimport type { BreadcrumbItemProps } from './types';\n\nconst { list, item, link, separator } = BreadcrumbsStyles();\n\n/**\n * Breadcrumbs - Accessible breadcrumb navigation\n *\n * Displays the user's location within an application hierarchy and provides\n * links back to parent pages. The final item represents the current page.\n *\n * @example\n * <Breadcrumbs>\n * <Breadcrumbs.Item linkProps={{ href: '/' }}>Home</Breadcrumbs.Item>\n * <Breadcrumbs.Item>Current</Breadcrumbs.Item>\n * </Breadcrumbs>\n */\nexport function Breadcrumbs({\n children,\n className,\n}: BreadcrumbsProps<BreadcrumbProps>) {\n containsExactChildren({\n children,\n componentName: Breadcrumbs.displayName,\n restrictions: [[BreadcrumbItem, { min: 1 }]],\n });\n\n return (\n <AriaBreadcrumbs className={list({ className })}>\n {children}\n </AriaBreadcrumbs>\n );\n}\nBreadcrumbs.displayName = 'Breadcrumbs';\n\nfunction BreadcrumbItem({\n children,\n classNames,\n linkProps,\n ...rest\n}: BreadcrumbItemProps) {\n return (\n <Breadcrumb\n {...rest}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className }),\n )}\n >\n {composeRenderProps(linkProps ? null : children, (itemChildren) => (\n <>\n {linkProps ? (\n <Link\n {...linkProps}\n className={composeRenderProps(classNames?.link, (className) =>\n link({ className }),\n )}\n >\n {children}\n </Link>\n ) : (\n itemChildren\n )}\n <Icon\n aria-hidden='true'\n className={separator({ className: classNames?.separator })}\n >\n <ChevronRight />\n </Icon>\n </>\n ))}\n </Breadcrumb>\n );\n}\nBreadcrumbItem.displayName = 'Breadcrumbs.Item';\n\nBreadcrumbs.Item = BreadcrumbItem;\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
declare const BreadcrumbsStyles: tailwind_variants.TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
7
|
+
link?: tailwind_merge.ClassNameValue;
|
|
8
|
+
list?: tailwind_merge.ClassNameValue;
|
|
9
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
10
|
+
item?: tailwind_merge.ClassNameValue;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
[x: string]: {
|
|
15
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
16
|
+
link?: tailwind_merge.ClassNameValue;
|
|
17
|
+
list?: tailwind_merge.ClassNameValue;
|
|
18
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
19
|
+
item?: tailwind_merge.ClassNameValue;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
} | {}, {
|
|
23
|
+
list: string;
|
|
24
|
+
item: string;
|
|
25
|
+
link: string;
|
|
26
|
+
separator: string;
|
|
27
|
+
}, undefined, {
|
|
28
|
+
[key: string]: {
|
|
29
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
30
|
+
link?: tailwind_merge.ClassNameValue;
|
|
31
|
+
list?: tailwind_merge.ClassNameValue;
|
|
32
|
+
separator?: tailwind_merge.ClassNameValue;
|
|
33
|
+
item?: tailwind_merge.ClassNameValue;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
} | {}, {
|
|
37
|
+
list: string;
|
|
38
|
+
item: string;
|
|
39
|
+
link: string;
|
|
40
|
+
separator: string;
|
|
41
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
42
|
+
list: string;
|
|
43
|
+
item: string;
|
|
44
|
+
link: string;
|
|
45
|
+
separator: string;
|
|
46
|
+
}, undefined, unknown, unknown>>;
|
|
47
|
+
|
|
48
|
+
export { BreadcrumbsStyles };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const t=tv({slots:{list:"fg-primary-muted flex items-center gap-s",item:"group/breadcrumb flex items-center gap-s",link:"current:fg-accent-primary-bold hover:fg-primary-bold",separator:"group-current/breadcrumb:hidden"}});export{t as BreadcrumbsStyles};//# sourceMappingURL=styles.js.map
|
|
2
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/breadcrumbs/styles.ts"],"names":["r"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAM,CAAA,CAAA,IAAA,CAAA,0CACA,CAAA,IAAA,CAAA,sGAEN,CAAW,SAAA,CAAA,iCAEd,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 BreadcrumbsStyles = tv({\n slots: {\n list: 'fg-primary-muted flex items-center gap-s',\n item: 'group/breadcrumb flex items-center gap-s',\n link: 'current:fg-accent-primary-bold hover:fg-primary-bold',\n separator: 'group-current/breadcrumb:hidden',\n },\n});\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BreadcrumbProps, LinkProps } from 'react-aria-components';
|
|
2
|
+
|
|
3
|
+
type BreadcrumbItemProps = Omit<BreadcrumbProps, 'children' | 'className'> & ({
|
|
4
|
+
classNames?: {
|
|
5
|
+
item?: BreadcrumbProps['className'];
|
|
6
|
+
link?: LinkProps['className'];
|
|
7
|
+
separator?: string;
|
|
8
|
+
};
|
|
9
|
+
linkProps: Omit<LinkProps, 'className'>;
|
|
10
|
+
children?: LinkProps['children'];
|
|
11
|
+
} | {
|
|
12
|
+
classNames?: {
|
|
13
|
+
item?: BreadcrumbProps['className'];
|
|
14
|
+
separator?: string;
|
|
15
|
+
};
|
|
16
|
+
linkProps?: never;
|
|
17
|
+
children?: BreadcrumbProps['children'];
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export type { BreadcrumbItemProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as react from 'react';
|
|
3
|
-
import { ContextValue } from 'react-aria-components';
|
|
4
3
|
import { ProviderProps } from '../../lib/types.js';
|
|
4
|
+
import { ContextValue } from 'react-aria-components';
|
|
5
5
|
import { ButtonProps, LinkButtonProps, ToggleButtonProps } from './types.js';
|
|
6
6
|
import 'tailwind-variants';
|
|
7
7
|
import './styles.js';
|
|
@@ -113,7 +113,7 @@ declare namespace ToggleButtonProvider {
|
|
|
113
113
|
*
|
|
114
114
|
* @example
|
|
115
115
|
* // Controlled toggle button with different variants
|
|
116
|
-
* <ToggleButton variant="
|
|
116
|
+
* <ToggleButton variant="flat" isSelected={isEnabled} onChange={setIsEnabled}>
|
|
117
117
|
* Enable Notifications
|
|
118
118
|
* </ToggleButton>
|
|
119
119
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
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
|
|
3
|
+
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 c=createContext(null);function p({children:t,...o}){return jsx(c.Provider,{value:o,children:t})}p.displayName="Button.Provider";function v({ref:t,...o}){[o,t]=useContextProps(o,t??null,c);const{children:r,className:i,color:u="mono-muted",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="mono-muted",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="mono-muted",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,c as ButtonContext,T as LinkButton,g as LinkButtonContext,k as ToggleButton,L as ToggleButtonContext};//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
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","Link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QACGC,CACL,aAGGC,CAAAA,CAAK,UAASN,GAAA,CAAAO,IAAA,CAAA,QACb,CAAA,CAAA,IAACe,CAAAA,CAAA,CACE,QACD,CAAKnB,IACLoB,YAAA,CAAA,CAAA,GAAA,CAAA,CAAA,GAAWb,CAAmBC,EAAYA,SAEtC,CAAAC,kBAAA,CAAA,CAAA,CAAA,CAAA,oBACA,CAAA,CAAA,SAEJ,CAAA,CACA,aAAYC,CAAAA,YACZ,CAAWT,EAEV,WACH,EACF,CAEJ,QACa,CAAA,CAAA,CAAA,CAAA,CAAA,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 { createContext } from 'react';\nimport {\n Button as AriaButton,\n ToggleButton as AriaToggleButton,\n type ContextValue,\n composeRenderProps,\n Link,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { ButtonStyles, LinkButtonStyles, ToggleButtonStyles } from './styles';\nimport type { ProviderProps } from '@/lib/types';\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"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["d","props","jsx","ButtonContext","e","ButtonProvider","useContextProps","ref","rest","Icon","m","AriaButton","C","composeRenderProps","className","P","color","size","LinkButtonProvider","LinkButtonContext","B","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,CA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AEV,WACH,EACF,CAEJ,QACa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,cACHQ,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 type { ProviderProps } from '@/lib/types';\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Button as AriaButton,\n ToggleButton as AriaToggleButton,\n type ContextValue,\n composeRenderProps,\n Link,\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 = 'mono-muted',\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 = 'mono-muted',\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=\"flat\" 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 = 'mono-muted',\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"]}
|
|
@@ -2,7 +2,6 @@ import * as tailwind_variants from 'tailwind-variants';
|
|
|
2
2
|
import * as tailwind_merge from 'tailwind-merge';
|
|
3
3
|
|
|
4
4
|
declare const ButtonStylesDefaults: {
|
|
5
|
-
readonly color: "info";
|
|
6
5
|
readonly variant: "filled";
|
|
7
6
|
};
|
|
8
7
|
declare const ButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
@@ -17,7 +16,7 @@ declare const ButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
17
16
|
variant: {
|
|
18
17
|
filled: string[];
|
|
19
18
|
outline: string[];
|
|
20
|
-
flat: string;
|
|
19
|
+
flat: string[];
|
|
21
20
|
icon: string[];
|
|
22
21
|
floating: string[];
|
|
23
22
|
};
|
|
@@ -25,7 +24,7 @@ declare const ButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
25
24
|
variant: {
|
|
26
25
|
filled: string[];
|
|
27
26
|
outline: string[];
|
|
28
|
-
flat: string;
|
|
27
|
+
flat: string[];
|
|
29
28
|
icon: string[];
|
|
30
29
|
floating: string[];
|
|
31
30
|
};
|
|
@@ -33,7 +32,7 @@ declare const ButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
33
32
|
variant: {
|
|
34
33
|
filled: string[];
|
|
35
34
|
outline: string[];
|
|
36
|
-
flat: string;
|
|
35
|
+
flat: string[];
|
|
37
36
|
icon: string[];
|
|
38
37
|
floating: string[];
|
|
39
38
|
};
|
|
@@ -41,7 +40,7 @@ declare const ButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
41
40
|
variant: {
|
|
42
41
|
filled: string[];
|
|
43
42
|
outline: string[];
|
|
44
|
-
flat: string;
|
|
43
|
+
flat: string[];
|
|
45
44
|
icon: string[];
|
|
46
45
|
floating: string[];
|
|
47
46
|
};
|
|
@@ -58,7 +57,7 @@ declare const LinkButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
58
57
|
variant: {
|
|
59
58
|
filled: string[];
|
|
60
59
|
outline: string[];
|
|
61
|
-
flat: string;
|
|
60
|
+
flat: string[];
|
|
62
61
|
icon: string[];
|
|
63
62
|
floating: string[];
|
|
64
63
|
};
|
|
@@ -66,7 +65,7 @@ declare const LinkButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
66
65
|
variant: {
|
|
67
66
|
filled: string[];
|
|
68
67
|
outline: string[];
|
|
69
|
-
flat: string;
|
|
68
|
+
flat: string[];
|
|
70
69
|
icon: string[];
|
|
71
70
|
floating: string[];
|
|
72
71
|
};
|
|
@@ -74,7 +73,7 @@ declare const LinkButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
74
73
|
variant: {
|
|
75
74
|
filled: string[];
|
|
76
75
|
outline: string[];
|
|
77
|
-
flat: string;
|
|
76
|
+
flat: string[];
|
|
78
77
|
icon: string[];
|
|
79
78
|
floating: string[];
|
|
80
79
|
};
|
|
@@ -82,21 +81,22 @@ declare const LinkButtonStyles: tailwind_variants.TVReturnType<{} | {
|
|
|
82
81
|
variant: {
|
|
83
82
|
filled: string[];
|
|
84
83
|
outline: string[];
|
|
85
|
-
flat: string;
|
|
84
|
+
flat: string[];
|
|
86
85
|
icon: string[];
|
|
87
86
|
floating: string[];
|
|
88
87
|
};
|
|
89
88
|
}, undefined, string[], unknown, unknown>>>;
|
|
90
89
|
declare const ToggleButtonStyles: tailwind_variants.TVReturnType<{
|
|
91
90
|
variant: {
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
flat: string[];
|
|
92
|
+
outline: string[];
|
|
93
|
+
icon: string[];
|
|
94
94
|
};
|
|
95
95
|
}, undefined, string[], {
|
|
96
96
|
variant: {
|
|
97
97
|
filled: string[];
|
|
98
98
|
outline: string[];
|
|
99
|
-
flat: string;
|
|
99
|
+
flat: string[];
|
|
100
100
|
icon: string[];
|
|
101
101
|
floating: string[];
|
|
102
102
|
};
|
|
@@ -104,7 +104,7 @@ declare const ToggleButtonStyles: tailwind_variants.TVReturnType<{
|
|
|
104
104
|
variant: {
|
|
105
105
|
filled: string[];
|
|
106
106
|
outline: string[];
|
|
107
|
-
flat: string;
|
|
107
|
+
flat: string[];
|
|
108
108
|
icon: string[];
|
|
109
109
|
floating: string[];
|
|
110
110
|
};
|
|
@@ -112,7 +112,7 @@ declare const ToggleButtonStyles: tailwind_variants.TVReturnType<{
|
|
|
112
112
|
variant: {
|
|
113
113
|
filled: string[];
|
|
114
114
|
outline: string[];
|
|
115
|
-
flat: string;
|
|
115
|
+
flat: string[];
|
|
116
116
|
icon: string[];
|
|
117
117
|
floating: string[];
|
|
118
118
|
};
|
|
@@ -120,7 +120,7 @@ declare const ToggleButtonStyles: tailwind_variants.TVReturnType<{
|
|
|
120
120
|
variant: {
|
|
121
121
|
filled: string[];
|
|
122
122
|
outline: string[];
|
|
123
|
-
flat: string;
|
|
123
|
+
flat: string[];
|
|
124
124
|
icon: string[];
|
|
125
125
|
floating: string[];
|
|
126
126
|
};
|