jaci-ui 0.6.3 → 0.7.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 (170) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +31 -0
  3. package/dist/components/alert/alert.cjs +11 -1
  4. package/dist/components/alert/alert.cjs.map +1 -1
  5. package/dist/components/alert/alert.d.cts +4 -1
  6. package/dist/components/alert/alert.d.ts +4 -1
  7. package/dist/components/alert/alert.js +11 -2
  8. package/dist/components/alert/alert.js.map +1 -1
  9. package/dist/components/alert/index.d.cts +2 -2
  10. package/dist/components/alert/index.d.ts +2 -2
  11. package/dist/components/aspect-ratio/aspect-ratio.cjs +23 -0
  12. package/dist/components/aspect-ratio/aspect-ratio.cjs.map +1 -0
  13. package/dist/components/aspect-ratio/aspect-ratio.d.cts +9 -0
  14. package/dist/components/aspect-ratio/aspect-ratio.d.ts +9 -0
  15. package/dist/components/aspect-ratio/aspect-ratio.js +23 -0
  16. package/dist/components/aspect-ratio/aspect-ratio.js.map +1 -0
  17. package/dist/components/aspect-ratio/index.d.cts +2 -0
  18. package/dist/components/aspect-ratio/index.d.ts +2 -0
  19. package/dist/components/card/card.cjs +10 -1
  20. package/dist/components/card/card.cjs.map +1 -1
  21. package/dist/components/card/card.d.cts +15 -2
  22. package/dist/components/card/card.d.ts +15 -2
  23. package/dist/components/card/card.js +10 -2
  24. package/dist/components/card/card.js.map +1 -1
  25. package/dist/components/card/index.d.cts +2 -2
  26. package/dist/components/card/index.d.ts +2 -2
  27. package/dist/components/code/code.cjs +39 -0
  28. package/dist/components/code/code.cjs.map +1 -0
  29. package/dist/components/code/code.d.cts +14 -0
  30. package/dist/components/code/code.d.ts +14 -0
  31. package/dist/components/code/code.js +39 -0
  32. package/dist/components/code/code.js.map +1 -0
  33. package/dist/components/code/index.d.cts +2 -0
  34. package/dist/components/code/index.d.ts +2 -0
  35. package/dist/components/feedback/badge.cjs +6 -3
  36. package/dist/components/feedback/badge.cjs.map +1 -1
  37. package/dist/components/feedback/badge.d.cts +1 -0
  38. package/dist/components/feedback/badge.d.ts +1 -0
  39. package/dist/components/feedback/badge.js +6 -3
  40. package/dist/components/feedback/badge.js.map +1 -1
  41. package/dist/components/figure/figure.cjs +125 -0
  42. package/dist/components/figure/figure.cjs.map +1 -0
  43. package/dist/components/figure/figure.d.cts +24 -0
  44. package/dist/components/figure/figure.d.ts +24 -0
  45. package/dist/components/figure/figure.js +122 -0
  46. package/dist/components/figure/figure.js.map +1 -0
  47. package/dist/components/figure/index.d.cts +2 -0
  48. package/dist/components/figure/index.d.ts +2 -0
  49. package/dist/components/image/image.cjs +103 -0
  50. package/dist/components/image/image.cjs.map +1 -0
  51. package/dist/components/image/image.d.cts +21 -0
  52. package/dist/components/image/image.d.ts +21 -0
  53. package/dist/components/image/image.js +103 -0
  54. package/dist/components/image/image.js.map +1 -0
  55. package/dist/components/image/index.d.cts +2 -0
  56. package/dist/components/image/index.d.ts +2 -0
  57. package/dist/components/kbd/index.d.cts +2 -0
  58. package/dist/components/kbd/index.d.ts +2 -0
  59. package/dist/components/kbd/kbd.cjs +23 -0
  60. package/dist/components/kbd/kbd.cjs.map +1 -0
  61. package/dist/components/kbd/kbd.d.cts +12 -0
  62. package/dist/components/kbd/kbd.d.ts +12 -0
  63. package/dist/components/kbd/kbd.js +23 -0
  64. package/dist/components/kbd/kbd.js.map +1 -0
  65. package/dist/components/progress/progress.cjs +19 -7
  66. package/dist/components/progress/progress.cjs.map +1 -1
  67. package/dist/components/progress/progress.d.cts +4 -0
  68. package/dist/components/progress/progress.d.ts +4 -0
  69. package/dist/components/progress/progress.js +19 -7
  70. package/dist/components/progress/progress.js.map +1 -1
  71. package/dist/components/quote/index.d.cts +2 -0
  72. package/dist/components/quote/index.d.ts +2 -0
  73. package/dist/components/quote/quote.cjs +38 -0
  74. package/dist/components/quote/quote.cjs.map +1 -0
  75. package/dist/components/quote/quote.d.cts +19 -0
  76. package/dist/components/quote/quote.d.ts +19 -0
  77. package/dist/components/quote/quote.js +38 -0
  78. package/dist/components/quote/quote.js.map +1 -0
  79. package/dist/components/stat/index.d.cts +2 -0
  80. package/dist/components/stat/index.d.ts +2 -0
  81. package/dist/components/stat/stat.cjs +122 -0
  82. package/dist/components/stat/stat.cjs.map +1 -0
  83. package/dist/components/stat/stat.d.cts +51 -0
  84. package/dist/components/stat/stat.d.ts +51 -0
  85. package/dist/components/stat/stat.js +114 -0
  86. package/dist/components/stat/stat.js.map +1 -0
  87. package/dist/components/stat-group/index.d.cts +2 -0
  88. package/dist/components/stat-group/index.d.ts +2 -0
  89. package/dist/components/typography/heading.cjs +8 -2
  90. package/dist/components/typography/heading.cjs.map +1 -1
  91. package/dist/components/typography/heading.d.cts +8 -1
  92. package/dist/components/typography/heading.d.ts +8 -1
  93. package/dist/components/typography/heading.js +8 -2
  94. package/dist/components/typography/heading.js.map +1 -1
  95. package/dist/components/typography/index.d.cts +2 -2
  96. package/dist/components/typography/index.d.ts +2 -2
  97. package/dist/components/typography/paragraph.cjs +7 -2
  98. package/dist/components/typography/paragraph.cjs.map +1 -1
  99. package/dist/components/typography/paragraph.d.cts +8 -2
  100. package/dist/components/typography/paragraph.d.ts +8 -2
  101. package/dist/components/typography/paragraph.js +7 -2
  102. package/dist/components/typography/paragraph.js.map +1 -1
  103. package/dist/components/typography/text.cjs +6 -2
  104. package/dist/components/typography/text.cjs.map +1 -1
  105. package/dist/components/typography/text.d.cts +5 -0
  106. package/dist/components/typography/text.d.ts +5 -0
  107. package/dist/components/typography/text.js +6 -2
  108. package/dist/components/typography/text.js.map +1 -1
  109. package/dist/index.cjs +27 -0
  110. package/dist/index.d.cts +19 -4
  111. package/dist/index.d.ts +19 -4
  112. package/dist/index.js +10 -3
  113. package/dist/styled-system/recipes/alert.cjs +2 -1
  114. package/dist/styled-system/recipes/alert.cjs.map +1 -1
  115. package/dist/styled-system/recipes/alert.js +2 -1
  116. package/dist/styled-system/recipes/alert.js.map +1 -1
  117. package/dist/styled-system/recipes/aspect-ratio-box.cjs +25 -0
  118. package/dist/styled-system/recipes/aspect-ratio-box.cjs.map +1 -0
  119. package/dist/styled-system/recipes/aspect-ratio-box.js +25 -0
  120. package/dist/styled-system/recipes/aspect-ratio-box.js.map +1 -0
  121. package/dist/styled-system/recipes/badge.cjs +16 -6
  122. package/dist/styled-system/recipes/badge.cjs.map +1 -1
  123. package/dist/styled-system/recipes/badge.js +16 -6
  124. package/dist/styled-system/recipes/badge.js.map +1 -1
  125. package/dist/styled-system/recipes/code.cjs +33 -0
  126. package/dist/styled-system/recipes/code.cjs.map +1 -0
  127. package/dist/styled-system/recipes/code.js +33 -0
  128. package/dist/styled-system/recipes/code.js.map +1 -0
  129. package/dist/styled-system/recipes/figure.cjs +42 -0
  130. package/dist/styled-system/recipes/figure.cjs.map +1 -0
  131. package/dist/styled-system/recipes/figure.js +42 -0
  132. package/dist/styled-system/recipes/figure.js.map +1 -0
  133. package/dist/styled-system/recipes/heading.cjs +34 -9
  134. package/dist/styled-system/recipes/heading.cjs.map +1 -1
  135. package/dist/styled-system/recipes/heading.js +34 -9
  136. package/dist/styled-system/recipes/heading.js.map +1 -1
  137. package/dist/styled-system/recipes/image.cjs +56 -0
  138. package/dist/styled-system/recipes/image.cjs.map +1 -0
  139. package/dist/styled-system/recipes/image.js +56 -0
  140. package/dist/styled-system/recipes/image.js.map +1 -0
  141. package/dist/styled-system/recipes/kbd.cjs +39 -0
  142. package/dist/styled-system/recipes/kbd.cjs.map +1 -0
  143. package/dist/styled-system/recipes/kbd.js +39 -0
  144. package/dist/styled-system/recipes/kbd.js.map +1 -0
  145. package/dist/styled-system/recipes/paragraph.cjs +25 -2
  146. package/dist/styled-system/recipes/paragraph.cjs.map +1 -1
  147. package/dist/styled-system/recipes/paragraph.js +25 -2
  148. package/dist/styled-system/recipes/paragraph.js.map +1 -1
  149. package/dist/styled-system/recipes/progress.cjs +1 -0
  150. package/dist/styled-system/recipes/progress.cjs.map +1 -1
  151. package/dist/styled-system/recipes/progress.js +1 -0
  152. package/dist/styled-system/recipes/progress.js.map +1 -1
  153. package/dist/styled-system/recipes/quote.cjs +39 -0
  154. package/dist/styled-system/recipes/quote.cjs.map +1 -0
  155. package/dist/styled-system/recipes/quote.js +39 -0
  156. package/dist/styled-system/recipes/quote.js.map +1 -0
  157. package/dist/styled-system/recipes/stat-group.cjs +40 -0
  158. package/dist/styled-system/recipes/stat-group.cjs.map +1 -0
  159. package/dist/styled-system/recipes/stat-group.js +40 -0
  160. package/dist/styled-system/recipes/stat-group.js.map +1 -0
  161. package/dist/styled-system/recipes/stat.cjs +63 -0
  162. package/dist/styled-system/recipes/stat.cjs.map +1 -0
  163. package/dist/styled-system/recipes/stat.js +63 -0
  164. package/dist/styled-system/recipes/stat.js.map +1 -0
  165. package/dist/styled-system/recipes/text.cjs +23 -2
  166. package/dist/styled-system/recipes/text.cjs.map +1 -1
  167. package/dist/styled-system/recipes/text.js +23 -2
  168. package/dist/styled-system/recipes/text.js.map +1 -1
  169. package/dist/styles.css +1002 -75
  170. package/package.json +1 -1
@@ -0,0 +1,103 @@
1
+ "use client";
2
+ import { cx } from "../../styled-system/css/cx.js";
3
+ import { image } from "../../styled-system/recipes/image.js";
4
+ import { forwardRef, useEffect, useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Dialog } from "@base-ui/react/dialog";
7
+ //#region src/components/image/image.tsx
8
+ const Image = forwardRef(function Image({ alt, aspectRatio, className, defaultOpen, fallback, fit = "cover", lightbox = false, lightboxLabel = "Open image", onError, onLoad, onOpenChange, onStatusChange, open, position, src, style, ...props }, ref) {
9
+ const [status, setStatus] = useState("loading");
10
+ useEffect(() => {
11
+ setStatus("loading");
12
+ }, [src]);
13
+ useEffect(() => {
14
+ onStatusChange?.(status);
15
+ }, [onStatusChange, status]);
16
+ const styles = image({
17
+ fit,
18
+ status
19
+ });
20
+ const rootStyle = {
21
+ ...aspectRatio && Number.isFinite(aspectRatio) && aspectRatio > 0 ? { aspectRatio } : void 0,
22
+ ...style
23
+ };
24
+ const content = /* @__PURE__ */ jsxs("span", {
25
+ "aria-busy": status === "loading" || void 0,
26
+ className: styles.root,
27
+ "data-fit": fit,
28
+ "data-jaci-component": "image",
29
+ "data-slot": "image",
30
+ "data-status": status,
31
+ style: rootStyle,
32
+ children: [/* @__PURE__ */ jsx("img", {
33
+ ...props,
34
+ ref,
35
+ alt,
36
+ className: cx(styles.image, className),
37
+ "data-slot": "image-content",
38
+ onError: (event) => {
39
+ setStatus("error");
40
+ onError?.(event);
41
+ },
42
+ onLoad: (event) => {
43
+ setStatus("loaded");
44
+ onLoad?.(event);
45
+ },
46
+ src,
47
+ style: { objectPosition: position }
48
+ }), status === "error" && fallback ? /* @__PURE__ */ jsx("span", {
49
+ "aria-live": "polite",
50
+ className: styles.fallback,
51
+ "data-slot": "image-fallback",
52
+ children: fallback
53
+ }) : null]
54
+ });
55
+ if (!lightbox) return content;
56
+ return /* @__PURE__ */ jsxs(Dialog.Root, {
57
+ defaultOpen,
58
+ onOpenChange: (nextOpen) => onOpenChange?.(nextOpen),
59
+ open,
60
+ children: [/* @__PURE__ */ jsx(Dialog.Trigger, {
61
+ "aria-label": lightboxLabel,
62
+ className: styles.trigger,
63
+ "data-jaci-component": "image-trigger",
64
+ "data-slot": "image-trigger",
65
+ children: content
66
+ }), /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {
67
+ className: styles.backdrop,
68
+ "data-slot": "image-lightbox-backdrop"
69
+ }), /* @__PURE__ */ jsx(Dialog.Viewport, {
70
+ className: styles.viewport,
71
+ "data-slot": "image-lightbox-viewport",
72
+ children: /* @__PURE__ */ jsxs(Dialog.Popup, {
73
+ "aria-label": alt || lightboxLabel,
74
+ className: styles.popup,
75
+ "data-jaci-component": "image-lightbox",
76
+ "data-slot": "image-lightbox-popup",
77
+ children: [
78
+ /* @__PURE__ */ jsx(Dialog.Title, {
79
+ className: styles.title,
80
+ children: alt || lightboxLabel
81
+ }),
82
+ /* @__PURE__ */ jsx(Dialog.Close, {
83
+ "aria-label": "Close image",
84
+ className: styles.close,
85
+ "data-slot": "image-lightbox-close",
86
+ children: "×"
87
+ }),
88
+ /* @__PURE__ */ jsx("img", {
89
+ alt,
90
+ className: styles.lightboxImage,
91
+ "data-slot": "image-lightbox-content",
92
+ src,
93
+ style: { objectPosition: position }
94
+ })
95
+ ]
96
+ })
97
+ })] })]
98
+ });
99
+ });
100
+ //#endregion
101
+ export { Image };
102
+
103
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.js","names":["BaseDialog"],"sources":["../../../src/components/image/image.tsx"],"sourcesContent":["\"use client\";\n\nimport { Dialog as BaseDialog } from \"@base-ui/react/dialog\";\nimport { forwardRef, useEffect, useState } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { image } from \"../../styled-system/recipes\";\n\nexport type ImageFit = \"contain\" | \"cover\" | \"fill\" | \"none\";\nexport type ImageStatus = \"loading\" | \"loaded\" | \"error\";\n\nexport interface ImageProps extends Omit<ComponentPropsWithoutRef<\"img\">, \"children\"> {\n alt: string;\n aspectRatio?: number;\n defaultOpen?: boolean;\n fallback?: ReactNode;\n fit?: ImageFit;\n lightbox?: boolean;\n lightboxLabel?: string;\n onOpenChange?: (open: boolean) => void;\n onStatusChange?: (status: ImageStatus) => void;\n open?: boolean;\n position?: string;\n}\n\nexport const Image = forwardRef<HTMLImageElement, ImageProps>(function Image(\n {\n alt,\n aspectRatio,\n className,\n defaultOpen,\n fallback,\n fit = \"cover\",\n lightbox = false,\n lightboxLabel = \"Open image\",\n onError,\n onLoad,\n onOpenChange,\n onStatusChange,\n open,\n position,\n src,\n style,\n ...props\n },\n ref,\n) {\n const [status, setStatus] = useState<ImageStatus>(\"loading\");\n\n // The source is intentionally the reset key for the native image lifecycle.\n // biome-ignore lint/correctness/useExhaustiveDependencies: changing src starts a new lifecycle.\n useEffect(() => {\n setStatus(\"loading\");\n }, [src]);\n\n useEffect(() => {\n onStatusChange?.(status);\n }, [onStatusChange, status]);\n\n const styles = image({ fit, status });\n const rootStyle = {\n ...(aspectRatio && Number.isFinite(aspectRatio) && aspectRatio > 0\n ? { aspectRatio }\n : undefined),\n ...style,\n };\n\n const content = (\n <span\n aria-busy={status === \"loading\" || undefined}\n className={styles.root}\n data-fit={fit}\n data-jaci-component=\"image\"\n data-slot=\"image\"\n data-status={status}\n style={rootStyle}\n >\n <img\n {...props}\n ref={ref}\n alt={alt}\n className={cx(styles.image, className)}\n data-slot=\"image-content\"\n onError={(event) => {\n setStatus(\"error\");\n onError?.(event);\n }}\n onLoad={(event) => {\n setStatus(\"loaded\");\n onLoad?.(event);\n }}\n src={src}\n style={{ objectPosition: position }}\n />\n {status === \"error\" && fallback ? (\n <span aria-live=\"polite\" className={styles.fallback} data-slot=\"image-fallback\">\n {fallback}\n </span>\n ) : null}\n </span>\n );\n\n if (!lightbox) {\n return content;\n }\n\n return (\n <BaseDialog.Root\n defaultOpen={defaultOpen}\n onOpenChange={(nextOpen) => onOpenChange?.(nextOpen)}\n open={open}\n >\n <BaseDialog.Trigger\n aria-label={lightboxLabel}\n className={styles.trigger}\n data-jaci-component=\"image-trigger\"\n data-slot=\"image-trigger\"\n >\n {content}\n </BaseDialog.Trigger>\n <BaseDialog.Portal>\n <BaseDialog.Backdrop className={styles.backdrop} data-slot=\"image-lightbox-backdrop\" />\n <BaseDialog.Viewport className={styles.viewport} data-slot=\"image-lightbox-viewport\">\n <BaseDialog.Popup\n aria-label={alt || lightboxLabel}\n className={styles.popup}\n data-jaci-component=\"image-lightbox\"\n data-slot=\"image-lightbox-popup\"\n >\n <BaseDialog.Title className={styles.title}>{alt || lightboxLabel}</BaseDialog.Title>\n <BaseDialog.Close\n aria-label=\"Close image\"\n className={styles.close}\n data-slot=\"image-lightbox-close\"\n >\n ×\n </BaseDialog.Close>\n <img\n alt={alt}\n className={styles.lightboxImage}\n data-slot=\"image-lightbox-content\"\n src={src}\n style={{ objectPosition: position }}\n />\n </BaseDialog.Popup>\n </BaseDialog.Viewport>\n </BaseDialog.Portal>\n </BaseDialog.Root>\n );\n});\n"],"mappings":";;;;;;;AA0BA,MAAa,QAAQ,WAAyC,SAAS,MACrE,EACE,KACA,aACA,WACA,aACA,UACA,MAAM,SACN,WAAW,OACX,gBAAgB,cAChB,SACA,QACA,cACA,gBACA,MACA,UACA,KACA,OACA,GAAG,SAEL,KACA;CACA,MAAM,CAAC,QAAQ,aAAa,SAAsB,SAAS;CAI3D,gBAAgB;EACd,UAAU,SAAS;CACrB,GAAG,CAAC,GAAG,CAAC;CAER,gBAAgB;EACd,iBAAiB,MAAM;CACzB,GAAG,CAAC,gBAAgB,MAAM,CAAC;CAE3B,MAAM,SAAS,MAAM;EAAE;EAAK;CAAO,CAAC;CACpC,MAAM,YAAY;EAChB,GAAI,eAAe,OAAO,SAAS,WAAW,KAAK,cAAc,IAC7D,EAAE,YAAY,IACd,KAAA;EACJ,GAAG;CACL;CAEA,MAAM,UACJ,qBAAC,QAAD;EACE,aAAW,WAAW,aAAa,KAAA;EACnC,WAAW,OAAO;EAClB,YAAU;EACV,uBAAoB;EACpB,aAAU;EACV,eAAa;EACb,OAAO;YAPT,CASE,oBAAC,OAAD;GACE,GAAI;GACC;GACA;GACL,WAAW,GAAG,OAAO,OAAO,SAAS;GACrC,aAAU;GACV,UAAU,UAAU;IAClB,UAAU,OAAO;IACjB,UAAU,KAAK;GACjB;GACA,SAAS,UAAU;IACjB,UAAU,QAAQ;IAClB,SAAS,KAAK;GAChB;GACK;GACL,OAAO,EAAE,gBAAgB,SAAS;EACnC,CAAA,GACA,WAAW,WAAW,WACrB,oBAAC,QAAD;GAAM,aAAU;GAAS,WAAW,OAAO;GAAU,aAAU;aAC5D;EACG,CAAA,IACJ,IACA;;CAGR,IAAI,CAAC,UACH,OAAO;CAGT,OACE,qBAACA,OAAW,MAAZ;EACe;EACb,eAAe,aAAa,eAAe,QAAQ;EAC7C;YAHR,CAKE,oBAACA,OAAW,SAAZ;GACE,cAAY;GACZ,WAAW,OAAO;GAClB,uBAAoB;GACpB,aAAU;aAET;EACiB,CAAA,GACpB,qBAACA,OAAW,QAAZ,EAAA,UAAA,CACE,oBAACA,OAAW,UAAZ;GAAqB,WAAW,OAAO;GAAU,aAAU;EAA2B,CAAA,GACtF,oBAACA,OAAW,UAAZ;GAAqB,WAAW,OAAO;GAAU,aAAU;aACzD,qBAACA,OAAW,OAAZ;IACE,cAAY,OAAO;IACnB,WAAW,OAAO;IAClB,uBAAoB;IACpB,aAAU;cAJZ;KAME,oBAACA,OAAW,OAAZ;MAAkB,WAAW,OAAO;gBAAQ,OAAO;KAAgC,CAAA;KACnF,oBAACA,OAAW,OAAZ;MACE,cAAW;MACX,WAAW,OAAO;MAClB,aAAU;gBACX;KAEiB,CAAA;KAClB,oBAAC,OAAD;MACO;MACL,WAAW,OAAO;MAClB,aAAU;MACL;MACL,OAAO,EAAE,gBAAgB,SAAS;KACnC,CAAA;IACe;;EACC,CAAA,CACJ,EAAA,CAAA,CACJ;;AAErB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Image, ImageFit, ImageProps, ImageStatus } from "./image.cjs";
2
+ export { Image, type ImageFit, type ImageProps, type ImageStatus };
@@ -0,0 +1,2 @@
1
+ import { Image, ImageFit, ImageProps, ImageStatus } from "./image.js";
2
+ export { Image, type ImageFit, type ImageProps, type ImageStatus };
@@ -0,0 +1,2 @@
1
+ import { Kbd, KbdProps, KbdSize, KbdVariant } from "./kbd.cjs";
2
+ export { Kbd, type KbdProps, type KbdSize, type KbdVariant };
@@ -0,0 +1,2 @@
1
+ import { Kbd, KbdProps, KbdSize, KbdVariant } from "./kbd.js";
2
+ export { Kbd, type KbdProps, type KbdSize, type KbdVariant };
@@ -0,0 +1,23 @@
1
+ const require_cx = require("../../styled-system/css/cx.cjs");
2
+ const require_kbd = require("../../styled-system/recipes/kbd.cjs");
3
+ let react = require("react");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ //#region src/components/kbd/kbd.tsx
6
+ const Kbd = (0, react.forwardRef)(function Kbd({ className, size = "md", variant = "subtle", ...props }, ref) {
7
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("kbd", {
8
+ ...props,
9
+ ref,
10
+ className: require_cx.cx(require_kbd.kbd({
11
+ size,
12
+ variant
13
+ }), className),
14
+ "data-jaci-component": "kbd",
15
+ "data-size": size,
16
+ "data-slot": "kbd",
17
+ "data-variant": variant
18
+ });
19
+ });
20
+ //#endregion
21
+ exports.Kbd = Kbd;
22
+
23
+ //# sourceMappingURL=kbd.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kbd.cjs","names":["cx","kbd"],"sources":["../../../src/components/kbd/kbd.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { kbd } from \"../../styled-system/recipes\";\n\nexport type KbdSize = \"sm\" | \"md\" | \"lg\";\nexport type KbdVariant = \"solid\" | \"outline\" | \"subtle\";\n\nexport interface KbdProps extends ComponentPropsWithoutRef<\"kbd\"> {\n size?: KbdSize;\n variant?: KbdVariant;\n}\n\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(function Kbd(\n { className, size = \"md\", variant = \"subtle\", ...props },\n ref,\n) {\n return (\n <kbd\n {...props}\n ref={ref}\n className={cx(kbd({ size, variant }), className)}\n data-jaci-component=\"kbd\"\n data-size={size}\n data-slot=\"kbd\"\n data-variant={variant}\n />\n );\n});\n"],"mappings":";;;;;AAcA,MAAa,OAAA,GAAA,MAAA,WAAA,CAAwC,SAAS,IAC5D,EAAE,WAAW,OAAO,MAAM,UAAU,UAAU,GAAG,SACjD,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GAAGC,YAAAA,IAAI;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EAC/C,uBAAoB;EACpB,aAAW;EACX,aAAU;EACV,gBAAc;CACf,CAAA;AAEL,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ComponentPropsWithoutRef } from "react";
2
+ //#region src/components/kbd/kbd.d.ts
3
+ type KbdSize = "sm" | "md" | "lg";
4
+ type KbdVariant = "solid" | "outline" | "subtle";
5
+ interface KbdProps extends ComponentPropsWithoutRef<"kbd"> {
6
+ size?: KbdSize;
7
+ variant?: KbdVariant;
8
+ }
9
+ declare const Kbd: import("react").ForwardRefExoticComponent<KbdProps & import("react").RefAttributes<HTMLElement>>;
10
+ //#endregion
11
+ export { Kbd, KbdProps, KbdSize, KbdVariant };
12
+ //# sourceMappingURL=kbd.d.cts.map
@@ -0,0 +1,12 @@
1
+ import { ComponentPropsWithoutRef } from "react";
2
+ //#region src/components/kbd/kbd.d.ts
3
+ type KbdSize = "sm" | "md" | "lg";
4
+ type KbdVariant = "solid" | "outline" | "subtle";
5
+ interface KbdProps extends ComponentPropsWithoutRef<"kbd"> {
6
+ size?: KbdSize;
7
+ variant?: KbdVariant;
8
+ }
9
+ declare const Kbd: import("react").ForwardRefExoticComponent<KbdProps & import("react").RefAttributes<HTMLElement>>;
10
+ //#endregion
11
+ export { Kbd, KbdProps, KbdSize, KbdVariant };
12
+ //# sourceMappingURL=kbd.d.ts.map
@@ -0,0 +1,23 @@
1
+ import { cx } from "../../styled-system/css/cx.js";
2
+ import { kbd } from "../../styled-system/recipes/kbd.js";
3
+ import { forwardRef } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/kbd/kbd.tsx
6
+ const Kbd = forwardRef(function Kbd({ className, size = "md", variant = "subtle", ...props }, ref) {
7
+ return /* @__PURE__ */ jsx("kbd", {
8
+ ...props,
9
+ ref,
10
+ className: cx(kbd({
11
+ size,
12
+ variant
13
+ }), className),
14
+ "data-jaci-component": "kbd",
15
+ "data-size": size,
16
+ "data-slot": "kbd",
17
+ "data-variant": variant
18
+ });
19
+ });
20
+ //#endregion
21
+ export { Kbd };
22
+
23
+ //# sourceMappingURL=kbd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kbd.js","names":[],"sources":["../../../src/components/kbd/kbd.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { kbd } from \"../../styled-system/recipes\";\n\nexport type KbdSize = \"sm\" | \"md\" | \"lg\";\nexport type KbdVariant = \"solid\" | \"outline\" | \"subtle\";\n\nexport interface KbdProps extends ComponentPropsWithoutRef<\"kbd\"> {\n size?: KbdSize;\n variant?: KbdVariant;\n}\n\nexport const Kbd = forwardRef<HTMLElement, KbdProps>(function Kbd(\n { className, size = \"md\", variant = \"subtle\", ...props },\n ref,\n) {\n return (\n <kbd\n {...props}\n ref={ref}\n className={cx(kbd({ size, variant }), className)}\n data-jaci-component=\"kbd\"\n data-size={size}\n data-slot=\"kbd\"\n data-variant={variant}\n />\n );\n});\n"],"mappings":";;;;;AAcA,MAAa,MAAM,WAAkC,SAAS,IAC5D,EAAE,WAAW,OAAO,MAAM,UAAU,UAAU,GAAG,SACjD,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,IAAI;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EAC/C,uBAAoB;EACpB,aAAW;EACX,aAAU;EACV,gBAAc;CACf,CAAA;AAEL,CAAC"}
@@ -11,11 +11,13 @@ function clamp(value, maximum) {
11
11
  * A semantic progress bar. Provide `label` or `aria-label` so its purpose is
12
12
  * announced to assistive technology.
13
13
  */
14
- const Progress = (0, react.forwardRef)(function Progress({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-valuetext": ariaValueText, className, indeterminate = false, label, max = 100, value = 0, ...props }, ref) {
14
+ const Progress = (0, react.forwardRef)(function Progress({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-valuetext": ariaValueText, className, format, getAriaValueText, indeterminate = false, label, locale, max = 100, value = 0, valueLabel, ...props }, ref) {
15
15
  const labelId = (0, react.useId)();
16
16
  const maximum = Number.isFinite(max) && max > 0 ? max : 100;
17
17
  const currentValue = clamp(value ?? 0, maximum);
18
18
  const percentage = currentValue / maximum * 100;
19
+ const formattedValue = new Intl.NumberFormat(locale, format).format(currentValue);
20
+ const computedValueText = getAriaValueText?.(formattedValue, currentValue);
19
21
  const hasVisibleLabel = label !== null && label !== void 0;
20
22
  const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? void 0 : labelId);
21
23
  const accessibleLabel = ariaLabel ?? (labelledBy ? void 0 : "Progress");
@@ -29,17 +31,27 @@ const Progress = (0, react.forwardRef)(function Progress({ "aria-label": ariaLab
29
31
  "aria-valuemax": maximum,
30
32
  "aria-valuemin": 0,
31
33
  "aria-valuenow": indeterminate ? void 0 : currentValue,
32
- "aria-valuetext": ariaValueText,
34
+ "aria-valuetext": ariaValueText ?? computedValueText,
33
35
  className: require_cx.cx(styles.root, className),
34
36
  "data-indeterminate": indeterminate || void 0,
35
37
  "data-jaci-component": "progress",
36
38
  "data-slot": "progress",
37
39
  role: "progressbar",
38
- children: [hasVisibleLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
39
- className: styles.label,
40
- "data-slot": "progress-label",
41
- id: labelId,
42
- children: label
40
+ children: [hasVisibleLabel || valueLabel !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
41
+ style: {
42
+ display: "flex",
43
+ minWidth: 0
44
+ },
45
+ children: [hasVisibleLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
46
+ className: styles.label,
47
+ "data-slot": "progress-label",
48
+ id: labelId,
49
+ children: label
50
+ }) : null, valueLabel !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
51
+ className: styles.value,
52
+ "data-slot": "progress-value",
53
+ children: valueLabel
54
+ }) : null]
43
55
  }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
44
56
  "aria-hidden": "true",
45
57
  className: styles.track,
@@ -1 +1 @@
1
- {"version":3,"file":"progress.cjs","names":["progress","cx"],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { progress } from \"../../styled-system/recipes\";\n\nfunction clamp(value: number, maximum: number) {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), maximum);\n}\n\nexport interface ProgressProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The current amount. Omit it, or set `indeterminate`, when it is unknown. */\n value?: number | null;\n /** The value that represents completion. Defaults to 100. */\n max?: number;\n /** Omits `aria-valuenow` and renders an in-progress visual state. */\n indeterminate?: boolean;\n /** A visible, automatically associated accessible label. */\n label?: ReactNode;\n}\n\n/**\n * A semantic progress bar. Provide `label` or `aria-label` so its purpose is\n * announced to assistive technology.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n className,\n indeterminate = false,\n label,\n max = 100,\n value = 0,\n ...props\n },\n ref,\n) {\n const labelId = useId();\n const maximum = Number.isFinite(max) && max > 0 ? max : 100;\n const currentValue = clamp(value ?? 0, maximum);\n const percentage = (currentValue / maximum) * 100;\n const hasVisibleLabel = label !== null && label !== undefined;\n const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? undefined : labelId);\n const accessibleLabel = ariaLabel ?? (labelledBy ? undefined : \"Progress\");\n const styles = progress({ indeterminate });\n\n return (\n <div\n {...props}\n ref={ref}\n aria-busy={indeterminate || undefined}\n aria-label={accessibleLabel}\n aria-labelledby={labelledBy}\n aria-valuemax={maximum}\n aria-valuemin={0}\n aria-valuenow={indeterminate ? undefined : currentValue}\n aria-valuetext={ariaValueText}\n className={cx(styles.root, className)}\n data-indeterminate={indeterminate || undefined}\n data-jaci-component=\"progress\"\n data-slot=\"progress\"\n role=\"progressbar\"\n >\n {hasVisibleLabel ? (\n <span className={styles.label} data-slot=\"progress-label\" id={labelId}>\n {label}\n </span>\n ) : null}\n <div aria-hidden=\"true\" className={styles.track} data-slot=\"progress-track\">\n <div\n className={styles.indicator}\n data-indeterminate={indeterminate || undefined}\n data-slot=\"progress-indicator\"\n style={indeterminate ? undefined : { width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,SAAiB;CAC7C,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO;CAGT,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,OAAO;AAC7C;;;;;AAiBA,MAAa,YAAA,GAAA,MAAA,WAAA,CAAqD,SAAS,SACzE,EACE,cAAc,WACd,mBAAmB,gBACnB,kBAAkB,eAClB,WACA,gBAAgB,OAChB,OACA,MAAM,KACN,QAAQ,GACR,GAAG,SAEL,KACA;CACA,MAAM,WAAA,GAAA,MAAA,MAAA,CAAgB;CACtB,MAAM,UAAU,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM;CACxD,MAAM,eAAe,MAAM,SAAS,GAAG,OAAO;CAC9C,MAAM,aAAc,eAAe,UAAW;CAC9C,MAAM,kBAAkB,UAAU,QAAQ,UAAU,KAAA;CACpD,MAAM,aAAa,mBAAmB,aAAa,CAAC,kBAAkB,KAAA,IAAY;CAClF,MAAM,kBAAkB,cAAc,aAAa,KAAA,IAAY;CAC/D,MAAM,SAASA,iBAAAA,SAAS,EAAE,cAAc,CAAC;CAEzC,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,aAAW,iBAAiB,KAAA;EAC5B,cAAY;EACZ,mBAAiB;EACjB,iBAAe;EACf,iBAAe;EACf,iBAAe,gBAAgB,KAAA,IAAY;EAC3C,kBAAgB;EAChB,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,sBAAoB,iBAAiB,KAAA;EACrC,uBAAoB;EACpB,aAAU;EACV,MAAK;YAdP,CAgBG,kBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;GAAM,WAAW,OAAO;GAAO,aAAU;GAAiB,IAAI;aAC3D;EACG,CAAA,IACJ,MACJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,eAAY;GAAO,WAAW,OAAO;GAAO,aAAU;aACzD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,WAAW,OAAO;IAClB,sBAAoB,iBAAiB,KAAA;IACrC,aAAU;IACV,OAAO,gBAAgB,KAAA,IAAY,EAAE,OAAO,GAAG,WAAW,GAAG;GAC9D,CAAA;EACE,CAAA,CACF;;AAET,CAAC"}
1
+ {"version":3,"file":"progress.cjs","names":["progress","cx"],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { progress } from \"../../styled-system/recipes\";\n\nfunction clamp(value: number, maximum: number) {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), maximum);\n}\n\nexport interface ProgressProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The current amount. Omit it, or set `indeterminate`, when it is unknown. */\n value?: number | null;\n /** The value that represents completion. Defaults to 100. */\n max?: number;\n /** Omits `aria-valuenow` and renders an in-progress visual state. */\n indeterminate?: boolean;\n /** A visible, automatically associated accessible label. */\n label?: ReactNode;\n valueLabel?: ReactNode;\n locale?: Intl.LocalesArgument;\n format?: Intl.NumberFormatOptions;\n getAriaValueText?: (formattedValue: string, value: number) => string;\n}\n\n/**\n * A semantic progress bar. Provide `label` or `aria-label` so its purpose is\n * announced to assistive technology.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n className,\n format,\n getAriaValueText,\n indeterminate = false,\n label,\n locale,\n max = 100,\n value = 0,\n valueLabel,\n ...props\n },\n ref,\n) {\n const labelId = useId();\n const maximum = Number.isFinite(max) && max > 0 ? max : 100;\n const currentValue = clamp(value ?? 0, maximum);\n const percentage = (currentValue / maximum) * 100;\n const formattedValue = new Intl.NumberFormat(locale, format).format(currentValue);\n const computedValueText = getAriaValueText?.(formattedValue, currentValue);\n const hasVisibleLabel = label !== null && label !== undefined;\n const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? undefined : labelId);\n const accessibleLabel = ariaLabel ?? (labelledBy ? undefined : \"Progress\");\n const styles = progress({ indeterminate });\n\n return (\n <div\n {...props}\n ref={ref}\n aria-busy={indeterminate || undefined}\n aria-label={accessibleLabel}\n aria-labelledby={labelledBy}\n aria-valuemax={maximum}\n aria-valuemin={0}\n aria-valuenow={indeterminate ? undefined : currentValue}\n aria-valuetext={ariaValueText ?? computedValueText}\n className={cx(styles.root, className)}\n data-indeterminate={indeterminate || undefined}\n data-jaci-component=\"progress\"\n data-slot=\"progress\"\n role=\"progressbar\"\n >\n {hasVisibleLabel || valueLabel !== undefined ? (\n <div style={{ display: \"flex\", minWidth: 0 }}>\n {hasVisibleLabel ? (\n <span className={styles.label} data-slot=\"progress-label\" id={labelId}>\n {label}\n </span>\n ) : null}\n {valueLabel !== undefined ? (\n <span className={styles.value} data-slot=\"progress-value\">\n {valueLabel}\n </span>\n ) : null}\n </div>\n ) : null}\n <div aria-hidden=\"true\" className={styles.track} data-slot=\"progress-track\">\n <div\n className={styles.indicator}\n data-indeterminate={indeterminate || undefined}\n data-slot=\"progress-indicator\"\n style={indeterminate ? undefined : { width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,SAAiB;CAC7C,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO;CAGT,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,OAAO;AAC7C;;;;;AAqBA,MAAa,YAAA,GAAA,MAAA,WAAA,CAAqD,SAAS,SACzE,EACE,cAAc,WACd,mBAAmB,gBACnB,kBAAkB,eAClB,WACA,QACA,kBACA,gBAAgB,OAChB,OACA,QACA,MAAM,KACN,QAAQ,GACR,YACA,GAAG,SAEL,KACA;CACA,MAAM,WAAA,GAAA,MAAA,MAAA,CAAgB;CACtB,MAAM,UAAU,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM;CACxD,MAAM,eAAe,MAAM,SAAS,GAAG,OAAO;CAC9C,MAAM,aAAc,eAAe,UAAW;CAC9C,MAAM,iBAAiB,IAAI,KAAK,aAAa,QAAQ,MAAM,CAAC,CAAC,OAAO,YAAY;CAChF,MAAM,oBAAoB,mBAAmB,gBAAgB,YAAY;CACzE,MAAM,kBAAkB,UAAU,QAAQ,UAAU,KAAA;CACpD,MAAM,aAAa,mBAAmB,aAAa,CAAC,kBAAkB,KAAA,IAAY;CAClF,MAAM,kBAAkB,cAAc,aAAa,KAAA,IAAY;CAC/D,MAAM,SAASA,iBAAAA,SAAS,EAAE,cAAc,CAAC;CAEzC,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,aAAW,iBAAiB,KAAA;EAC5B,cAAY;EACZ,mBAAiB;EACjB,iBAAe;EACf,iBAAe;EACf,iBAAe,gBAAgB,KAAA,IAAY;EAC3C,kBAAgB,iBAAiB;EACjC,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,sBAAoB,iBAAiB,KAAA;EACrC,uBAAoB;EACpB,aAAU;EACV,MAAK;YAdP,CAgBG,mBAAmB,eAAe,KAAA,IACjC,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAK,OAAO;IAAE,SAAS;IAAQ,UAAU;GAAE;aAA3C,CACG,kBACC,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAW,OAAO;IAAO,aAAU;IAAiB,IAAI;cAC3D;GACG,CAAA,IACJ,MACH,eAAe,KAAA,IACd,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,WAAW,OAAO;IAAO,aAAU;cACtC;GACG,CAAA,IACJ,IACD;OACH,MACJ,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,eAAY;GAAO,WAAW,OAAO;GAAO,aAAU;aACzD,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IACE,WAAW,OAAO;IAClB,sBAAoB,iBAAiB,KAAA;IACrC,aAAU;IACV,OAAO,gBAAgB,KAAA,IAAY,EAAE,OAAO,GAAG,WAAW,GAAG;GAC9D,CAAA;EACE,CAAA,CACF;;AAET,CAAC"}
@@ -9,6 +9,10 @@ interface ProgressProps extends Omit<ComponentPropsWithoutRef<"div">, "children"
9
9
  indeterminate?: boolean;
10
10
  /** A visible, automatically associated accessible label. */
11
11
  label?: ReactNode;
12
+ valueLabel?: ReactNode;
13
+ locale?: Intl.LocalesArgument;
14
+ format?: Intl.NumberFormatOptions;
15
+ getAriaValueText?: (formattedValue: string, value: number) => string;
12
16
  }
13
17
  /**
14
18
  * A semantic progress bar. Provide `label` or `aria-label` so its purpose is
@@ -9,6 +9,10 @@ interface ProgressProps extends Omit<ComponentPropsWithoutRef<"div">, "children"
9
9
  indeterminate?: boolean;
10
10
  /** A visible, automatically associated accessible label. */
11
11
  label?: ReactNode;
12
+ valueLabel?: ReactNode;
13
+ locale?: Intl.LocalesArgument;
14
+ format?: Intl.NumberFormatOptions;
15
+ getAriaValueText?: (formattedValue: string, value: number) => string;
12
16
  }
13
17
  /**
14
18
  * A semantic progress bar. Provide `label` or `aria-label` so its purpose is
@@ -11,11 +11,13 @@ function clamp(value, maximum) {
11
11
  * A semantic progress bar. Provide `label` or `aria-label` so its purpose is
12
12
  * announced to assistive technology.
13
13
  */
14
- const Progress = forwardRef(function Progress({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-valuetext": ariaValueText, className, indeterminate = false, label, max = 100, value = 0, ...props }, ref) {
14
+ const Progress = forwardRef(function Progress({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-valuetext": ariaValueText, className, format, getAriaValueText, indeterminate = false, label, locale, max = 100, value = 0, valueLabel, ...props }, ref) {
15
15
  const labelId = useId();
16
16
  const maximum = Number.isFinite(max) && max > 0 ? max : 100;
17
17
  const currentValue = clamp(value ?? 0, maximum);
18
18
  const percentage = currentValue / maximum * 100;
19
+ const formattedValue = new Intl.NumberFormat(locale, format).format(currentValue);
20
+ const computedValueText = getAriaValueText?.(formattedValue, currentValue);
19
21
  const hasVisibleLabel = label !== null && label !== void 0;
20
22
  const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? void 0 : labelId);
21
23
  const accessibleLabel = ariaLabel ?? (labelledBy ? void 0 : "Progress");
@@ -29,17 +31,27 @@ const Progress = forwardRef(function Progress({ "aria-label": ariaLabel, "aria-l
29
31
  "aria-valuemax": maximum,
30
32
  "aria-valuemin": 0,
31
33
  "aria-valuenow": indeterminate ? void 0 : currentValue,
32
- "aria-valuetext": ariaValueText,
34
+ "aria-valuetext": ariaValueText ?? computedValueText,
33
35
  className: cx(styles.root, className),
34
36
  "data-indeterminate": indeterminate || void 0,
35
37
  "data-jaci-component": "progress",
36
38
  "data-slot": "progress",
37
39
  role: "progressbar",
38
- children: [hasVisibleLabel ? /* @__PURE__ */ jsx("span", {
39
- className: styles.label,
40
- "data-slot": "progress-label",
41
- id: labelId,
42
- children: label
40
+ children: [hasVisibleLabel || valueLabel !== void 0 ? /* @__PURE__ */ jsxs("div", {
41
+ style: {
42
+ display: "flex",
43
+ minWidth: 0
44
+ },
45
+ children: [hasVisibleLabel ? /* @__PURE__ */ jsx("span", {
46
+ className: styles.label,
47
+ "data-slot": "progress-label",
48
+ id: labelId,
49
+ children: label
50
+ }) : null, valueLabel !== void 0 ? /* @__PURE__ */ jsx("span", {
51
+ className: styles.value,
52
+ "data-slot": "progress-value",
53
+ children: valueLabel
54
+ }) : null]
43
55
  }) : null, /* @__PURE__ */ jsx("div", {
44
56
  "aria-hidden": "true",
45
57
  className: styles.track,
@@ -1 +1 @@
1
- {"version":3,"file":"progress.js","names":[],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { progress } from \"../../styled-system/recipes\";\n\nfunction clamp(value: number, maximum: number) {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), maximum);\n}\n\nexport interface ProgressProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The current amount. Omit it, or set `indeterminate`, when it is unknown. */\n value?: number | null;\n /** The value that represents completion. Defaults to 100. */\n max?: number;\n /** Omits `aria-valuenow` and renders an in-progress visual state. */\n indeterminate?: boolean;\n /** A visible, automatically associated accessible label. */\n label?: ReactNode;\n}\n\n/**\n * A semantic progress bar. Provide `label` or `aria-label` so its purpose is\n * announced to assistive technology.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n className,\n indeterminate = false,\n label,\n max = 100,\n value = 0,\n ...props\n },\n ref,\n) {\n const labelId = useId();\n const maximum = Number.isFinite(max) && max > 0 ? max : 100;\n const currentValue = clamp(value ?? 0, maximum);\n const percentage = (currentValue / maximum) * 100;\n const hasVisibleLabel = label !== null && label !== undefined;\n const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? undefined : labelId);\n const accessibleLabel = ariaLabel ?? (labelledBy ? undefined : \"Progress\");\n const styles = progress({ indeterminate });\n\n return (\n <div\n {...props}\n ref={ref}\n aria-busy={indeterminate || undefined}\n aria-label={accessibleLabel}\n aria-labelledby={labelledBy}\n aria-valuemax={maximum}\n aria-valuemin={0}\n aria-valuenow={indeterminate ? undefined : currentValue}\n aria-valuetext={ariaValueText}\n className={cx(styles.root, className)}\n data-indeterminate={indeterminate || undefined}\n data-jaci-component=\"progress\"\n data-slot=\"progress\"\n role=\"progressbar\"\n >\n {hasVisibleLabel ? (\n <span className={styles.label} data-slot=\"progress-label\" id={labelId}>\n {label}\n </span>\n ) : null}\n <div aria-hidden=\"true\" className={styles.track} data-slot=\"progress-track\">\n <div\n className={styles.indicator}\n data-indeterminate={indeterminate || undefined}\n data-slot=\"progress-indicator\"\n style={indeterminate ? undefined : { width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,SAAiB;CAC7C,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO;CAGT,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,OAAO;AAC7C;;;;;AAiBA,MAAa,WAAW,WAA0C,SAAS,SACzE,EACE,cAAc,WACd,mBAAmB,gBACnB,kBAAkB,eAClB,WACA,gBAAgB,OAChB,OACA,MAAM,KACN,QAAQ,GACR,GAAG,SAEL,KACA;CACA,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM;CACxD,MAAM,eAAe,MAAM,SAAS,GAAG,OAAO;CAC9C,MAAM,aAAc,eAAe,UAAW;CAC9C,MAAM,kBAAkB,UAAU,QAAQ,UAAU,KAAA;CACpD,MAAM,aAAa,mBAAmB,aAAa,CAAC,kBAAkB,KAAA,IAAY;CAClF,MAAM,kBAAkB,cAAc,aAAa,KAAA,IAAY;CAC/D,MAAM,SAAS,SAAS,EAAE,cAAc,CAAC;CAEzC,OACE,qBAAC,OAAD;EACE,GAAI;EACC;EACL,aAAW,iBAAiB,KAAA;EAC5B,cAAY;EACZ,mBAAiB;EACjB,iBAAe;EACf,iBAAe;EACf,iBAAe,gBAAgB,KAAA,IAAY;EAC3C,kBAAgB;EAChB,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,sBAAoB,iBAAiB,KAAA;EACrC,uBAAoB;EACpB,aAAU;EACV,MAAK;YAdP,CAgBG,kBACC,oBAAC,QAAD;GAAM,WAAW,OAAO;GAAO,aAAU;GAAiB,IAAI;aAC3D;EACG,CAAA,IACJ,MACJ,oBAAC,OAAD;GAAK,eAAY;GAAO,WAAW,OAAO;GAAO,aAAU;aACzD,oBAAC,OAAD;IACE,WAAW,OAAO;IAClB,sBAAoB,iBAAiB,KAAA;IACrC,aAAU;IACV,OAAO,gBAAgB,KAAA,IAAY,EAAE,OAAO,GAAG,WAAW,GAAG;GAC9D,CAAA;EACE,CAAA,CACF;;AAET,CAAC"}
1
+ {"version":3,"file":"progress.js","names":[],"sources":["../../../src/components/progress/progress.tsx"],"sourcesContent":["import { forwardRef, useId } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { progress } from \"../../styled-system/recipes\";\n\nfunction clamp(value: number, maximum: number) {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), maximum);\n}\n\nexport interface ProgressProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The current amount. Omit it, or set `indeterminate`, when it is unknown. */\n value?: number | null;\n /** The value that represents completion. Defaults to 100. */\n max?: number;\n /** Omits `aria-valuenow` and renders an in-progress visual state. */\n indeterminate?: boolean;\n /** A visible, automatically associated accessible label. */\n label?: ReactNode;\n valueLabel?: ReactNode;\n locale?: Intl.LocalesArgument;\n format?: Intl.NumberFormatOptions;\n getAriaValueText?: (formattedValue: string, value: number) => string;\n}\n\n/**\n * A semantic progress bar. Provide `label` or `aria-label` so its purpose is\n * announced to assistive technology.\n */\nexport const Progress = forwardRef<HTMLDivElement, ProgressProps>(function Progress(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n \"aria-valuetext\": ariaValueText,\n className,\n format,\n getAriaValueText,\n indeterminate = false,\n label,\n locale,\n max = 100,\n value = 0,\n valueLabel,\n ...props\n },\n ref,\n) {\n const labelId = useId();\n const maximum = Number.isFinite(max) && max > 0 ? max : 100;\n const currentValue = clamp(value ?? 0, maximum);\n const percentage = (currentValue / maximum) * 100;\n const formattedValue = new Intl.NumberFormat(locale, format).format(currentValue);\n const computedValueText = getAriaValueText?.(formattedValue, currentValue);\n const hasVisibleLabel = label !== null && label !== undefined;\n const labelledBy = ariaLabelledBy ?? (ariaLabel || !hasVisibleLabel ? undefined : labelId);\n const accessibleLabel = ariaLabel ?? (labelledBy ? undefined : \"Progress\");\n const styles = progress({ indeterminate });\n\n return (\n <div\n {...props}\n ref={ref}\n aria-busy={indeterminate || undefined}\n aria-label={accessibleLabel}\n aria-labelledby={labelledBy}\n aria-valuemax={maximum}\n aria-valuemin={0}\n aria-valuenow={indeterminate ? undefined : currentValue}\n aria-valuetext={ariaValueText ?? computedValueText}\n className={cx(styles.root, className)}\n data-indeterminate={indeterminate || undefined}\n data-jaci-component=\"progress\"\n data-slot=\"progress\"\n role=\"progressbar\"\n >\n {hasVisibleLabel || valueLabel !== undefined ? (\n <div style={{ display: \"flex\", minWidth: 0 }}>\n {hasVisibleLabel ? (\n <span className={styles.label} data-slot=\"progress-label\" id={labelId}>\n {label}\n </span>\n ) : null}\n {valueLabel !== undefined ? (\n <span className={styles.value} data-slot=\"progress-value\">\n {valueLabel}\n </span>\n ) : null}\n </div>\n ) : null}\n <div aria-hidden=\"true\" className={styles.track} data-slot=\"progress-track\">\n <div\n className={styles.indicator}\n data-indeterminate={indeterminate || undefined}\n data-slot=\"progress-indicator\"\n style={indeterminate ? undefined : { width: `${percentage}%` }}\n />\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;AAMA,SAAS,MAAM,OAAe,SAAiB;CAC7C,IAAI,CAAC,OAAO,SAAS,KAAK,GACxB,OAAO;CAGT,OAAO,KAAK,IAAI,KAAK,IAAI,OAAO,CAAC,GAAG,OAAO;AAC7C;;;;;AAqBA,MAAa,WAAW,WAA0C,SAAS,SACzE,EACE,cAAc,WACd,mBAAmB,gBACnB,kBAAkB,eAClB,WACA,QACA,kBACA,gBAAgB,OAChB,OACA,QACA,MAAM,KACN,QAAQ,GACR,YACA,GAAG,SAEL,KACA;CACA,MAAM,UAAU,MAAM;CACtB,MAAM,UAAU,OAAO,SAAS,GAAG,KAAK,MAAM,IAAI,MAAM;CACxD,MAAM,eAAe,MAAM,SAAS,GAAG,OAAO;CAC9C,MAAM,aAAc,eAAe,UAAW;CAC9C,MAAM,iBAAiB,IAAI,KAAK,aAAa,QAAQ,MAAM,CAAC,CAAC,OAAO,YAAY;CAChF,MAAM,oBAAoB,mBAAmB,gBAAgB,YAAY;CACzE,MAAM,kBAAkB,UAAU,QAAQ,UAAU,KAAA;CACpD,MAAM,aAAa,mBAAmB,aAAa,CAAC,kBAAkB,KAAA,IAAY;CAClF,MAAM,kBAAkB,cAAc,aAAa,KAAA,IAAY;CAC/D,MAAM,SAAS,SAAS,EAAE,cAAc,CAAC;CAEzC,OACE,qBAAC,OAAD;EACE,GAAI;EACC;EACL,aAAW,iBAAiB,KAAA;EAC5B,cAAY;EACZ,mBAAiB;EACjB,iBAAe;EACf,iBAAe;EACf,iBAAe,gBAAgB,KAAA,IAAY;EAC3C,kBAAgB,iBAAiB;EACjC,WAAW,GAAG,OAAO,MAAM,SAAS;EACpC,sBAAoB,iBAAiB,KAAA;EACrC,uBAAoB;EACpB,aAAU;EACV,MAAK;YAdP,CAgBG,mBAAmB,eAAe,KAAA,IACjC,qBAAC,OAAD;GAAK,OAAO;IAAE,SAAS;IAAQ,UAAU;GAAE;aAA3C,CACG,kBACC,oBAAC,QAAD;IAAM,WAAW,OAAO;IAAO,aAAU;IAAiB,IAAI;cAC3D;GACG,CAAA,IACJ,MACH,eAAe,KAAA,IACd,oBAAC,QAAD;IAAM,WAAW,OAAO;IAAO,aAAU;cACtC;GACG,CAAA,IACJ,IACD;OACH,MACJ,oBAAC,OAAD;GAAK,eAAY;GAAO,WAAW,OAAO;GAAO,aAAU;aACzD,oBAAC,OAAD;IACE,WAAW,OAAO;IAClB,sBAAoB,iBAAiB,KAAA;IACrC,aAAU;IACV,OAAO,gBAAgB,KAAA,IAAY,EAAE,OAAO,GAAG,WAAW,GAAG;GAC9D,CAAA;EACE,CAAA,CACF;;AAET,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Quote, QuoteProps, QuoteSize, QuoteVariant } from "./quote.cjs";
2
+ export { Quote, type QuoteProps, type QuoteSize, type QuoteVariant };
@@ -0,0 +1,2 @@
1
+ import { Quote, QuoteProps, QuoteSize, QuoteVariant } from "./quote.js";
2
+ export { Quote, type QuoteProps, type QuoteSize, type QuoteVariant };
@@ -0,0 +1,38 @@
1
+ const require_cx = require("../../styled-system/css/cx.cjs");
2
+ const require_quote = require("../../styled-system/recipes/quote.cjs");
3
+ let react = require("react");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+ //#region src/components/quote/quote.tsx
6
+ /** A semantic blockquote with optional author and source attribution. */
7
+ const Quote = (0, react.forwardRef)(function Quote({ author, children, className, size = "md", source, variant = "default", ...props }, ref) {
8
+ const hasAttribution = author !== void 0 || source !== void 0;
9
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("blockquote", {
10
+ ...props,
11
+ ref,
12
+ className: require_cx.cx(require_quote.quote({
13
+ size,
14
+ variant
15
+ }), className),
16
+ "data-jaci-component": "quote",
17
+ "data-size": size,
18
+ "data-slot": "quote",
19
+ "data-variant": variant,
20
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
21
+ "data-slot": "quote-content",
22
+ children
23
+ }), hasAttribution ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
24
+ "data-slot": "quote-footer",
25
+ children: [author !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
26
+ "data-slot": "quote-author",
27
+ children: author
28
+ }) : null, source !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("cite", {
29
+ "data-slot": "quote-source",
30
+ children: source
31
+ }) : null]
32
+ }) : null]
33
+ });
34
+ });
35
+ //#endregion
36
+ exports.Quote = Quote;
37
+
38
+ //# sourceMappingURL=quote.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote.cjs","names":["cx","quote"],"sources":["../../../src/components/quote/quote.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { quote } from \"../../styled-system/recipes\";\n\nexport type QuoteVariant = \"default\" | \"accent\" | \"subtle\";\nexport type QuoteSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface QuoteProps extends ComponentPropsWithoutRef<\"blockquote\"> {\n /** Visual treatment for the quote surface and leading border. */\n variant?: QuoteVariant;\n /** Typography scale for the quoted content. */\n size?: QuoteSize;\n /** Optional author rendered in a semantic footer. */\n author?: ReactNode;\n /** Optional source rendered as a semantic `<cite>`. */\n source?: ReactNode;\n}\n\n/** A semantic blockquote with optional author and source attribution. */\nexport const Quote = forwardRef<HTMLQuoteElement, QuoteProps>(function Quote(\n { author, children, className, size = \"md\", source, variant = \"default\", ...props },\n ref,\n) {\n const hasAttribution = author !== undefined || source !== undefined;\n\n return (\n <blockquote\n {...props}\n ref={ref}\n className={cx(quote({ size, variant }), className)}\n data-jaci-component=\"quote\"\n data-size={size}\n data-slot=\"quote\"\n data-variant={variant}\n >\n <div data-slot=\"quote-content\">{children}</div>\n {hasAttribution ? (\n <footer data-slot=\"quote-footer\">\n {author !== undefined ? <span data-slot=\"quote-author\">{author}</span> : null}\n {source !== undefined ? <cite data-slot=\"quote-source\">{source}</cite> : null}\n </footer>\n ) : null}\n </blockquote>\n );\n});\n"],"mappings":";;;;;;AAqBA,MAAa,SAAA,GAAA,MAAA,WAAA,CAAiD,SAAS,MACrE,EAAE,QAAQ,UAAU,WAAW,OAAO,MAAM,QAAQ,UAAU,WAAW,GAAG,SAC5E,KACA;CACA,MAAM,iBAAiB,WAAW,KAAA,KAAa,WAAW,KAAA;CAE1D,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,cAAD;EACE,GAAI;EACC;EACL,WAAWA,WAAAA,GAAGC,cAAAA,MAAM;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EACjD,uBAAoB;EACpB,aAAW;EACX,aAAU;EACV,gBAAc;YAPhB,CASE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,aAAU;GAAiB;EAAc,CAAA,GAC7C,iBACC,iBAAA,GAAA,kBAAA,KAAA,CAAC,UAAD;GAAQ,aAAU;aAAlB,CACG,WAAW,KAAA,IAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,aAAU;cAAgB;GAAa,CAAA,IAAI,MACxE,WAAW,KAAA,IAAY,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;IAAM,aAAU;cAAgB;GAAa,CAAA,IAAI,IACnE;OACN,IACM;;AAEhB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ //#region src/components/quote/quote.d.ts
3
+ type QuoteVariant = "default" | "accent" | "subtle";
4
+ type QuoteSize = "sm" | "md" | "lg";
5
+ interface QuoteProps extends ComponentPropsWithoutRef<"blockquote"> {
6
+ /** Visual treatment for the quote surface and leading border. */
7
+ variant?: QuoteVariant;
8
+ /** Typography scale for the quoted content. */
9
+ size?: QuoteSize;
10
+ /** Optional author rendered in a semantic footer. */
11
+ author?: ReactNode;
12
+ /** Optional source rendered as a semantic `<cite>`. */
13
+ source?: ReactNode;
14
+ }
15
+ /** A semantic blockquote with optional author and source attribution. */
16
+ declare const Quote: import("react").ForwardRefExoticComponent<QuoteProps & import("react").RefAttributes<HTMLQuoteElement>>;
17
+ //#endregion
18
+ export { Quote, QuoteProps, QuoteSize, QuoteVariant };
19
+ //# sourceMappingURL=quote.d.cts.map
@@ -0,0 +1,19 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from "react";
2
+ //#region src/components/quote/quote.d.ts
3
+ type QuoteVariant = "default" | "accent" | "subtle";
4
+ type QuoteSize = "sm" | "md" | "lg";
5
+ interface QuoteProps extends ComponentPropsWithoutRef<"blockquote"> {
6
+ /** Visual treatment for the quote surface and leading border. */
7
+ variant?: QuoteVariant;
8
+ /** Typography scale for the quoted content. */
9
+ size?: QuoteSize;
10
+ /** Optional author rendered in a semantic footer. */
11
+ author?: ReactNode;
12
+ /** Optional source rendered as a semantic `<cite>`. */
13
+ source?: ReactNode;
14
+ }
15
+ /** A semantic blockquote with optional author and source attribution. */
16
+ declare const Quote: import("react").ForwardRefExoticComponent<QuoteProps & import("react").RefAttributes<HTMLQuoteElement>>;
17
+ //#endregion
18
+ export { Quote, QuoteProps, QuoteSize, QuoteVariant };
19
+ //# sourceMappingURL=quote.d.ts.map
@@ -0,0 +1,38 @@
1
+ import { cx } from "../../styled-system/css/cx.js";
2
+ import { quote } from "../../styled-system/recipes/quote.js";
3
+ import { forwardRef } from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/components/quote/quote.tsx
6
+ /** A semantic blockquote with optional author and source attribution. */
7
+ const Quote = forwardRef(function Quote({ author, children, className, size = "md", source, variant = "default", ...props }, ref) {
8
+ const hasAttribution = author !== void 0 || source !== void 0;
9
+ return /* @__PURE__ */ jsxs("blockquote", {
10
+ ...props,
11
+ ref,
12
+ className: cx(quote({
13
+ size,
14
+ variant
15
+ }), className),
16
+ "data-jaci-component": "quote",
17
+ "data-size": size,
18
+ "data-slot": "quote",
19
+ "data-variant": variant,
20
+ children: [/* @__PURE__ */ jsx("div", {
21
+ "data-slot": "quote-content",
22
+ children
23
+ }), hasAttribution ? /* @__PURE__ */ jsxs("footer", {
24
+ "data-slot": "quote-footer",
25
+ children: [author !== void 0 ? /* @__PURE__ */ jsx("span", {
26
+ "data-slot": "quote-author",
27
+ children: author
28
+ }) : null, source !== void 0 ? /* @__PURE__ */ jsx("cite", {
29
+ "data-slot": "quote-source",
30
+ children: source
31
+ }) : null]
32
+ }) : null]
33
+ });
34
+ });
35
+ //#endregion
36
+ export { Quote };
37
+
38
+ //# sourceMappingURL=quote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quote.js","names":[],"sources":["../../../src/components/quote/quote.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { quote } from \"../../styled-system/recipes\";\n\nexport type QuoteVariant = \"default\" | \"accent\" | \"subtle\";\nexport type QuoteSize = \"sm\" | \"md\" | \"lg\";\n\nexport interface QuoteProps extends ComponentPropsWithoutRef<\"blockquote\"> {\n /** Visual treatment for the quote surface and leading border. */\n variant?: QuoteVariant;\n /** Typography scale for the quoted content. */\n size?: QuoteSize;\n /** Optional author rendered in a semantic footer. */\n author?: ReactNode;\n /** Optional source rendered as a semantic `<cite>`. */\n source?: ReactNode;\n}\n\n/** A semantic blockquote with optional author and source attribution. */\nexport const Quote = forwardRef<HTMLQuoteElement, QuoteProps>(function Quote(\n { author, children, className, size = \"md\", source, variant = \"default\", ...props },\n ref,\n) {\n const hasAttribution = author !== undefined || source !== undefined;\n\n return (\n <blockquote\n {...props}\n ref={ref}\n className={cx(quote({ size, variant }), className)}\n data-jaci-component=\"quote\"\n data-size={size}\n data-slot=\"quote\"\n data-variant={variant}\n >\n <div data-slot=\"quote-content\">{children}</div>\n {hasAttribution ? (\n <footer data-slot=\"quote-footer\">\n {author !== undefined ? <span data-slot=\"quote-author\">{author}</span> : null}\n {source !== undefined ? <cite data-slot=\"quote-source\">{source}</cite> : null}\n </footer>\n ) : null}\n </blockquote>\n );\n});\n"],"mappings":";;;;;;AAqBA,MAAa,QAAQ,WAAyC,SAAS,MACrE,EAAE,QAAQ,UAAU,WAAW,OAAO,MAAM,QAAQ,UAAU,WAAW,GAAG,SAC5E,KACA;CACA,MAAM,iBAAiB,WAAW,KAAA,KAAa,WAAW,KAAA;CAE1D,OACE,qBAAC,cAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,MAAM;GAAE;GAAM;EAAQ,CAAC,GAAG,SAAS;EACjD,uBAAoB;EACpB,aAAW;EACX,aAAU;EACV,gBAAc;YAPhB,CASE,oBAAC,OAAD;GAAK,aAAU;GAAiB;EAAc,CAAA,GAC7C,iBACC,qBAAC,UAAD;GAAQ,aAAU;aAAlB,CACG,WAAW,KAAA,IAAY,oBAAC,QAAD;IAAM,aAAU;cAAgB;GAAa,CAAA,IAAI,MACxE,WAAW,KAAA,IAAY,oBAAC,QAAD;IAAM,aAAU;cAAgB;GAAa,CAAA,IAAI,IACnE;OACN,IACM;;AAEhB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Stat, StatDescription, StatDescriptionProps, StatIcon, StatIconProps, StatLabel, StatLabelProps, StatRoot, StatRootProps, StatSize, StatTone, StatTrend, StatTrendDirection, StatTrendProps, StatValue, StatValueProps } from "./stat.cjs";
2
+ export { Stat, StatDescription, type StatDescriptionProps, StatIcon, type StatIconProps, StatLabel, type StatLabelProps, StatRoot, type StatRootProps, type StatSize, type StatTone, StatTrend, type StatTrendDirection, type StatTrendProps, StatValue, type StatValueProps };
@@ -0,0 +1,2 @@
1
+ import { Stat, StatDescription, StatDescriptionProps, StatIcon, StatIconProps, StatLabel, StatLabelProps, StatRoot, StatRootProps, StatSize, StatTone, StatTrend, StatTrendDirection, StatTrendProps, StatValue, StatValueProps } from "./stat.js";
2
+ export { Stat, StatDescription, type StatDescriptionProps, StatIcon, type StatIconProps, StatLabel, type StatLabelProps, StatRoot, type StatRootProps, type StatSize, type StatTone, StatTrend, type StatTrendDirection, type StatTrendProps, StatValue, type StatValueProps };