@radui/ui 0.1.7 → 0.2.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 +87 -47
- package/dist/components/Accordion.d.ts +94 -30
- package/dist/components/Accordion.js +1 -1
- package/dist/components/AlertDialog.d.ts +13 -14
- package/dist/components/AlertDialog.js +1 -1
- package/dist/components/AspectRatio.js +1 -1
- package/dist/components/Avatar.d.ts +4 -3
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.d.ts +1 -0
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/AvatarPrimitiveFallback-KiY3slgV.js +1 -0
- package/dist/components/Badge.d.ts +6 -4
- package/dist/components/Badge.js +1 -1
- package/dist/components/BlockQuote.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Callout.d.ts +19 -11
- package/dist/components/Callout.js +1 -1
- package/dist/components/Card.d.ts +30 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/Checkbox.d.ts +22 -6
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/CheckboxCards.d.ts +25 -7
- package/dist/components/CheckboxCards.js +1 -1
- package/dist/components/CheckboxGroup.d.ts +22 -7
- package/dist/components/CheckboxGroup.js +1 -1
- package/dist/components/CheckboxGroupPrimitive-DIOswrR1.js +1 -0
- package/dist/components/Code.js +1 -1
- package/dist/components/Collapsible.d.ts +12 -9
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/Combobox.d.ts +98 -0
- package/dist/components/Combobox.js +1 -0
- package/dist/components/ComboboxPrimitive-Bn1C5dkn.js +1 -0
- package/dist/components/ContextMenu.d.ts +31 -1
- package/dist/components/ContextMenu.js +1 -1
- package/dist/components/DataList.d.ts +12 -5
- package/dist/components/DataList.js +1 -1
- package/dist/components/Dialog.d.ts +37 -18
- package/dist/components/Dialog.js +1 -1
- package/dist/components/Disclosure.d.ts +6 -1
- package/dist/components/Disclosure.js +1 -1
- package/dist/components/DropdownMenu.d.ts +31 -1
- package/dist/components/DropdownMenu.js +1 -1
- package/dist/components/Em.js +1 -1
- package/dist/components/Heading.js +1 -1
- package/dist/components/HoverCard.d.ts +12 -1
- package/dist/components/HoverCard.js +1 -1
- package/dist/components/Kbd.d.ts +1 -1
- package/dist/components/Kbd.js +1 -1
- package/dist/components/Link.d.ts +3 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/MenuPrimitive-6Qr46BSn.js +1 -0
- package/dist/components/Menubar.d.ts +81 -37
- package/dist/components/Menubar.js +1 -1
- package/dist/components/Minimap.d.ts +11 -8
- package/dist/components/Minimap.js +1 -1
- package/dist/components/NavigationMenu.d.ts +13 -12
- package/dist/components/NavigationMenu.js +1 -1
- package/dist/components/NumberField.d.ts +28 -6
- package/dist/components/NumberField.js +1 -1
- package/dist/components/Progress.d.ts +1 -1
- package/dist/components/Progress.js +1 -1
- package/dist/components/Quote.js +1 -1
- package/dist/components/Radio.js +1 -1
- package/dist/components/RadioCards.d.ts +7 -2
- package/dist/components/RadioCards.js +1 -1
- package/dist/components/RadioGroup.d.ts +1 -1
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/RadioGroupPrimitive-QSMno27i.js +1 -0
- package/dist/components/ScrollArea.d.ts +18 -2
- package/dist/components/ScrollArea.js +1 -1
- package/dist/components/Select.d.ts +20 -15
- package/dist/components/Select.js +1 -1
- package/dist/components/Separator.js +1 -1
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/Slider.d.ts +57 -11
- package/dist/components/Slider.js +1 -1
- package/dist/components/Spinner.d.ts +13 -0
- package/dist/components/Spinner.js +1 -0
- package/dist/components/Splitter.d.ts +1 -1
- package/dist/components/Splitter.js +1 -1
- package/dist/components/Steps.d.ts +21 -9
- package/dist/components/Steps.js +1 -1
- package/dist/components/Strong.js +1 -1
- package/dist/components/Switch.d.ts +8 -7
- package/dist/components/Switch.js +1 -1
- package/dist/components/TabNav.d.ts +23 -5
- package/dist/components/TabNav.js +1 -1
- package/dist/components/Table.d.ts +9 -1
- package/dist/components/Table.js +1 -1
- package/dist/components/Tabs.d.ts +25 -1
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/TextArea.d.ts +18 -2
- package/dist/components/TextArea.js +1 -1
- package/dist/components/Theme.js +1 -1
- package/dist/components/ThemeContext-Sm-iNANd.js +1 -0
- package/dist/components/Toggle.js +1 -1
- package/dist/components/ToggleGroup.d.ts +33 -0
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/Toolbar.d.ts +83 -0
- package/dist/components/Toolbar.js +1 -0
- package/dist/components/Tooltip.d.ts +6 -0
- package/dist/components/Tooltip.js +1 -1
- package/dist/components/Tree.d.ts +10 -1
- package/dist/components/Tree.js +1 -1
- package/dist/components/VisuallyHidden.d.ts +1 -1
- package/dist/components/VisuallyHidden.js +1 -1
- package/dist/components/check-DujVUWP-.js +44 -0
- package/dist/components/floating-ui.react-DMgxgTKq.js +5 -0
- package/dist/components/index-3dZuI04X.js +1 -0
- package/dist/components/index-6If6D2Zi.js +1 -0
- package/dist/components/index-98jQ1vTr.js +1 -0
- package/dist/components/index-BOy86lYu.js +1 -0
- package/dist/components/index-BZVbVgqN.js +1 -0
- package/dist/components/index-CTJl2pTM.js +1 -0
- package/dist/components/index-CXzybYmm.js +1 -0
- package/dist/components/index-DTYJVF-V.js +1 -0
- package/dist/components/index-hAp0hL9w.js +1 -0
- package/dist/components/index-wRElCyvx.js +1 -0
- package/dist/components/index-yqRHPukT.js +1 -0
- package/dist/themes/default.css +1 -1
- package/package.json +51 -32
- package/dist/components/AvatarPrimitiveFallback-BV0bK5Qg.js +0 -1
- package/dist/components/CheckboxGroupPrimitive-DrGqSxi3.js +0 -1
- package/dist/components/MenuPrimitive-CPcrK1EK.js +0 -1
- package/dist/components/RadioGroupPrimitive-D9grAL7G.js +0 -1
- package/dist/components/floating-ui.react-CLbXmKZY.js +0 -5
- package/dist/components/index-BRmT6kl7.js +0 -1
- package/dist/components/index-BVxS3Ixi.js +0 -1
- package/dist/components/index-Bf4LVEjJ.js +0 -1
- package/dist/components/index-BtoPzkH9.js +0 -1
- package/dist/components/index-DBZNt4Em.js +0 -1
- package/dist/components/index-Dc5Cm9z0.js +0 -1
- package/dist/components/index-Di6TooPD.js +0 -1
- package/dist/components/index-DnCiOYxZ.js +0 -1
- package/dist/components/index-XqbKa2D2.js +0 -1
- package/dist/components/index-YgKcfT__.js +0 -1
- package/dist/components/index-fkj4Fdgt.js +0 -1
- package/dist/components/tslib.es6-BtVxab8e.js +0 -1
package/README.md
CHANGED
|
@@ -1,88 +1,128 @@
|
|
|
1
1
|
[](https://codecov.io/gh/rad-ui/ui)
|
|
2
2
|
|
|
3
|
-
#
|
|
3
|
+
# Rad UI
|
|
4
4
|
|
|
5
|
-

|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## What is Rad UI?
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
<img src="./docs/public/sponsorship/browserstack_light.png" alt="BrowserStack" width="200" />
|
|
11
|
-
|
|
12
|
-
<img src="./docs/public/sponsorship/code_rabbit_light.png" alt="CodeRabbit" width="200" />
|
|
13
|
-
</p>
|
|
9
|
+
Rad UI is a single, cohesive React component system for teams that want full control over their UI.
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
It is built for long lived products, custom design systems, and engineers who are tired of fighting pre baked styles, fragile abstractions, and dependency soup.
|
|
16
12
|
|
|
17
|
-
Rad UI
|
|
13
|
+
Rad UI handles behavior, accessibility, and composition so you can own structure, visuals, and tokens without compromise.
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
If your UI is becoming infrastructure, Rad UI is built for you.
|
|
16
|
+
|
|
17
|
+
## Why Rad UI exists
|
|
18
|
+
|
|
19
|
+
Most UI libraries optimize for speed at the start and cost you later.
|
|
20
|
+
|
|
21
|
+
They ship opinions disguised as convenience.
|
|
22
|
+
They lock you into styling decisions.
|
|
23
|
+
They scale poorly once your product and team grow.
|
|
24
|
+
|
|
25
|
+
Rad UI takes a different approach.
|
|
26
|
+
|
|
27
|
+
- One codebase, not a bundle of libraries
|
|
28
|
+
- One accessibility model across all components
|
|
29
|
+
- Predictable behavior and upgrade paths
|
|
30
|
+
- Detach first architecture with clean escape hatches
|
|
31
|
+
- Designed to plug into your existing design system
|
|
32
|
+
|
|
33
|
+
We chose cohesion over assembly and ownership over shortcuts.
|
|
34
|
+
|
|
35
|
+
## What Rad UI is not
|
|
36
|
+
|
|
37
|
+
- Not a starter kit
|
|
38
|
+
- Not a theme library
|
|
39
|
+
- Not a copy paste UI generator
|
|
40
|
+
- Not optimized for screenshots or demos
|
|
41
|
+
|
|
42
|
+
Rad UI is intentionally boring in the ways that save you time and money later.
|
|
43
|
+
|
|
44
|
+
## Components and examples
|
|
45
|
+
|
|
46
|
+
Explore the full component set and live examples in Storybook:
|
|
47
|
+
|
|
48
|
+
https://main--657eda33d6033847be90aaf8.chromatic.com/
|
|
20
49
|
|
|
21
50
|
## Documentation
|
|
22
51
|
|
|
23
|
-
|
|
52
|
+
Complete guides, architecture notes, and contribution docs live here:
|
|
53
|
+
|
|
54
|
+
https://www.rad-ui.com/docs/first-steps/introduction
|
|
55
|
+
|
|
56
|
+
Docs are treated as product, not an afterthought.
|
|
24
57
|
|
|
25
58
|
## Installation
|
|
26
59
|
|
|
27
|
-
|
|
60
|
+
Install Rad UI from npm:
|
|
28
61
|
|
|
29
62
|
```bash
|
|
30
63
|
npm install @radui/ui
|
|
31
64
|
```
|
|
32
65
|
|
|
33
|
-
|
|
34
|
-
<!--
|
|
66
|
+
Rad UI works with modern React setups and is friendly to tokens, CSS variables, and custom theming strategies.
|
|
35
67
|
|
|
36
|
-
##
|
|
68
|
+
## Philosophy
|
|
37
69
|
|
|
38
|
-
|
|
39
|
-
This includes programming languages, databases or other storage mechanisms, build tools, frameworks, and so forth.
|
|
40
|
-
If specific versions of other software are required, or known not to work, call that out.
|
|
70
|
+
Rad UI is opinionated where bugs live and flexible where taste lives.
|
|
41
71
|
|
|
42
|
-
|
|
72
|
+
We are strict about:
|
|
73
|
+
- Accessibility
|
|
74
|
+
- Keyboard and focus behavior
|
|
75
|
+
- Composition patterns
|
|
76
|
+
- Predictable APIs
|
|
43
77
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
78
|
+
We are deliberately neutral about:
|
|
79
|
+
- Styling
|
|
80
|
+
- Theming
|
|
81
|
+
- Design tokens
|
|
82
|
+
- Visual language
|
|
47
83
|
|
|
48
|
-
|
|
84
|
+
Bring your own system. Rad UI adapts.
|
|
49
85
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
## Known issues
|
|
53
|
-
|
|
54
|
-
Document any known significant shortcomings with the software.
|
|
86
|
+
## Getting involved
|
|
55
87
|
|
|
56
|
-
|
|
88
|
+
Rad UI is open source and built in the open.
|
|
57
89
|
|
|
58
|
-
|
|
90
|
+
If you care about UI architecture, accessibility, and long term maintainability, we would love your help.
|
|
59
91
|
|
|
60
|
-
|
|
92
|
+
Contribution guide:
|
|
93
|
+
https://www.rad-ui.com/docs/contributing/before-you-start
|
|
61
94
|
|
|
62
|
-
|
|
95
|
+
Dev environment setup:
|
|
96
|
+
https://www.rad-ui.com/docs/contributing/setting-up-dev-environment
|
|
63
97
|
|
|
64
|
-
##
|
|
98
|
+
## Community and support
|
|
65
99
|
|
|
66
|
-
|
|
67
|
-
|
|
100
|
+
GitHub Discussions:
|
|
101
|
+
https://github.com/rad-ui/ui/discussions
|
|
68
102
|
|
|
69
|
-
|
|
103
|
+
Discord:
|
|
104
|
+
https://discord.com/invite/nMaQfeEPNp
|
|
70
105
|
|
|
71
|
-
|
|
106
|
+
Questions, ideas, and strong opinions are welcome.
|
|
72
107
|
|
|
73
|
-
|
|
74
|
-
[Discord](https://discord.com/invite/nMaQfeEPNp)
|
|
108
|
+
## License
|
|
75
109
|
|
|
76
|
-
|
|
110
|
+
Rad UI is open source software.
|
|
111
|
+
See the LICENSE file for details.
|
|
77
112
|
|
|
78
|
-
|
|
113
|
+
## Development environment
|
|
79
114
|
|
|
80
|
-
|
|
115
|
+
Node versions tested:
|
|
116
|
+
- 18.19.0
|
|
117
|
+
- 19.x
|
|
118
|
+
- 20.x
|
|
119
|
+
- 21.4.0
|
|
81
120
|
|
|
82
|
-
|
|
121
|
+
## Credits
|
|
83
122
|
|
|
84
|
-
|
|
123
|
+
Rad UI stands on the shoulders of great work in the ecosystem.
|
|
85
124
|
|
|
86
|
-
|
|
125
|
+
Heavily inspired by Radix UI, Floating UI, shadcn/ui, and other libraries that shaped modern UI development.
|
|
87
126
|
|
|
88
|
-
|
|
127
|
+
We respect them.
|
|
128
|
+
We made different tradeoffs.
|
|
@@ -1,36 +1,100 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
-
type
|
|
4
|
-
|
|
3
|
+
type AccordionRootProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultValue'> & {
|
|
4
|
+
customRootClass?: string;
|
|
5
|
+
transitionDuration?: number;
|
|
6
|
+
transitionTimingFunction?: string;
|
|
7
|
+
orientation?: 'horizontal' | 'vertical';
|
|
8
|
+
/** When true, every item is non-interactive (Radix Accordion.Root `disabled`). */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
loop?: boolean;
|
|
12
|
+
disableTabIndexing?: boolean;
|
|
13
|
+
/** @deprecated Prefer `type="multiple"`. */
|
|
14
|
+
openMultiple?: boolean;
|
|
15
|
+
/** Radix-aligned mode: single allows one open section; multiple allows several. */
|
|
16
|
+
type?: 'single' | 'multiple';
|
|
17
|
+
/**
|
|
18
|
+
* When `type` is single (default), whether the open item can be closed by activating its trigger again.
|
|
19
|
+
* Matches Radix: defaults to false (trigger does not collapse the only open item).
|
|
20
|
+
*/
|
|
21
|
+
collapsible?: boolean;
|
|
22
|
+
value?: (number | string)[];
|
|
23
|
+
defaultValue?: (number | string)[];
|
|
24
|
+
onValueChange?: (value: (number | string)[]) => void;
|
|
5
25
|
};
|
|
6
|
-
declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
declare const AccordionRoot: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "defaultValue"> & {
|
|
27
|
+
customRootClass?: string;
|
|
28
|
+
transitionDuration?: number;
|
|
29
|
+
transitionTimingFunction?: string;
|
|
30
|
+
orientation?: "horizontal" | "vertical";
|
|
31
|
+
/** When true, every item is non-interactive (Radix Accordion.Root `disabled`). */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
asChild?: boolean;
|
|
34
|
+
loop?: boolean;
|
|
35
|
+
disableTabIndexing?: boolean;
|
|
36
|
+
/** @deprecated Prefer `type="multiple"`. */
|
|
37
|
+
openMultiple?: boolean;
|
|
38
|
+
/** Radix-aligned mode: single allows one open section; multiple allows several. */
|
|
39
|
+
type?: "single" | "multiple";
|
|
40
|
+
/**
|
|
41
|
+
* When `type` is single (default), whether the open item can be closed by activating its trigger again.
|
|
42
|
+
* Matches Radix: defaults to false (trigger does not collapse the only open item).
|
|
43
|
+
*/
|
|
44
|
+
collapsible?: boolean;
|
|
45
|
+
value?: (number | string)[];
|
|
46
|
+
defaultValue?: (number | string)[];
|
|
47
|
+
onValueChange?: (value: (number | string)[]) => void;
|
|
48
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
49
|
+
|
|
50
|
+
type AccordionItemProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
51
|
+
value?: number | string;
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
asChild?: boolean;
|
|
54
|
+
};
|
|
55
|
+
declare const AccordionItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
56
|
+
value?: number | string;
|
|
57
|
+
disabled?: boolean;
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
60
|
+
|
|
61
|
+
type AccordionHeaderProps = React.ComponentPropsWithoutRef<'h3'> & {
|
|
62
|
+
asChild?: boolean;
|
|
63
|
+
};
|
|
64
|
+
declare const AccordionHeader: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & {
|
|
65
|
+
asChild?: boolean;
|
|
66
|
+
} & React.RefAttributes<HTMLHeadingElement>>;
|
|
67
|
+
|
|
68
|
+
type AccordionTriggerProps = React.ComponentPropsWithoutRef<'button'> & {
|
|
69
|
+
asChild?: boolean;
|
|
33
70
|
};
|
|
71
|
+
declare const AccordionTrigger: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
72
|
+
asChild?: boolean;
|
|
73
|
+
} & React.RefAttributes<HTMLButtonElement>>;
|
|
74
|
+
|
|
75
|
+
type AccordionContentProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
76
|
+
/** @deprecated Index is no longer required; ids come from collapsible context. */
|
|
77
|
+
index?: number;
|
|
78
|
+
forceMount?: boolean;
|
|
79
|
+
asChild?: boolean;
|
|
80
|
+
};
|
|
81
|
+
declare const AccordionContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
82
|
+
/** @deprecated Index is no longer required; ids come from collapsible context. */
|
|
83
|
+
index?: number;
|
|
84
|
+
forceMount?: boolean;
|
|
85
|
+
asChild?: boolean;
|
|
86
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
87
|
+
|
|
88
|
+
type AccordionProps = React.ComponentPropsWithoutRef<typeof AccordionRoot>;
|
|
89
|
+
type AccordionCompound = typeof AccordionRoot & {
|
|
90
|
+
Root: typeof AccordionRoot;
|
|
91
|
+
Item: typeof AccordionItem;
|
|
92
|
+
Header: typeof AccordionHeader;
|
|
93
|
+
Trigger: typeof AccordionTrigger;
|
|
94
|
+
Content: typeof AccordionContent;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
declare const Accordion: AccordionCompound;
|
|
34
98
|
|
|
35
99
|
export { Accordion as default };
|
|
36
|
-
export type { AccordionProps };
|
|
100
|
+
export type { AccordionCompound, AccordionContentProps, AccordionHeaderProps, AccordionItemProps, AccordionProps, AccordionRootProps, AccordionTriggerProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import i,{createContext as t,useRef as n,useId as a,useContext as o,useCallback as r,isValidElement as s,cloneElement as l}from"react";import{c as d}from"./clsx-BaVHROc5.js";import{c}from"./index-6If6D2Zi.js";import{u as m}from"./index-wRElCyvx.js";import{R as u}from"./index-hAp0hL9w.js";import{P as f,m as h,c as p}from"./index-98jQ1vTr.js";import{C}from"./index-DTYJVF-V.js";import{B as b}from"./index-BOy86lYu.js";const g=t({rootClass:"",activeItems:[],setActiveItems:()=>{},accordionRef:void 0,transitionDuration:0,transitionTimingFunction:"ease-out",openMultiple:!1,collapsible:!1,disabled:!1,orientation:"vertical"}),v="Accordion",I=i.forwardRef((({children:i,orientation:t="vertical",disableTabIndexing:a=!1,asChild:o,transitionDuration:r=0,transitionTimingFunction:s="linear",customRootClass:l,disabled:h=!1,loop:p=!0,openMultiple:C=!1,type:b,collapsible:I=!1,value:N,defaultValue:x=[],onValueChange:R,dir:T,...j},y)=>{const A=n(null),M=c(l,v),$="multiple"===b||"single"!==b&&C,w=!!$||I,D=void 0!==N?$?N:N.length>0?[N[0]]:[]:void 0,F=$?x:x.length>0?[x[0]]:[],[V,P]=m(D,F,R),H="rtl"===T?"rtl":"ltr";return e(g.Provider,{value:{rootClass:M,activeItems:V,setActiveItems:P,accordionRef:A,transitionDuration:r,transitionTimingFunction:s,openMultiple:$,collapsible:w,disabled:h,orientation:t},children:e(u.Root,{orientation:t,loop:p,disableTabIndexing:a,dir:H,children:e(u.Group,{children:e(f.div,{className:d(`${M}-root`),dir:T,"data-orientation":t,ref:e=>{const i=e;A.current=i,"function"==typeof y?y(i):y&&(y.current=i)},asChild:o,...j,children:i})})})})}));I.displayName=v;const N=t({itemValue:"",disabled:!1,headerId:""});function x(...e){return i=>{e.forEach((e=>{e&&("function"==typeof e?e(i):e.current=i)}))}}const R=i.forwardRef((({children:t,value:n,className:s="",disabled:l=!1,asChild:c=!1,...m},u)=>{const h=i.useRef(null),p=a(),b=n??p,v=a(),{rootClass:I,activeItems:R,setActiveItems:T,transitionDuration:j,transitionTimingFunction:y,openMultiple:A,collapsible:M,disabled:$,orientation:w}=o(g),D=l||$,F=R.includes(b),V=r((e=>{D||T(A?i=>e?i.includes(b)?i:[...i,b]:i.filter((e=>e!==b)):e?[b]:e=>!M&&e.includes(b)&&1===e.length?e:[])}),[D,A,b,T,M]);return e(N.Provider,{value:{itemValue:b,disabled:D,headerId:v},children:e(C.Root,{open:F,onOpenChange:V,disabled:D,transitionDuration:j,transitionTimingFunction:y,asChild:!0,children:e(f.div,{ref:x(h,u),className:d(`${I}-item`,s),"data-state":F?"open":"closed","data-disabled":D?"":void 0,"data-orientation":w,asChild:c,...m,children:t})})})}));R.displayName="AccordionItem";const T=i.forwardRef((({children:i,className:t="",asChild:n=!1,...a},r)=>{const{rootClass:c,orientation:m}=o(g),u=d(`${c}-header`,t);if(n&&s(i)){const e=i,t=h({className:u,"data-orientation":m},e.props);return l(e,{...t,ref:p(r,e.ref)})}return e("h3",{ref:r,className:u,"data-orientation":m,...a,children:i})}));T.displayName="AccordionHeader";const j=i.forwardRef((({children:i,className:t="",asChild:n=!1,id:a,...r},s)=>{const{rootClass:l,activeItems:c,orientation:m}=o(g),{itemValue:f,disabled:h,headerId:p}=o(N);return e(u.Item,{domId:a??p,children:e(C.Trigger,{disabled:h,asChild:!0,children:e(b,{className:d(`${l}-trigger`,t),ref:s,"aria-disabled":h,"aria-expanded":c.includes(f),"data-orientation":m,asChild:n,...r,children:i})})})}));j.displayName="AccordionTrigger";const y=i.forwardRef((({children:i,index:t,className:n="",forceMount:a,asChild:r=!1,...s},l)=>{const{rootClass:c,orientation:m}=o(g),{headerId:u}=o(N);return e(C.Content,{ref:l,asChild:r,forceMount:a,className:d(`${c}-content`,n),role:"region","aria-labelledby":u,"data-orientation":m,...s,children:r?i:e("div",{className:`${c}-content-inner`,children:i})})}));y.displayName="AccordionContent";const A=Object.assign(I,{Root:I,Item:R,Header:T,Trigger:j,Content:y});export{A as default};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import DialogPrimitive from '~/core/primitives/Dialog';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
import Primitive from '~/core/primitives/Primitive';
|
|
5
6
|
|
|
6
7
|
type DialogPrimitiveActionProps = {
|
|
@@ -15,15 +16,9 @@ type DialogPrimitiveCancelProps = {
|
|
|
15
16
|
className?: string;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
type
|
|
19
|
-
|
|
19
|
+
type DialogPrimitiveFooterProps = React__default.ComponentPropsWithoutRef<typeof DialogPrimitive.Footer>;
|
|
20
|
+
type AlertDialogFooterProps = DialogPrimitiveFooterProps & {
|
|
20
21
|
className?: string;
|
|
21
|
-
asChild?: boolean;
|
|
22
|
-
forceMount?: boolean;
|
|
23
|
-
role?: string;
|
|
24
|
-
'aria-modal'?: boolean;
|
|
25
|
-
'aria-labelledby'?: string;
|
|
26
|
-
'aria-describedby'?: string;
|
|
27
22
|
};
|
|
28
23
|
|
|
29
24
|
type DialogPrimitiveRootProps$1 = {
|
|
@@ -57,6 +52,13 @@ type AlertDialogPortalProps = DialogPrimitivePortalProps & {
|
|
|
57
52
|
keepMounted?: boolean;
|
|
58
53
|
};
|
|
59
54
|
|
|
55
|
+
type DialogPrimitiveContentProps = React__default.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
|
|
56
|
+
type AlertDialogContentProps = DialogPrimitiveContentProps & {
|
|
57
|
+
className?: string;
|
|
58
|
+
asChild?: boolean;
|
|
59
|
+
forceMount?: boolean;
|
|
60
|
+
};
|
|
61
|
+
|
|
60
62
|
type PrimitiveH2Props = React__default.ComponentPropsWithoutRef<typeof Primitive.h2>;
|
|
61
63
|
type AlertDialogTitleProps = PrimitiveH2Props & {
|
|
62
64
|
className?: string;
|
|
@@ -94,16 +96,13 @@ declare const AlertDialog: {
|
|
|
94
96
|
children?: React.ReactNode;
|
|
95
97
|
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
96
98
|
Portal: {
|
|
97
|
-
({ children, ...props }: AlertDialogPortalProps):
|
|
99
|
+
({ children, ...props }: AlertDialogPortalProps): react_jsx_runtime.JSX.Element;
|
|
98
100
|
displayName: string;
|
|
99
101
|
};
|
|
100
|
-
Content: React$1.ForwardRefExoticComponent<
|
|
101
|
-
className?: string;
|
|
102
|
-
asChild?: boolean;
|
|
103
|
-
forceMount?: boolean;
|
|
104
|
-
} & React$1.RefAttributes<HTMLDivElement>>;
|
|
102
|
+
Content: React$1.ForwardRefExoticComponent<AlertDialogContentProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
105
103
|
Title: React$1.ForwardRefExoticComponent<AlertDialogTitleProps & React$1.RefAttributes<HTMLElement>>;
|
|
106
104
|
Description: React$1.ForwardRefExoticComponent<AlertDialogDescriptionProps & React$1.RefAttributes<HTMLElement>>;
|
|
105
|
+
Footer: React$1.ForwardRefExoticComponent<AlertDialogFooterProps & React$1.RefAttributes<HTMLDivElement>>;
|
|
107
106
|
Cancel: React$1.ForwardRefExoticComponent<Omit<DialogPrimitiveCancelProps & React$1.RefAttributes<HTMLButtonElement>, "ref"> & {
|
|
108
107
|
className?: string;
|
|
109
108
|
} & React$1.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as e}from"react/jsx-runtime";import{createContext as s,forwardRef as r,useState as t,useContext as a,useRef as o,useEffect as i}from"react";import{c as l}from"./index-6If6D2Zi.js";import{c as n}from"./clsx-BaVHROc5.js";import{u as c}from"./index-wRElCyvx.js";import{D as d}from"./index-CTJl2pTM.js";import{F as m}from"./index-yqRHPukT.js";import{P as p}from"./index-98jQ1vTr.js";import"./index-BOy86lYu.js";import"./ThemeContext-Sm-iNANd.js";import"./floating-ui.react-DMgxgTKq.js";import"react-dom";const h=s({rootClass:"",isOpen:!1,setIsOpen:()=>{},titleId:void 0,descriptionId:void 0,setTitleId:()=>{},setDescriptionId:()=>{}}),C="AlertDialog",u=r((({children:s,className:r="",customRootClass:a="",defaultOpen:o=!1,open:i,onOpenChange:m,...p},u)=>{const N=l(a,C),[f,g]=c(i,o,m),[D,I]=t(void 0),[y,A]=t(void 0),v={rootClass:N,isOpen:f,setIsOpen:g,titleId:D,descriptionId:y,setTitleId:I,setDescriptionId:A};return e(d.Root,{open:f,onOpenChange:g,className:n(N,r),...p,children:e(h.Provider,{value:v,children:e("div",{ref:u,className:n(N,r),children:s})})})}));u.displayName=C;const N=r((({children:s,className:r="",asChild:t=!1,forceMount:o=!1,...i},l)=>{const{rootClass:c,titleId:m,descriptionId:p}=a(h);return e(d.Content,{ref:l,className:n(`${c}-content`,r),asChild:t,forceMount:o,role:"alertdialog","aria-modal":!0,"aria-labelledby":m,"aria-describedby":p,...i,children:s})}));N.displayName="AlertDialogContent";const f=r((({children:s,asChild:r,className:t="",disabled:o=!1,...i},l)=>{const{rootClass:c,isOpen:m}=a(h),p=m?"open":"closed",C=o?"":void 0;return e(d.Trigger,{ref:l,className:n(`${c}-trigger`,t),asChild:r,disabled:o,"data-state":p,"data-disabled":C,...i,children:s})}));f.displayName="AlertDialogTrigger";const g=({children:s,...r})=>e(d.Portal,{...r,children:s});g.displayName="AlertDialogPortal";const D=r((({className:s="",asChild:r=!1,forceMount:t=!1,children:o,...i},l)=>{const{rootClass:c}=a(h);return e(d.Overlay,{ref:l,className:n(`${c}-overlay`,s),asChild:r,forceMount:t,...i,children:o})}));D.displayName="AlertDialogOverlay";const I=r((({children:s,asChild:r,className:t="",...o},i)=>{const{rootClass:l}=a(h);return e(d.Cancel,{ref:i,className:`${l}-cancel ${t}`,asChild:r,...o,children:s})}));I.displayName="AlertDialogCancel";const y=r((({children:s,asChild:r,className:t="",...o},i)=>{const{rootClass:l}=a(h);return e(d.Action,{ref:i,className:`${l}-action ${t}`,asChild:r,...o,children:s})}));y.displayName="AlertDialogAction";const A=r((({children:s,className:r="",...t},o)=>{const{rootClass:i}=a(h);return e(d.Footer,{ref:o,className:n(`${i}-footer`,r),...t,children:s})}));A.displayName="AlertDialogFooter";const v=r((({children:s,className:r="",asChild:t=!1,id:l,...n},c)=>{const{rootClass:d,setTitleId:C,titleId:u}=a(h),N=m.useId(),f=l??N,g=o(f),D=o(u);return i((()=>{D.current=u}),[u]),i((()=>(g.current=f,f&&C(f),()=>{D.current===g.current&&C(void 0)})),[f,C]),e(p.h2,{ref:c,id:f,className:`${d}-title ${r}`,asChild:t,...n,children:s})}));v.displayName="AlertDialogTitle";const $=r((({children:s,className:r="",asChild:t=!1,id:l,...n},c)=>{const{rootClass:d,setDescriptionId:C,descriptionId:u}=a(h),N=m.useId(),f=l??N,g=o(f),D=o(u);return i((()=>{D.current=u}),[u]),i((()=>(g.current=f,f&&C(f),()=>{D.current===g.current&&C(void 0)})),[f,C]),e(p.p,{ref:c,id:f,className:`${d}-description ${r}`,asChild:t,...n,children:s})}));$.displayName="AlertDialogDescription";const O=()=>(console.warn("Direct usage of AlertDialog is not supported. Please use AlertDialog.Root, AlertDialog.Content, etc. instead."),null);O.Root=u,O.Trigger=f,O.Overlay=D,O.Portal=g,O.Content=N,O.Title=v,O.Description=$,O.Footer=A,O.Cancel=I,O.Action=y;export{O as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as r}from"react/jsx-runtime";import s from"react";import{c as t}from"./index-6If6D2Zi.js";import{c as a}from"./clsx-BaVHROc5.js";const e="AspectRatio",o=s.forwardRef((({children:s,customRootClass:o,className:m,ratio:c="1",...i},d)=>{isNaN(Number(c))&&!c.match(/^(\d+)\/(\d+)$/)&&(c="1"),Number(c)<=0&&(c="1");const l=t(o,e);return r("div",{ref:d,style:{aspectRatio:c},className:a(l,m),...i,children:s})}));o.displayName=e;export{o as default};
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
-
import AvatarPrimitiveFallback from '~/core/primitives/Avatar/fragments/AvatarPrimitiveFallback';
|
|
4
3
|
import AvatarPrimitiveRoot from '~/core/primitives/Avatar/fragments/AvatarPrimitiveRoot';
|
|
5
4
|
import AvatarPrimitiveImage from '~/core/primitives/Avatar/fragments/AvatarPrimitiveImage';
|
|
6
|
-
|
|
7
|
-
type AvatarFallbackProps = React__default.ComponentPropsWithoutRef<typeof AvatarPrimitiveFallback>;
|
|
5
|
+
import AvatarPrimitiveFallback from '~/core/primitives/Avatar/fragments/AvatarPrimitiveFallback';
|
|
8
6
|
|
|
9
7
|
type AvatarRootProps = React__default.ComponentPropsWithoutRef<typeof AvatarPrimitiveRoot> & {
|
|
10
8
|
customRootClass?: string;
|
|
@@ -16,6 +14,8 @@ type AvatarRootProps = React__default.ComponentPropsWithoutRef<typeof AvatarPrim
|
|
|
16
14
|
|
|
17
15
|
type AvatarImageProps = React__default.ComponentPropsWithoutRef<typeof AvatarPrimitiveImage>;
|
|
18
16
|
|
|
17
|
+
type AvatarFallbackProps = React__default.ComponentPropsWithoutRef<typeof AvatarPrimitiveFallback>;
|
|
18
|
+
|
|
19
19
|
declare const Avatar: {
|
|
20
20
|
(): null;
|
|
21
21
|
displayName: string;
|
|
@@ -29,3 +29,4 @@ declare namespace AvatarProps {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export { AvatarProps, Avatar as default };
|
|
32
|
+
export type { AvatarFallbackProps, AvatarImageProps, AvatarRootProps };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as a}from"react/jsx-runtime";import r,{createContext as s,useContext as o}from"react";import{A as t,a as e,b as l}from"./AvatarPrimitiveFallback-KiY3slgV.js";import{c}from"./clsx-BaVHROc5.js";import{c as i}from"./index-6If6D2Zi.js";import{c as m,a as n,b as d}from"./index-3dZuI04X.js";import"./index-98jQ1vTr.js";const f=s({size:"",variant:"",color:"",rootClass:""}),v="Avatar",p=r.forwardRef((({children:r,customRootClass:s="",className:o="",size:e="",variant:l="",color:p="",...u},A)=>{const N=i(s,v),b=m("avatar",{variant:l,size:e}),j=d(p),x=n(b,j);return a(f.Provider,{value:{size:e,variant:l,color:p,rootClass:N},children:a(t,{ref:A,className:c(N,o),...x,...u,children:r})})}));p.displayName=v;const u=r.forwardRef((({src:r="",alt:s="",...t},l)=>{const{rootClass:i}=o(f);return a(e,{ref:l,className:c(`${i}-image`),src:r,alt:s,...t})}));u.displayName="AvatarImage";const A=r.forwardRef((({children:r,className:s="",...t},e)=>{const{rootClass:i}=o(f);return a(l,{ref:e,className:c(`${i}-fallback`,s),...t,children:r})}));A.displayName="AvatarFallback";const N=()=>(console.warn("Direct usage of Avatar is not supported. Please use Avatar.Root, Avatar.Image, Avatar.Fallback instead."),null);N.displayName="Avatar",N.Root=p,N.Image=u,N.Fallback=A;export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as a}from"react/jsx-runtime";import r,{createContext as s,useContext as t}from"react";import{c as o}from"./clsx-BaVHROc5.js";import{c as e}from"./index-6If6D2Zi.js";import{c as l,a as c,b as i}from"./index-3dZuI04X.js";import{A as n,a as m,b as d}from"./AvatarPrimitiveFallback-KiY3slgV.js";import"./index-98jQ1vTr.js";const p=s({rootClass:"",size:"",variant:""}),v="AvatarGroup",f=r.forwardRef((({customRootClass:r="",size:s="",variant:t="",children:i,className:n="",...m},d)=>{const f=e(r,v),u=l("avatar",{variant:t,size:s}),A=c(u);return a(p.Provider,{value:{size:s,variant:t,rootClass:f},children:a("div",{ref:d,className:o(f,n),...A,...m,children:i})})}));f.displayName=v;const u=r.forwardRef((({color:r="",children:s,className:e,...l},m)=>{const{rootClass:d}=t(p),v=i(r),f=c(v);return a(n,{ref:m,className:o(`${d}-item`,e),...f,...l,children:s})}));u.displayName="AvatarGroupItem";const A=r.forwardRef((({src:r,alt:s,...t},o)=>a(m,{ref:o,src:r,alt:s,...t})));A.displayName="AvatarGroupAvatar";const N=r.forwardRef((({children:r,className:s,...e},l)=>{const{rootClass:c}=t(p);return a(d,{ref:l,className:o(`${c}-fallback`,s),...e,children:r})}));N.displayName="AvatarGroupFallback";const G=()=>(console.warn("Direct usage of AvatarGroup is not supported. Please use AvatarGroup.Root, AvatarGroup.Item, AvatarGroup.Avatar, AvatarGroup.Fallback instead."),null);G.Root=f,G.Item=u,G.Avatar=A,G.Fallback=N;export{G as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use client';import{jsx as r}from"react/jsx-runtime";import a,{createContext as e,useState as i,useMemo as s,useContext as o,useEffect as n}from"react";import{P as t}from"./index-98jQ1vTr.js";const d=e({}),l=a.forwardRef((({children:e,asChild:o=!1,...n},l)=>{const[m,c]=i(!1),[h,p]=i(!1),f=s((()=>{if(!e)return!1;const r=e=>{if(a.isValidElement(e)){if("img"===e.type&&e.props?.src)return!0;if(e.props?.src)return!0;if(e.props?.children)return a.Children.toArray(e.props.children).some(r)}return!1};return a.Children.toArray(e).some(r)}),[e]),u={isImageLoaded:m,hasError:h,setHasError:p,handleLoadImage:()=>{c(!0),p(!1)},handleErrorImage:()=>{c(!1),p(!0)}};return r(d.Provider,{value:u,children:r(t.span,{ref:l,asChild:o,"data-rad-ui-has-image":f?"":void 0,...n,children:e})})}));l.displayName="AvatarPrimitiveRoot";const m=a.forwardRef((({src:a="",alt:e="",...i},s)=>{const{handleErrorImage:l,handleLoadImage:m,hasError:c}=o(d);return c?null:(n((()=>{a||l()}),[a,l,c]),r(t.img,{ref:s,src:a,alt:e,onError:l,onLoad:m,...i}))}));m.displayName="AvatarPrimitiveImage";const c=a.forwardRef((({children:a,asChild:e=!1,className:i="",...s},n)=>{const{isImageLoaded:l}=o(d);return l?null:r(t.span,{ref:n,asChild:e,className:i,...s,children:a})}));c.displayName="AvatarPrimitiveFallback";export{l as A,m as a,c as b};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
type BadgeVariant = 'solid' | 'soft' | 'surface' | 'outline' | 'ghost';
|
|
4
|
+
type BadgeSize = 'small' | 'medium' | 'large' | 'x-large';
|
|
3
5
|
type BadgeProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
4
6
|
customRootClass?: string;
|
|
5
|
-
variant?:
|
|
6
|
-
size?:
|
|
7
|
+
variant?: BadgeVariant;
|
|
8
|
+
size?: BadgeSize;
|
|
7
9
|
color?: string;
|
|
8
10
|
};
|
|
9
11
|
declare const Badge: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
12
|
customRootClass?: string;
|
|
11
|
-
variant?:
|
|
12
|
-
size?:
|
|
13
|
+
variant?: BadgeVariant;
|
|
14
|
+
size?: BadgeSize;
|
|
13
15
|
color?: string;
|
|
14
16
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
17
|
|
package/dist/components/Badge.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as a}from"react/jsx-runtime";import r from"react";import{c as s}from"./index-6If6D2Zi.js";import{c as e}from"./clsx-BaVHROc5.js";import{c as o,a as i,b as m}from"./index-3dZuI04X.js";const t="Badge",c=r.forwardRef((({children:r,customRootClass:c="",className:d="",color:l="",variant:n="solid",size:f="medium",...p},u)=>{const x=s(c,t),j=o("badge",{variant:n,size:f}),v=m(l),N=i(j,v);return a("div",{ref:u,className:e(x,d),...N,...p,children:r})}));c.displayName=t;export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as o}from"react/jsx-runtime";import a from"react";import{c as r}from"./clsx-BaVHROc5.js";import{c as t}from"./index-6If6D2Zi.js";const e="BlockQuote",c=a.forwardRef((({children:a,customRootClass:c="",className:s="",color:i="",variant:l="",size:m="",...d},n)=>{const u=t(c,e),f={};return l&&(f["data-block-quote-variant"]=l),m&&(f["data-block-quote-size"]=m),i&&(f["data-rad-ui-accent-color"]=i),o("blockquote",{ref:n,className:r(u,s),...d,...f,children:a})}));c.displayName=e;export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import{
|
|
1
|
+
'use client';import{jsx as t}from"react/jsx-runtime";import{forwardRef as o}from"react";import{c as a}from"./index-6If6D2Zi.js";import{c as s}from"./clsx-BaVHROc5.js";import{B as r}from"./index-BOy86lYu.js";import{c as i,a as e,b as n}from"./index-3dZuI04X.js";import"./index-98jQ1vTr.js";const d="Button",m=o((({children:o,type:m="button",customRootClass:c="",className:l="",variant:p="",size:f="",color:u="",disabled:x=!1,onClick:b,...j},v)=>{const y=a(c,d),C=i("button",{variant:p,size:f}),N=n(u),h=e(C,N);return t(r,{ref:v,type:m,disabled:x,"data-disabled":x?"":void 0,className:s(y,l),...h,onClick:t=>{if(x)return t.preventDefault(),void t.stopPropagation();b?.(t)},...j,children:o})}));m.displayName=d;export{m as default};
|