asheeui 1.0.0 → 1.1.1

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 (287) hide show
  1. package/LICENSE +201 -21
  2. package/NOTICE +10 -0
  3. package/README.md +63 -166
  4. package/dist/components/accordion/Accordion.d.ts +1 -1
  5. package/dist/components/alert/Alert.d.ts.map +1 -1
  6. package/dist/components/alert/Alert.js +6 -6
  7. package/dist/components/auth-layout/AuthLayout.d.ts +79 -0
  8. package/dist/components/auth-layout/AuthLayout.d.ts.map +1 -0
  9. package/dist/components/auth-layout/AuthLayout.js +54 -0
  10. package/dist/components/auth-layout/auth-layout-config.d.ts +41 -0
  11. package/dist/components/auth-layout/auth-layout-config.d.ts.map +1 -0
  12. package/dist/components/auth-layout/auth-layout-config.js +18 -0
  13. package/dist/components/auth-layout/auth-layout-styles.d.ts +25 -0
  14. package/dist/components/auth-layout/auth-layout-styles.d.ts.map +1 -0
  15. package/dist/components/auth-layout/auth-layout-styles.js +11 -0
  16. package/dist/components/auth-layout/index.d.ts +3 -0
  17. package/dist/components/auth-layout/index.d.ts.map +1 -0
  18. package/dist/components/auth-layout/index.js +3 -0
  19. package/dist/components/autocomplete/Autocomplete.d.ts.map +1 -1
  20. package/dist/components/avatar/Avatar.d.ts.map +1 -1
  21. package/dist/components/avatar/Avatar.js +7 -7
  22. package/dist/components/badge/Badge.d.ts.map +1 -1
  23. package/dist/components/badge/Badge.js +3 -3
  24. package/dist/components/breadcrumb/Breadcrumb.d.ts.map +1 -1
  25. package/dist/components/breadcrumb/Breadcrumb.js +6 -6
  26. package/dist/components/calendar/Calendar.d.ts.map +1 -1
  27. package/dist/components/calendar/Calendar.js +4 -4
  28. package/dist/components/calendar/DateGrid.d.ts.map +1 -1
  29. package/dist/components/calendar/DateGrid.js +87 -87
  30. package/dist/components/clipboard/Clipboard.d.ts +75 -0
  31. package/dist/components/clipboard/Clipboard.d.ts.map +1 -0
  32. package/dist/components/clipboard/Clipboard.js +53 -0
  33. package/dist/components/clipboard/CopyButton.d.ts +64 -0
  34. package/dist/components/clipboard/CopyButton.d.ts.map +1 -0
  35. package/dist/components/clipboard/CopyButton.js +44 -0
  36. package/dist/components/clipboard/clipboard-config.d.ts +42 -0
  37. package/dist/components/clipboard/clipboard-config.d.ts.map +1 -0
  38. package/dist/components/clipboard/clipboard-config.js +23 -0
  39. package/dist/components/clipboard/clipboard-styles.d.ts +11 -0
  40. package/dist/components/clipboard/clipboard-styles.d.ts.map +1 -0
  41. package/dist/components/clipboard/clipboard-styles.js +5 -0
  42. package/dist/components/clipboard/index.d.ts +4 -0
  43. package/dist/components/clipboard/index.d.ts.map +1 -0
  44. package/dist/components/clipboard/index.js +4 -0
  45. package/dist/components/container/Container.d.ts +51 -0
  46. package/dist/components/container/Container.d.ts.map +1 -0
  47. package/dist/components/container/Container.js +21 -0
  48. package/dist/components/container/container-config.d.ts +61 -0
  49. package/dist/components/container/container-config.d.ts.map +1 -0
  50. package/dist/components/container/container-config.js +16 -0
  51. package/dist/components/container/container-styles.d.ts +18 -0
  52. package/dist/components/container/container-styles.d.ts.map +1 -0
  53. package/dist/components/container/container-styles.js +12 -0
  54. package/dist/components/container/index.d.ts +3 -0
  55. package/dist/components/container/index.d.ts.map +1 -0
  56. package/dist/components/container/index.js +3 -0
  57. package/dist/components/cta/CTA.d.ts +81 -0
  58. package/dist/components/cta/CTA.d.ts.map +1 -0
  59. package/dist/components/cta/CTA.js +60 -0
  60. package/dist/components/cta/cta-config.d.ts +69 -0
  61. package/dist/components/cta/cta-config.d.ts.map +1 -0
  62. package/dist/components/cta/cta-config.js +22 -0
  63. package/dist/components/cta/cta-styles.d.ts +8 -0
  64. package/dist/components/cta/cta-styles.d.ts.map +1 -0
  65. package/dist/components/cta/cta-styles.js +9 -0
  66. package/dist/components/cta/index.d.ts +3 -0
  67. package/dist/components/cta/index.d.ts.map +1 -0
  68. package/dist/components/cta/index.js +3 -0
  69. package/dist/components/dropmenu/Dropmenu.d.ts.map +1 -1
  70. package/dist/components/empty-state/EmptyState.d.ts +77 -0
  71. package/dist/components/empty-state/EmptyState.d.ts.map +1 -0
  72. package/dist/components/empty-state/EmptyState.js +46 -0
  73. package/dist/components/empty-state/empty-state-config.d.ts +44 -0
  74. package/dist/components/empty-state/empty-state-config.d.ts.map +1 -0
  75. package/dist/components/empty-state/empty-state-config.js +16 -0
  76. package/dist/components/empty-state/empty-state-styles.d.ts +13 -0
  77. package/dist/components/empty-state/empty-state-styles.d.ts.map +1 -0
  78. package/dist/components/empty-state/empty-state-styles.js +18 -0
  79. package/dist/components/empty-state/index.d.ts +3 -0
  80. package/dist/components/empty-state/index.d.ts.map +1 -0
  81. package/dist/components/empty-state/index.js +3 -0
  82. package/dist/components/feature-grid/FeatureGrid.d.ts +107 -0
  83. package/dist/components/feature-grid/FeatureGrid.d.ts.map +1 -0
  84. package/dist/components/feature-grid/FeatureGrid.js +94 -0
  85. package/dist/components/feature-grid/feature-grid-config.d.ts +80 -0
  86. package/dist/components/feature-grid/feature-grid-config.d.ts.map +1 -0
  87. package/dist/components/feature-grid/feature-grid-config.js +28 -0
  88. package/dist/components/feature-grid/feature-grid-styles.d.ts +11 -0
  89. package/dist/components/feature-grid/feature-grid-styles.d.ts.map +1 -0
  90. package/dist/components/feature-grid/feature-grid-styles.js +5 -0
  91. package/dist/components/feature-grid/index.d.ts +3 -0
  92. package/dist/components/feature-grid/index.d.ts.map +1 -0
  93. package/dist/components/feature-grid/index.js +3 -0
  94. package/dist/components/footer/Footer.d.ts +73 -0
  95. package/dist/components/footer/Footer.d.ts.map +1 -0
  96. package/dist/components/footer/Footer.js +112 -0
  97. package/dist/components/footer/footer-config.d.ts +40 -0
  98. package/dist/components/footer/footer-config.d.ts.map +1 -0
  99. package/dist/components/footer/footer-config.js +18 -0
  100. package/dist/components/footer/footer-styles.d.ts +22 -0
  101. package/dist/components/footer/footer-styles.d.ts.map +1 -0
  102. package/dist/components/footer/footer-styles.js +9 -0
  103. package/dist/components/footer/index.d.ts +3 -0
  104. package/dist/components/footer/index.d.ts.map +1 -0
  105. package/dist/components/footer/index.js +3 -0
  106. package/dist/components/form/Form.d.ts.map +1 -1
  107. package/dist/components/grid/Grid.d.ts +71 -0
  108. package/dist/components/grid/Grid.d.ts.map +1 -0
  109. package/dist/components/grid/Grid.js +23 -0
  110. package/dist/components/grid/grid-config.d.ts +63 -0
  111. package/dist/components/grid/grid-config.d.ts.map +1 -0
  112. package/dist/components/grid/grid-config.js +16 -0
  113. package/dist/components/grid/grid-styles.d.ts +12 -0
  114. package/dist/components/grid/grid-styles.d.ts.map +1 -0
  115. package/dist/components/grid/grid-styles.js +31 -0
  116. package/dist/components/grid/index.d.ts +3 -0
  117. package/dist/components/grid/index.d.ts.map +1 -0
  118. package/dist/components/grid/index.js +3 -0
  119. package/dist/components/hero/Hero.d.ts +90 -0
  120. package/dist/components/hero/Hero.d.ts.map +1 -0
  121. package/dist/components/hero/Hero.js +63 -0
  122. package/dist/components/hero/hero-config.d.ts +71 -0
  123. package/dist/components/hero/hero-config.d.ts.map +1 -0
  124. package/dist/components/hero/hero-config.js +22 -0
  125. package/dist/components/hero/hero-styles.d.ts +19 -0
  126. package/dist/components/hero/hero-styles.d.ts.map +1 -0
  127. package/dist/components/hero/hero-styles.js +5 -0
  128. package/dist/components/hero/index.d.ts +3 -0
  129. package/dist/components/hero/index.d.ts.map +1 -0
  130. package/dist/components/hero/index.js +3 -0
  131. package/dist/components/multi-select/MultiSelect.d.ts.map +1 -1
  132. package/dist/components/navbar/Navbar.d.ts +87 -0
  133. package/dist/components/navbar/Navbar.d.ts.map +1 -0
  134. package/dist/components/navbar/Navbar.js +117 -0
  135. package/dist/components/navbar/index.d.ts +3 -0
  136. package/dist/components/navbar/index.d.ts.map +1 -0
  137. package/dist/components/navbar/index.js +3 -0
  138. package/dist/components/navbar/navbar-config.d.ts +52 -0
  139. package/dist/components/navbar/navbar-config.d.ts.map +1 -0
  140. package/dist/components/navbar/navbar-config.js +20 -0
  141. package/dist/components/navbar/navbar-styles.d.ts +28 -0
  142. package/dist/components/navbar/navbar-styles.d.ts.map +1 -0
  143. package/dist/components/navbar/navbar-styles.js +9 -0
  144. package/dist/components/page/Page.d.ts +166 -0
  145. package/dist/components/page/Page.d.ts.map +1 -0
  146. package/dist/components/page/Page.js +90 -0
  147. package/dist/components/page/index.d.ts +3 -0
  148. package/dist/components/page/index.d.ts.map +1 -0
  149. package/dist/components/page/index.js +3 -0
  150. package/dist/components/page/page-config.d.ts +57 -0
  151. package/dist/components/page/page-config.d.ts.map +1 -0
  152. package/dist/components/page/page-config.js +20 -0
  153. package/dist/components/page/page-styles.d.ts +25 -0
  154. package/dist/components/page/page-styles.d.ts.map +1 -0
  155. package/dist/components/page/page-styles.js +5 -0
  156. package/dist/components/pagination/Pagination.d.ts.map +1 -1
  157. package/dist/components/pagination/Pagination.js +8 -8
  158. package/dist/components/pin-input/PinInput.d.ts +109 -0
  159. package/dist/components/pin-input/PinInput.d.ts.map +1 -0
  160. package/dist/components/pin-input/PinInput.js +124 -0
  161. package/dist/components/pin-input/index.d.ts +3 -0
  162. package/dist/components/pin-input/index.d.ts.map +1 -0
  163. package/dist/components/pin-input/index.js +3 -0
  164. package/dist/components/pin-input/pin-input-config.d.ts +82 -0
  165. package/dist/components/pin-input/pin-input-config.d.ts.map +1 -0
  166. package/dist/components/pin-input/pin-input-config.js +23 -0
  167. package/dist/components/pin-input/pin-input-styles.d.ts +16 -0
  168. package/dist/components/pin-input/pin-input-styles.d.ts.map +1 -0
  169. package/dist/components/pin-input/pin-input-styles.js +9 -0
  170. package/dist/components/pricing-card/PricingCard.d.ts +87 -0
  171. package/dist/components/pricing-card/PricingCard.d.ts.map +1 -0
  172. package/dist/components/pricing-card/PricingCard.js +79 -0
  173. package/dist/components/pricing-card/index.d.ts +3 -0
  174. package/dist/components/pricing-card/index.d.ts.map +1 -0
  175. package/dist/components/pricing-card/index.js +3 -0
  176. package/dist/components/pricing-card/pricing-card-config.d.ts +35 -0
  177. package/dist/components/pricing-card/pricing-card-config.d.ts.map +1 -0
  178. package/dist/components/pricing-card/pricing-card-config.js +16 -0
  179. package/dist/components/pricing-card/pricing-card-styles.d.ts +21 -0
  180. package/dist/components/pricing-card/pricing-card-styles.d.ts.map +1 -0
  181. package/dist/components/pricing-card/pricing-card-styles.js +5 -0
  182. package/dist/components/radio/RadioGroup.d.ts.map +1 -1
  183. package/dist/components/section/Section.d.ts +56 -0
  184. package/dist/components/section/Section.d.ts.map +1 -0
  185. package/dist/components/section/Section.js +27 -0
  186. package/dist/components/section/index.d.ts +3 -0
  187. package/dist/components/section/index.d.ts.map +1 -0
  188. package/dist/components/section/index.js +3 -0
  189. package/dist/components/section/section-config.d.ts +64 -0
  190. package/dist/components/section/section-config.d.ts.map +1 -0
  191. package/dist/components/section/section-config.js +20 -0
  192. package/dist/components/section/section-styles.d.ts +8 -0
  193. package/dist/components/section/section-styles.d.ts.map +1 -0
  194. package/dist/components/section/section-styles.js +9 -0
  195. package/dist/components/section-kit/ActionGroup.d.ts +47 -0
  196. package/dist/components/section-kit/ActionGroup.d.ts.map +1 -0
  197. package/dist/components/section-kit/ActionGroup.js +35 -0
  198. package/dist/components/section-kit/SectionHeading.d.ts +65 -0
  199. package/dist/components/section-kit/SectionHeading.d.ts.map +1 -0
  200. package/dist/components/section-kit/SectionHeading.js +34 -0
  201. package/dist/components/section-kit/index.d.ts +12 -0
  202. package/dist/components/section-kit/index.d.ts.map +1 -0
  203. package/dist/components/section-kit/index.js +2 -0
  204. package/dist/components/sidebar-layout/SidebarLayout.d.ts +67 -0
  205. package/dist/components/sidebar-layout/SidebarLayout.d.ts.map +1 -0
  206. package/dist/components/sidebar-layout/SidebarLayout.js +40 -0
  207. package/dist/components/sidebar-layout/index.d.ts +3 -0
  208. package/dist/components/sidebar-layout/index.d.ts.map +1 -0
  209. package/dist/components/sidebar-layout/index.js +3 -0
  210. package/dist/components/sidebar-layout/sidebar-layout-config.d.ts +49 -0
  211. package/dist/components/sidebar-layout/sidebar-layout-config.d.ts.map +1 -0
  212. package/dist/components/sidebar-layout/sidebar-layout-config.js +16 -0
  213. package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts +21 -0
  214. package/dist/components/sidebar-layout/sidebar-layout-styles.d.ts.map +1 -0
  215. package/dist/components/sidebar-layout/sidebar-layout-styles.js +9 -0
  216. package/dist/components/skeleton/Skeleton.d.ts.map +1 -1
  217. package/dist/components/stack/Stack.d.ts +107 -0
  218. package/dist/components/stack/Stack.d.ts.map +1 -0
  219. package/dist/components/stack/Stack.js +36 -0
  220. package/dist/components/stack/index.d.ts +3 -0
  221. package/dist/components/stack/index.d.ts.map +1 -0
  222. package/dist/components/stack/index.js +3 -0
  223. package/dist/components/stack/stack-config.d.ts +68 -0
  224. package/dist/components/stack/stack-config.d.ts.map +1 -0
  225. package/dist/components/stack/stack-config.js +20 -0
  226. package/dist/components/stack/stack-styles.d.ts +10 -0
  227. package/dist/components/stack/stack-styles.d.ts.map +1 -0
  228. package/dist/components/stack/stack-styles.js +21 -0
  229. package/dist/components/testimonials/Testimonials.d.ts +78 -0
  230. package/dist/components/testimonials/Testimonials.d.ts.map +1 -0
  231. package/dist/components/testimonials/Testimonials.js +96 -0
  232. package/dist/components/testimonials/index.d.ts +3 -0
  233. package/dist/components/testimonials/index.d.ts.map +1 -0
  234. package/dist/components/testimonials/index.js +3 -0
  235. package/dist/components/testimonials/testimonials-config.d.ts +44 -0
  236. package/dist/components/testimonials/testimonials-config.d.ts.map +1 -0
  237. package/dist/components/testimonials/testimonials-config.js +28 -0
  238. package/dist/components/testimonials/testimonials-styles.d.ts +11 -0
  239. package/dist/components/testimonials/testimonials-styles.d.ts.map +1 -0
  240. package/dist/components/testimonials/testimonials-styles.js +5 -0
  241. package/dist/components/typography/typography-styles.d.ts.map +1 -1
  242. package/dist/config/validate-config.d.ts.map +1 -1
  243. package/dist/icons/CopyIcon.d.ts +3 -0
  244. package/dist/icons/CopyIcon.d.ts.map +1 -0
  245. package/dist/icons/CopyIcon.js +24 -0
  246. package/dist/index.d.ts +19 -2
  247. package/dist/index.d.ts.map +1 -1
  248. package/dist/index.js +107 -72
  249. package/dist/puck/adapters.d.ts +41 -0
  250. package/dist/puck/adapters.d.ts.map +1 -0
  251. package/dist/puck/adapters.js +30 -0
  252. package/dist/puck/blocks/content.d.ts +32 -0
  253. package/dist/puck/blocks/content.d.ts.map +1 -0
  254. package/dist/puck/blocks/content.js +54 -0
  255. package/dist/puck/blocks/layout.d.ts +44 -0
  256. package/dist/puck/blocks/layout.d.ts.map +1 -0
  257. package/dist/puck/blocks/layout.js +69 -0
  258. package/dist/puck/blocks/navigation.d.ts +66 -0
  259. package/dist/puck/blocks/navigation.d.ts.map +1 -0
  260. package/dist/puck/blocks/navigation.js +122 -0
  261. package/dist/puck/blocks/sections.d.ts +134 -0
  262. package/dist/puck/blocks/sections.d.ts.map +1 -0
  263. package/dist/puck/blocks/sections.js +232 -0
  264. package/dist/puck/blocks/utility.d.ts +22 -0
  265. package/dist/puck/blocks/utility.d.ts.map +1 -0
  266. package/dist/puck/blocks/utility.js +49 -0
  267. package/dist/puck/config.d.ts +63 -0
  268. package/dist/puck/config.d.ts.map +1 -0
  269. package/dist/puck/config.js +79 -0
  270. package/dist/puck/fields.d.ts +94 -0
  271. package/dist/puck/fields.d.ts.map +1 -0
  272. package/dist/puck/fields.js +116 -0
  273. package/dist/puck/index.d.ts +21 -0
  274. package/dist/puck/index.d.ts.map +1 -0
  275. package/dist/puck/index.js +10 -0
  276. package/dist/shared/action.d.ts +52 -0
  277. package/dist/shared/action.d.ts.map +1 -0
  278. package/dist/shared/index.d.ts +2 -0
  279. package/dist/shared/index.d.ts.map +1 -1
  280. package/dist/shared/spacing.d.ts +38 -0
  281. package/dist/shared/spacing.d.ts.map +1 -0
  282. package/dist/shared/spacing.js +29 -0
  283. package/dist/shared/typography.d.ts.map +1 -1
  284. package/dist/utils/resolve-token.d.ts +32 -7
  285. package/dist/utils/resolve-token.d.ts.map +1 -1
  286. package/dist/utils/resolve-token.js +9 -1
  287. package/package.json +18 -4
@@ -1,194 +1,194 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../utils/cn.js";
3
3
  import { ChevronRightIcon as t } from "../../icons/ChevronRightIcon.js";
4
- import { ChevronLeftIcon as n } from "../../icons/ChevronLeftIcon.js";
5
- import { DAYS_OF_WEEK as r, MONTHS as i, buildDayCells as a } from "./calendar.helpers.js";
6
- import { CALENDAR_COLOR_CLASSES as o, DATE_PICKER_CELL_SIZE_CLASS as s } from "./calendar-styles.js";
7
- import { TimeSpinner as c } from "./TimeSpinner.js";
8
- import { memo as l, useCallback as u, useEffect as d, useMemo as f, useRef as p, useState as m } from "react";
9
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
4
+ import { DAYS_OF_WEEK as n, MONTHS as r, buildDayCells as ee } from "./calendar.helpers.js";
5
+ import { ChevronLeftIcon as i } from "../../icons/ChevronLeftIcon.js";
6
+ import { CALENDAR_COLOR_CLASSES as a, DATE_PICKER_CELL_SIZE_CLASS as o } from "./calendar-styles.js";
7
+ import { TimeSpinner as s } from "./TimeSpinner.js";
8
+ import { memo as c, useCallback as te, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
9
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
10
10
  //#region src/components/calendar/DateGrid.tsx
11
- var _ = l(function({ selected: l, mode: _, isClearable: v, resolvedSizeKey: y, resolvedColor: b, radiusClass: x, onSelect: S, onClose: C, disableFuture: w = !1 }) {
12
- let T = /* @__PURE__ */ new Date(), [E, D] = m(l?.getFullYear() ?? T.getFullYear()), [O, k] = m(l?.getMonth() ?? T.getMonth()), [A, ee] = m(l?.getHours() ?? 0), [j, te] = m(l?.getMinutes() ?? 0), [M, N] = m(l?.getSeconds() ?? 0), [P, F] = m(() => l ?? T), I = p({}), L = p(!1), R = (e) => `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`, z = u((e) => {
13
- F((t) => {
11
+ var h = c(function({ selected: c, mode: h, isClearable: g, resolvedSizeKey: _, resolvedColor: v, radiusClass: y, onSelect: b, onClose: x, disableFuture: S = !1 }) {
12
+ let C = /* @__PURE__ */ new Date(), [w, T] = f(c?.getFullYear() ?? C.getFullYear()), [E, D] = f(c?.getMonth() ?? C.getMonth()), [O, ne] = f(c?.getHours() ?? 0), [k, A] = f(c?.getMinutes() ?? 0), [j, M] = f(c?.getSeconds() ?? 0), [N, P] = f(() => c ?? C), F = d({}), I = d(!1), L = (e) => `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`, R = te((e) => {
13
+ P((t) => {
14
14
  let n = new Date(t.getFullYear(), t.getMonth(), t.getDate() + e);
15
- return D(n.getFullYear()), k(n.getMonth()), L.current = !0, n;
15
+ return T(n.getFullYear()), D(n.getMonth()), I.current = !0, n;
16
16
  });
17
17
  }, []);
18
- d(() => {
19
- L.current && (L.current = !1, I.current[R(P)]?.focus());
18
+ l(() => {
19
+ I.current && (I.current = !1, F.current[L(N)]?.focus());
20
20
  });
21
- function B(e) {
21
+ function z(e) {
22
22
  switch (e.key) {
23
23
  case "ArrowLeft":
24
- e.preventDefault(), z(-1);
24
+ e.preventDefault(), R(-1);
25
25
  return;
26
26
  case "ArrowRight":
27
- e.preventDefault(), z(1);
27
+ e.preventDefault(), R(1);
28
28
  return;
29
29
  case "ArrowUp":
30
- e.preventDefault(), z(-7);
30
+ e.preventDefault(), R(-7);
31
31
  return;
32
32
  case "ArrowDown":
33
- e.preventDefault(), z(7);
33
+ e.preventDefault(), R(7);
34
34
  return;
35
35
  case "PageUp":
36
- e.preventDefault(), z(-30);
36
+ e.preventDefault(), R(-30);
37
37
  return;
38
38
  case "PageDown":
39
- e.preventDefault(), z(30);
39
+ e.preventDefault(), R(30);
40
40
  return;
41
41
  }
42
42
  }
43
- let V = o[b] ?? o.primary;
44
- function H(e, t, n) {
45
- let r = l ?? /* @__PURE__ */ new Date();
46
- S(new Date(r.getFullYear(), r.getMonth(), r.getDate(), e, t, n, 0));
43
+ let B = a[v] ?? a.primary;
44
+ function V(e, t, n) {
45
+ let r = c ?? /* @__PURE__ */ new Date();
46
+ b(new Date(r.getFullYear(), r.getMonth(), r.getDate(), e, t, n, 0));
47
+ }
48
+ function H(e) {
49
+ ne(e), V(e, k, j);
47
50
  }
48
51
  function U(e) {
49
- ee(e), H(e, j, M);
52
+ A(e), V(O, e, j);
50
53
  }
51
54
  function W(e) {
52
- te(e), H(A, e, M);
55
+ M(e), V(O, k, e);
53
56
  }
54
57
  function G(e) {
55
- N(e), H(A, j, e);
56
- }
57
- function K(e) {
58
- S(new Date(E, O, e, A, j, M, 0)), _ === "date" && C();
58
+ b(new Date(w, E, e, O, k, j, 0)), h === "date" && x();
59
59
  }
60
- function ne() {
61
- O === 0 ? (k(11), D((e) => e - 1)) : k((e) => e - 1);
60
+ function K() {
61
+ E === 0 ? (D(11), T((e) => e - 1)) : D((e) => e - 1);
62
62
  }
63
63
  function re() {
64
- O === 11 ? (k(0), D((e) => e + 1)) : k((e) => e + 1);
64
+ E === 11 ? (D(0), T((e) => e + 1)) : D((e) => e + 1);
65
65
  }
66
66
  function q(e) {
67
- return !!l && l.getFullYear() === E && l.getMonth() === O && l.getDate() === e;
67
+ return !!c && c.getFullYear() === w && c.getMonth() === E && c.getDate() === e;
68
68
  }
69
69
  function J(e) {
70
- return T.getFullYear() === E && T.getMonth() === O && T.getDate() === e;
70
+ return C.getFullYear() === w && C.getMonth() === E && C.getDate() === e;
71
71
  }
72
- let ie = new Date(T.getFullYear(), T.getMonth(), T.getDate());
72
+ let ie = new Date(C.getFullYear(), C.getMonth(), C.getDate());
73
73
  function Y(e) {
74
- return w ? new Date(E, O, e) > ie : !1;
74
+ return S ? new Date(w, E, e) > ie : !1;
75
75
  }
76
- let X = !w || E < T.getFullYear() || E === T.getFullYear() && O < T.getMonth(), Z = _ === "date" || _ === "datetime", ae = _ === "time" || _ === "datetime", oe = _ !== "date" || v && !!l, Q = a(E, O), $ = f(() => Q.map((e, t) => ({
76
+ let X = !S || w < C.getFullYear() || w === C.getFullYear() && E < C.getMonth(), Z = h === "date" || h === "datetime", ae = h === "time" || h === "datetime", oe = h !== "date" || g && !!c, Q = ee(w, E), $ = u(() => Q.map((e, t) => ({
77
77
  key: e === null ? `empty-slot-${t}` : `day-${e}`,
78
78
  day: e
79
- })), [Q]), se = f(() => {
79
+ })), [Q]), se = u(() => {
80
80
  let e = [];
81
81
  for (let t = 0; t < $.length; t += 7) e.push($.slice(t, t + 7));
82
82
  return e;
83
83
  }, [$]);
84
- return /* @__PURE__ */ g("div", {
85
- className: e("bg-background border border-border/70 shadow-xl select-none p-4 w-max", x),
86
- children: [/* @__PURE__ */ g("div", {
84
+ return /* @__PURE__ */ m("div", {
85
+ className: e("bg-background border border-border/70 shadow-xl select-none p-4 w-max", y),
86
+ children: [/* @__PURE__ */ m("div", {
87
87
  className: "flex flex-row",
88
- children: [Z && /* @__PURE__ */ g("div", {
88
+ children: [Z && /* @__PURE__ */ m("div", {
89
89
  className: "flex flex-col w-[264px]",
90
- children: [/* @__PURE__ */ g("div", {
90
+ children: [/* @__PURE__ */ m("div", {
91
91
  className: "flex items-center justify-between pb-3 mb-2 border-b border-border/60",
92
92
  children: [
93
- /* @__PURE__ */ h("button", {
93
+ /* @__PURE__ */ p("button", {
94
94
  type: "button",
95
- onClick: ne,
95
+ onClick: K,
96
96
  "aria-label": "Previous month",
97
- className: e("p-1.5 text-foreground/70 transition-all active:scale-95", "hover:text-foreground hover:bg-secondary", x),
98
- children: /* @__PURE__ */ h(n, {})
97
+ className: e("p-1.5 text-foreground/70 transition-all active:scale-95", "hover:text-foreground hover:bg-secondary", y),
98
+ children: /* @__PURE__ */ p(i, {})
99
99
  }),
100
- /* @__PURE__ */ g("span", {
100
+ /* @__PURE__ */ m("span", {
101
101
  className: "font-semibold text-sm text-foreground tracking-wide",
102
102
  children: [
103
- i[O],
103
+ r[E],
104
104
  " ",
105
- E
105
+ w
106
106
  ]
107
107
  }),
108
- /* @__PURE__ */ h("button", {
108
+ /* @__PURE__ */ p("button", {
109
109
  type: "button",
110
110
  onClick: re,
111
111
  disabled: !X,
112
112
  "aria-label": "Next month",
113
- className: e("p-1.5 text-foreground/70 transition-all", X ? "hover:text-foreground hover:bg-secondary active:scale-95" : "opacity-30 cursor-not-allowed", x),
114
- children: /* @__PURE__ */ h(t, {})
113
+ className: e("p-1.5 text-foreground/70 transition-all", X ? "hover:text-foreground hover:bg-secondary active:scale-95" : "opacity-30 cursor-not-allowed", y),
114
+ children: /* @__PURE__ */ p(t, {})
115
115
  })
116
116
  ]
117
- }), /* @__PURE__ */ g("table", {
117
+ }), /* @__PURE__ */ m("table", {
118
118
  role: "grid",
119
- "aria-label": `${i[O]} ${E}`,
119
+ "aria-label": `${r[E]} ${w}`,
120
120
  tabIndex: -1,
121
- onKeyDown: B,
121
+ onKeyDown: z,
122
122
  className: "w-full table-fixed border-separate border-spacing-1 text-center",
123
- children: [/* @__PURE__ */ h("thead", { children: /* @__PURE__ */ h("tr", { children: r.map((e) => /* @__PURE__ */ h("th", {
123
+ children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ p("tr", { children: n.map((e) => /* @__PURE__ */ p("th", {
124
124
  scope: "col",
125
125
  className: "text-[11px] font-bold tracking-wider text-foreground/50 uppercase py-1 mb-1",
126
126
  children: e
127
- }, e)) }) }), /* @__PURE__ */ h("tbody", { children: se.map((t, n) => /* @__PURE__ */ h("tr", { children: t.map(({ key: t, day: n }) => n === null ? /* @__PURE__ */ h("td", {}, t) : /* @__PURE__ */ h("td", {
127
+ }, e)) }) }), /* @__PURE__ */ p("tbody", { children: se.map((t, n) => /* @__PURE__ */ p("tr", { children: t.map(({ key: t, day: n }) => n === null ? /* @__PURE__ */ p("td", {}, t) : /* @__PURE__ */ p("td", {
128
128
  role: "gridcell",
129
129
  tabIndex: -1,
130
130
  "aria-selected": q(n),
131
131
  "aria-current": J(n) ? "date" : void 0,
132
- children: /* @__PURE__ */ h("button", {
132
+ children: /* @__PURE__ */ p("button", {
133
133
  ref: (e) => {
134
- I.current[R(new Date(E, O, n))] = e;
134
+ F.current[L(new Date(w, E, n))] = e;
135
135
  },
136
136
  type: "button",
137
- tabIndex: P.getFullYear() === E && P.getMonth() === O && P.getDate() === n ? 0 : -1,
138
- "aria-label": `${n} ${i[O]} ${E}`,
139
- onClick: () => K(n),
137
+ tabIndex: N.getFullYear() === w && N.getMonth() === E && N.getDate() === n ? 0 : -1,
138
+ "aria-label": `${n} ${r[E]} ${w}`,
139
+ onClick: () => G(n),
140
140
  disabled: Y(n),
141
- className: e("w-full flex items-center justify-center font-medium transition-all duration-200", s[y], x, Y(n) ? "opacity-30 cursor-not-allowed text-foreground/50" : "active:scale-90", !Y(n) && !q(n) && !J(n) && V.hover, q(n) && e(V.bg, "font-semibold shadow-sm"), J(n) && !q(n) && e("border", V.border, V.text), !q(n) && !J(n) && "text-foreground"),
141
+ className: e("w-full flex items-center justify-center font-medium transition-all duration-200", o[_], y, Y(n) ? "opacity-30 cursor-not-allowed text-foreground/50" : "active:scale-90", !Y(n) && !q(n) && !J(n) && B.hover, q(n) && e(B.bg, "font-semibold shadow-sm"), J(n) && !q(n) && e("border", B.border, B.text), !q(n) && !J(n) && "text-foreground"),
142
142
  children: n
143
143
  })
144
144
  }, t)) }, t[0]?.key ?? `week-${n}`)) })]
145
145
  })]
146
- }), ae && /* @__PURE__ */ g("div", {
146
+ }), ae && /* @__PURE__ */ m("div", {
147
147
  className: e("flex items-center justify-center gap-4", Z && "pl-5 ml-4 border-l border-border/60"),
148
148
  children: [
149
- /* @__PURE__ */ h(c, {
150
- value: A,
149
+ /* @__PURE__ */ p(s, {
150
+ value: O,
151
151
  max: 23,
152
152
  label: "HH",
153
- onChange: U,
154
- resolvedColor: b,
155
- radiusClass: x
153
+ onChange: H,
154
+ resolvedColor: v,
155
+ radiusClass: y
156
156
  }),
157
- /* @__PURE__ */ h(c, {
158
- value: j,
157
+ /* @__PURE__ */ p(s, {
158
+ value: k,
159
159
  max: 59,
160
160
  label: "MM",
161
- onChange: W,
162
- resolvedColor: b,
163
- radiusClass: x
161
+ onChange: U,
162
+ resolvedColor: v,
163
+ radiusClass: y
164
164
  }),
165
- /* @__PURE__ */ h(c, {
166
- value: M,
165
+ /* @__PURE__ */ p(s, {
166
+ value: j,
167
167
  max: 59,
168
168
  label: "SS",
169
- onChange: G,
170
- resolvedColor: b,
171
- radiusClass: x
169
+ onChange: W,
170
+ resolvedColor: v,
171
+ radiusClass: y
172
172
  })
173
173
  ]
174
174
  })]
175
- }), oe && /* @__PURE__ */ g("div", {
175
+ }), oe && /* @__PURE__ */ m("div", {
176
176
  className: "flex items-center justify-between border-t border-border/60 pt-3 mt-3",
177
- children: [v && l ? /* @__PURE__ */ h("button", {
177
+ children: [g && c ? /* @__PURE__ */ p("button", {
178
178
  type: "button",
179
179
  onClick: () => {
180
- S(null), C();
180
+ b(null), x();
181
181
  },
182
182
  className: "text-xs font-medium text-foreground/50 hover:text-danger transition-colors active:scale-95 px-2 py-1",
183
183
  children: "Clear"
184
- }) : /* @__PURE__ */ h("div", {}), _ !== "date" && /* @__PURE__ */ h("button", {
184
+ }) : /* @__PURE__ */ p("div", {}), h !== "date" && /* @__PURE__ */ p("button", {
185
185
  type: "button",
186
- onClick: C,
187
- className: e("ml-auto text-xs font-semibold px-4 py-2 transition-all hover:opacity-90 active:scale-95 shadow-sm", x, V.bg),
186
+ onClick: x,
187
+ className: e("ml-auto text-xs font-semibold px-4 py-2 transition-all hover:opacity-90 active:scale-95 shadow-sm", y, B.bg),
188
188
  children: "Done"
189
189
  })]
190
190
  })]
191
191
  });
192
192
  });
193
193
  //#endregion
194
- export { _ as DateGrid };
194
+ export { h as DateGrid };
@@ -0,0 +1,75 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * What a clipboard consumer renders with.
4
+ */
5
+ export interface ClipboardState {
6
+ /**
7
+ * Whether the text is on the clipboard.
8
+ * It returns to false after the configured timeout.
9
+ */
10
+ copied: boolean;
11
+ /**
12
+ * Whether the last attempt failed.
13
+ * A browser refuses clipboard access outside a user gesture or without
14
+ * permission, which is a state a consumer usually wants to surface.
15
+ */
16
+ error: boolean;
17
+ /**
18
+ * Copy the component's value, or the given text.
19
+ *
20
+ * @param text - Text to copy instead of the component's value.
21
+ * @returns Whether the copy succeeded.
22
+ */
23
+ copy: (text?: string) => Promise<boolean>;
24
+ /** Clear the copied and error states without copying. */
25
+ reset: () => void;
26
+ }
27
+ /**
28
+ * Props for the Clipboard component.
29
+ */
30
+ export interface ClipboardProps {
31
+ /** Text copied when `copy` is called without an argument. */
32
+ value?: string;
33
+ /**
34
+ * How long the copied state lasts, in milliseconds.
35
+ * Defaults to `components.clipboard.timeout`, then to the framework fallback.
36
+ */
37
+ timeout?: number;
38
+ /** Called after a successful copy. */
39
+ onCopy?: (text: string) => void;
40
+ /** Called after a failed copy. */
41
+ onError?: (error: unknown) => void;
42
+ /** Renders the control, using the clipboard state. */
43
+ children: (state: ClipboardState) => ReactNode;
44
+ }
45
+ /**
46
+ * Copies text and reports the result through a render function.
47
+ *
48
+ * The copied state is a timer, not a change of value, so this component keeps
49
+ * one and clears it on unmount. Copying is a user-triggered side effect, so the
50
+ * component performs no clipboard work during render and renders identically on
51
+ * the server and the client.
52
+ *
53
+ * @param props - The value, the timing and the render function.
54
+ * @param props.value - Text copied by a bare `copy()` call.
55
+ * @param props.timeout - How long the copied state lasts.
56
+ * @param props.onCopy - Called after a successful copy.
57
+ * @param props.onError - Called after a failed copy.
58
+ * @param props.children - Renders the control.
59
+ * @returns The rendered control.
60
+ *
61
+ * @example
62
+ * ```tsx
63
+ * <Clipboard value={invoice.id}>
64
+ * {({ copied, copy }) => (
65
+ * <button type="button" onClick={() => copy()}>
66
+ * {copied ? "Copied" : "Copy invoice number"}
67
+ * </button>
68
+ * )}
69
+ * </Clipboard>
70
+ * ```
71
+ *
72
+ * @see CopyButton - The framework's own copy control.
73
+ */
74
+ export declare function Clipboard({ value, timeout, onCopy, onError, children, }: ClipboardProps): import("react").JSX.Element;
75
+ //# sourceMappingURL=Clipboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Clipboard.d.ts","sourceRoot":"","sources":["../../../src/components/clipboard/Clipboard.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EACL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAC;AAKf;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IAEf;;;;;OAKG;IACH,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE1C,yDAAyD;IACzD,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sCAAsC;IACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhC,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC,sDAAsD;IACtD,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,SAAS,CAAC;CAChD;AA0CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,GACT,EAAE,cAAc,+BAiEhB"}
@@ -0,0 +1,53 @@
1
+ "use client";
2
+ "use client";
3
+ import { useAsheeConfig as e } from "../../libs/context.js";
4
+ import { resolveAnimate as t } from "../../utils/resolve-token.js";
5
+ import { FALLBACK_CLIPBOARD_CONFIG as n } from "./clipboard-config.js";
6
+ import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
7
+ import { Fragment as s, jsx as c } from "react/jsx-runtime";
8
+ //#region src/components/clipboard/Clipboard.tsx
9
+ async function l(e) {
10
+ if (typeof navigator < "u" && navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
11
+ if (typeof document > "u") return !1;
12
+ let t = document.createElement("textarea");
13
+ t.value = e, t.setAttribute("readonly", ""), t.style.position = "fixed", t.style.opacity = "0";
14
+ let n = document.activeElement;
15
+ document.body.appendChild(t), t.select();
16
+ try {
17
+ return document.execCommand("copy");
18
+ } finally {
19
+ t.remove(), n instanceof HTMLElement && n.focus();
20
+ }
21
+ }
22
+ function u({ value: u, timeout: d, onCopy: f, onError: p, children: m }) {
23
+ let h = e(), g = t(d, h.components?.clipboard?.timeout, n.timeout), [_, v] = o(!1), [y, b] = o(!1), x = a(null), S = r(() => {
24
+ x.current !== null && (clearTimeout(x.current), x.current = null);
25
+ }, []);
26
+ i(() => S, [S]);
27
+ let C = r(() => {
28
+ S(), v(!1), b(!1);
29
+ }, [S]), w = r(async (e) => {
30
+ let t = e ?? u ?? "";
31
+ try {
32
+ return await l(t) ? (S(), b(!1), v(!0), f?.(t), x.current = setTimeout(() => {
33
+ v(!1), x.current = null;
34
+ }, g), !0) : (S(), b(!0), v(!1), p?.(/* @__PURE__ */ Error("Clipboard access was refused")), !1);
35
+ } catch (e) {
36
+ return S(), b(!0), v(!1), p?.(e), !1;
37
+ }
38
+ }, [
39
+ S,
40
+ f,
41
+ p,
42
+ g,
43
+ u
44
+ ]);
45
+ return /* @__PURE__ */ c(s, { children: m({
46
+ copied: _,
47
+ error: y,
48
+ copy: w,
49
+ reset: C
50
+ }) });
51
+ }
52
+ //#endregion
53
+ export { u as Clipboard };
@@ -0,0 +1,64 @@
1
+ import { ReactNode } from 'react';
2
+ import { ButtonProps } from '../button/Button';
3
+ type BaseCopyButtonProps = Omit<ButtonProps, "children" | "startContent" | "endContent" | "onClick" | "onCopy" | "isLoading">;
4
+ /**
5
+ * Props for the CopyButton component.
6
+ */
7
+ export interface CopyButtonProps extends BaseCopyButtonProps {
8
+ /** Text written to the clipboard. */
9
+ value: string;
10
+ /** Name of the control. Defaults to `components.clipboard.label`. */
11
+ label?: ReactNode;
12
+ /** Name of the control once the text is copied. Defaults to
13
+ * `components.clipboard.copiedLabel`. */
14
+ copiedLabel?: ReactNode;
15
+ /** Announcement made through the status region once the text is copied. */
16
+ copiedAnnouncement?: string;
17
+ /**
18
+ * How long the copied state lasts, in milliseconds.
19
+ * Defaults to `components.clipboard.timeout`.
20
+ */
21
+ timeout?: number;
22
+ /** Called after a successful copy. */
23
+ onCopy?: (text: string) => void;
24
+ /** Called after a failed copy. */
25
+ onError?: (error: unknown) => void;
26
+ /** Icon shown before the copy. @default CopyIcon */
27
+ copyIcon?: ReactNode;
28
+ /** Icon shown after a successful copy. @default CheckIcon */
29
+ copiedIcon?: ReactNode;
30
+ }
31
+ /**
32
+ * A button that copies a value to the clipboard.
33
+ *
34
+ * The control reports its result twice: the label changes to the copied wording
35
+ * and a status region announces the same thing, because a label change alone is
36
+ * not announced by a screen reader. Focus stays on the button, so a reader can
37
+ * copy again immediately.
38
+ *
39
+ * @param props - CopyButton configuration options and button props.
40
+ * @param props.value - Text written to the clipboard.
41
+ * @param props.label - Name of the control before a copy.
42
+ * @param props.copiedLabel - Name of the control after a copy.
43
+ * @param props.copiedAnnouncement - Announcement made after a copy.
44
+ * @param props.timeout - How long the copied state lasts.
45
+ * @param props.onCopy - Called after a successful copy.
46
+ * @param props.onError - Called after a failed copy.
47
+ * @param props.copyIcon - Icon shown before the copy.
48
+ * @param props.copiedIcon - Icon shown after a copy.
49
+ * @returns The rendered control and its status region.
50
+ *
51
+ * @example
52
+ * ```tsx
53
+ * <CopyButton
54
+ * value="INV-1042"
55
+ * label="Copy invoice number"
56
+ * copiedAnnouncement="Invoice number copied"
57
+ * />
58
+ * ```
59
+ *
60
+ * @see Clipboard - The headless primitive, for a consumer's own control.
61
+ */
62
+ export declare const CopyButton: import('react').ForwardRefExoticComponent<CopyButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
63
+ export {};
64
+ //# sourceMappingURL=CopyButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../../src/components/clipboard/CopyButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKnD,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK5D,KAAK,mBAAmB,GAAG,IAAI,CAC7B,WAAW,EACT,UAAU,GACV,cAAc,GACd,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,WAAW,CACd,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAC1D,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IAEd,qEAAqE;IACrE,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;6CACyC;IACzC,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,sCAAsC;IACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAEhC,kCAAkC;IAClC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAEnC,oDAAoD;IACpD,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,UAAU,+GAyEtB,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use client";
2
+ "use client";
3
+ import { useAsheeConfig as e } from "../../libs/context.js";
4
+ import { resolveCascade as t } from "../../utils/resolve-token.js";
5
+ import { CheckIcon as n } from "../../icons/CheckIcon.js";
6
+ import { Button as r } from "../button/Button.js";
7
+ import { FALLBACK_CLIPBOARD_CONFIG as i } from "./clipboard-config.js";
8
+ import { Clipboard as a } from "./Clipboard.js";
9
+ import { CopyIcon as o } from "../../icons/CopyIcon.js";
10
+ import { CLIPBOARD_STATUS_CLASS as s } from "./clipboard-styles.js";
11
+ import { forwardRef as c } from "react";
12
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
13
+ //#region src/components/clipboard/CopyButton.tsx
14
+ var f = c(({ value: c, label: f, copiedLabel: p, copiedAnnouncement: m, timeout: h, onCopy: g, onError: _, copyIcon: v, copiedIcon: y, ...b }, x) => {
15
+ let S = e().components?.clipboard, C = t(f, S?.label, void 0, i.label), w = t(p, S?.copiedLabel, void 0, i.copiedLabel);
16
+ return /* @__PURE__ */ u(a, {
17
+ value: c,
18
+ timeout: h,
19
+ onCopy: g,
20
+ onError: _,
21
+ children: ({ copied: e, copy: t }) => /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(r, {
22
+ ref: x,
23
+ type: "button",
24
+ variant: b.variant ?? S?.variant ?? void 0,
25
+ color: b.color ?? S?.color ?? void 0,
26
+ size: b.size ?? S?.size ?? void 0,
27
+ startContent: e ? y ?? /* @__PURE__ */ u(n, {}) : v ?? /* @__PURE__ */ u(o, {}),
28
+ onClick: () => {
29
+ t();
30
+ },
31
+ ...b,
32
+ children: e ? w : C
33
+ }), /* @__PURE__ */ u("span", {
34
+ role: "status",
35
+ "aria-live": "polite",
36
+ className: s,
37
+ "data-copied": e ? "true" : void 0,
38
+ children: e ? m ?? `${String(w)}: ${c}` : ""
39
+ })] })
40
+ });
41
+ });
42
+ f.displayName = "CopyButton";
43
+ //#endregion
44
+ export { f as CopyButton };
@@ -0,0 +1,42 @@
1
+ import { Color, Radius, Size, Variant } from '../../shared';
2
+ /**
3
+ * Theme configuration options for the clipboard components.
4
+ *
5
+ * Set under `components.clipboard` in the AsheeUI config. Values feed the
6
+ * component-level fallback tier of the theme cascade.
7
+ */
8
+ export interface ClipboardConfig {
9
+ /**
10
+ * How long the copied state lasts, in milliseconds.
11
+ *
12
+ * @default 2000
13
+ */
14
+ timeout?: number;
15
+ /** Name of the copy control. @default "Copy" */
16
+ label?: string;
17
+ /** Name of the copy control once the text is on the clipboard.
18
+ * @default "Copied" */
19
+ copiedLabel?: string;
20
+ /** Visual style of the copy control. @default "bordered" */
21
+ variant?: Variant;
22
+ /** Accent colour of the copy control. @default "primary" */
23
+ color?: Color;
24
+ /** Density of the copy control. @default "sm" */
25
+ size?: Size;
26
+ /** Corner rounding of the copy control. Defaults to the framework radius. */
27
+ radius?: Radius;
28
+ }
29
+ /**
30
+ * Default config values registered for the clipboard components.
31
+ */
32
+ export declare const defaultClipboardConfig: ClipboardConfig;
33
+ declare module "../../libs/registry" {
34
+ interface ComponentTypeConfigRegistry {
35
+ clipboard: ClipboardConfig;
36
+ }
37
+ }
38
+ /**
39
+ * Hard fallback values used when no config tier provides a value.
40
+ */
41
+ export declare const FALLBACK_CLIPBOARD_CONFIG: Required<ClipboardConfig>;
42
+ //# sourceMappingURL=clipboard-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard-config.d.ts","sourceRoot":"","sources":["../../../src/components/clipboard/clipboard-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;2BACuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4DAA4D;IAC5D,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,4DAA4D;IAC5D,KAAK,CAAC,EAAE,KAAK,CAAC;IAEd,iDAAiD;IACjD,IAAI,CAAC,EAAE,IAAI,CAAC;IAEZ,6EAA6E;IAC7E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,eAOpC,CAAC;AAEF,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,2BAA2B;QACnC,SAAS,EAAE,eAAe,CAAC;KAC5B;CACF;AAID;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,eAAe,CAQ/D,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { registerComponentDefaults as e } from "../../libs/registry.js";
3
+ //#region src/components/clipboard/clipboard-config.ts
4
+ var t = {
5
+ timeout: 2e3,
6
+ label: "Copy",
7
+ copiedLabel: "Copied",
8
+ variant: "bordered",
9
+ color: "primary",
10
+ size: "sm"
11
+ };
12
+ e("clipboard", t);
13
+ var n = {
14
+ timeout: 2e3,
15
+ label: "Copy",
16
+ copiedLabel: "Copied",
17
+ variant: "bordered",
18
+ color: "primary",
19
+ size: "sm",
20
+ radius: "sm"
21
+ };
22
+ //#endregion
23
+ export { n as FALLBACK_CLIPBOARD_CONFIG, t as defaultClipboardConfig };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Clipboard component styles for AsheeUI.
3
+ * This file provides the static class mappings for the clipboard pair.
4
+ */
5
+ /**
6
+ * The status region a copy control announces its result through.
7
+ * It is visually hidden and stays in the document, so the change is announced
8
+ * without moving the reader's focus off the control they pressed.
9
+ */
10
+ export declare const CLIPBOARD_STATUS_CLASS = "sr-only";
11
+ //# sourceMappingURL=clipboard-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clipboard-styles.d.ts","sourceRoot":"","sources":["../../../src/components/clipboard/clipboard-styles.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ //#region src/components/clipboard/clipboard-styles.ts
3
+ var e = "sr-only";
4
+ //#endregion
5
+ export { e as CLIPBOARD_STATUS_CLASS };
@@ -0,0 +1,4 @@
1
+ export * from './Clipboard';
2
+ export * from './CopyButton';
3
+ export * from './clipboard-config';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/clipboard/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./Clipboard.js";
2
+ export * from "./CopyButton.js";
3
+ export * from "./clipboard-config.js";
4
+ export * from "./clipboard-styles.js";