asterui 0.10.3 → 0.12.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.
Files changed (317) hide show
  1. package/README.md +1 -100
  2. package/dist/components/Anchor.d.ts +45 -0
  3. package/dist/components/Diff.d.ts +12 -0
  4. package/dist/components/Kbd.d.ts +8 -0
  5. package/dist/components/Segmented.d.ts +37 -0
  6. package/dist/components/TextRotate.d.ts +13 -0
  7. package/dist/components/Tour.d.ts +61 -0
  8. package/dist/hooks/useClickOutside.d.ts +17 -0
  9. package/dist/hooks/useClipboard.d.ts +20 -0
  10. package/dist/hooks/useDebounce.d.ts +18 -0
  11. package/dist/hooks/useDisclosure.d.ts +20 -0
  12. package/dist/hooks/useHover.d.ts +18 -0
  13. package/dist/hooks/useKeyPress.d.ts +40 -0
  14. package/dist/hooks/useLocalStorage.d.ts +12 -0
  15. package/dist/hooks/usePrevious.d.ts +15 -0
  16. package/dist/hooks/useWindowSize.d.ts +21 -0
  17. package/dist/index.d.ts +26 -0
  18. package/dist/index.js +205 -174
  19. package/dist/index.js.map +1 -1
  20. package/dist/index10.js +92 -30
  21. package/dist/index10.js.map +1 -1
  22. package/dist/index100.js +12 -20
  23. package/dist/index100.js.map +1 -1
  24. package/dist/index101.js +29 -22
  25. package/dist/index101.js.map +1 -1
  26. package/dist/index102.js +17 -19
  27. package/dist/index102.js.map +1 -1
  28. package/dist/index103.js +10788 -95
  29. package/dist/index103.js.map +1 -1
  30. package/dist/index104.js +5 -360
  31. package/dist/index104.js.map +1 -1
  32. package/dist/index105.js +40 -23
  33. package/dist/index105.js.map +1 -1
  34. package/dist/index106.js +2 -73
  35. package/dist/index106.js.map +1 -1
  36. package/dist/index107.js +6 -15
  37. package/dist/index107.js.map +1 -1
  38. package/dist/index108.js +147 -61
  39. package/dist/index108.js.map +1 -1
  40. package/dist/index109.js +26 -140
  41. package/dist/index109.js.map +1 -1
  42. package/dist/index11.js +28 -263
  43. package/dist/index11.js.map +1 -1
  44. package/dist/index110.js +30 -2
  45. package/dist/index110.js.map +1 -1
  46. package/dist/index111.js +2 -56
  47. package/dist/index111.js.map +1 -1
  48. package/dist/index112.js +72 -2
  49. package/dist/index112.js.map +1 -1
  50. package/dist/index113.js +39 -2
  51. package/dist/index113.js.map +1 -1
  52. package/dist/index114.js +26 -2
  53. package/dist/index114.js.map +1 -1
  54. package/dist/index115.js +21 -2
  55. package/dist/index115.js.map +1 -1
  56. package/dist/index116.js +24 -2
  57. package/dist/index116.js.map +1 -1
  58. package/dist/index117.js +20 -2
  59. package/dist/index117.js.map +1 -1
  60. package/dist/index118.js +100 -2
  61. package/dist/index118.js.map +1 -1
  62. package/dist/index119.js +359 -31
  63. package/dist/index119.js.map +1 -1
  64. package/dist/index12.js +259 -89
  65. package/dist/index12.js.map +1 -1
  66. package/dist/index120.js +25 -2
  67. package/dist/index120.js.map +1 -1
  68. package/dist/index121.js +72 -7
  69. package/dist/index121.js.map +1 -1
  70. package/dist/index122.js +16 -2
  71. package/dist/index122.js.map +1 -1
  72. package/dist/index123.js +66 -2
  73. package/dist/index123.js.map +1 -1
  74. package/dist/index124.js +143 -20
  75. package/dist/index124.js.map +1 -1
  76. package/dist/index125.js +2 -2
  77. package/dist/index126.js +55 -23
  78. package/dist/index126.js.map +1 -1
  79. package/dist/index127.js +2 -71
  80. package/dist/index127.js.map +1 -1
  81. package/dist/index128.js +2 -21
  82. package/dist/index128.js.map +1 -1
  83. package/dist/index129.js +2 -34
  84. package/dist/index129.js.map +1 -1
  85. package/dist/index13.js +90 -153
  86. package/dist/index13.js.map +1 -1
  87. package/dist/index130.js +2 -70
  88. package/dist/index130.js.map +1 -1
  89. package/dist/index131.js +2 -2
  90. package/dist/index132.js +2 -2
  91. package/dist/index133.js +2 -22
  92. package/dist/index133.js.map +1 -1
  93. package/dist/index134.js +2 -2
  94. package/dist/index135.js +32 -2
  95. package/dist/index135.js.map +1 -1
  96. package/dist/index136.js +2 -2
  97. package/dist/index137.js +8 -2
  98. package/dist/index137.js.map +1 -1
  99. package/dist/index138.js +2 -4
  100. package/dist/index138.js.map +1 -1
  101. package/dist/index139.js +5 -0
  102. package/dist/index139.js.map +1 -0
  103. package/dist/index14.js +154 -146
  104. package/dist/index14.js.map +1 -1
  105. package/dist/index140.js +24 -0
  106. package/dist/index140.js.map +1 -0
  107. package/dist/index141.js +5 -0
  108. package/dist/index141.js.map +1 -0
  109. package/dist/index142.js +27 -0
  110. package/dist/index142.js.map +1 -0
  111. package/dist/index143.js +74 -0
  112. package/dist/index143.js.map +1 -0
  113. package/dist/index144.js +24 -0
  114. package/dist/index144.js.map +1 -0
  115. package/dist/index145.js +37 -0
  116. package/dist/index145.js.map +1 -0
  117. package/dist/index146.js +73 -0
  118. package/dist/index146.js.map +1 -0
  119. package/dist/index147.js +5 -0
  120. package/dist/index147.js.map +1 -0
  121. package/dist/index148.js +25 -0
  122. package/dist/index148.js.map +1 -0
  123. package/dist/index149.js +5 -0
  124. package/dist/index149.js.map +1 -0
  125. package/dist/index15.js +150 -5
  126. package/dist/index15.js.map +1 -1
  127. package/dist/index150.js +5 -0
  128. package/dist/index150.js.map +1 -0
  129. package/dist/index151.js +5 -0
  130. package/dist/index151.js.map +1 -0
  131. package/dist/index152.js +5 -0
  132. package/dist/index152.js.map +1 -0
  133. package/dist/index153.js +7 -0
  134. package/dist/index153.js.map +1 -0
  135. package/dist/index16.js +5 -71
  136. package/dist/index16.js.map +1 -1
  137. package/dist/index17.js +71 -17
  138. package/dist/index17.js.map +1 -1
  139. package/dist/index18.js +15 -96
  140. package/dist/index18.js.map +1 -1
  141. package/dist/index19.js +89 -105
  142. package/dist/index19.js.map +1 -1
  143. package/dist/index20.js +107 -177
  144. package/dist/index20.js.map +1 -1
  145. package/dist/index21.js +181 -107
  146. package/dist/index21.js.map +1 -1
  147. package/dist/index22.js +107 -29
  148. package/dist/index22.js.map +1 -1
  149. package/dist/index23.js +19 -41
  150. package/dist/index23.js.map +1 -1
  151. package/dist/index24.js +31 -11
  152. package/dist/index24.js.map +1 -1
  153. package/dist/index25.js +41 -33
  154. package/dist/index25.js.map +1 -1
  155. package/dist/index26.js +12 -63
  156. package/dist/index26.js.map +1 -1
  157. package/dist/index27.js +33 -80
  158. package/dist/index27.js.map +1 -1
  159. package/dist/index28.js +63 -18
  160. package/dist/index28.js.map +1 -1
  161. package/dist/index29.js +78 -159
  162. package/dist/index29.js.map +1 -1
  163. package/dist/index3.js +96 -27
  164. package/dist/index3.js.map +1 -1
  165. package/dist/index30.js +16 -1080
  166. package/dist/index30.js.map +1 -1
  167. package/dist/index31.js +159 -16
  168. package/dist/index31.js.map +1 -1
  169. package/dist/index32.js +1081 -121
  170. package/dist/index32.js.map +1 -1
  171. package/dist/index33.js +17 -39
  172. package/dist/index33.js.map +1 -1
  173. package/dist/index34.js +121 -190
  174. package/dist/index34.js.map +1 -1
  175. package/dist/index35.js +37 -94
  176. package/dist/index35.js.map +1 -1
  177. package/dist/index36.js +186 -157
  178. package/dist/index36.js.map +1 -1
  179. package/dist/index37.js +89 -138
  180. package/dist/index37.js.map +1 -1
  181. package/dist/index38.js +161 -14
  182. package/dist/index38.js.map +1 -1
  183. package/dist/index39.js +146 -21
  184. package/dist/index39.js.map +1 -1
  185. package/dist/index4.js +26 -99
  186. package/dist/index4.js.map +1 -1
  187. package/dist/index40.js +12 -116
  188. package/dist/index40.js.map +1 -1
  189. package/dist/index41.js +18 -13
  190. package/dist/index41.js.map +1 -1
  191. package/dist/index42.js +21 -35
  192. package/dist/index42.js.map +1 -1
  193. package/dist/index43.js +117 -114
  194. package/dist/index43.js.map +1 -1
  195. package/dist/index44.js +13 -176
  196. package/dist/index44.js.map +1 -1
  197. package/dist/index45.js +34 -146
  198. package/dist/index45.js.map +1 -1
  199. package/dist/index46.js +116 -12
  200. package/dist/index46.js.map +1 -1
  201. package/dist/index47.js +176 -22
  202. package/dist/index47.js.map +1 -1
  203. package/dist/index48.js +147 -14
  204. package/dist/index48.js.map +1 -1
  205. package/dist/index49.js +10 -5
  206. package/dist/index49.js.map +1 -1
  207. package/dist/index5.js +100 -60
  208. package/dist/index5.js.map +1 -1
  209. package/dist/index50.js +21 -265
  210. package/dist/index50.js.map +1 -1
  211. package/dist/index51.js +10 -13
  212. package/dist/index51.js.map +1 -1
  213. package/dist/index52.js +7 -122
  214. package/dist/index52.js.map +1 -1
  215. package/dist/index53.js +262 -106
  216. package/dist/index53.js.map +1 -1
  217. package/dist/index54.js +14 -167
  218. package/dist/index54.js.map +1 -1
  219. package/dist/index55.js +121 -31
  220. package/dist/index55.js.map +1 -1
  221. package/dist/index56.js +107 -119
  222. package/dist/index56.js.map +1 -1
  223. package/dist/index57.js +161 -77
  224. package/dist/index57.js.map +1 -1
  225. package/dist/index58.js +31 -19
  226. package/dist/index58.js.map +1 -1
  227. package/dist/index59.js +117 -69
  228. package/dist/index59.js.map +1 -1
  229. package/dist/index6.js +61 -130
  230. package/dist/index6.js.map +1 -1
  231. package/dist/index60.js +82 -53
  232. package/dist/index60.js.map +1 -1
  233. package/dist/index61.js +19 -44
  234. package/dist/index61.js.map +1 -1
  235. package/dist/index62.js +70 -48
  236. package/dist/index62.js.map +1 -1
  237. package/dist/index63.js +55 -60
  238. package/dist/index63.js.map +1 -1
  239. package/dist/index64.js +39 -101
  240. package/dist/index64.js.map +1 -1
  241. package/dist/index65.js +52 -41
  242. package/dist/index65.js.map +1 -1
  243. package/dist/index66.js +62 -21
  244. package/dist/index66.js.map +1 -1
  245. package/dist/index67.js +104 -43
  246. package/dist/index67.js.map +1 -1
  247. package/dist/index68.js +41 -134
  248. package/dist/index68.js.map +1 -1
  249. package/dist/index69.js +65 -49
  250. package/dist/index69.js.map +1 -1
  251. package/dist/index7.js +130 -11
  252. package/dist/index7.js.map +1 -1
  253. package/dist/index70.js +21 -22
  254. package/dist/index70.js.map +1 -1
  255. package/dist/index71.js +46 -22
  256. package/dist/index71.js.map +1 -1
  257. package/dist/index72.js +126 -321
  258. package/dist/index72.js.map +1 -1
  259. package/dist/index73.js +52 -56
  260. package/dist/index73.js.map +1 -1
  261. package/dist/index74.js +22 -40
  262. package/dist/index74.js.map +1 -1
  263. package/dist/index75.js +22 -95
  264. package/dist/index75.js.map +1 -1
  265. package/dist/index76.js +311 -112
  266. package/dist/index76.js.map +1 -1
  267. package/dist/index77.js +52 -157
  268. package/dist/index77.js.map +1 -1
  269. package/dist/index78.js +40 -65
  270. package/dist/index78.js.map +1 -1
  271. package/dist/index79.js +23 -35
  272. package/dist/index79.js.map +1 -1
  273. package/dist/index8.js +11 -70
  274. package/dist/index8.js.map +1 -1
  275. package/dist/index80.js +92 -31
  276. package/dist/index80.js.map +1 -1
  277. package/dist/index81.js +116 -196
  278. package/dist/index81.js.map +1 -1
  279. package/dist/index82.js +155 -207
  280. package/dist/index82.js.map +1 -1
  281. package/dist/index83.js +60 -290
  282. package/dist/index83.js.map +1 -1
  283. package/dist/index84.js +34 -177
  284. package/dist/index84.js.map +1 -1
  285. package/dist/index85.js +227 -251
  286. package/dist/index85.js.map +1 -1
  287. package/dist/index86.js +34 -14
  288. package/dist/index86.js.map +1 -1
  289. package/dist/index87.js +208 -31
  290. package/dist/index87.js.map +1 -1
  291. package/dist/index88.js +206 -10786
  292. package/dist/index88.js.map +1 -1
  293. package/dist/index89.js +295 -5
  294. package/dist/index89.js.map +1 -1
  295. package/dist/index9.js +69 -91
  296. package/dist/index9.js.map +1 -1
  297. package/dist/index90.js +172 -36
  298. package/dist/index90.js.map +1 -1
  299. package/dist/index91.js +258 -2
  300. package/dist/index91.js.map +1 -1
  301. package/dist/index92.js +13 -6
  302. package/dist/index92.js.map +1 -1
  303. package/dist/index93.js +32 -151
  304. package/dist/index93.js.map +1 -1
  305. package/dist/index94.js +5 -29
  306. package/dist/index94.js.map +1 -1
  307. package/dist/index95.js +12 -28
  308. package/dist/index95.js.map +1 -1
  309. package/dist/index96.js +46 -2
  310. package/dist/index96.js.map +1 -1
  311. package/dist/index97.js +12 -71
  312. package/dist/index97.js.map +1 -1
  313. package/dist/index98.js +13 -37
  314. package/dist/index98.js.map +1 -1
  315. package/dist/index99.js +7 -25
  316. package/dist/index99.js.map +1 -1
  317. package/package.json +1 -1
package/README.md CHANGED
@@ -102,106 +102,7 @@ export default function App() {
102
102
 
103
103
  ## Components
104
104
 
105
- ### General
106
- - **Typography** - Text, Title, Paragraph, and Link components with consistent styling
107
-
108
- ### Actions
109
- - **Button** - Buttons with multiple types, sizes, and variants
110
- - **Dropdown** - Composable dropdown menu with trigger, items, and dividers
111
- - **FloatButton** - Floating action button with BackTop variant
112
- - **ThemeController** - Theme switcher with swap and dropdown modes
113
-
114
- ### Data Entry
115
- - **Autocomplete** - Search and select with keyboard navigation and filtering
116
- - **Cascader** - Cascade selection for hierarchical data
117
- - **Checkbox** - Checkboxes with sizes, colors, and indeterminate state
118
- - **ColorPicker** - Color selection with presets and custom colors
119
- - **DatePicker** - Interactive calendar date picker with custom formatting
120
- - **Fieldset** - Fieldset container with legend
121
- - **FileInput** - File input with sizes and colors
122
- - **Form** - Form component with React Hook Form integration and validation
123
- - **Input** - Text inputs with types, sizes, colors, and input masking
124
- - **InputNumber** - Numeric input with increment/decrement controls
125
- - **Label** - Form labels with required indicator and floating labels
126
- - **Mention** - Input with @mention support for tagging users
127
- - **Radio** - Radio buttons with group support
128
- - **Range** - Range slider with min, max, and step support
129
- - **Rating** - Star rating component
130
- - **Select** - Select dropdown with sizes and colors
131
- - **Textarea** - Multiline text input
132
- - **TimePicker** - Time input with hour and minute selection
133
- - **Toggle** - Toggle switches with sizes and colors
134
- - **Transfer** - Double-column transfer for moving items between lists
135
- - **TreeSelect** - Tree selection dropdown for hierarchical data
136
- - **Upload** - File upload with drag and drop support
137
-
138
- ### Data Display
139
- - **Avatar** - User avatars with sizes, shapes, and group support
140
- - **Badge** - Notification badges, status indicators, and ribbons
141
- - **Card** - Composable card component with body, title, actions, and figure
142
- - **Carousel** - Image carousel with navigation and indicators
143
- - **Chart** - Data visualization with ApexCharts and theme integration
144
- - **Chat** - Chat message bubbles with avatars and timestamps
145
- - **Collapse** - Collapsible content panels
146
- - **Descriptions** - Display multiple read-only fields in groups
147
- - **Empty** - Empty state placeholder with custom images and actions
148
- - **Image** - Image component with fallback and preview support
149
- - **List** - Vertical list layout with customizable rows
150
- - **Pagination** - Page navigation with multiple sizes
151
- - **QRCode** - QR code generator
152
- - **Stats** - Statistics display with figures and actions
153
- - **Steps** - Step progress indicator
154
- - **Table** - Feature-rich data table with sorting and pagination
155
- - **Tag** - Categorization labels with colors and close button
156
- - **Timeline** - Timeline component for displaying chronological events
157
- - **Tree** - Hierarchical tree view with expand/collapse and selection
158
-
159
- ### Layout
160
- - **Affix** - Make elements stick to viewport when scrolling
161
- - **Divider** - Horizontal and vertical dividers with optional text
162
- - **Drawer** - Sidebar drawer with multiple placements
163
- - **Footer** - Footer component with title sections
164
- - **Grid** - Flexible grid system with Row and Col components
165
- - **Hero** - Hero section with overlay and content wrapping
166
- - **Indicator** - Position indicators on elements
167
- - **Join** - Join multiple elements together seamlessly
168
- - **Layout** - Page layout with Header, Sider, Content, and Footer
169
- - **Masonry** - Responsive masonry grid layout
170
- - **Space** - Layout component for consistent spacing between elements
171
- - **Splitter** - Resizable split panes for adjustable layouts
172
-
173
- ### Responsive
174
- - **Show/Hide** - Conditionally render content based on breakpoint
175
- - **useBreakpoint** - Hook for detecting current breakpoint and screen width
176
-
177
- ### Navigation
178
- - **Breadcrumb** - Breadcrumb navigation trail
179
- - **Menu** - Menu with vertical, horizontal, and inline modes
180
- - **Navbar** - Navigation bar with start, center, and end sections
181
- - **Tabs** - Tab navigation with multiple variants
182
-
183
- ### Feedback
184
- - **Alert** - Alert messages with multiple types and dismissible option
185
- - **Loading** - Loading spinners with sizes and overlay support
186
- - **Modal** - Modal dialogs with imperative API
187
- - **Notification** - Toast notifications with auto-dismiss and stacking
188
- - **Popconfirm** - Confirmation popover for actions
189
- - **Popover** - Floating content triggered by hover or click
190
- - **Progress** - Progress bars with colors and indeterminate state
191
- - **RadialProgress** - Circular progress indicator
192
- - **Result** - Result pages for operation outcomes
193
- - **Skeleton** - Loading placeholder with animated shimmer effect
194
- - **Tooltip** - Tooltips with multiple placements
195
-
196
- ### Mockup
197
- - **Browser** - Browser window mockup with URL bar
198
- - **Code** - Terminal-style code display with line highlighting
199
- - **Phone** - iPhone-style phone frame mockup
200
- - **Window** - OS-style window frame mockup
201
-
202
- ## Demo
203
-
204
- View live examples and documentation at [https://asterui.com](https://asterui.com)
105
+ 80+ components including forms, data display, navigation, feedback, and layout. See the full list at [asterui.com/components](https://asterui.com/components).
205
106
 
206
107
  ## Requirements
207
108
 
@@ -0,0 +1,45 @@
1
+ import { default as React } from 'react';
2
+ export interface AnchorLinkItem {
3
+ /** Target element id (without #) */
4
+ href: string;
5
+ /** Link title */
6
+ title: React.ReactNode;
7
+ /** Nested links */
8
+ children?: AnchorLinkItem[];
9
+ }
10
+ export interface AnchorProps {
11
+ /** Anchor links (alternative to Anchor.Link children) */
12
+ items?: AnchorLinkItem[];
13
+ /** Layout direction */
14
+ direction?: 'horizontal' | 'vertical';
15
+ /** Offset from top when calculating scroll position */
16
+ offsetTop?: number;
17
+ /** Target scroll container (default: window) */
18
+ getContainer?: () => HTMLElement | Window;
19
+ /** Callback when active link changes */
20
+ onChange?: (activeLink: string) => void;
21
+ /** Callback when link is clicked */
22
+ onClick?: (e: React.MouseEvent, link: {
23
+ href: string;
24
+ title: React.ReactNode;
25
+ }) => void;
26
+ /** Currently active link (controlled) */
27
+ activeLink?: string;
28
+ /** Custom class name */
29
+ className?: string;
30
+ /** Anchor.Link children */
31
+ children?: React.ReactNode;
32
+ }
33
+ export interface AnchorLinkProps {
34
+ /** Target element id (without #) */
35
+ href: string;
36
+ /** Link title */
37
+ title: React.ReactNode;
38
+ /** Nested links */
39
+ children?: React.ReactNode;
40
+ /** Custom class name */
41
+ className?: string;
42
+ }
43
+ export declare const Anchor: React.FC<AnchorProps> & {
44
+ Link: React.FC<AnchorLinkProps>;
45
+ };
@@ -0,0 +1,12 @@
1
+ import { default as React } from 'react';
2
+ export interface DiffProps {
3
+ /** Left side content (revealed when dragging) */
4
+ left: React.ReactNode;
5
+ /** Right side content (hidden when dragging) */
6
+ right: React.ReactNode;
7
+ /** Aspect ratio class (e.g., "aspect-16/9", "aspect-4/3", "aspect-square") */
8
+ aspect?: string;
9
+ /** Additional CSS classes */
10
+ className?: string;
11
+ }
12
+ export declare const Diff: React.FC<DiffProps>;
@@ -0,0 +1,8 @@
1
+ import { default as React } from 'react';
2
+ export interface KbdProps extends React.HTMLAttributes<HTMLElement> {
3
+ /** Size of the kbd */
4
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
5
+ /** Key content */
6
+ children?: React.ReactNode;
7
+ }
8
+ export declare const Kbd: React.FC<KbdProps>;
@@ -0,0 +1,37 @@
1
+ import { default as React } from 'react';
2
+ export type SegmentedValue = string | number;
3
+ export interface SegmentedItemProps {
4
+ /** Option value */
5
+ value: SegmentedValue;
6
+ /** Disable this option */
7
+ disabled?: boolean;
8
+ /** Icon to display before label */
9
+ icon?: React.ReactNode;
10
+ /** Label content */
11
+ children: React.ReactNode;
12
+ /** Additional CSS class */
13
+ className?: string;
14
+ }
15
+ declare const SegmentedItem: React.FC<SegmentedItemProps>;
16
+ export interface SegmentedProps {
17
+ /** Currently selected value (controlled) */
18
+ value?: SegmentedValue;
19
+ /** Default selected value (uncontrolled) */
20
+ defaultValue?: SegmentedValue;
21
+ /** Callback when selection changes */
22
+ onChange?: (value: SegmentedValue) => void;
23
+ /** Size variant */
24
+ size?: 'xs' | 'sm' | 'md' | 'lg';
25
+ /** Take full width of container */
26
+ block?: boolean;
27
+ /** Disable all options */
28
+ disabled?: boolean;
29
+ /** Additional CSS class */
30
+ className?: string;
31
+ /** Segmented.Item children */
32
+ children: React.ReactNode;
33
+ }
34
+ export declare const Segmented: React.FC<SegmentedProps> & {
35
+ Item: typeof SegmentedItem;
36
+ };
37
+ export {};
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ export type TextRotateDuration = 6000 | 9000 | 12000 | 15000 | 18000;
3
+ export interface TextRotateProps {
4
+ /** Text items to rotate through (max 6) */
5
+ items: React.ReactNode[];
6
+ /** Animation duration in ms (default 10000) */
7
+ duration?: TextRotateDuration;
8
+ /** Center text horizontally */
9
+ centered?: boolean;
10
+ /** Additional CSS classes */
11
+ className?: string;
12
+ }
13
+ export declare const TextRotate: React.FC<TextRotateProps>;
@@ -0,0 +1,61 @@
1
+ import { default as React } from 'react';
2
+ export type TourPlacement = 'top' | 'topLeft' | 'topRight' | 'bottom' | 'bottomLeft' | 'bottomRight' | 'left' | 'leftTop' | 'leftBottom' | 'right' | 'rightTop' | 'rightBottom' | 'center';
3
+ export interface TourStepProps {
4
+ /** Target element ref or function returning element */
5
+ target?: React.RefObject<HTMLElement | null> | (() => HTMLElement | null) | null;
6
+ /** Step title */
7
+ title: React.ReactNode;
8
+ /** Step description */
9
+ description?: React.ReactNode;
10
+ /** Cover image or content above title */
11
+ cover?: React.ReactNode;
12
+ /** Placement of popover relative to target */
13
+ placement?: TourPlacement;
14
+ /** Custom class for this step's popover */
15
+ className?: string;
16
+ /** Called when this step becomes active */
17
+ onOpen?: () => void;
18
+ /** Called when leaving this step */
19
+ onClose?: () => void;
20
+ }
21
+ export interface TourProps {
22
+ /** Whether tour is visible */
23
+ open?: boolean;
24
+ /** Callback when tour closes */
25
+ onClose?: () => void;
26
+ /** Callback when tour finishes (last step completed) */
27
+ onFinish?: () => void;
28
+ /** Tour steps */
29
+ steps: TourStepProps[];
30
+ /** Current step (controlled) */
31
+ current?: number;
32
+ /** Callback when step changes */
33
+ onChange?: (current: number) => void;
34
+ /** Show mask overlay */
35
+ mask?: boolean;
36
+ /** Type affects styling */
37
+ type?: 'default' | 'primary';
38
+ /** Gap between highlight and target [radius, offset] or single number */
39
+ gap?: number | [number, number];
40
+ /** Text for prev button */
41
+ prevButtonText?: React.ReactNode;
42
+ /** Text for next button */
43
+ nextButtonText?: React.ReactNode;
44
+ /** Text for finish button */
45
+ finishButtonText?: React.ReactNode;
46
+ /** Text for skip button */
47
+ skipButtonText?: React.ReactNode;
48
+ /** Show skip button */
49
+ showSkip?: boolean;
50
+ /** Show step indicators */
51
+ showIndicators?: boolean;
52
+ /** Close on mask click */
53
+ closeOnMaskClick?: boolean;
54
+ /** Close on escape key */
55
+ closeOnEscape?: boolean;
56
+ /** Scroll target into view */
57
+ scrollIntoView?: boolean;
58
+ /** Z-index for tour overlay */
59
+ zIndex?: number;
60
+ }
61
+ export declare const Tour: React.FC<TourProps>;
@@ -0,0 +1,17 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Hook that detects clicks outside of a referenced element.
4
+ * Useful for closing dropdowns, modals, or menus.
5
+ *
6
+ * @param handler - Callback when click outside is detected
7
+ * @param enabled - Whether the listener is active (default: true)
8
+ * @returns Ref to attach to the element
9
+ *
10
+ * @example
11
+ * const ref = useClickOutside(() => setIsOpen(false))
12
+ *
13
+ * <div ref={ref}>
14
+ * <Dropdown>...</Dropdown>
15
+ * </div>
16
+ */
17
+ export declare function useClickOutside<T extends HTMLElement = HTMLElement>(handler: (event: MouseEvent | TouchEvent) => void, enabled?: boolean): RefObject<T | null>;
@@ -0,0 +1,20 @@
1
+ export interface UseClipboardReturn {
2
+ copy: (text: string) => Promise<boolean>;
3
+ copied: boolean;
4
+ error: Error | null;
5
+ reset: () => void;
6
+ }
7
+ /**
8
+ * Hook for copying text to clipboard with success/error state.
9
+ *
10
+ * @param timeout - Duration in ms to show copied state (default: 2000)
11
+ * @returns Object with copy function and state
12
+ *
13
+ * @example
14
+ * const { copy, copied } = useClipboard()
15
+ *
16
+ * <Button onClick={() => copy('Hello!')}>
17
+ * {copied ? 'Copied!' : 'Copy'}
18
+ * </Button>
19
+ */
20
+ export declare function useClipboard(timeout?: number): UseClipboardReturn;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Hook that delays updating a value until after a specified delay.
3
+ * Useful for search inputs to avoid excessive API calls.
4
+ *
5
+ * @param value - Value to debounce
6
+ * @param delay - Delay in milliseconds (default: 300)
7
+ * @returns Debounced value
8
+ *
9
+ * @example
10
+ * const [search, setSearch] = useState('')
11
+ * const debouncedSearch = useDebounce(search, 500)
12
+ *
13
+ * useEffect(() => {
14
+ * // This runs 500ms after user stops typing
15
+ * fetchResults(debouncedSearch)
16
+ * }, [debouncedSearch])
17
+ */
18
+ export declare function useDebounce<T>(value: T, delay?: number): T;
@@ -0,0 +1,20 @@
1
+ export interface UseDisclosureReturn {
2
+ isOpen: boolean;
3
+ onOpen: () => void;
4
+ onClose: () => void;
5
+ onToggle: () => void;
6
+ setIsOpen: (value: boolean) => void;
7
+ }
8
+ /**
9
+ * Hook for managing open/close state of modals, drawers, dropdowns, etc.
10
+ *
11
+ * @param defaultIsOpen - Initial open state (default: false)
12
+ * @returns Object with isOpen state and control functions
13
+ *
14
+ * @example
15
+ * const { isOpen, onOpen, onClose } = useDisclosure()
16
+ *
17
+ * <Button onClick={onOpen}>Open Modal</Button>
18
+ * <Modal open={isOpen} onClose={onClose}>Content</Modal>
19
+ */
20
+ export declare function useDisclosure(defaultIsOpen?: boolean): UseDisclosureReturn;
@@ -0,0 +1,18 @@
1
+ import { RefObject } from 'react';
2
+ export interface UseHoverReturn<T extends HTMLElement> {
3
+ ref: RefObject<T | null>;
4
+ isHovered: boolean;
5
+ }
6
+ /**
7
+ * Hook that tracks hover state of an element.
8
+ *
9
+ * @returns Object with ref and isHovered state
10
+ *
11
+ * @example
12
+ * const { ref, isHovered } = useHover<HTMLDivElement>()
13
+ *
14
+ * <div ref={ref} className={isHovered ? 'bg-blue-500' : 'bg-gray-500'}>
15
+ * Hover me!
16
+ * </div>
17
+ */
18
+ export declare function useHover<T extends HTMLElement = HTMLElement>(): UseHoverReturn<T>;
@@ -0,0 +1,40 @@
1
+ export interface UseKeyPressOptions {
2
+ /** Target element (default: window) */
3
+ target?: HTMLElement | Window | null;
4
+ /** Event type: 'keydown' | 'keyup' (default: 'keydown') */
5
+ event?: 'keydown' | 'keyup';
6
+ /** Prevent default browser behavior */
7
+ preventDefault?: boolean;
8
+ }
9
+ /**
10
+ * Hook that detects when a specific key is pressed.
11
+ *
12
+ * @param targetKey - Key to detect (e.g., 'Enter', 'Escape', 'a')
13
+ * @param options - Configuration options
14
+ * @returns Whether the key is currently pressed
15
+ *
16
+ * @example
17
+ * const enterPressed = useKeyPress('Enter')
18
+ * const escapePressed = useKeyPress('Escape')
19
+ *
20
+ * useEffect(() => {
21
+ * if (escapePressed) closeModal()
22
+ * }, [escapePressed])
23
+ *
24
+ * @example
25
+ * // With callback for immediate action
26
+ * useKeyPress('Escape', { preventDefault: true })
27
+ */
28
+ export declare function useKeyPress(targetKey: string, options?: UseKeyPressOptions): boolean;
29
+ /**
30
+ * Hook that calls a callback when a specific key is pressed.
31
+ *
32
+ * @param targetKey - Key to detect
33
+ * @param callback - Function to call when key is pressed
34
+ * @param options - Configuration options
35
+ *
36
+ * @example
37
+ * useKeyPressCallback('Escape', () => closeModal())
38
+ * useKeyPressCallback('Enter', () => submitForm(), { preventDefault: true })
39
+ */
40
+ export declare function useKeyPressCallback(targetKey: string, callback: (event: KeyboardEvent) => void, options?: UseKeyPressOptions): void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Hook for persisting state to localStorage.
3
+ *
4
+ * @param key - localStorage key
5
+ * @param initialValue - Initial value if key doesn't exist
6
+ * @returns [value, setValue, removeValue] tuple
7
+ *
8
+ * @example
9
+ * const [theme, setTheme] = useLocalStorage('theme', 'light')
10
+ * const [user, setUser, removeUser] = useLocalStorage('user', null)
11
+ */
12
+ export declare function useLocalStorage<T>(key: string, initialValue: T): [T, (value: T | ((prev: T) => T)) => void, () => void];
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Hook that returns the previous value of a variable.
3
+ * Useful for comparing current and previous values in effects.
4
+ *
5
+ * @param value - Current value
6
+ * @returns Previous value (undefined on first render)
7
+ *
8
+ * @example
9
+ * const [count, setCount] = useState(0)
10
+ * const prevCount = usePrevious(count)
11
+ *
12
+ * // prevCount is the value from previous render
13
+ * console.log(`Changed from ${prevCount} to ${count}`)
14
+ */
15
+ export declare function usePrevious<T>(value: T): T | undefined;
@@ -0,0 +1,21 @@
1
+ export interface WindowSize {
2
+ width: number;
3
+ height: number;
4
+ }
5
+ /**
6
+ * Hook that tracks window dimensions.
7
+ * Updates on window resize.
8
+ *
9
+ * @returns Object with current width and height
10
+ *
11
+ * @example
12
+ * const { width, height } = useWindowSize()
13
+ *
14
+ * return (
15
+ * <div>
16
+ * Window: {width} x {height}
17
+ * {width < 768 && <MobileNav />}
18
+ * </div>
19
+ * )
20
+ */
21
+ export declare function useWindowSize(): WindowSize;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export { Affix } from './components/Affix';
2
2
  export type { AffixProps } from './components/Affix';
3
+ export { Anchor } from './components/Anchor';
4
+ export type { AnchorProps, AnchorLinkProps, AnchorLinkItem } from './components/Anchor';
3
5
  export { Alert } from './components/Alert';
4
6
  export type { AlertProps } from './components/Alert';
5
7
  export { Autocomplete } from './components/Autocomplete';
@@ -38,6 +40,8 @@ export { DatePicker } from './components/DatePicker';
38
40
  export type { DatePickerProps } from './components/DatePicker';
39
41
  export { Descriptions } from './components/Descriptions';
40
42
  export type { DescriptionsProps, DescriptionsItemProps, DescriptionsSize, DescriptionsLayout } from './components/Descriptions';
43
+ export { Diff } from './components/Diff';
44
+ export type { DiffProps } from './components/Diff';
41
45
  export { Divider } from './components/Divider';
42
46
  export type { DividerProps } from './components/Divider';
43
47
  export { Drawer } from './components/Drawer';
@@ -72,6 +76,8 @@ export { InputNumber } from './components/InputNumber';
72
76
  export type { InputNumberProps } from './components/InputNumber';
73
77
  export { Join } from './components/Join';
74
78
  export type { JoinProps } from './components/Join';
79
+ export { Kbd } from './components/Kbd';
80
+ export type { KbdProps } from './components/Kbd';
75
81
  export { Label } from './components/Label';
76
82
  export type { LabelProps, FloatingLabelProps } from './components/Label';
77
83
  export { Layout, useSiderContext } from './components/Layout';
@@ -126,6 +132,8 @@ export { Result } from './components/Result';
126
132
  export type { ResultProps, ResultStatus } from './components/Result';
127
133
  export { Select } from './components/Select';
128
134
  export type { SelectProps } from './components/Select';
135
+ export { Segmented } from './components/Segmented';
136
+ export type { SegmentedProps, SegmentedItemProps, SegmentedValue } from './components/Segmented';
129
137
  export { Skeleton } from './components/Skeleton';
130
138
  export type { SkeletonProps } from './components/Skeleton';
131
139
  export { Space } from './components/Space';
@@ -144,6 +152,8 @@ export { Tabs } from './components/Tabs';
144
152
  export type { TabsProps, TabPanelProps } from './components/Tabs';
145
153
  export { Textarea } from './components/Textarea';
146
154
  export type { TextareaProps } from './components/Textarea';
155
+ export { TextRotate } from './components/TextRotate';
156
+ export type { TextRotateProps, TextRotateDuration } from './components/TextRotate';
147
157
  export { Tag, CheckableTag } from './components/Tag';
148
158
  export type { TagProps, CheckableTagProps } from './components/Tag';
149
159
  export { ThemeController } from './components/ThemeController';
@@ -154,6 +164,8 @@ export { Timeline } from './components/Timeline';
154
164
  export type { TimelineProps, TimelineItemProps } from './components/Timeline';
155
165
  export { Toggle } from './components/Toggle';
156
166
  export type { ToggleProps } from './components/Toggle';
167
+ export { Tour } from './components/Tour';
168
+ export type { TourProps, TourStepProps, TourPlacement } from './components/Tour';
157
169
  export { Tooltip } from './components/Tooltip';
158
170
  export type { TooltipProps } from './components/Tooltip';
159
171
  export { Transfer } from './components/Transfer';
@@ -170,3 +182,17 @@ export { Show, Hide } from './components/Responsive';
170
182
  export type { ShowProps, HideProps } from './components/Responsive';
171
183
  export { useBreakpoint } from './hooks/useBreakpoint';
172
184
  export type { Breakpoint, UseBreakpointReturn } from './hooks/useBreakpoint';
185
+ export { useDisclosure } from './hooks/useDisclosure';
186
+ export type { UseDisclosureReturn } from './hooks/useDisclosure';
187
+ export { useClipboard } from './hooks/useClipboard';
188
+ export type { UseClipboardReturn } from './hooks/useClipboard';
189
+ export { useLocalStorage } from './hooks/useLocalStorage';
190
+ export { useDebounce } from './hooks/useDebounce';
191
+ export { useClickOutside } from './hooks/useClickOutside';
192
+ export { usePrevious } from './hooks/usePrevious';
193
+ export { useHover } from './hooks/useHover';
194
+ export type { UseHoverReturn } from './hooks/useHover';
195
+ export { useKeyPress, useKeyPressCallback } from './hooks/useKeyPress';
196
+ export type { UseKeyPressOptions } from './hooks/useKeyPress';
197
+ export { useWindowSize } from './hooks/useWindowSize';
198
+ export type { WindowSize } from './hooks/useWindowSize';