@accelint/design-toolkit 1.0.1 → 2.1.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/README.md +16 -7
- package/dist/components/accordion/index.d.ts +21 -30
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.d.ts +96 -0
- package/dist/components/accordion/styles.js +2 -0
- package/dist/components/accordion/styles.js.map +1 -0
- package/dist/components/accordion/types.d.ts +20 -0
- package/dist/components/avatar/index.d.ts +4 -4
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/box/index.d.ts +3 -3
- package/dist/components/box/index.js.map +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/color-picker/index.d.ts +21 -0
- package/dist/components/color-picker/index.js +2 -0
- package/dist/components/color-picker/index.js.map +1 -0
- package/dist/components/combobox/index.d.ts +7 -16
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/combobox/index.js.map +1 -1
- package/dist/components/date-field/index.d.ts +28 -0
- package/dist/components/date-field/index.js +2 -0
- package/dist/components/date-field/index.js.map +1 -0
- package/dist/components/dialog/index.d.ts +40 -0
- package/dist/components/dialog/index.js +2 -0
- package/dist/components/dialog/index.js.map +1 -0
- package/dist/components/floating-button/index.js.map +1 -1
- package/dist/components/icon/index.d.ts +15 -15
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/styles.d.ts +34 -0
- package/dist/components/icon/styles.js +2 -0
- package/dist/components/icon/styles.js.map +1 -0
- package/dist/components/icon/types.d.ts +10 -0
- package/dist/components/icon/types.js +2 -0
- package/dist/components/icon/types.js.map +1 -0
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button/index.js.map +1 -1
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/options/index.d.ts +32 -0
- package/dist/components/options/index.js +2 -0
- package/dist/components/options/index.js.map +1 -0
- package/dist/components/options-item/index.d.ts +30 -0
- package/dist/components/options-item/index.js +2 -0
- package/dist/components/options-item/index.js.map +1 -0
- package/dist/components/query-builder/action-element.d.ts +6 -0
- package/dist/components/query-builder/action-element.js +2 -0
- package/dist/components/query-builder/action-element.js.map +1 -0
- package/dist/components/query-builder/constants.d.ts +3 -0
- package/dist/components/query-builder/constants.js +2 -0
- package/dist/components/query-builder/constants.js.map +1 -0
- package/dist/components/query-builder/example-configuration.d.ts +30 -0
- package/dist/components/query-builder/example-configuration.js +2 -0
- package/dist/components/query-builder/example-configuration.js.map +1 -0
- package/dist/components/query-builder/group.d.ts +8 -0
- package/dist/components/query-builder/group.js +2 -0
- package/dist/components/query-builder/group.js.map +1 -0
- package/dist/components/query-builder/index.d.ts +44 -0
- package/dist/components/query-builder/index.js +2 -0
- package/dist/components/query-builder/index.js.map +1 -0
- package/dist/components/query-builder/rule.d.ts +6 -0
- package/dist/components/query-builder/rule.js +2 -0
- package/dist/components/query-builder/rule.js.map +1 -0
- package/dist/components/query-builder/utils.d.ts +14 -0
- package/dist/components/query-builder/utils.js +2 -0
- package/dist/components/query-builder/utils.js.map +1 -0
- package/dist/components/query-builder/value-editor.d.ts +6 -0
- package/dist/components/query-builder/value-editor.js +2 -0
- package/dist/components/query-builder/value-editor.js.map +1 -0
- package/dist/components/query-builder/value-selector.d.ts +6 -0
- package/dist/components/query-builder/value-selector.js +2 -0
- package/dist/components/query-builder/value-selector.js.map +1 -0
- package/dist/components/radio/index.d.ts +2 -2
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +19 -0
- package/dist/components/search-field/index.js +2 -0
- package/dist/components/search-field/index.js.map +1 -0
- package/dist/components/slider/index.d.ts +23 -0
- package/dist/components/slider/index.js +2 -0
- package/dist/components/slider/index.js.map +1 -0
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +33 -0
- package/dist/components/tabs/index.js +2 -0
- package/dist/components/tabs/index.js.map +1 -0
- package/dist/components/text-area/index.js +1 -1
- package/dist/components/text-area/index.js.map +1 -1
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/toggle-icon-button/index.js +1 -1
- package/dist/components/toggle-icon-button/index.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/icons/catalog.js.map +1 -1
- package/dist/index.css +60 -6
- package/dist/index.d.ts +28 -6
- package/dist/index.js +1 -1
- package/dist/lib/react.d.ts +15 -3
- package/dist/lib/react.js +4 -1
- package/dist/lib/react.js.map +1 -1
- package/dist/lib/types.d.ts +29 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +15 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +715 -129
- package/package.json +28 -9
- package/dist/types/types.d.ts +0 -11
- /package/dist/{types → components/accordion}/types.js +0 -0
- /package/dist/{types → components/accordion}/types.js.map +0 -0
package/README.md
CHANGED
@@ -44,18 +44,27 @@ Also add the following to your `settings.json` file for VSCode:
|
|
44
44
|
},
|
45
45
|
"tailwindCSS.includeLanguages": {
|
46
46
|
"javascript": "javascript",
|
47
|
-
"javascriptreact": "javascriptreact",
|
48
47
|
"typescript": "typescript",
|
49
|
-
"
|
50
|
-
"
|
48
|
+
"html": "html",
|
49
|
+
"typescriptreact": "html",
|
50
|
+
"javascriptreact": "html"
|
51
51
|
},
|
52
52
|
"tailwindCSS.experimental.classRegex": [
|
53
|
-
[
|
54
|
-
|
55
|
-
|
56
|
-
[
|
53
|
+
[
|
54
|
+
"/\\*tw\\*/ '([^']*)'"
|
55
|
+
],
|
56
|
+
[
|
57
|
+
"([\"'`][^\"'`]*.*?[\"'`])",
|
58
|
+
"[\"'`]([^\"'`]*).*?[\"'`]"
|
59
|
+
],
|
57
60
|
],
|
58
61
|
"files.associations": {
|
59
62
|
"*.css": "tailwindcss"
|
60
63
|
}
|
61
64
|
```
|
65
|
+
|
66
|
+
## In Depth Documentation
|
67
|
+
|
68
|
+
Be sure to view topic specific documentation to understand technology choices, best practices, established patterns, and enforced opinions.
|
69
|
+
|
70
|
+
- [Tailwind](./src/documentation/tailwind.md)
|
@@ -1,44 +1,35 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import * as
|
3
|
-
import
|
4
|
-
import {
|
5
|
-
import
|
2
|
+
import * as React from 'react';
|
3
|
+
import { ContextValue } from 'react-aria-components';
|
4
|
+
import { AccordionProps, AccordionGroupProps, AccordionHeaderProps, AccordionTriggerProps, AccordionPanelProps } from './types.js';
|
5
|
+
import '../../lib/types.js';
|
6
|
+
import './styles.js';
|
7
|
+
import 'tailwind-variants';
|
6
8
|
|
7
|
-
declare const
|
8
|
-
|
9
|
-
|
10
|
-
interface AccordionProps extends VariantProps<typeof accordionStyles>, DisclosureProps {
|
11
|
-
options?: boolean;
|
12
|
-
}
|
13
|
-
declare function Accordion({ children, className, isDisabled, options, variant, ...props }: AccordionProps): react_jsx_runtime.JSX.Element;
|
14
|
-
declare namespace Accordion {
|
9
|
+
declare const AccordionContext: React.Context<ContextValue<AccordionProps, HTMLDivElement>>;
|
10
|
+
declare function AccordionGroup({ ref, children, className, variant, isDisabled, ...rest }: AccordionGroupProps): react_jsx_runtime.JSX.Element;
|
11
|
+
declare namespace AccordionGroup {
|
15
12
|
var displayName: string;
|
16
|
-
var Header: typeof AccordionHeader;
|
17
|
-
var Panel: typeof AccordionPanel;
|
18
|
-
var Group: typeof AccordionGroup;
|
19
|
-
}
|
20
|
-
interface AccordionHeaderProps extends Pick<AccordionProps, 'options' | 'variant'> {
|
21
|
-
children: React.ReactNode;
|
22
|
-
className?: ButtonProps['className'];
|
23
|
-
isDisabled?: boolean;
|
24
13
|
}
|
25
|
-
declare function AccordionHeader({ children }: AccordionHeaderProps): react_jsx_runtime.JSX.Element;
|
14
|
+
declare function AccordionHeader({ ref, children, className }: AccordionHeaderProps): react_jsx_runtime.JSX.Element;
|
26
15
|
declare namespace AccordionHeader {
|
27
16
|
var displayName: string;
|
28
17
|
}
|
29
|
-
|
18
|
+
declare function AccordionTrigger({ ref, children, classNames, }: AccordionTriggerProps): react_jsx_runtime.JSX.Element;
|
19
|
+
declare namespace AccordionTrigger {
|
20
|
+
var displayName: string;
|
30
21
|
}
|
31
|
-
declare function AccordionPanel({ children, className, ...
|
22
|
+
declare function AccordionPanel({ ref, children, className, ...rest }: AccordionPanelProps): react_jsx_runtime.JSX.Element;
|
32
23
|
declare namespace AccordionPanel {
|
33
24
|
var displayName: string;
|
34
25
|
}
|
35
|
-
|
36
|
-
|
37
|
-
allowsMultipleExpanded?: boolean;
|
38
|
-
}
|
39
|
-
declare function AccordionGroup({ allowsMultipleExpanded, children, className, ...props }: AccordionGroupProps): react_jsx_runtime.JSX.Element;
|
40
|
-
declare namespace AccordionGroup {
|
26
|
+
declare function Accordion({ ref, ...props }: AccordionProps): react_jsx_runtime.JSX.Element;
|
27
|
+
declare namespace Accordion {
|
41
28
|
var displayName: string;
|
29
|
+
var Group: typeof AccordionGroup;
|
30
|
+
var Header: typeof AccordionHeader;
|
31
|
+
var Trigger: typeof AccordionTrigger;
|
32
|
+
var Panel: typeof AccordionPanel;
|
42
33
|
}
|
43
34
|
|
44
|
-
export { Accordion,
|
35
|
+
export { Accordion, AccordionContext };
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {
|
1
|
+
import {useContextProps,Disclosure,composeRenderProps,DisclosureGroup,DisclosureStateContext,Heading,Button,DisclosurePanel}from'react-aria-components';import {isSlottedContextValue}from'./../../lib/utils.js';import {ChevronDown}from'@accelint/icons';import {createContext,useContext}from'react';import {Icon}from'../icon/index.js';import {AccordionStyles,AccordionStylesDefaults}from'./styles.js';import {jsx,jsxs}from'react/jsx-runtime';var {group:I,accordion:V,header:B,heading:k,trigger:w,panel:z}=AccordionStyles(),l=createContext(null);function f({ref:r,children:e,className:n,variant:o=AccordionStylesDefaults.variant,isDisabled:i,...c}){return jsx(l.Provider,{value:{variant:o,isDisabled:i},children:jsx(DisclosureGroup,{...c,ref:r,className:composeRenderProps(n,a=>I({className:a,variant:o,isDisabled:i})),children:e})})}f.displayName="Accordion.Group";function v({ref:r,children:e,className:n}){let o=useContext(l),i=useContext(DisclosureStateContext),c=(isSlottedContextValue(o)?void 0:o?.variant)??AccordionStylesDefaults.variant,a=(isSlottedContextValue(o)?void 0:o?.isDisabled)??AccordionStylesDefaults.isDisabled,d=i?.isExpanded??AccordionStylesDefaults.isExpanded;return jsx(Icon.Provider,{size:c==="compact"?"small":"large",children:jsx("div",{ref:r,className:B({className:n,variant:c,isDisabled:a,isExpanded:d}),children:e})})}v.displayName="Accordion.Header";function x({ref:r,children:e,classNames:n}){let o=useContext(l),i=useContext(DisclosureStateContext),c=(isSlottedContextValue(o)?void 0:o?.variant)??AccordionStylesDefaults.variant,a=(isSlottedContextValue(o)?void 0:o?.isDisabled)??AccordionStylesDefaults.isDisabled,d=i?.isExpanded??AccordionStylesDefaults.isExpanded;return jsx(Heading,{ref:r,className:k({className:n?.heading,variant:c,isDisabled:a,isExpanded:d}),children:jsxs(Button,{slot:"trigger",className:composeRenderProps(n?.trigger,N=>w({className:N,variant:c,isExpanded:d})),children:[jsx(Icon,{children:jsx(ChevronDown,{className:"transform group-dtk-expanded:rotate-180"})}),e]})})}x.displayName="Accordion.Trigger";function D({ref:r,children:e,className:n,...o}){return jsx(DisclosurePanel,{...o,ref:r,className:composeRenderProps(n,i=>z({className:i})),children:e})}D.displayName="Accordion.Panel";function p({ref:r,...e}){[e,r]=useContextProps(e,r??null,l);let{children:n,className:o,variant:i=AccordionStylesDefaults.variant,isDisabled:c,...a}=e;return jsx(l.Provider,{value:{variant:i,isDisabled:c},children:jsx(Disclosure,{...a,className:composeRenderProps(o,d=>V({className:d})),isDisabled:c,children:n})})}p.displayName="Accordion";p.Group=f;p.Header=v;p.Trigger=x;p.Panel=D;export{p as Accordion,l as AccordionContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/accordion/index.tsx"],"names":["
|
1
|
+
{"version":3,"sources":["../../../src/components/accordion/index.tsx"],"names":["group","header","heading","trigger","panel","AccordionStyles","AccordionContext","createContext","h","AccordionGroup","children","variant","jsx","s","rest","H","ref","A","AccordionHeader","context","useContext","DisclosureStateContext","isSlottedContextValue","P","u","t","isDisabled","Icon","AccordionTrigger","Heading","E","jsxs","C","className","g","T","AccordionPanel","DisclosurePanel","b","Accordion","props","useContextProps","G","y","accordion"],"mappings":"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","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport {\n Button,\n type ContextValue,\n Disclosure,\n DisclosureGroup,\n DisclosurePanel,\n DisclosureStateContext,\n Heading,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\n\nimport { isSlottedContextValue } from '@/lib/utils';\nimport { ChevronDown } from '@accelint/icons';\nimport { createContext, useContext } from 'react';\nimport { Icon } from '../icon';\nimport { AccordionStyles, AccordionStylesDefaults } from './styles';\nimport type {\n AccordionGroupProps,\n AccordionHeaderProps,\n AccordionPanelProps,\n AccordionProps,\n AccordionTriggerProps,\n} from './types';\n\nconst { group, accordion, header, heading, trigger, panel } = AccordionStyles();\n\nexport const AccordionContext =\n createContext<ContextValue<AccordionProps, HTMLDivElement>>(null);\n\nfunction AccordionGroup({\n ref,\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n}: AccordionGroupProps) {\n return (\n <AccordionContext.Provider value={{ variant, isDisabled }}>\n <DisclosureGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n group({\n className,\n variant,\n isDisabled,\n }),\n )}\n >\n {children}\n </DisclosureGroup>\n </AccordionContext.Provider>\n );\n}\nAccordionGroup.displayName = 'Accordion.Group';\n\nfunction AccordionHeader({ ref, children, className }: AccordionHeaderProps) {\n const context = useContext(AccordionContext);\n const state = useContext(DisclosureStateContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n const isDisabled =\n (isSlottedContextValue(context) ? undefined : context?.isDisabled) ??\n AccordionStylesDefaults.isDisabled;\n const isExpanded = state?.isExpanded ?? AccordionStylesDefaults.isExpanded;\n\n return (\n <Icon.Provider size={variant === 'compact' ? 'small' : 'large'}>\n <div\n ref={ref}\n className={header({\n className,\n variant,\n isDisabled,\n isExpanded,\n })}\n >\n {children}\n </div>\n </Icon.Provider>\n );\n}\nAccordionHeader.displayName = 'Accordion.Header';\n\nfunction AccordionTrigger({\n ref,\n children,\n classNames,\n}: AccordionTriggerProps) {\n const context = useContext(AccordionContext);\n const state = useContext(DisclosureStateContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n AccordionStylesDefaults.variant;\n const isDisabled =\n (isSlottedContextValue(context) ? undefined : context?.isDisabled) ??\n AccordionStylesDefaults.isDisabled;\n const isExpanded = state?.isExpanded ?? AccordionStylesDefaults.isExpanded;\n\n return (\n <Heading\n ref={ref}\n className={heading({\n className: classNames?.heading,\n variant,\n isDisabled,\n isExpanded,\n })}\n >\n <Button\n slot='trigger'\n className={composeRenderProps(classNames?.trigger, (className) =>\n trigger({\n className,\n variant,\n isExpanded,\n }),\n )}\n >\n <Icon>\n <ChevronDown className='transform group-dtk-expanded:rotate-180' />\n </Icon>\n {children}\n </Button>\n </Heading>\n );\n}\nAccordionTrigger.displayName = 'Accordion.Trigger';\n\nfunction AccordionPanel({\n ref,\n children,\n className,\n ...rest\n}: AccordionPanelProps) {\n return (\n <DisclosurePanel\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n panel({ className }),\n )}\n >\n {children}\n </DisclosurePanel>\n );\n}\nAccordionPanel.displayName = 'Accordion.Panel';\n\nexport function Accordion({ ref, ...props }: AccordionProps) {\n [props, ref] = useContextProps(props, ref ?? null, AccordionContext);\n\n const {\n children,\n className,\n variant = AccordionStylesDefaults.variant,\n isDisabled,\n ...rest\n } = props;\n\n return (\n <AccordionContext.Provider\n value={{\n variant,\n isDisabled,\n }}\n >\n <Disclosure\n {...rest}\n className={composeRenderProps(className, (className) =>\n accordion({\n className,\n }),\n )}\n isDisabled={isDisabled}\n >\n {children}\n </Disclosure>\n </AccordionContext.Provider>\n );\n}\nAccordion.displayName = 'Accordion';\nAccordion.Group = AccordionGroup;\nAccordion.Header = AccordionHeader;\nAccordion.Trigger = AccordionTrigger;\nAccordion.Panel = AccordionPanel;\n"]}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
3
|
+
|
4
|
+
declare const AccordionStylesDefaults: {
|
5
|
+
readonly variant: "cozy";
|
6
|
+
readonly isDisabled: false;
|
7
|
+
readonly isExpanded: false;
|
8
|
+
};
|
9
|
+
declare const AccordionStyles: tailwind_variants.TVReturnType<{
|
10
|
+
variant: {
|
11
|
+
cozy: {
|
12
|
+
trigger: string;
|
13
|
+
};
|
14
|
+
compact: {
|
15
|
+
trigger: string;
|
16
|
+
};
|
17
|
+
};
|
18
|
+
isDisabled: {
|
19
|
+
false: {
|
20
|
+
header: string;
|
21
|
+
};
|
22
|
+
true: {
|
23
|
+
header: string;
|
24
|
+
};
|
25
|
+
};
|
26
|
+
isExpanded: {
|
27
|
+
false: {};
|
28
|
+
true: {};
|
29
|
+
};
|
30
|
+
}, {
|
31
|
+
group: string;
|
32
|
+
accordion: string;
|
33
|
+
header: string;
|
34
|
+
heading: string;
|
35
|
+
trigger: string[];
|
36
|
+
panel: string;
|
37
|
+
}, undefined, {
|
38
|
+
variant: {
|
39
|
+
cozy: {
|
40
|
+
trigger: string;
|
41
|
+
};
|
42
|
+
compact: {
|
43
|
+
trigger: string;
|
44
|
+
};
|
45
|
+
};
|
46
|
+
isDisabled: {
|
47
|
+
false: {
|
48
|
+
header: string;
|
49
|
+
};
|
50
|
+
true: {
|
51
|
+
header: string;
|
52
|
+
};
|
53
|
+
};
|
54
|
+
isExpanded: {
|
55
|
+
false: {};
|
56
|
+
true: {};
|
57
|
+
};
|
58
|
+
}, {
|
59
|
+
group: string;
|
60
|
+
accordion: string;
|
61
|
+
header: string;
|
62
|
+
heading: string;
|
63
|
+
trigger: string[];
|
64
|
+
panel: string;
|
65
|
+
}, tailwind_variants.TVReturnType<{
|
66
|
+
variant: {
|
67
|
+
cozy: {
|
68
|
+
trigger: string;
|
69
|
+
};
|
70
|
+
compact: {
|
71
|
+
trigger: string;
|
72
|
+
};
|
73
|
+
};
|
74
|
+
isDisabled: {
|
75
|
+
false: {
|
76
|
+
header: string;
|
77
|
+
};
|
78
|
+
true: {
|
79
|
+
header: string;
|
80
|
+
};
|
81
|
+
};
|
82
|
+
isExpanded: {
|
83
|
+
false: {};
|
84
|
+
true: {};
|
85
|
+
};
|
86
|
+
}, {
|
87
|
+
group: string;
|
88
|
+
accordion: string;
|
89
|
+
header: string;
|
90
|
+
heading: string;
|
91
|
+
trigger: string[];
|
92
|
+
panel: string;
|
93
|
+
}, undefined, unknown, unknown, undefined>>;
|
94
|
+
type AccordionStyleVariants = VariantProps<typeof AccordionStyles>;
|
95
|
+
|
96
|
+
export { type AccordionStyleVariants, AccordionStyles, AccordionStylesDefaults };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import {tv}from'./../../lib/utils.js';var r={variant:"cozy",isDisabled:false,isExpanded:false},a=tv({slots:{group:"flex w-full flex-col",accordion:"group flex w-full flex-col bg-transparent",header:"fg-default-light flex w-full items-center gap-s rounded-medium p-s outline-none",heading:"grow",trigger:["flex w-full cursor-pointer dtk-disabled:cursor-default items-center rounded-medium outline-none"],panel:"p-s"},variants:{variant:{cozy:{trigger:"gap-s text-header-m"},compact:{trigger:"gap-xs text-header-s"}},isDisabled:{false:{header:"focus-within:bg-interactive-hover-dark hover:bg-interactive-hover-dark"},true:{header:"fg-disabled cursor-default focus-within:bg-transparent hover:bg-transparent"}},isExpanded:{false:{},true:{}}},defaultVariants:r});export{a as AccordionStyles,r as AccordionStylesDefaults};//# sourceMappingURL=styles.js.map
|
2
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/accordion/styles.ts"],"names":["tv","e"],"mappings":"sCAgBE,IAAA,CAAA,CAAA,CAAA,OAAS,CACT,MAAA,CAAA,UACA,CAAA,KAAA,CAAA,UAG6BA,MAC7B,CAAA,CAAA,CAAA,CAAAC,EAAA,CAAO,CACL,KAAA,CAAO,CAAA,KAAA,CAAA,sBACP,CAAA,SAAW,CAAA,2CACX,CACE,wFACF,CAAA,OAAS,CACT,MAAA,CAAA,0GAGA,CAAO,CAAA,KACT,CACA,eACE,CAAA,CAAA,OACQ,CACJ,CAAA,IAAA,CAAA,CAAA,OAAS,CAAA,8BAGT,CAAA,CAAA,OAAS,CAAA,sBAGb,CAAA,CAAA,CAAA,UACE,CAAO,CACL,OACE,MAAA,CAAA,wEAEE,CACJ,OACE,MAAA,CAAA,6EAGN,CAAA,CAAA,CAAA,UACE,CAAO,CAAC,KACR,CAAA,EAAO,CACT,IAEF,CAAA,EAAA,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';\nimport type { VariantProps } from 'tailwind-variants';\n\nexport const AccordionStylesDefaults = {\n variant: 'cozy',\n isDisabled: false,\n isExpanded: false,\n} as const;\n\nexport const AccordionStyles = tv({\n slots: {\n group: 'flex w-full flex-col',\n accordion: 'group flex w-full flex-col bg-transparent',\n header:\n 'fg-default-light flex w-full items-center gap-s rounded-medium p-s outline-none',\n heading: 'grow',\n trigger: [\n 'flex w-full cursor-pointer dtk-disabled:cursor-default items-center rounded-medium outline-none',\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 isDisabled: {\n false: {\n header:\n 'focus-within:bg-interactive-hover-dark hover:bg-interactive-hover-dark',\n },\n true: {\n header:\n 'fg-disabled cursor-default focus-within:bg-transparent hover:bg-transparent',\n },\n },\n isExpanded: {\n false: {},\n true: {},\n },\n },\n defaultVariants: AccordionStylesDefaults,\n});\n\nexport type AccordionStyleVariants = VariantProps<typeof AccordionStyles>;\n"]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { RenderPropsClassName } from '../../lib/types.js';
|
2
|
+
import { RefAttributes, PropsWithChildren } from 'react';
|
3
|
+
import { DisclosureProps, DisclosureGroupProps, ButtonRenderProps, DisclosurePanelProps } from 'react-aria-components';
|
4
|
+
import { AccordionStyleVariants } from './styles.js';
|
5
|
+
import 'tailwind-variants';
|
6
|
+
|
7
|
+
type AccordionGroupProps = DisclosureGroupProps & Pick<AccordionStyleVariants, 'variant'> & RefAttributes<HTMLDivElement>;
|
8
|
+
type AccordionProps = DisclosureProps & Pick<AccordionStyleVariants, 'variant'> & RefAttributes<HTMLDivElement>;
|
9
|
+
type AccordionHeaderProps = PropsWithChildren<{
|
10
|
+
className?: string;
|
11
|
+
}> & RefAttributes<HTMLDivElement>;
|
12
|
+
type AccordionTriggerProps = PropsWithChildren<{
|
13
|
+
classNames?: {
|
14
|
+
heading?: string;
|
15
|
+
trigger?: RenderPropsClassName<ButtonRenderProps>;
|
16
|
+
};
|
17
|
+
}> & RefAttributes<HTMLDivElement>;
|
18
|
+
type AccordionPanelProps = DisclosurePanelProps & RefAttributes<HTMLDivElement>;
|
19
|
+
|
20
|
+
export type { AccordionGroupProps, AccordionHeaderProps, AccordionPanelProps, AccordionProps, AccordionTriggerProps };
|
@@ -2,22 +2,22 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as cva_types from 'cva/types';
|
3
3
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
4
4
|
import { VariantProps } from 'cva';
|
5
|
-
import
|
5
|
+
import React__default from 'react';
|
6
6
|
|
7
7
|
declare const avatarStyles: (props?: ({
|
8
8
|
size?: "small" | "medium" | null | undefined;
|
9
9
|
} & cva_types.ClassProp) | undefined) => string;
|
10
|
-
interface AvatarProps extends
|
10
|
+
interface AvatarProps extends React__default.ComponentProps<typeof AvatarPrimitive.Image>, VariantProps<typeof avatarStyles> {
|
11
11
|
/**
|
12
12
|
* The fallback that the avatar will render if it cannot load the provided source.
|
13
13
|
*
|
14
14
|
* Accepts any React component.
|
15
15
|
*/
|
16
|
-
fallback?:
|
16
|
+
fallback?: React__default.ReactNode;
|
17
17
|
/** How long the system should wait before it shows the fallback component. By default there is no delay. */
|
18
18
|
fallbackDelay?: number;
|
19
19
|
/** The source of an avatar can either be a URL representing an image or a React component (such as an SVG or an icon from a library). */
|
20
|
-
source?: string |
|
20
|
+
source?: string | React__default.ReactNode;
|
21
21
|
}
|
22
22
|
declare const Avatar: {
|
23
23
|
({ className, children, fallback, fallbackDelay, source, size, ...props }: AvatarProps): react_jsx_runtime.JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/avatar/index.tsx"],"names":["d","cn","o","
|
1
|
+
{"version":3,"sources":["../../../src/components/avatar/index.tsx"],"names":["d","cn","o","source","size","n","Person","r","children","Avatar","props","className","avatarStyles"],"mappings":"uMAoBE,IAAA,CAAA,CAAAA,GAAA,CAAA,4GAGU,CACJ,CAAA,IAAA,CAAA,CAAQ,qCACD,CAAA,KAAA,CAAA,yBAGX,CAAA,CAAA,CAAA,eACQ,CAAA,CAAA,IAAA,CAAA,QAKgBC,CAAG,CAC7B,CAAA,CAAA,CAAA,CAAAC,EAAA,CAAA,CAAA,uBACA,CAAA,mJAmBA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,wBAEA,CAAA,CAAA,CAAA,CAAA,CAAAC,OACAC,CAAAA,CAAO,IAAA,CAAA,CAAA,CAAA,YAGN,CAAA,CAAA,GAAAC,IAAA,CAAI,KAAA,CAAA,CAAA,SACH,CAAA,CAAA,CAAA,QAAiB,CAAA,CAAAA,IAAA,CAAhB,CACC,gBACE,CAAAH,EAAA,CAAA,kCACe,CAAA,CAAAE,CAAAA,CAAM,IAAA,CAAA,CAAA,CAAA,SAEvB,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,IAEJ,CAAA,KAAA,CAAA,QAAA,CAAA,CAAOD,OAAW,CAAA,EAAA,eAChB,CACC,KAAA,CAAA,CAAA,SAAU,CAAA,2CACEA,OAAW,CAAA,EAAA,QAAoB,CAAA,CAAA,CAC1C,MACH,CAEDA,GAAU,CAAA,CAAA,CAAA,CAAA,CAAA,EAAOA,OAAW,CAAA,EAAA,yBAGD,CAAA,CAAA,OACvB,CAAA,CAAA,CAAA,QAAuBG,CAAA,CAAA,EAAOC,GACjC,QAEJ,EACCC,CAAAA,CAAAA,CACH,CAAA,CAEFC,CAAAA,CAAO,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,SAAY,CAAA,QAEjBC,CAAAA,CACAC,CAAAA,EAAAA,CACGV,CAAAA,CAAGW,CAAAA,CAAa,GAAEV,EAAGQ,CAAAA,CAAO,CAAA,CAAA,GAAA,CAAA,CAAA,SAAY,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { cn } from '@/lib/utils';\nimport { Person } from '@accelint/icons';\nimport * as AvatarPrimitive from '@radix-ui/react-avatar';\nimport 'client-only';\nimport { type VariantProps, cva } from 'cva';\nimport type React from 'react';\n\nconst avatarStyles = cva(\n 'fg-default-dark flex items-center justify-center overflow-hidden rounded-full bg-surface-overlay',\n {\n variants: {\n size: {\n medium: 'size-[32px] **:[svg]:size-xl',\n small: 'size-xl **:[svg]:size-l',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n);\n\nconst avatarWrapperStyles = cn([\n 'relative inline-block',\n '[--badge-empty-inset:0_0_auto_auto] [--badge-inset:calc(var(--spacing-xxs)*-1)_calc(var(--spacing-xxs)*-1)_auto_auto] [--badge-position:absolute]',\n]);\n\nexport interface AvatarProps\n extends React.ComponentProps<typeof AvatarPrimitive.Image>,\n VariantProps<typeof avatarStyles> {\n /**\n * The fallback that the avatar will render if it cannot load the provided source.\n *\n * Accepts any React component.\n */\n fallback?: React.ReactNode;\n /** How long the system should wait before it shows the fallback component. By default there is no delay. */\n fallbackDelay?: number;\n /** The source of an avatar can either be a URL representing an image or a React component (such as an SVG or an icon from a library). */\n source?: string | React.ReactNode;\n}\n\nexport const Avatar = ({\n className,\n children,\n fallback,\n fallbackDelay = 0,\n source,\n size = 'medium',\n ...props\n}: AvatarProps) => (\n <div className={avatarWrapperStyles}>\n <AvatarPrimitive.Root\n className={cn(\n 'pointer-events-none inline-block',\n avatarStyles({ size, className }),\n )}\n role='img'\n >\n {typeof source === 'string' && (\n <AvatarPrimitive.Image\n className='size-full object-cover object-center'\n src={typeof source === 'string' ? source : undefined}\n {...props}\n />\n )}\n {source && typeof source !== 'string' ? (\n source\n ) : (\n <AvatarPrimitive.Fallback delayMs={fallbackDelay}>\n {fallback ? fallback : <Person />}\n </AvatarPrimitive.Fallback>\n )}\n </AvatarPrimitive.Root>\n {children}\n </div>\n);\nAvatar.displayAs = 'Avatar';\nAvatar.as = (\n props: VariantProps<typeof avatarStyles>,\n className?: string | string[],\n) => cn(avatarStyles({ ...props, className }));\n"]}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import * as cva_types from 'cva/types';
|
3
3
|
import { VariantProps } from 'cva';
|
4
|
-
import
|
4
|
+
import React__default from 'react';
|
5
5
|
|
6
6
|
declare const badgeStyles: (props?: ({
|
7
7
|
variant?: "info" | "advisory" | "normal" | "serious" | "critical" | null | undefined;
|
8
8
|
} & cva_types.ClassProp) | undefined) => string;
|
9
|
-
interface BadgeProps extends VariantProps<typeof badgeStyles>, Omit<
|
9
|
+
interface BadgeProps extends VariantProps<typeof badgeStyles>, Omit<React__default.HTMLProps<HTMLSpanElement>, 'children'> {
|
10
10
|
className?: string;
|
11
11
|
/** Used to add text to the badge, such as the number of unread notifications. */
|
12
12
|
children?: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/badge/index.tsx"],"names":["o","i","
|
1
|
+
{"version":3,"sources":["../../../src/components/badge/index.tsx"],"names":["o","i","r","props","Badge","className","cn","badgeStyles"],"mappings":"gGAiBK,IACD,CAAA,CAAAA,GAAA,CAAAC,EAAA,CAAA,CAAA,0JACA,CAAA,4HAGA,CAAA,CAAA,CAAA,CAAA,iBAEI,CAAA,CAAA,mDACA,CAAA,QAAU,CAAA,6CACD,CAAA,mCACT,CAAQ,wCACF,CAAA,IAAA,CAAA,kCAGV,CAAA,CAAA,CAAA,eACE,CAAA,CAAA,OACF,CACF,MAWoB,CACpB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,mBACU,CAAA,CAAA,CACV,MACF,CAAA,GACG,CAAA,CAAA,GAAAC,GAAA,CAAA,iBAGK,CAAAD,EAAA,CAAA,CAAA,CAAA,CAAA,qBAIAE,CAAAA,CACN,CAAA,CAEFC,GAAM,CAAA,CAAA,EAAA,CAAA,CAAA,WAAc,CAAA,OAElBD,EACAE,CAAAA,EAAAA,CACGC,CAAAA,CAAGC,EAAY,GAAEN,EAAGE,EAAO,CAAA,CAAA,GAAA,CAAA,CAAA,SAAY,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { cn } from '@/lib/utils';\nimport { type VariantProps, cva } from 'cva';\nimport type React from 'react';\n\nconst badgeStyles = cva(\n cn([\n 'fg-default-light inline-flex h-l min-w-l items-center justify-center rounded-full px-xs text-body-xs outline empty:size-s empty:min-w-none empty:px-none',\n '[inset:var(--badge-inset,initial)] [position:var(--badge-position,initial)] empty:[inset:var(--badge-empty-inset,initial)]',\n ]),\n {\n variants: {\n variant: {\n advisory: 'bg-advisory-subtle outline-advisory-bold',\n critical: 'bg-critical-subtle outline-critical',\n serious: 'bg-serious-subtle outline-serious',\n normal: 'bg-normal-subtle outline-normal',\n info: 'bg-info-subtle outline-info-bold',\n },\n },\n defaultVariants: {\n variant: 'info',\n },\n },\n);\n\nexport interface BadgeProps\n extends VariantProps<typeof badgeStyles>,\n Omit<React.HTMLProps<HTMLSpanElement>, 'children'> {\n className?: string;\n /** Used to add text to the badge, such as the number of unread notifications. */\n children?: string;\n}\n\nexport const Badge = ({\n className,\n variant = 'info',\n ...props\n}: BadgeProps) => (\n <span\n className={cn(\n badgeStyles({\n variant,\n className,\n }),\n )}\n {...props}\n />\n);\nBadge.displayName = 'Badge';\nBadge.as = (\n props: VariantProps<typeof badgeStyles>,\n className?: string | string[],\n) => cn(badgeStyles({ ...props, className }));\n"]}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import
|
2
|
+
import React__default from 'react';
|
3
3
|
|
4
|
-
interface BoxProps extends
|
5
|
-
as?:
|
4
|
+
interface BoxProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
5
|
+
as?: React__default.ElementType;
|
6
6
|
/** When true, apply flex display */
|
7
7
|
flex?: boolean;
|
8
8
|
/** Flex direction: 'row' or 'col' */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/box/index.tsx"],"names":["Box","Component","className","flex","direction","justify","align","gap","children","rest","classes","cx","jsx"],"mappings":"6DA4BaA,CAAM,
|
1
|
+
{"version":3,"sources":["../../../src/components/box/index.tsx"],"names":["Box","Component","className","flex","direction","justify","align","gap","children","rest","classes","cx","jsx"],"mappings":"6DA4BaA,CAAAA,CAAM,CAAC,CAClB,EAAA,CAAIC,CAAAA,CAAY,MAChB,SAAA,CAAAC,CAAAA,CACA,KAAAC,CAAAA,CACA,SAAA,CAAAC,EAAY,KAAA,CACZ,OAAA,CAAAC,EACA,KAAA,CAAAC,CAAAA,CACA,IAAAC,CAAAA,CACA,QAAA,CAAAC,EACA,GAAGC,CACL,IAAgB,CACd,IAAMC,EAAUC,EAAAA,CACdR,CAAAA,EAAQ,OACRA,CAAAA,GAASC,CAAAA,GAAc,MAAQ,UAAA,CAAa,UAAA,CAAA,CAC5CC,GACE,CACE,KAAA,CAAO,gBACP,MAAA,CAAQ,gBAAA,CACR,IAAK,aAAA,CACL,OAAA,CAAS,kBACT,MAAA,CAAQ,gBAAA,CACR,OAAQ,gBACV,CAAA,CAAEA,CAAO,CAAA,CACXC,CAAAA,EACE,CACE,KAAA,CAAO,aAAA,CACP,OAAQ,cAAA,CACR,GAAA,CAAK,YACL,OAAA,CAAS,eAAA,CACT,SAAU,gBACZ,CAAA,CAAEA,CAAK,CAAA,CACTC,CAAAA,GAAQ,QAAa,CAAA,IAAA,EAAOA,CAAG,GAC/BL,CACF,CAAA,CAEA,OACEU,GAAAA,CAACX,CAAAA,CAAA,CAAU,SAAA,CAAWS,CAAAA,CAAU,GAAGD,CAAAA,CAChC,QAAA,CAAAD,EACH,CAEJ","file":"index.js","sourcesContent":["import { cx } from 'cva';\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport type React from 'react';\n\nexport interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {\n as?: React.ElementType;\n /** When true, apply flex display */\n flex?: boolean;\n /** Flex direction: 'row' or 'col' */\n direction?: 'row' | 'col';\n /** Horizontal alignment in flex container */\n justify?: 'start' | 'center' | 'end' | 'between' | 'around' | 'evenly';\n /** Vertical alignment in flex container */\n align?: 'start' | 'center' | 'end' | 'stretch' | 'baseline';\n /** Gap between children (matches Tailwind's spacing scale) */\n gap?: number;\n}\n\nexport const Box = ({\n as: Component = 'div',\n className,\n flex,\n direction = 'row',\n justify,\n align,\n gap,\n children,\n ...rest\n}: BoxProps) => {\n const classes = cx(\n flex && 'flex',\n flex && (direction === 'col' ? 'flex-col' : 'flex-row'),\n justify &&\n {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n around: 'justify-around',\n evenly: 'justify-evenly',\n }[justify],\n align &&\n {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n baseline: 'items-baseline',\n }[align],\n gap !== undefined && `gap-${gap}`,\n className,\n );\n\n return (\n <Component className={classes} {...rest}>\n {children}\n </Component>\n );\n};\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {expectsIconWrapper}from'./../../lib/react.js';import {cn}from'./../../lib/utils.js';import {cva}from'cva';import {Button,composeRenderProps}from'react-aria-components';import {jsx}from'react/jsx-runtime';var
|
1
|
+
import {expectsIconWrapper}from'./../../lib/react.js';import {cn}from'./../../lib/utils.js';import {cva}from'cva';import {Button,composeRenderProps}from'react-aria-components';import {jsx}from'react/jsx-runtime';var n=cva("inline-flex cursor-pointer items-center justify-center whitespace-nowrap [--icon-size:20px]",{variants:{variant:{primary:"fg-inverse-light rounded-medium bg-interactive-default dtk-pressed:bg-interactive-hover-light outline-none hover:bg-interactive-hover-light focus:bg-interactive-hover-light",outline:"fg-default-light rounded-medium outline dtk-pressed:outline-interactive-hover outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover",flat:"fg-default-light rounded-medium bg-transparent dtk-pressed:bg-interactive-hover-dark outline-none hover:bg-interactive-hover-dark focus:bg-interactive-hover-dark",destructive:"fg-inverse-light rounded-medium bg-serious-bold dtk-pressed:bg-serious-hover outline-none hover:bg-serious-hover focus:bg-serious-hover",critical:"fg-default-light rounded-medium bg-critical-bold dtk-pressed:bg-critical-hover outline-none hover:bg-critical-hover focus:bg-critical-hover"},size:{large:"min-h-xxl gap-xs rounded-medium px-l py-s text-button-l [--icon-size:24px]",medium:"min-h-[32px] gap-xs rounded-medium px-l py-xs text-button-m [--icon-size:20px]",small:"min-h-xl gap-xxs p-s text-button-s [--icon-size:16px]",xsmall:"min-h-[20px] gap-xxs px-s py-xs text-button-xs [--icon-size:12px]"},isDisabled:{true:"fg-disabled hover:fg-disabled cursor-not-allowed bg-interactive-disabled hover:bg-interactive-disabled focus:bg-interactive-disabled",false:""}},compoundVariants:[{variant:"outline",isDisabled:true,className:"fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent outline outline-interactive-disabled hover:bg-transparent focus:bg-transparent"},{variant:"flat",isDisabled:true,className:"fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent hover:bg-transparent focus:bg-transparent"}],defaultVariants:{isDisabled:false,variant:"primary",size:"medium"}}),i=({className:t,isDisabled:e,variant:s="primary",size:a="medium",...r})=>(expectsIconWrapper({children:r.children,componentName:i.displayName}),jsx(Button,{className:composeRenderProps(t,d=>cn("w-content",n({isDisabled:e,variant:s,size:a,className:d}))),isDisabled:e,...r}));i.displayName="Button";i.as=(t,e)=>cn(n({...t,className:e}));export{i as Button};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["u","
|
1
|
+
{"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["u","Button","className","isDisabled","props","l","jsx","b","composeRenderProps","p","buttonStyles","cn","o"],"mappings":"oNAqBE,IAAA,CAAA,CAAAA,GAAA,CAAA,6FAGI,CAAA,CAAA,QACE,CAAA,CAAA,+LAGE,CAAA,OAAA,CAAA,mKACI,CAAA,IAAA,CAAA,mKAEJ,CAAA,WAAA,CAAA,yIAEA,CAAA,QAAA,CAAA,6IAIA,CAAA,CAAA,IAAA,CAAA,CAAA,KAAA,CAAA,oKAGK,CAAA,KAAA,CAAA,uDAEL,CAAA,MAAA,CAAA,mEAGF,CAAA,CAAA,UAAM,CAAA,CAAA,IAAA,CAAA,sIAIV,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,gBAEa,CAAA,CAAA,CAAA,OACT,CAAA,UACA,UACE,CAAA,IAAA,CAAA,SAAA,CAAA,kKAGO,CAAA,CAAA,CAAA,OACT,CAAA,OACA,UACE,CAAA,IAAA,CAAA,SAAA,CAAA,6HAGN,CAAA,CAAA,CAAA,iBAEE,UAAS,CAAA,KAAA,CAAA,OACT,CAAA,SACF,CACF,IAgBWC,CAAS,QACpB,CAAA,CAAA,CAAA,CAAAC,CAAAA,CACA,CAAA,CAAA,SAAAC,CAAAA,CACA,WAAU,CAAA,CAAA,CAAA,OACV,CAAA,CAAA,CAAA,cACA,CAAGC,CACL,CAAA,QAEI,CAAA,GAAA,CAAA,CAAA,IAAgBC,kBAAA,CAAA,CAAA,QAChB,CAAA,CAAA,CAAA,QAAA,CAAeJ,aACjB,CAAC,EAGCK,WACE,CAAA,CAAA,CAAAC,GAAWC,CAAAA,MAAmBN,CAAAA,CAAYA,SAEtC,CAAAO,kBAAA,CAAA,CAAA,CAAA,CAAA,EACAC,EAAAA,CAAa,WACX,CAAAP,EACA,CAAA,UACA,CAAA,CAAA,CAAA,cAEF,CAAC,CACH,CACF,SACA,CAAA,CAAA,CAAA,CAAYA,CAAAA,CACX,CAAA,UAIA,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,CAAA,EAAc,CAAA,CAAA,YACT,QAGPQ,CAAGD,EAAa,EAAE,CAAA,CAAGN,EAAO,CAAA,GAAAQ,EAAA,CAAA,CAAA,CAAA,CAAA,GAAW,CAAC,CAAA,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA","file":"index.js","sourcesContent":["import { expectsIconWrapper } from '@/lib/react';\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport { cn } from '@/lib/utils';\nimport { type VariantProps, cva } from 'cva';\nimport {\n Button as AriaButton,\n type ButtonProps as AriaButtonProps,\n composeRenderProps,\n} from 'react-aria-components';\n\nconst buttonStyles = cva(\n 'inline-flex cursor-pointer items-center justify-center whitespace-nowrap [--icon-size:20px]',\n {\n variants: {\n variant: {\n primary:\n 'fg-inverse-light rounded-medium bg-interactive-default dtk-pressed:bg-interactive-hover-light outline-none hover:bg-interactive-hover-light focus:bg-interactive-hover-light',\n outline:\n 'fg-default-light rounded-medium outline dtk-pressed:outline-interactive-hover outline-interactive hover:outline-interactive-hover focus:outline-interactive-hover',\n flat: 'fg-default-light rounded-medium bg-transparent dtk-pressed:bg-interactive-hover-dark outline-none hover:bg-interactive-hover-dark focus:bg-interactive-hover-dark',\n destructive:\n 'fg-inverse-light rounded-medium bg-serious-bold dtk-pressed:bg-serious-hover outline-none hover:bg-serious-hover focus:bg-serious-hover',\n critical:\n 'fg-default-light rounded-medium bg-critical-bold dtk-pressed:bg-critical-hover outline-none hover:bg-critical-hover focus:bg-critical-hover',\n },\n size: {\n large:\n 'min-h-xxl gap-xs rounded-medium px-l py-s text-button-l [--icon-size:24px]',\n medium:\n 'min-h-[32px] gap-xs rounded-medium px-l py-xs text-button-m [--icon-size:20px]',\n small: 'min-h-xl gap-xxs p-s text-button-s [--icon-size:16px]',\n xsmall:\n 'min-h-[20px] gap-xxs px-s py-xs text-button-xs [--icon-size:12px]',\n },\n isDisabled: {\n true: 'fg-disabled hover:fg-disabled cursor-not-allowed bg-interactive-disabled hover:bg-interactive-disabled focus:bg-interactive-disabled',\n false: '',\n },\n },\n compoundVariants: [\n {\n variant: 'outline',\n isDisabled: true,\n className:\n 'fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent outline outline-interactive-disabled hover:bg-transparent focus:bg-transparent',\n },\n {\n variant: 'flat',\n isDisabled: true,\n className:\n 'fg-disabled hover:fg-disabled focus:fg-disabled cursor-not-allowed bg-transparent hover:bg-transparent focus:bg-transparent',\n },\n ],\n defaultVariants: {\n isDisabled: false,\n variant: 'primary',\n size: 'medium',\n },\n },\n);\n\nexport interface ButtonProps\n extends Omit<AriaButtonProps, 'children' | 'isDisabled'>,\n VariantProps<typeof buttonStyles> {\n /**\n * Used to add text to the badge, such as the number of unread notifications.\n *\n * Can also receive a function which will be called with the parameters mentioned\n * {@link https://react-spectrum.adobe.com/react-aria/Button.html#styling:~:text=are%20documented%20below.-,Name,-CSS%20Selector here}\n */\n children?: AriaButtonProps['children'];\n isDisabled?: boolean;\n}\n\nexport const Button = ({\n className,\n isDisabled,\n variant = 'primary',\n size = 'medium',\n ...props\n}: ButtonProps) => {\n expectsIconWrapper({\n children: props.children,\n componentName: Button.displayName,\n });\n\n return (\n <AriaButton\n className={composeRenderProps(className, (className) =>\n cn(\n 'w-content',\n buttonStyles({\n isDisabled,\n variant,\n size,\n className,\n }),\n ),\n )}\n isDisabled={isDisabled}\n {...props}\n />\n );\n};\nButton.displayName = 'Button';\nButton.as = (\n props: VariantProps<typeof buttonStyles>,\n className?: string | string[],\n) => cn(buttonStyles({ ...props, className }));\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import
|
2
|
+
import React__default from 'react';
|
3
3
|
import { CheckboxProps as CheckboxProps$1, CheckboxGroupProps as CheckboxGroupProps$1 } from 'react-aria-components';
|
4
4
|
|
5
5
|
/**
|
@@ -12,7 +12,7 @@ declare namespace Checkbox {
|
|
12
12
|
var Group: typeof CheckboxGroup;
|
13
13
|
}
|
14
14
|
interface CheckboxGroupProps extends CheckboxGroupProps$1 {
|
15
|
-
label?: string |
|
15
|
+
label?: string | React__default.JSX.Element;
|
16
16
|
}
|
17
17
|
declare function CheckboxGroup({ children, className, label, ...props }: CheckboxGroupProps): react_jsx_runtime.JSX.Element;
|
18
18
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {cn}from'./../../lib/utils.js';import {CheckboxIndeterminate,CheckboxSelected}from'@accelint/icons';import {cva}from'cva';import {Checkbox,CheckboxGroup}from'react-aria-components';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var f=cva("fg-inverse-light size-l rounded-small outline outline-interactive",{variants:{isIndeterminate:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isSelected:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isHovered:{true:"outline-interactive-hover"},isFocused:{true:"outline-interactive-hover"},isDisabled:{true:"outline-interactive-disabled hover:outline-interactive-disabled"},isReadOnly:{true:"outline-interactive-disabled hover:outline-interactive-disabled"}},compoundVariants:[{isDisabled:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isDisabled:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"}],defaultVariants:{isIndeterminate:false,isSelected:false}});function k({className:e,children:r,...t}){return jsx(Checkbox,{...t,className:cn("fg-default-light flex items-center gap-m
|
1
|
+
import {cn}from'./../../lib/utils.js';import {CheckboxIndeterminate,CheckboxSelected}from'@accelint/icons';import {cva}from'cva';import {Checkbox,CheckboxGroup}from'react-aria-components';import {Label}from'../label/index.js';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var f=cva("fg-inverse-light size-l rounded-small outline outline-interactive",{variants:{isIndeterminate:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isSelected:{true:"bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover"},isHovered:{true:"outline-interactive-hover"},isFocused:{true:"outline-interactive-hover"},isDisabled:{true:"outline-interactive-disabled hover:outline-interactive-disabled"},isReadOnly:{true:"outline-interactive-disabled hover:outline-interactive-disabled"}},compoundVariants:[{isDisabled:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isDisabled:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isSelected:true,className:"icon-inverse-light bg-interactive-disabled"},{isReadOnly:true,isIndeterminate:true,className:"icon-inverse-light bg-interactive-disabled"}],defaultVariants:{isIndeterminate:false,isSelected:false}});function k({className:e,children:r,...t}){return jsx(Checkbox,{...t,className:cn("fg-default-light flex items-center gap-m dtk-disabled:text-interactive-disabled text-body-s",e),children:({isDisabled:o,isFocused:a,isHovered:d,isIndeterminate:s,isReadOnly:h,isSelected:n})=>jsxs(Fragment,{children:[jsxs("div",{className:cn(f({isDisabled:o,isFocused:a,isHovered:d,isIndeterminate:s,isReadOnly:h,isSelected:n})),"aria-hidden":true,children:[s&&!n&&jsx(CheckboxIndeterminate,{}),n&&!s&&jsx(CheckboxSelected,{})]}),r]})})}function C({children:e,className:r,label:t,...o}){return jsx(CheckboxGroup,{...o,className:cn("fg-default-light flex flex-col gap-m text-body-s",r),children:a=>jsxs(Fragment,{children:[t?jsx(Label,{children:t}):void 0,typeof e=="function"?e(a):e]})})}k.Group=C;export{k as Checkbox};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/checkbox/index.tsx"],"names":["v","
|
1
|
+
{"version":3,"sources":["../../../src/components/checkbox/index.tsx"],"names":["v","jsx","args","x","c","Fragment","l","u","isSelected","CheckboxIndeterminate","isIndeterminate","CheckboxSelected","i","p","children","label","props","g","m","Checkbox","CheckboxGroup"],"mappings":"oRAyBE,IAAA,CAAA,CAAAA,GAAA,CAAA,mEAEE,CAAA,CAAA,QACE,CAAA,CAAA,eACQ,CAAA,CAAA,IAAA,CAAA,gGAER,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,gGAER,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,2BAER,CAAA,CAAA,SACQ,CAAA,CAAA,IAAA,CAAA,2BAER,CAAA,CAAA,kFAGA,CAAA,CAAA,UACQ,CAAA,CAAA,IAAA,CAAA,iEAGV,CAAA,CAAA,CAAA,gBAEI,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,UACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,eACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,yBACW,CAAA,4CAGX,CAAA,CAAA,CAAA,UACA,CAAA,IAAA,CAAA,eACA,CAAA,IAAA,CAAA,SAAW,CAAA,4CAGf,CAAA,CAAA,CAAA,eACE,CAAA,CAAA,eACA,CAAA,KAAA,CAAA,UAUC,CAAA,KAAA,CAAA,CAAA,CAAA,CAAA,SAAoB,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,QAAkB,CAAkB,CACxE,CAAA,GAAA,CAAA,CAAA,CACEC,CAAAA,OACMC,GAAAA,CACJC,QAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SACE,CAAAC,EAAA,CAAA,6FAID,CAAA,CAAA,CAAA,CAAA,QACC,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,eACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UAEAC,CAAAA,CAAA,CACE,GAAAC,IAAA,CAAAC,QAAA,CAAA,CAAA,QAAC,CAAA,CAAAD,IACC,CAAA,KAAA,CAAA,CAAA,SAEI,CAAAF,EAAA,CAAA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,eACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,UAGJ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,aAEC,CAAA,IAAA,CAAA,QAAoBI,CAAcP,CAAAA,CAACQ,EAAA,CAAA,CAAsB,EACzDD,yBAAc,CAACE,EAAAA,CAAmBT,CAAAA,CAACU,EAAA,CAAA,CAAiB,EAAAC,GACvD,CAAAC,gBACCC,CAAAA,EACH,CAAA,CAEJ,CAEJ,CAOA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,SACE,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,SACA,CAAAC,CAAAA,CACA,KACF,CAAuB,CACrB,CAAA,GAAA,CAAA,CAAA,CACEd,CAAAA,OACMe,GAAAA,CACJC,aAAA,CAAA,CAAA,GAAA,CAAA,CAAA,SACE,CAAAb,EAAA,CAAA,kDAID,CAAA,CAAA,CAAA,CAAA,QACC,CACG,CAAA,EAAAE,IAAA,CAAAC,QAAA,CAAA,CAAA,QAAS,CAAO,CAAA,CAAA,CAAAK,GAAA,CAAAM,KAAA,CAAA,CAAA,QAAiB,CAAA,CAAA,CAAA,CACjC,CAAA,MAAOJ,CAAAA,OAAa,CAAA,EAAA,UAA+BA,CACtD,CAAA,CAEJ,CAEJ,CAEAK,CAAAA,CAAS,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQC,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { cn } from '@/lib/utils';\nimport { CheckboxIndeterminate, CheckboxSelected } from '@accelint/icons';\nimport { cva } from 'cva';\nimport type React from 'react';\nimport {\n Checkbox as AriaCheckbox,\n CheckboxGroup as AriaCheckboxGroup,\n type CheckboxGroupProps as AriaCheckboxGroupProps,\n type CheckboxProps as AriaCheckboxProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\n\nconst checkboxStyles = cva(\n 'fg-inverse-light size-l rounded-small outline outline-interactive',\n {\n variants: {\n isIndeterminate: {\n true: 'bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover',\n },\n isSelected: {\n true: 'bg-highlight outline-highlight hover:outline-interactive-hover focus:outline-interactive-hover',\n },\n isHovered: {\n true: 'outline-interactive-hover',\n },\n isFocused: {\n true: 'outline-interactive-hover',\n },\n isDisabled: {\n true: 'outline-interactive-disabled hover:outline-interactive-disabled',\n },\n isReadOnly: {\n true: 'outline-interactive-disabled hover:outline-interactive-disabled',\n },\n },\n compoundVariants: [\n {\n isDisabled: true,\n isSelected: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isDisabled: true,\n isIndeterminate: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isReadOnly: true,\n isSelected: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n {\n isReadOnly: true,\n isIndeterminate: true,\n className: 'icon-inverse-light bg-interactive-disabled',\n },\n ],\n defaultVariants: {\n isIndeterminate: false,\n isSelected: false,\n },\n },\n);\n\n/**\n * This is a checkbox.\n */\nexport interface CheckboxProps extends AriaCheckboxProps {}\n\nexport function Checkbox({ className, children, ...args }: CheckboxProps) {\n return (\n <AriaCheckbox\n {...args}\n className={cn(\n 'fg-default-light flex items-center gap-m dtk-disabled:text-interactive-disabled text-body-s',\n className,\n )}\n >\n {({\n isDisabled,\n isFocused,\n isHovered,\n isIndeterminate,\n isReadOnly,\n isSelected,\n }) => (\n <>\n <div\n className={cn(\n checkboxStyles({\n isDisabled,\n isFocused,\n isHovered,\n isIndeterminate,\n isReadOnly,\n isSelected,\n }),\n )}\n aria-hidden\n >\n {isIndeterminate && !isSelected && <CheckboxIndeterminate />}\n {isSelected && !isIndeterminate && <CheckboxSelected />}\n </div>\n {children}\n </>\n )}\n </AriaCheckbox>\n );\n}\n\nexport interface CheckboxGroupProps extends AriaCheckboxGroupProps {\n // children: React.JSX.Element;\n label?: string | React.JSX.Element;\n}\n\nfunction CheckboxGroup({\n children,\n className,\n label,\n ...props\n}: CheckboxGroupProps) {\n return (\n <AriaCheckboxGroup\n {...props}\n className={cn(\n 'fg-default-light flex flex-col gap-m text-body-s',\n className,\n )}\n >\n {(props) => (\n <>\n {label ? <Label>{label}</Label> : undefined}\n {typeof children === 'function' ? children(props) : children}\n </>\n )}\n </AriaCheckboxGroup>\n );\n}\n\nCheckbox.Group = CheckboxGroup;\n"]}
|