@aaas-pro/library 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (247) hide show
  1. package/README.md +107 -2
  2. package/dist/components/address-picker.d.ts +18 -0
  3. package/dist/components/address-picker.js +46 -0
  4. package/dist/components/card-date-filter.d.ts +12 -0
  5. package/dist/components/card-date-filter.js +95 -0
  6. package/dist/components/date-time-picker.d.ts +12 -0
  7. package/dist/components/date-time-picker.js +96 -0
  8. package/dist/components/detail-dialog.d.ts +48 -0
  9. package/dist/components/detail-dialog.js +97 -0
  10. package/dist/components/document-links.d.ts +13 -0
  11. package/dist/components/document-links.js +19 -0
  12. package/dist/components/draft-row-actions.d.ts +14 -0
  13. package/dist/components/draft-row-actions.js +70 -0
  14. package/dist/components/error-boundary.d.ts +14 -0
  15. package/dist/components/error-boundary.js +35 -0
  16. package/dist/components/glow-card.d.ts +13 -0
  17. package/dist/components/glow-card.js +48 -0
  18. package/dist/components/org-picker.d.ts +17 -0
  19. package/dist/components/org-picker.js +56 -0
  20. package/dist/components/overflow-row-actions.d.ts +29 -0
  21. package/dist/components/overflow-row-actions.js +135 -0
  22. package/dist/components/page-header.d.ts +21 -0
  23. package/dist/components/page-header.js +21 -0
  24. package/dist/components/permission-button.d.ts +4 -0
  25. package/dist/components/permission-button.js +17 -0
  26. package/dist/components/permission-context.d.ts +12 -0
  27. package/dist/components/permission-context.js +17 -0
  28. package/dist/components/person-picker.d.ts +20 -0
  29. package/dist/components/person-picker.js +38 -0
  30. package/dist/components/process-flow-bar.d.ts +15 -0
  31. package/dist/components/process-flow-bar.js +19 -0
  32. package/dist/components/product-picker.d.ts +19 -0
  33. package/dist/components/product-picker.js +155 -0
  34. package/dist/components/ref-doc-picker.d.ts +24 -0
  35. package/dist/components/ref-doc-picker.js +139 -0
  36. package/dist/components/scroll-to-top.d.ts +1 -0
  37. package/dist/components/scroll-to-top.js +20 -0
  38. package/dist/components/state-view.d.ts +26 -0
  39. package/dist/components/state-view.js +75 -0
  40. package/dist/components/theme-switcher.d.ts +27 -0
  41. package/dist/components/theme-switcher.js +77 -0
  42. package/dist/components/time-filter.d.ts +7 -0
  43. package/dist/components/time-filter.js +65 -0
  44. package/dist/components/ui/accordion.d.ts +7 -0
  45. package/dist/components/ui/accordion.js +64 -0
  46. package/dist/components/ui/alert-dialog.d.ts +15 -0
  47. package/dist/components/ui/alert-dialog.js +160 -0
  48. package/dist/components/ui/alert.d.ts +12 -0
  49. package/dist/components/ui/alert.js +66 -0
  50. package/dist/components/ui/aspect-ratio.d.ts +3 -0
  51. package/dist/components/ui/aspect-ratio.js +10 -0
  52. package/dist/components/ui/avatar.d.ts +6 -0
  53. package/dist/components/ui/avatar.js +53 -0
  54. package/dist/components/ui/badge.d.ts +12 -0
  55. package/dist/components/ui/badge.js +44 -0
  56. package/dist/components/ui/breadcrumb.d.ts +11 -0
  57. package/dist/components/ui/breadcrumb.js +103 -0
  58. package/dist/components/ui/button-group.d.ts +14 -0
  59. package/dist/components/ui/button-group.js +76 -0
  60. package/dist/components/ui/button.d.ts +20 -0
  61. package/dist/components/ui/button.js +93 -0
  62. package/dist/components/ui/calendar.d.ts +73 -0
  63. package/dist/components/ui/calendar.js +103 -0
  64. package/dist/components/ui/card.d.ts +9 -0
  65. package/dist/components/ui/card.js +90 -0
  66. package/dist/components/ui/carousel.d.ts +14 -0
  67. package/dist/components/ui/carousel.js +200 -0
  68. package/dist/components/ui/chart.d.ts +43 -0
  69. package/dist/components/ui/chart.js +252 -0
  70. package/dist/components/ui/checkbox.d.ts +4 -0
  71. package/dist/components/ui/checkbox.js +31 -0
  72. package/dist/components/ui/collapsible.d.ts +5 -0
  73. package/dist/components/ui/collapsible.js +34 -0
  74. package/dist/components/ui/command.d.ts +18 -0
  75. package/dist/components/ui/command.js +170 -0
  76. package/dist/components/ui/context-menu.d.ts +26 -0
  77. package/dist/components/ui/context-menu.js +237 -0
  78. package/dist/components/ui/dialog.d.ts +17 -0
  79. package/dist/components/ui/dialog.js +139 -0
  80. package/dist/components/ui/drawer.d.ts +13 -0
  81. package/dist/components/ui/drawer.js +129 -0
  82. package/dist/components/ui/dropdown-menu.d.ts +26 -0
  83. package/dist/components/ui/dropdown-menu.js +245 -0
  84. package/dist/components/ui/empty.d.ts +14 -0
  85. package/dist/components/ui/empty.js +102 -0
  86. package/dist/components/ui/field.d.ts +27 -0
  87. package/dist/components/ui/field.js +229 -0
  88. package/dist/components/ui/form.d.ts +26 -0
  89. package/dist/components/ui/form.js +118 -0
  90. package/dist/components/ui/hover-card.d.ts +6 -0
  91. package/dist/components/ui/hover-card.js +39 -0
  92. package/dist/components/ui/input-group.d.ts +22 -0
  93. package/dist/components/ui/input-group.js +156 -0
  94. package/dist/components/ui/input-otp.d.ts +11 -0
  95. package/dist/components/ui/input-otp.js +66 -0
  96. package/dist/components/ui/input.d.ts +3 -0
  97. package/dist/components/ui/input.js +21 -0
  98. package/dist/components/ui/item.d.ts +29 -0
  99. package/dist/components/ui/item.js +187 -0
  100. package/dist/components/ui/kbd.d.ts +3 -0
  101. package/dist/components/ui/kbd.js +31 -0
  102. package/dist/components/ui/label.d.ts +4 -0
  103. package/dist/components/ui/label.js +22 -0
  104. package/dist/components/ui/menubar.d.ts +26 -0
  105. package/dist/components/ui/menubar.js +252 -0
  106. package/dist/components/ui/navigation-menu.d.ts +17 -0
  107. package/dist/components/ui/navigation-menu.js +170 -0
  108. package/dist/components/ui/pagination.d.ts +13 -0
  109. package/dist/components/ui/pagination.js +118 -0
  110. package/dist/components/ui/popover.d.ts +8 -0
  111. package/dist/components/ui/popover.js +47 -0
  112. package/dist/components/ui/progress.d.ts +4 -0
  113. package/dist/components/ui/progress.js +34 -0
  114. package/dist/components/ui/radio-group.d.ts +5 -0
  115. package/dist/components/ui/radio-group.js +45 -0
  116. package/dist/components/ui/resizable.d.ts +7 -0
  117. package/dist/components/ui/resizable.js +49 -0
  118. package/dist/components/ui/scroll-area.d.ts +5 -0
  119. package/dist/components/ui/scroll-area.js +60 -0
  120. package/dist/components/ui/select.d.ts +17 -0
  121. package/dist/components/ui/select.js +215 -0
  122. package/dist/components/ui/separator.d.ts +4 -0
  123. package/dist/components/ui/separator.js +26 -0
  124. package/dist/components/ui/sheet.d.ts +13 -0
  125. package/dist/components/ui/sheet.js +127 -0
  126. package/dist/components/ui/sidebar.d.ts +72 -0
  127. package/dist/components/ui/sidebar.js +656 -0
  128. package/dist/components/ui/skeleton.d.ts +2 -0
  129. package/dist/components/ui/skeleton.js +15 -0
  130. package/dist/components/ui/slider.d.ts +4 -0
  131. package/dist/components/ui/slider.js +63 -0
  132. package/dist/components/ui/sonner.d.ts +4 -0
  133. package/dist/components/ui/sonner.js +34 -0
  134. package/dist/components/ui/spinner.d.ts +2 -0
  135. package/dist/components/ui/spinner.js +17 -0
  136. package/dist/components/ui/switch.d.ts +4 -0
  137. package/dist/components/ui/switch.js +31 -0
  138. package/dist/components/ui/table.d.ts +10 -0
  139. package/dist/components/ui/table.js +114 -0
  140. package/dist/components/ui/tabs.d.ts +7 -0
  141. package/dist/components/ui/tabs.js +67 -0
  142. package/dist/components/ui/textarea.d.ts +3 -0
  143. package/dist/components/ui/textarea.js +18 -0
  144. package/dist/components/ui/toggle-group.d.ts +9 -0
  145. package/dist/components/ui/toggle-group.js +68 -0
  146. package/dist/components/ui/toggle.d.ts +12 -0
  147. package/dist/components/ui/toggle.js +43 -0
  148. package/dist/components/ui/tooltip.d.ts +7 -0
  149. package/dist/components/ui/tooltip.js +56 -0
  150. package/dist/hooks/use-mobile.d.ts +1 -0
  151. package/dist/hooks/use-mobile.js +18 -0
  152. package/dist/icons/index.d.ts +57 -0
  153. package/dist/icons/index.js +115 -0
  154. package/dist/icons/paths.d.ts +556 -0
  155. package/dist/icons/paths.js +231 -0
  156. package/dist/index.d.ts +68 -0
  157. package/dist/index.js +399 -0
  158. package/dist/internal/selection-base.d.ts +37 -0
  159. package/dist/internal/selection-base.js +40 -0
  160. package/dist/lib/class-names.d.ts +6 -0
  161. package/dist/lib/class-names.js +159 -0
  162. package/dist/lib/utils.d.ts +3 -0
  163. package/dist/lib/utils.js +7 -0
  164. package/dist/lib/variants.d.ts +21 -0
  165. package/dist/lib/variants.js +21 -0
  166. package/dist/primitives/accordion.d.ts +29 -0
  167. package/dist/primitives/accordion.js +49 -0
  168. package/dist/primitives/alert-dialog.d.ts +10 -0
  169. package/dist/primitives/alert-dialog.js +22 -0
  170. package/dist/primitives/aspect-ratio.d.ts +4 -0
  171. package/dist/primitives/aspect-ratio.js +7 -0
  172. package/dist/primitives/avatar.d.ts +8 -0
  173. package/dist/primitives/avatar.js +45 -0
  174. package/dist/primitives/carousel.d.ts +22 -0
  175. package/dist/primitives/carousel.js +78 -0
  176. package/dist/primitives/chart.d.ts +71 -0
  177. package/dist/primitives/chart.js +125 -0
  178. package/dist/primitives/checkbox.d.ts +13 -0
  179. package/dist/primitives/checkbox.js +24 -0
  180. package/dist/primitives/collapsible.d.ts +14 -0
  181. package/dist/primitives/collapsible.js +29 -0
  182. package/dist/primitives/command.d.ts +43 -0
  183. package/dist/primitives/command.js +98 -0
  184. package/dist/primitives/context-menu.d.ts +24 -0
  185. package/dist/primitives/context-menu.js +19 -0
  186. package/dist/primitives/core.d.ts +25 -0
  187. package/dist/primitives/core.js +89 -0
  188. package/dist/primitives/dialog.d.ts +7 -0
  189. package/dist/primitives/dialog.js +15 -0
  190. package/dist/primitives/drawer.d.ts +30 -0
  191. package/dist/primitives/drawer.js +39 -0
  192. package/dist/primitives/dropdown-menu.d.ts +24 -0
  193. package/dist/primitives/dropdown-menu.js +19 -0
  194. package/dist/primitives/form.d.ts +154 -0
  195. package/dist/primitives/form.js +139 -0
  196. package/dist/primitives/hover-card.d.ts +4 -0
  197. package/dist/primitives/hover-card.js +8 -0
  198. package/dist/primitives/input-otp.d.ts +21 -0
  199. package/dist/primitives/input-otp.js +78 -0
  200. package/dist/primitives/label.d.ts +2 -0
  201. package/dist/primitives/label.js +7 -0
  202. package/dist/primitives/layer.d.ts +84 -0
  203. package/dist/primitives/layer.js +300 -0
  204. package/dist/primitives/menu.d.ts +56 -0
  205. package/dist/primitives/menu.js +126 -0
  206. package/dist/primitives/menubar.d.ts +91 -0
  207. package/dist/primitives/menubar.js +44 -0
  208. package/dist/primitives/navigation-menu.d.ts +32 -0
  209. package/dist/primitives/navigation-menu.js +121 -0
  210. package/dist/primitives/popover.d.ts +4 -0
  211. package/dist/primitives/popover.js +12 -0
  212. package/dist/primitives/progress.d.ts +7 -0
  213. package/dist/primitives/progress.js +13 -0
  214. package/dist/primitives/radio-group.d.ts +18 -0
  215. package/dist/primitives/radio-group.js +36 -0
  216. package/dist/primitives/resizable.d.ts +19 -0
  217. package/dist/primitives/resizable.js +91 -0
  218. package/dist/primitives/scroll-area.d.ts +12 -0
  219. package/dist/primitives/scroll-area.js +26 -0
  220. package/dist/primitives/select.d.ts +42 -0
  221. package/dist/primitives/select.js +167 -0
  222. package/dist/primitives/separator.d.ts +5 -0
  223. package/dist/primitives/separator.js +7 -0
  224. package/dist/primitives/slider.d.ts +25 -0
  225. package/dist/primitives/slider.js +98 -0
  226. package/dist/primitives/slot.d.ts +1 -0
  227. package/dist/primitives/slot.js +4 -0
  228. package/dist/primitives/switch.d.ts +11 -0
  229. package/dist/primitives/switch.js +22 -0
  230. package/dist/primitives/tabs.d.ts +23 -0
  231. package/dist/primitives/tabs.js +38 -0
  232. package/dist/primitives/toast.d.ts +55 -0
  233. package/dist/primitives/toast.js +86 -0
  234. package/dist/primitives/toggle-group.d.ts +24 -0
  235. package/dist/primitives/toggle-group.js +33 -0
  236. package/dist/primitives/toggle.d.ts +7 -0
  237. package/dist/primitives/toggle.js +13 -0
  238. package/dist/primitives/tooltip.d.ts +7 -0
  239. package/dist/primitives/tooltip.js +10 -0
  240. package/dist/style-entry.d.ts +1 -0
  241. package/dist/style-entry.js +1 -0
  242. package/dist/styles.css +7016 -0
  243. package/dist/styles.js +1 -0
  244. package/dist/theme/index.d.ts +110 -0
  245. package/dist/theme/index.js +199 -0
  246. package/licenses/Lucide.txt +15 -0
  247. package/package.json +67 -4
@@ -0,0 +1,86 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ let sequence = 0, snapshot = [];
4
+ const subscribers = /* @__PURE__ */ new Set(), timers = /* @__PURE__ */ new Map();
5
+ const defaults = /* @__PURE__ */ new Map();
6
+ const empty = [];
7
+ const notify = () => subscribers.forEach((callback) => callback());
8
+ function dismiss(id, automatic = false) {
9
+ const removed = snapshot.filter((item) => id === void 0 || item.id === id);
10
+ snapshot = snapshot.filter((item) => !removed.includes(item));
11
+ removed.forEach((item) => {
12
+ clearTimeout(timers.get(item.id));
13
+ timers.delete(item.id);
14
+ automatic ? item.onAutoClose?.(item) : item.onDismiss?.(item);
15
+ });
16
+ notify();
17
+ }
18
+ function add(type, title, options = {}) {
19
+ options = { ...defaults.get(options.toasterId), ...options, ...type === "loading" && options.duration === void 0 ? { duration: Infinity } : {} };
20
+ const id = options.id ?? ++sequence, item = { ...options, id, title, type };
21
+ clearTimeout(timers.get(id));
22
+ snapshot = [...snapshot.filter((item2) => item2.id !== id), item];
23
+ notify();
24
+ const duration = options.duration ?? (type === "loading" ? Infinity : 4e3);
25
+ if (Number.isFinite(duration) && duration > 0) timers.set(id, setTimeout(() => dismiss(id, true), duration));
26
+ return id;
27
+ }
28
+ const toast = Object.assign((title, options) => add("message", title, options), {
29
+ message: (title, options) => add("message", title, options),
30
+ success: (title, options) => add("success", title, options),
31
+ error: (title, options) => add("error", title, options),
32
+ warning: (title, options) => add("warning", title, options),
33
+ info: (title, options) => add("info", title, options),
34
+ loading: (title, options) => add("loading", title, options),
35
+ dismiss,
36
+ custom: (render, options = {}) => {
37
+ const id = options.id ?? ++sequence;
38
+ return add("message", render(id), { ...options, id });
39
+ },
40
+ promise: (promise, options) => {
41
+ const id = add("loading", options.loading ?? "处理中…", options);
42
+ const task = typeof promise === "function" ? promise() : promise;
43
+ task.then((value) => add("success", typeof options.success === "function" ? options.success(value) : options.success ?? "操作完成", { ...options, id }), (error) => add("error", typeof options.error === "function" ? options.error(error) : options.error ?? "操作失败", { ...options, id }));
44
+ return id;
45
+ }
46
+ });
47
+ function Toaster({ id, position = "bottom-right", duration = 4e3, visibleToasts = 3, closeButton = true, richColors = false, theme, icons, toastOptions, offset = 24, style, className, ...props }) {
48
+ React.useEffect(() => {
49
+ const options = { duration, ...toastOptions };
50
+ defaults.set(id, options);
51
+ return () => {
52
+ if (defaults.get(id) === options) defaults.delete(id);
53
+ };
54
+ }, [id, duration, toastOptions]);
55
+ const records = React.useSyncExternalStore(React.useCallback((callback) => {
56
+ subscribers.add(callback);
57
+ return () => {
58
+ subscribers.delete(callback);
59
+ };
60
+ }, []), () => snapshot, () => empty).filter((item) => item.toasterId === id).slice(-Math.max(1, visibleToasts));
61
+ const center = position.endsWith("center"), left = position.endsWith("left");
62
+ return /* @__PURE__ */ jsx("div", { ...props, "data-aaas-toaster": id ?? "default", "data-theme": theme, className, "aria-label": "消息通知", style: { position: "fixed", colorScheme: theme === "system" ? "light dark" : theme, zIndex: 1e3, [position.startsWith("top") ? "top" : "bottom"]: offset, left: center ? "50%" : left ? offset : void 0, right: !center && !left ? offset : void 0, transform: center ? "translateX(-50%)" : void 0, width: "min(360px, calc(100vw - 32px))", display: "grid", gap: 8, pointerEvents: "none", ...style }, children: records.map((item) => /* @__PURE__ */ jsxs("div", { "data-toast-type": item.type, role: item.type === "error" ? "alert" : "status", "aria-live": item.type === "error" ? "assertive" : "polite", style: { background: richColors && item.type !== "message" && item.type !== "loading" ? `color-mix(in srgb, ${item.type === "error" ? "var(--destructive)" : item.type === "success" ? "var(--success, #16a34a)" : item.type === "warning" ? "var(--warning, #d97706)" : "var(--info, #2563eb)"} 12%, var(--normal-bg, var(--popover)))` : "var(--normal-bg, var(--popover))", color: "var(--normal-text, var(--popover-foreground))", border: "1px solid var(--normal-border, var(--border))", borderRadius: "var(--radius)", padding: 16, boxShadow: "0 8px 28px #0002", pointerEvents: "auto" }, children: [
63
+ /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 10, alignItems: "center" }, children: [
64
+ icons?.[item.type],
65
+ /* @__PURE__ */ jsxs("div", { style: { flex: 1 }, children: [
66
+ /* @__PURE__ */ jsx("strong", { children: item.title }),
67
+ item.description && /* @__PURE__ */ jsx("div", { style: { fontSize: 12, opacity: 0.75, marginTop: 4 }, children: item.description })
68
+ ] }),
69
+ closeButton && item.dismissible !== false && /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "关闭通知", onClick: () => dismiss(item.id), children: "×" })
70
+ ] }),
71
+ (item.action || item.cancel) && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 12, marginTop: 8 }, children: [
72
+ item.action && /* @__PURE__ */ jsx("button", { type: "button", onClick: (event) => {
73
+ item.action?.onClick(event);
74
+ if (!event.defaultPrevented) dismiss(item.id);
75
+ }, children: item.action.label }),
76
+ item.cancel && /* @__PURE__ */ jsx("button", { type: "button", onClick: (event) => {
77
+ item.cancel?.onClick?.(event);
78
+ if (!event.defaultPrevented) dismiss(item.id);
79
+ }, children: item.cancel.label })
80
+ ] })
81
+ ] }, item.id)) });
82
+ }
83
+ export {
84
+ Toaster,
85
+ toast
86
+ };
@@ -0,0 +1,24 @@
1
+ import * as React from 'react';
2
+ import { type ButtonProps, type DivProps } from './core';
3
+ type Selection = {
4
+ type: 'single';
5
+ value?: string;
6
+ defaultValue?: string;
7
+ onValueChange?: (value: string) => void;
8
+ } | {
9
+ type: 'multiple';
10
+ value?: string[];
11
+ defaultValue?: string[];
12
+ onValueChange?: (value: string[]) => void;
13
+ };
14
+ type GroupProps = Omit<DivProps, 'defaultValue'> & Selection & {
15
+ disabled?: boolean;
16
+ orientation?: 'horizontal' | 'vertical';
17
+ loop?: boolean;
18
+ rovingFocus?: boolean;
19
+ };
20
+ export declare function Root({ type, value, defaultValue, onValueChange, disabled, orientation, loop, rovingFocus, onKeyDown, ...props }: GroupProps): React.JSX.Element;
21
+ export declare function Item({ value, onClick, ...props }: ButtonProps & {
22
+ value: string;
23
+ }): React.JSX.Element;
24
+ export {};
@@ -0,0 +1,33 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { ButtonPart, useControllable, DivPart, moveFocus } from "./core.js";
4
+ const Context = React.createContext({ values: [], toggle: (_v) => {
5
+ }, disabled: false, single: false });
6
+ function Root({ type, value, defaultValue, onValueChange, disabled = false, orientation = "horizontal", loop = true, rovingFocus = true, onKeyDown, ...props }) {
7
+ const [current, set] = useControllable(value, defaultValue ?? (type === "single" ? "" : []), (next) => {
8
+ if (type === "single")
9
+ onValueChange?.(next);
10
+ else
11
+ onValueChange?.(next);
12
+ });
13
+ const values = Array.isArray(current) ? current : current ? [current] : [];
14
+ const toggle = (key) => set(type === "single" ? values.includes(key) ? "" : key : values.includes(key) ? values.filter((v) => v !== key) : [...values, key]);
15
+ return /* @__PURE__ */ jsx(Context.Provider, { value: { values, toggle, disabled, single: type === "single" }, children: /* @__PURE__ */ jsx(DivPart, { ...props, role: "group", "data-orientation": orientation, onKeyDown: (event) => {
16
+ onKeyDown?.(event);
17
+ if (!event.defaultPrevented && rovingFocus)
18
+ moveFocus(event, "button", { vertical: orientation === "vertical", loop });
19
+ } }) });
20
+ }
21
+ function Item({ value, onClick, ...props }) {
22
+ const state = React.useContext(Context);
23
+ const on = state.values.includes(value);
24
+ return /* @__PURE__ */ jsx(ButtonPart, { ...props, disabled: props.disabled || state.disabled, "aria-pressed": on, "data-state": on ? "on" : "off", onClick: (event) => {
25
+ onClick?.(event);
26
+ if (!event.defaultPrevented)
27
+ state.toggle(value);
28
+ } });
29
+ }
30
+ export {
31
+ Item,
32
+ Root
33
+ };
@@ -0,0 +1,7 @@
1
+ import { type ButtonProps } from './core';
2
+ export interface ToggleProps extends ButtonProps {
3
+ pressed?: boolean;
4
+ defaultPressed?: boolean;
5
+ onPressedChange?: (pressed: boolean) => void;
6
+ }
7
+ export declare function Root({ pressed, defaultPressed, onPressedChange, onClick, ...props }: ToggleProps): import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useControllable, ButtonPart } from "./core.js";
3
+ function Root({ pressed, defaultPressed = false, onPressedChange, onClick, ...props }) {
4
+ const [current, set] = useControllable(pressed, defaultPressed, onPressedChange);
5
+ return /* @__PURE__ */ jsx(ButtonPart, { ...props, "aria-pressed": current, "data-state": current ? "on" : "off", onClick: (event) => {
6
+ onClick?.(event);
7
+ if (!event.defaultPrevented)
8
+ set(!current);
9
+ } });
10
+ }
11
+ export {
12
+ Root
13
+ };
@@ -0,0 +1,7 @@
1
+ export declare const Root: ({ children, open: controlled, defaultOpen, onOpenChange, modal: isModal, delayDuration, openDelay, closeDelay, ...rest }: import("./layer").LayerRootProps & {
2
+ sub?: boolean;
3
+ direction?: import("./layer").LayerState["direction"];
4
+ }) => import("react").JSX.Element, Trigger: ({ onClick, onKeyDown, onPointerEnter, onPointerLeave, onFocus, onBlur, onContextMenu, ref, disabled, ...props }: import("./core").ButtonProps) => import("react").JSX.Element, Portal: ({ children, container, forceMount }: import("./layer").PortalProps) => import("react").ReactPortal | null, Content: ({ forceMount, side, align, sideOffset, alignOffset, avoidCollisions, collisionPadding, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, ref, style, onKeyDown, onPointerEnter, onPointerLeave, ...props }: import("./layer").LayerContentProps) => import("react").JSX.Element | null, Arrow: (props: React.ComponentProps<"span">) => import("react").JSX.Element, Provider: ({ children, delayDuration }: {
5
+ children?: React.ReactNode;
6
+ delayDuration?: number;
7
+ }) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { createLayer } from "./layer.js";
2
+ const { Root, Trigger, Portal, Content, Arrow, Provider } = createLayer({ role: "tooltip", hover: true });
3
+ export {
4
+ Arrow,
5
+ Content,
6
+ Portal,
7
+ Provider,
8
+ Root,
9
+ Trigger
10
+ };
@@ -0,0 +1 @@
1
+ import './styles.css';
@@ -0,0 +1 @@
1
+ /* empty css */