@wow-two-beta/ui 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/index.d.ts +240 -2
- package/dist/actions/index.js +5 -2
- package/dist/chunk-33IOXQYO.js +47 -0
- package/dist/chunk-33IOXQYO.js.map +1 -0
- package/dist/chunk-4CIRBYYP.js +120 -0
- package/dist/chunk-4CIRBYYP.js.map +1 -0
- package/dist/chunk-6NYTRHP7.js +168 -0
- package/dist/chunk-6NYTRHP7.js.map +1 -0
- package/dist/chunk-77WSI427.js +39 -0
- package/dist/chunk-77WSI427.js.map +1 -0
- package/dist/chunk-BMBIZLO4.js +34 -0
- package/dist/chunk-BMBIZLO4.js.map +1 -0
- package/dist/chunk-D67WGR7Y.js +212 -0
- package/dist/chunk-D67WGR7Y.js.map +1 -0
- package/dist/chunk-DN7WBRIV.js +17 -0
- package/dist/chunk-DN7WBRIV.js.map +1 -0
- package/dist/chunk-JCMV6IT4.js +268 -0
- package/dist/chunk-JCMV6IT4.js.map +1 -0
- package/dist/chunk-JTJEI6MF.js +11 -0
- package/dist/chunk-JTJEI6MF.js.map +1 -0
- package/dist/chunk-KSJE3JAI.js +604 -0
- package/dist/chunk-KSJE3JAI.js.map +1 -0
- package/dist/chunk-KZ4VFY2T.js +11 -0
- package/dist/chunk-KZ4VFY2T.js.map +1 -0
- package/dist/chunk-MP4OTUFA.js +318 -0
- package/dist/chunk-MP4OTUFA.js.map +1 -0
- package/dist/chunk-Q27NAHVB.js +34 -0
- package/dist/chunk-Q27NAHVB.js.map +1 -0
- package/dist/chunk-SYG6ZE42.js +218 -0
- package/dist/chunk-SYG6ZE42.js.map +1 -0
- package/dist/chunk-TDX22OWF.js +33 -0
- package/dist/chunk-TDX22OWF.js.map +1 -0
- package/dist/chunk-YLN7VMYU.js +275 -0
- package/dist/chunk-YLN7VMYU.js.map +1 -0
- package/dist/display/index.d.ts +805 -1
- package/dist/display/index.js +6 -1
- package/dist/feedback/index.d.ts +506 -1
- package/dist/feedback/index.js +5 -1
- package/dist/forms/index.d.ts +217 -1
- package/dist/forms/index.js +8 -1
- package/dist/hooks/index.d.ts +2 -5
- package/dist/hooks/index.js +4 -1
- package/dist/icons/index.d.ts +2 -5
- package/dist/icons/index.js +3 -1
- package/dist/index-Bk6CuDNT.d.ts +247 -0
- package/dist/index-C0IDphm_.d.ts +61 -0
- package/dist/index-CEAM9LLM.d.ts +37 -0
- package/dist/index-PAuwodyY.d.ts +103 -0
- package/dist/index-goThcZ1E.d.ts +416 -0
- package/dist/index.d.ts +13 -5
- package/dist/index.js +16 -9
- package/dist/layout/index.d.ts +605 -1
- package/dist/layout/index.js +5 -1
- package/dist/primitives/index.d.ts +5 -0
- package/dist/primitives/index.js +10 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/tailwind/index.js +8 -2
- package/dist/tailwind/index.js.map +1 -1
- package/dist/tokens/index.d.ts +1 -1
- package/dist/tokens/index.js +1 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.js +3 -1
- package/package.json +8 -1
- package/dist/chunk-6YKPUEHU.js +0 -47
- package/dist/chunk-6YKPUEHU.js.map +0 -1
- package/dist/chunk-7CP7KR5F.js +0 -41
- package/dist/chunk-7CP7KR5F.js.map +0 -1
- package/dist/chunk-A2OBJDIK.js +0 -3
- package/dist/chunk-A2OBJDIK.js.map +0 -1
- package/dist/chunk-CTVGU35H.js +0 -6
- package/dist/chunk-CTVGU35H.js.map +0 -1
- package/dist/chunk-ECZ4YFAI.js +0 -16
- package/dist/chunk-ECZ4YFAI.js.map +0 -1
- package/dist/chunk-PSDQXPUE.js +0 -3
- package/dist/chunk-PSDQXPUE.js.map +0 -1
- package/dist/chunk-U4JXXIE2.js +0 -6
- package/dist/chunk-U4JXXIE2.js.map +0 -1
- package/dist/chunk-YP4MAZRQ.js +0 -3
- package/dist/chunk-YP4MAZRQ.js.map +0 -1
- package/dist/chunk-ZDU7SROW.js +0 -3
- package/dist/chunk-ZDU7SROW.js.map +0 -1
- package/dist/index-CdSRWb8y.d.ts +0 -78
- package/dist/index-D-adCzNR.d.ts +0 -14
package/dist/forms/index.d.ts
CHANGED
|
@@ -1,2 +1,218 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { LabelHTMLAttributes, ComponentPropsWithoutRef, FieldsetHTMLAttributes, HTMLAttributes, InputHTMLAttributes, TextareaHTMLAttributes } from 'react';
|
|
3
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
4
|
+
import { VariantProps } from 'tailwind-variants';
|
|
5
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
1
6
|
|
|
2
|
-
|
|
7
|
+
interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
8
|
+
/** Show a `*` indicator. Auto-derived from `FormControl.isRequired` when present. */
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* `<label>` wired to `FormControl` context — when wrapped in a `FormControl`
|
|
13
|
+
* it auto-fills `htmlFor` and `id`. Standalone use: pass `htmlFor` directly.
|
|
14
|
+
*/
|
|
15
|
+
declare const Label: react.ForwardRefExoticComponent<LabelProps & react.RefAttributes<HTMLLabelElement>>;
|
|
16
|
+
|
|
17
|
+
type FormHelperTextProps = ComponentPropsWithoutRef<'p'>;
|
|
18
|
+
/**
|
|
19
|
+
* Helper / hint text below a form control. Reads `helperId` from
|
|
20
|
+
* `FormControl` so the input can reference it via `aria-describedby`.
|
|
21
|
+
*/
|
|
22
|
+
declare const FormHelperText: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
23
|
+
|
|
24
|
+
type FormErrorMessageProps = ComponentPropsWithoutRef<'p'>;
|
|
25
|
+
/**
|
|
26
|
+
* Error copy under a form control. Renders only when the surrounding
|
|
27
|
+
* `FormControl` is `isInvalid`. `id={errorId}` for `aria-describedby` wiring.
|
|
28
|
+
*/
|
|
29
|
+
declare const FormErrorMessage: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & react.RefAttributes<HTMLParagraphElement>>;
|
|
30
|
+
|
|
31
|
+
type FieldsetProps = FieldsetHTMLAttributes<HTMLFieldSetElement>;
|
|
32
|
+
/**
|
|
33
|
+
* Semantic `<fieldset>` for grouping related controls. Pair with `Legend`
|
|
34
|
+
* for the group label.
|
|
35
|
+
*/
|
|
36
|
+
declare const Fieldset: react.ForwardRefExoticComponent<FieldsetProps & react.RefAttributes<HTMLFieldSetElement>>;
|
|
37
|
+
|
|
38
|
+
type LegendProps = HTMLAttributes<HTMLLegendElement>;
|
|
39
|
+
/**
|
|
40
|
+
* `<legend>` styled to match `Label`. Pair with `Fieldset`.
|
|
41
|
+
*/
|
|
42
|
+
declare const Legend: react.ForwardRefExoticComponent<LegendProps & react.RefAttributes<HTMLLegendElement>>;
|
|
43
|
+
|
|
44
|
+
declare const inputBaseVariants: tailwind_variants.TVReturnType<{
|
|
45
|
+
size: {
|
|
46
|
+
sm: string;
|
|
47
|
+
md: string;
|
|
48
|
+
lg: string;
|
|
49
|
+
};
|
|
50
|
+
state: {
|
|
51
|
+
default: string;
|
|
52
|
+
invalid: string;
|
|
53
|
+
};
|
|
54
|
+
}, undefined, "flex w-full rounded-md border bg-white text-neutral-900 placeholder:text-neutral-400 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 disabled:cursor-not-allowed disabled:opacity-60 read-only:bg-neutral-50", tailwind_variants_dist_config_js.TVConfig<{
|
|
55
|
+
size: {
|
|
56
|
+
sm: string;
|
|
57
|
+
md: string;
|
|
58
|
+
lg: string;
|
|
59
|
+
};
|
|
60
|
+
state: {
|
|
61
|
+
default: string;
|
|
62
|
+
invalid: string;
|
|
63
|
+
};
|
|
64
|
+
}, {
|
|
65
|
+
size: {
|
|
66
|
+
sm: string;
|
|
67
|
+
md: string;
|
|
68
|
+
lg: string;
|
|
69
|
+
};
|
|
70
|
+
state: {
|
|
71
|
+
default: string;
|
|
72
|
+
invalid: string;
|
|
73
|
+
};
|
|
74
|
+
}>, {
|
|
75
|
+
size: {
|
|
76
|
+
sm: string;
|
|
77
|
+
md: string;
|
|
78
|
+
lg: string;
|
|
79
|
+
};
|
|
80
|
+
state: {
|
|
81
|
+
default: string;
|
|
82
|
+
invalid: string;
|
|
83
|
+
};
|
|
84
|
+
}, undefined, tailwind_variants.TVReturnType<{
|
|
85
|
+
size: {
|
|
86
|
+
sm: string;
|
|
87
|
+
md: string;
|
|
88
|
+
lg: string;
|
|
89
|
+
};
|
|
90
|
+
state: {
|
|
91
|
+
default: string;
|
|
92
|
+
invalid: string;
|
|
93
|
+
};
|
|
94
|
+
}, undefined, "flex w-full rounded-md border bg-white text-neutral-900 placeholder:text-neutral-400 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 disabled:cursor-not-allowed disabled:opacity-60 read-only:bg-neutral-50", tailwind_variants_dist_config_js.TVConfig<{
|
|
95
|
+
size: {
|
|
96
|
+
sm: string;
|
|
97
|
+
md: string;
|
|
98
|
+
lg: string;
|
|
99
|
+
};
|
|
100
|
+
state: {
|
|
101
|
+
default: string;
|
|
102
|
+
invalid: string;
|
|
103
|
+
};
|
|
104
|
+
}, {
|
|
105
|
+
size: {
|
|
106
|
+
sm: string;
|
|
107
|
+
md: string;
|
|
108
|
+
lg: string;
|
|
109
|
+
};
|
|
110
|
+
state: {
|
|
111
|
+
default: string;
|
|
112
|
+
invalid: string;
|
|
113
|
+
};
|
|
114
|
+
}>, unknown, unknown, undefined>>;
|
|
115
|
+
type InputBaseVariants = VariantProps<typeof inputBaseVariants>;
|
|
116
|
+
|
|
117
|
+
interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>, InputBaseVariants {
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Single-line text input. For email/tel/url/number/password/search variants
|
|
121
|
+
* use the dedicated input component (each carries only the props/buttons it
|
|
122
|
+
* actually needs).
|
|
123
|
+
*/
|
|
124
|
+
declare const TextInput: react.ForwardRefExoticComponent<TextInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
125
|
+
|
|
126
|
+
interface EmailInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>, InputBaseVariants {
|
|
127
|
+
}
|
|
128
|
+
/** `<input type="email">` with sensible defaults (autocomplete, inputmode). */
|
|
129
|
+
declare const EmailInput: react.ForwardRefExoticComponent<EmailInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
130
|
+
|
|
131
|
+
interface TelInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>, InputBaseVariants {
|
|
132
|
+
}
|
|
133
|
+
/** `<input type="tel">` with `inputmode="tel"` and `autocomplete="tel"`. */
|
|
134
|
+
declare const TelInput: react.ForwardRefExoticComponent<TelInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
135
|
+
|
|
136
|
+
interface UrlInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>, InputBaseVariants {
|
|
137
|
+
}
|
|
138
|
+
/** `<input type="url">` with `inputmode="url"` and `autocomplete="url"`. */
|
|
139
|
+
declare const UrlInput: react.ForwardRefExoticComponent<UrlInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
140
|
+
|
|
141
|
+
interface NumberInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>, InputBaseVariants {
|
|
142
|
+
step?: number;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Numeric input with stepper buttons. Steppers are raw `<button>` elements
|
|
146
|
+
* (not `IconButton`) to keep the strict atom rule.
|
|
147
|
+
*/
|
|
148
|
+
declare const NumberInput: react.ForwardRefExoticComponent<NumberInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
149
|
+
|
|
150
|
+
interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>, InputBaseVariants {
|
|
151
|
+
/** Whether to render the visibility-toggle button. Default true. */
|
|
152
|
+
toggleable?: boolean;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Password input with optional visibility toggle. Toggle is a raw `<button>`
|
|
156
|
+
* to keep the strict atom rule.
|
|
157
|
+
*/
|
|
158
|
+
declare const PasswordInput: react.ForwardRefExoticComponent<PasswordInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
159
|
+
|
|
160
|
+
interface SearchInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'>, InputBaseVariants {
|
|
161
|
+
/** Show a clear (×) button when the input has a value. Default true. */
|
|
162
|
+
clearable?: boolean;
|
|
163
|
+
onClear?: () => void;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Search input with leading search icon and optional clear button.
|
|
167
|
+
* Buttons are raw `<button>` elements to keep the strict atom rule.
|
|
168
|
+
*/
|
|
169
|
+
declare const SearchInput: react.ForwardRefExoticComponent<SearchInputProps & react.RefAttributes<HTMLInputElement>>;
|
|
170
|
+
|
|
171
|
+
interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'>, InputBaseVariants {
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Multi-line text input. Inherits the input visual base. For autosize, pair
|
|
175
|
+
* with a sibling-domain hook in v1 — kept simple at L3.
|
|
176
|
+
*/
|
|
177
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
178
|
+
|
|
179
|
+
interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
180
|
+
size?: 'sm' | 'md' | 'lg';
|
|
181
|
+
/** Tristate visual — input is `checked={false}` but rendered as a dash. */
|
|
182
|
+
indeterminate?: boolean;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Native checkbox with custom visual. Renders the input visually hidden but
|
|
186
|
+
* accessible — wrap in a `<label>` (or pair with `Label` via `FormControl`).
|
|
187
|
+
*/
|
|
188
|
+
declare const Checkbox: react.ForwardRefExoticComponent<CheckboxProps & react.RefAttributes<HTMLInputElement>>;
|
|
189
|
+
|
|
190
|
+
interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
191
|
+
size?: 'sm' | 'md' | 'lg';
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Native radio button with custom visual. Use multiple with the same `name`
|
|
195
|
+
* to form a mutually exclusive group; for arrow-key nav, wrap in
|
|
196
|
+
* `RadioGroup` (L4).
|
|
197
|
+
*/
|
|
198
|
+
declare const Radio: react.ForwardRefExoticComponent<RadioProps & react.RefAttributes<HTMLInputElement>>;
|
|
199
|
+
|
|
200
|
+
interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
201
|
+
size?: 'sm' | 'md' | 'lg';
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Toggle switch — native checkbox styled as an iOS-style track + thumb.
|
|
205
|
+
* Strict atom: no built-in label; pair via `FormControl` or wrap manually.
|
|
206
|
+
*/
|
|
207
|
+
declare const Switch: react.ForwardRefExoticComponent<SwitchProps & react.RefAttributes<HTMLInputElement>>;
|
|
208
|
+
|
|
209
|
+
interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
210
|
+
size?: 'sm' | 'md' | 'lg';
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Single-value range slider — native `<input type="range">` styled across
|
|
214
|
+
* browsers. Multi-thumb / range slider lives at L5.
|
|
215
|
+
*/
|
|
216
|
+
declare const Slider: react.ForwardRefExoticComponent<SliderProps & react.RefAttributes<HTMLInputElement>>;
|
|
217
|
+
|
|
218
|
+
export { Checkbox, type CheckboxProps, EmailInput, type EmailInputProps, Fieldset, type FieldsetProps, FormErrorMessage, type FormErrorMessageProps, FormHelperText, type FormHelperTextProps, Label, type LabelProps, Legend, type LegendProps, NumberInput, type NumberInputProps, PasswordInput, type PasswordInputProps, Radio, type RadioProps, SearchInput, type SearchInputProps, Slider, type SliderProps, Switch, type SwitchProps, TelInput, type TelInputProps, TextInput, type TextInputProps, Textarea, type TextareaProps, UrlInput, type UrlInputProps };
|
package/dist/forms/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
export { Checkbox, EmailInput, Fieldset, FormErrorMessage, FormHelperText, Label, Legend, NumberInput, PasswordInput, Radio, SearchInput, Slider, Switch, TelInput, TextInput, Textarea, UrlInput } from '../chunk-KSJE3JAI.js';
|
|
2
|
+
import '../chunk-TDX22OWF.js';
|
|
3
|
+
import '../chunk-Q27NAHVB.js';
|
|
4
|
+
import '../chunk-JTJEI6MF.js';
|
|
5
|
+
import '../chunk-BMBIZLO4.js';
|
|
6
|
+
import '../chunk-DN7WBRIV.js';
|
|
7
|
+
import '../chunk-KZ4VFY2T.js';
|
|
8
|
+
import '../chunk-PZ5AY32C.js';
|
|
2
9
|
//# sourceMappingURL=index.js.map
|
|
3
10
|
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export { index as i };
|
|
1
|
+
export { D as DisclosureControls, u as useControlled, a as useDisclosure, b as useEscape, c as useEventListener, d as useFocusTrap, e as useId, f as useMediaQuery, g as useOutsideClick, h as useResizeObserver, j as useScrollLock } from '../index-PAuwodyY.js';
|
|
2
|
+
import 'react';
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export { useControlled, useDisclosure, useEscape, useEventListener, useFocusTrap, useMediaQuery, useOutsideClick, useResizeObserver } from '../chunk-6NYTRHP7.js';
|
|
2
|
+
export { useScrollLock } from '../chunk-77WSI427.js';
|
|
3
|
+
export { useId } from '../chunk-JTJEI6MF.js';
|
|
4
|
+
import '../chunk-PZ5AY32C.js';
|
|
2
5
|
//# sourceMappingURL=index.js.map
|
|
3
6
|
//# sourceMappingURL=index.js.map
|
package/dist/icons/index.d.ts
CHANGED
package/dist/icons/index.js
CHANGED
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HTMLAttributes, ReactNode, ReactElement, KeyboardEvent as KeyboardEvent$1, Context } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import * as _radix_ui_react_focus_scope from '@radix-ui/react-focus-scope';
|
|
5
|
+
import { FocusScope as FocusScope$1 } from '@radix-ui/react-focus-scope';
|
|
6
|
+
import { Placement } from '@floating-ui/react';
|
|
7
|
+
|
|
8
|
+
interface SlotProps extends HTMLAttributes<HTMLElement> {
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Polymorphic slot — renders the single child element with the parent's props
|
|
13
|
+
* merged in (className concatenated, handlers chained, refs composed).
|
|
14
|
+
*
|
|
15
|
+
* Use to enable an `asChild` API on a component:
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <Button asChild><a href="/x">Open</a></Button>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare const Slot: react.ForwardRefExoticComponent<SlotProps & react.RefAttributes<HTMLElement>>;
|
|
21
|
+
|
|
22
|
+
interface PortalProps {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
/** Container to render into. Default: `document.body`. */
|
|
25
|
+
container?: HTMLElement | null;
|
|
26
|
+
/** Optional named layer — sets `data-portal-name` on the wrapper. */
|
|
27
|
+
name?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Render children into a different DOM node (default `document.body`).
|
|
31
|
+
* Client-only — package targets pure CSR consumers.
|
|
32
|
+
*/
|
|
33
|
+
declare function Portal({ children, container, name }: PortalProps): ReactNode;
|
|
34
|
+
|
|
35
|
+
type VisuallyHiddenProps = HTMLAttributes<HTMLSpanElement>;
|
|
36
|
+
/**
|
|
37
|
+
* Visually hidden span — content removed from the visual layout but still
|
|
38
|
+
* announced to screen readers. Use for accessible labels on icon-only
|
|
39
|
+
* affordances and live-region announcements.
|
|
40
|
+
*/
|
|
41
|
+
declare const VisuallyHidden: react.ForwardRefExoticComponent<VisuallyHiddenProps & react.RefAttributes<HTMLSpanElement>>;
|
|
42
|
+
|
|
43
|
+
interface PresenceProps {
|
|
44
|
+
/** Whether the content should be present. Toggle false to trigger exit. */
|
|
45
|
+
present: boolean;
|
|
46
|
+
/** Single React element child — receives `ref` and `data-state` ("open" | "closed"). */
|
|
47
|
+
children: ReactElement;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Defer unmount until the child's exit animation/transition finishes.
|
|
51
|
+
* Pass `present={false}` to start the exit; the child stays mounted with
|
|
52
|
+
* `data-state="closed"` until `animationend`/`transitionend` fires.
|
|
53
|
+
*/
|
|
54
|
+
declare function Presence({ present, children }: PresenceProps): ReactElement | null;
|
|
55
|
+
|
|
56
|
+
type Direction = 'ltr' | 'rtl';
|
|
57
|
+
interface DirectionProviderProps {
|
|
58
|
+
dir: Direction;
|
|
59
|
+
children: ReactNode;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Provide reading direction to descendants. Components that mirror in RTL
|
|
63
|
+
* (Tabs arrow keys, Slider, Carousel, etc.) read this via `useDirection()`.
|
|
64
|
+
*/
|
|
65
|
+
declare function DirectionProvider({ dir, children }: DirectionProviderProps): react_jsx_runtime.JSX.Element;
|
|
66
|
+
declare function useDirection(): Direction;
|
|
67
|
+
|
|
68
|
+
interface AccessibleIconProps {
|
|
69
|
+
/** Required accessible label for the icon. */
|
|
70
|
+
label: string;
|
|
71
|
+
/** Single icon element — will receive `aria-hidden` so SR reads only the label. */
|
|
72
|
+
children: ReactElement;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Wrap an icon-only element with an accessible label. The icon is hidden
|
|
76
|
+
* from assistive tech and a `VisuallyHidden` sibling provides the label.
|
|
77
|
+
*/
|
|
78
|
+
declare function AccessibleIcon({ label, children }: AccessibleIconProps): react_jsx_runtime.JSX.Element;
|
|
79
|
+
|
|
80
|
+
type FocusScopeProps = React.ComponentProps<typeof FocusScope$1>;
|
|
81
|
+
/**
|
|
82
|
+
* Trap focus within children. On unmount, returns focus to the previously
|
|
83
|
+
* focused element. Pass `loop` to wrap Tab navigation; `trapped` to enable
|
|
84
|
+
* the trap (default true while mounted).
|
|
85
|
+
*
|
|
86
|
+
* Wraps `@radix-ui/react-focus-scope` — battle-tested implementation.
|
|
87
|
+
*/
|
|
88
|
+
declare const FocusScope: react.ForwardRefExoticComponent<_radix_ui_react_focus_scope.FocusScopeProps & react.RefAttributes<HTMLDivElement>>;
|
|
89
|
+
|
|
90
|
+
interface DismissableLayerProps extends HTMLAttributes<HTMLDivElement> {
|
|
91
|
+
/** Called when Escape is pressed and this is the topmost layer. */
|
|
92
|
+
onEscape?: (event: KeyboardEvent) => void;
|
|
93
|
+
/** Called when a pointerdown lands outside this layer's DOM and this is topmost. */
|
|
94
|
+
onOutsidePointerDown?: (event: PointerEvent) => void;
|
|
95
|
+
/** Disable the Escape listener for this layer. */
|
|
96
|
+
disableEscape?: boolean;
|
|
97
|
+
/** Disable the outside-pointer-down listener for this layer. */
|
|
98
|
+
disableOutsideClick?: boolean;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Stack-aware dismissal layer. Multiple layers may stack (modal > popover);
|
|
102
|
+
* only the topmost reacts to Escape / outside click. Used as the base of
|
|
103
|
+
* Modal, Drawer, Popover, Menu, HoverCard, ContextMenu.
|
|
104
|
+
*/
|
|
105
|
+
declare const DismissableLayer: react.ForwardRefExoticComponent<DismissableLayerProps & react.RefAttributes<HTMLDivElement>>;
|
|
106
|
+
|
|
107
|
+
interface AnchoredPositionerProps extends HTMLAttributes<HTMLDivElement> {
|
|
108
|
+
/** The element the floating layer should be anchored to. */
|
|
109
|
+
anchor: HTMLElement | null;
|
|
110
|
+
/** Floating UI placement. Default `bottom`. */
|
|
111
|
+
placement?: Placement;
|
|
112
|
+
/** Distance between anchor and floating element in px. Default 8. */
|
|
113
|
+
offset?: number;
|
|
114
|
+
/** Render the floating element only when open. */
|
|
115
|
+
open?: boolean;
|
|
116
|
+
children: ReactNode;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Position children relative to an anchor element using Floating UI.
|
|
120
|
+
* Auto-flips and shifts to stay in viewport. Use as the positioning surface
|
|
121
|
+
* for Tooltip, Popover, Menu, HoverCard.
|
|
122
|
+
*/
|
|
123
|
+
declare const AnchoredPositioner: react.ForwardRefExoticComponent<AnchoredPositionerProps & react.RefAttributes<HTMLDivElement>>;
|
|
124
|
+
|
|
125
|
+
type Orientation = 'horizontal' | 'vertical' | 'both';
|
|
126
|
+
interface RovingFocusGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
127
|
+
orientation?: Orientation;
|
|
128
|
+
loop?: boolean;
|
|
129
|
+
children: ReactNode;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Provide arrow-key navigation for a group of focusable children. Children
|
|
133
|
+
* call `useRovingFocusItem()` to register and receive `tabIndex` / event
|
|
134
|
+
* handlers. Used by Tabs, ToggleGroup, RadioGroup, Menu.
|
|
135
|
+
*/
|
|
136
|
+
declare function RovingFocusGroup({ orientation, loop, children, ...props }: RovingFocusGroupProps): react_jsx_runtime.JSX.Element;
|
|
137
|
+
interface UseRovingFocusItemReturn {
|
|
138
|
+
ref: (node: HTMLElement | null) => void;
|
|
139
|
+
tabIndex: 0 | -1;
|
|
140
|
+
onKeyDown: (event: KeyboardEvent$1) => void;
|
|
141
|
+
onFocus: () => void;
|
|
142
|
+
'data-roving-focus-item': boolean;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Inside a `RovingFocusGroup`, returns props to spread onto a focusable item.
|
|
146
|
+
* Outside, returns inert props (tabIndex 0).
|
|
147
|
+
*/
|
|
148
|
+
declare function useRovingFocusItem(): UseRovingFocusItemReturn;
|
|
149
|
+
|
|
150
|
+
interface CollectionContextValue<T> {
|
|
151
|
+
items: T[];
|
|
152
|
+
register: (item: T) => void;
|
|
153
|
+
unregister: (item: T) => void;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Factory for a typed children-registry context. Compound components
|
|
157
|
+
* (Menu, Tabs, Listbox) use this so the parent can iterate ordered children
|
|
158
|
+
* without prop-drilling.
|
|
159
|
+
*/
|
|
160
|
+
declare function createCollection<T>(): {
|
|
161
|
+
Provider: (props: {
|
|
162
|
+
children: ReactNode;
|
|
163
|
+
}) => ReactNode;
|
|
164
|
+
useCollection: () => CollectionContextValue<T>;
|
|
165
|
+
Context: Context<CollectionContextValue<T> | null>;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
interface FormControlContextValue {
|
|
169
|
+
id: string;
|
|
170
|
+
labelId: string;
|
|
171
|
+
helperId: string;
|
|
172
|
+
errorId: string;
|
|
173
|
+
isInvalid: boolean;
|
|
174
|
+
isDisabled: boolean;
|
|
175
|
+
isRequired: boolean;
|
|
176
|
+
isReadOnly: boolean;
|
|
177
|
+
}
|
|
178
|
+
interface FormControlProviderProps {
|
|
179
|
+
/** Override the auto-generated id (also used as control's `id`). */
|
|
180
|
+
id?: string;
|
|
181
|
+
isInvalid?: boolean;
|
|
182
|
+
isDisabled?: boolean;
|
|
183
|
+
isRequired?: boolean;
|
|
184
|
+
isReadOnly?: boolean;
|
|
185
|
+
children: ReactNode;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Wires Label ↔ control ↔ HelperText/ErrorMessage via stable IDs and shared
|
|
189
|
+
* state flags. Used by `FormField` (L4) — atoms (Input, Label, etc.) read
|
|
190
|
+
* via `useFormControl()` to get the right `id`/`htmlFor`/`aria-describedby`.
|
|
191
|
+
*/
|
|
192
|
+
declare function FormControlProvider({ id: providedId, isInvalid, isDisabled, isRequired, isReadOnly, children, }: FormControlProviderProps): react_jsx_runtime.JSX.Element;
|
|
193
|
+
/**
|
|
194
|
+
* Read the surrounding form-control context. Returns `null` when used
|
|
195
|
+
* outside a provider — atoms gracefully degrade to standalone mode.
|
|
196
|
+
*/
|
|
197
|
+
declare function useFormControl(): FormControlContextValue | null;
|
|
198
|
+
|
|
199
|
+
interface ScrollLockProviderProps {
|
|
200
|
+
enabled?: boolean;
|
|
201
|
+
children: ReactNode;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Component wrapper around `useScrollLock` — handy when scroll lock should
|
|
205
|
+
* follow a child's mount lifecycle (e.g. inside a Modal's portal).
|
|
206
|
+
* Multiple wrappers stack; lock releases when the count reaches zero.
|
|
207
|
+
*/
|
|
208
|
+
declare function ScrollLockProvider({ enabled, children }: ScrollLockProviderProps): react_jsx_runtime.JSX.Element;
|
|
209
|
+
|
|
210
|
+
declare const index_AccessibleIcon: typeof AccessibleIcon;
|
|
211
|
+
type index_AccessibleIconProps = AccessibleIconProps;
|
|
212
|
+
declare const index_AnchoredPositioner: typeof AnchoredPositioner;
|
|
213
|
+
type index_AnchoredPositionerProps = AnchoredPositionerProps;
|
|
214
|
+
type index_CollectionContextValue<T> = CollectionContextValue<T>;
|
|
215
|
+
type index_Direction = Direction;
|
|
216
|
+
declare const index_DirectionProvider: typeof DirectionProvider;
|
|
217
|
+
type index_DirectionProviderProps = DirectionProviderProps;
|
|
218
|
+
declare const index_DismissableLayer: typeof DismissableLayer;
|
|
219
|
+
type index_DismissableLayerProps = DismissableLayerProps;
|
|
220
|
+
declare const index_FocusScope: typeof FocusScope;
|
|
221
|
+
type index_FocusScopeProps = FocusScopeProps;
|
|
222
|
+
type index_FormControlContextValue = FormControlContextValue;
|
|
223
|
+
declare const index_FormControlProvider: typeof FormControlProvider;
|
|
224
|
+
type index_FormControlProviderProps = FormControlProviderProps;
|
|
225
|
+
type index_Orientation = Orientation;
|
|
226
|
+
declare const index_Portal: typeof Portal;
|
|
227
|
+
type index_PortalProps = PortalProps;
|
|
228
|
+
declare const index_Presence: typeof Presence;
|
|
229
|
+
type index_PresenceProps = PresenceProps;
|
|
230
|
+
declare const index_RovingFocusGroup: typeof RovingFocusGroup;
|
|
231
|
+
type index_RovingFocusGroupProps = RovingFocusGroupProps;
|
|
232
|
+
declare const index_ScrollLockProvider: typeof ScrollLockProvider;
|
|
233
|
+
type index_ScrollLockProviderProps = ScrollLockProviderProps;
|
|
234
|
+
declare const index_Slot: typeof Slot;
|
|
235
|
+
type index_SlotProps = SlotProps;
|
|
236
|
+
type index_UseRovingFocusItemReturn = UseRovingFocusItemReturn;
|
|
237
|
+
declare const index_VisuallyHidden: typeof VisuallyHidden;
|
|
238
|
+
type index_VisuallyHiddenProps = VisuallyHiddenProps;
|
|
239
|
+
declare const index_createCollection: typeof createCollection;
|
|
240
|
+
declare const index_useDirection: typeof useDirection;
|
|
241
|
+
declare const index_useFormControl: typeof useFormControl;
|
|
242
|
+
declare const index_useRovingFocusItem: typeof useRovingFocusItem;
|
|
243
|
+
declare namespace index {
|
|
244
|
+
export { index_AccessibleIcon as AccessibleIcon, type index_AccessibleIconProps as AccessibleIconProps, index_AnchoredPositioner as AnchoredPositioner, type index_AnchoredPositionerProps as AnchoredPositionerProps, type index_CollectionContextValue as CollectionContextValue, type index_Direction as Direction, index_DirectionProvider as DirectionProvider, type index_DirectionProviderProps as DirectionProviderProps, index_DismissableLayer as DismissableLayer, type index_DismissableLayerProps as DismissableLayerProps, index_FocusScope as FocusScope, type index_FocusScopeProps as FocusScopeProps, type index_FormControlContextValue as FormControlContextValue, index_FormControlProvider as FormControlProvider, type index_FormControlProviderProps as FormControlProviderProps, type index_Orientation as Orientation, index_Portal as Portal, type index_PortalProps as PortalProps, index_Presence as Presence, type index_PresenceProps as PresenceProps, index_RovingFocusGroup as RovingFocusGroup, type index_RovingFocusGroupProps as RovingFocusGroupProps, index_ScrollLockProvider as ScrollLockProvider, type index_ScrollLockProviderProps as ScrollLockProviderProps, index_Slot as Slot, type index_SlotProps as SlotProps, type index_UseRovingFocusItemReturn as UseRovingFocusItemReturn, index_VisuallyHidden as VisuallyHidden, type index_VisuallyHiddenProps as VisuallyHiddenProps, index_createCollection as createCollection, index_useDirection as useDirection, index_useFormControl as useFormControl, index_useRovingFocusItem as useRovingFocusItem };
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export { AccessibleIcon as A, type CollectionContextValue as C, type Direction as D, FocusScope as F, type Orientation as O, Portal as P, RovingFocusGroup as R, ScrollLockProvider as S, type UseRovingFocusItemReturn as U, VisuallyHidden as V, type AccessibleIconProps as a, AnchoredPositioner as b, type AnchoredPositionerProps as c, DirectionProvider as d, type DirectionProviderProps as e, DismissableLayer as f, type DismissableLayerProps as g, type FocusScopeProps as h, index as i, type FormControlContextValue as j, FormControlProvider as k, type FormControlProviderProps as l, type PortalProps as m, Presence as n, type PresenceProps as o, type RovingFocusGroupProps as p, type ScrollLockProviderProps as q, Slot as r, type SlotProps as s, type VisuallyHiddenProps as t, createCollection as u, useDirection as v, useFormControl as w, useRovingFocusItem as x };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
import { Ref, SyntheticEvent, ElementType, ComponentPropsWithRef, PropsWithoutRef } from 'react';
|
|
3
|
+
import { VariantProps, tv } from 'tailwind-variants';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Conditional class composer with Tailwind conflict-resolution.
|
|
7
|
+
* Use anywhere you'd otherwise concatenate class strings.
|
|
8
|
+
*/
|
|
9
|
+
declare function cn(...inputs: ClassValue[]): string;
|
|
10
|
+
|
|
11
|
+
type PossibleRef<T> = Ref<T> | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Merge multiple React refs (callback or object) into a single callback ref.
|
|
14
|
+
* Use to forward a ref while also keeping a local ref to the same node.
|
|
15
|
+
*/
|
|
16
|
+
declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T | null) => void;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Chain two event handlers. The first handler runs, then the second — unless
|
|
20
|
+
* the first called `event.preventDefault()`, in which case the second is skipped.
|
|
21
|
+
* Use when overriding a default handler from a parent while still allowing
|
|
22
|
+
* the consumer to provide their own.
|
|
23
|
+
*/
|
|
24
|
+
declare function composeEventHandlers<E extends SyntheticEvent>(theirHandler: ((event: E) => void) | undefined, ourHandler: (event: E) => void, { checkForDefaultPrevented }?: {
|
|
25
|
+
checkForDefaultPrevented?: boolean;
|
|
26
|
+
}): (event: E) => void;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns `""` when the condition is true, `undefined` otherwise.
|
|
30
|
+
* Use for boolean `data-*` attributes — React strips the attr when value is undefined,
|
|
31
|
+
* so the DOM cleanly toggles `data-state` rather than `data-state="false"`.
|
|
32
|
+
*/
|
|
33
|
+
declare function dataAttr(condition: boolean | undefined): '' | undefined;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Props for a polymorphic component (`as` prop). Use only when a component
|
|
37
|
+
* meaningfully changes its DOM element — most components should use `Slot`/`asChild`
|
|
38
|
+
* instead.
|
|
39
|
+
*/
|
|
40
|
+
type PolymorphicProps<C extends ElementType, P = object> = P & Omit<ComponentPropsWithRef<C>, keyof P | 'as'> & {
|
|
41
|
+
as?: C;
|
|
42
|
+
};
|
|
43
|
+
type PolymorphicPropsWithoutRef<C extends ElementType, P = object> = P & Omit<PropsWithoutRef<ComponentPropsWithRef<C>>, keyof P | 'as'> & {
|
|
44
|
+
as?: C;
|
|
45
|
+
};
|
|
46
|
+
type PolymorphicRef<C extends ElementType> = ComponentPropsWithRef<C>['ref'];
|
|
47
|
+
|
|
48
|
+
type index_PolymorphicProps<C extends ElementType, P = object> = PolymorphicProps<C, P>;
|
|
49
|
+
type index_PolymorphicPropsWithoutRef<C extends ElementType, P = object> = PolymorphicPropsWithoutRef<C, P>;
|
|
50
|
+
type index_PolymorphicRef<C extends ElementType> = PolymorphicRef<C>;
|
|
51
|
+
declare const index_VariantProps: typeof VariantProps;
|
|
52
|
+
declare const index_cn: typeof cn;
|
|
53
|
+
declare const index_composeEventHandlers: typeof composeEventHandlers;
|
|
54
|
+
declare const index_composeRefs: typeof composeRefs;
|
|
55
|
+
declare const index_dataAttr: typeof dataAttr;
|
|
56
|
+
declare const index_tv: typeof tv;
|
|
57
|
+
declare namespace index {
|
|
58
|
+
export { type index_PolymorphicProps as PolymorphicProps, type index_PolymorphicPropsWithoutRef as PolymorphicPropsWithoutRef, type index_PolymorphicRef as PolymorphicRef, index_VariantProps as VariantProps, index_cn as cn, index_composeEventHandlers as composeEventHandlers, index_composeRefs as composeRefs, index_dataAttr as dataAttr, index_tv as tv };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { type PolymorphicProps as P, type PolymorphicPropsWithoutRef as a, type PolymorphicRef as b, cn as c, composeEventHandlers as d, composeRefs as e, dataAttr as f, index as i };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { SVGProps, ComponentType } from 'react';
|
|
3
|
+
|
|
4
|
+
interface IconAdapterProps extends SVGProps<SVGSVGElement> {
|
|
5
|
+
size?: number | string;
|
|
6
|
+
}
|
|
7
|
+
type IconAdapter = ComponentType<IconAdapterProps>;
|
|
8
|
+
interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'aria-hidden'> {
|
|
9
|
+
/** Icon component — pass a `lucide-react` icon, custom SVG component, or any matching shape. */
|
|
10
|
+
icon: IconAdapter;
|
|
11
|
+
/** Pixel size of the rendered SVG. Default 20. */
|
|
12
|
+
size?: number | string;
|
|
13
|
+
/**
|
|
14
|
+
* Provide an aria-label when the icon stands alone (decorative siblings
|
|
15
|
+
* should pass it via parent). Sets `role="img"` and unhides from AT.
|
|
16
|
+
* Without it, the icon is `aria-hidden` and decorative.
|
|
17
|
+
*/
|
|
18
|
+
'aria-label'?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Generic icon wrapper. Accepts any icon component matching the lucide-react
|
|
22
|
+
* shape (`{ size, color, className, ...svgProps }`).
|
|
23
|
+
*
|
|
24
|
+
* - Without `aria-label` → decorative, `aria-hidden`.
|
|
25
|
+
* - With `aria-label` → semantic, `role="img"`.
|
|
26
|
+
*/
|
|
27
|
+
declare const Icon: react.ForwardRefExoticComponent<Omit<IconProps, "ref"> & react.RefAttributes<SVGSVGElement>>;
|
|
28
|
+
|
|
29
|
+
declare const index_Icon: typeof Icon;
|
|
30
|
+
type index_IconAdapter = IconAdapter;
|
|
31
|
+
type index_IconAdapterProps = IconAdapterProps;
|
|
32
|
+
type index_IconProps = IconProps;
|
|
33
|
+
declare namespace index {
|
|
34
|
+
export { index_Icon as Icon, type index_IconAdapter as IconAdapter, type index_IconAdapterProps as IconAdapterProps, type index_IconProps as IconProps };
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { Icon as I, type IconAdapter as a, type IconAdapterProps as b, type IconProps as c, index as i };
|