@forsyteco/product-ui 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/active-element-history-BJ1HYFpN.mjs +33 -0
- package/dist/active-element-history-BkCdrE-X.js +1 -0
- package/dist/avatar/avatar.d.ts +0 -1
- package/dist/avatar/avatar.d.ts.map +1 -1
- package/dist/avatar/index.cjs +1 -0
- package/dist/avatar/index.d.ts +0 -1
- package/dist/avatar/index.d.ts.map +1 -1
- package/dist/avatar/index.mjs +6 -0
- package/dist/avatar-BS1rK8jd.js +1 -0
- package/dist/avatar-CN9vtSKm.mjs +831 -0
- package/dist/breadcrumb/index.cjs +1 -0
- package/dist/breadcrumb/index.mjs +10 -0
- package/dist/breadcrumb-Bz_JVFcb.mjs +108 -0
- package/dist/breadcrumb-y_RB72EG.js +1 -0
- package/dist/bugs-CUXRbTY8.js +1 -0
- package/dist/bugs-bn44RJ1Q.mjs +19 -0
- package/dist/button/button.d.ts +1 -1
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/index.cjs +1 -0
- package/dist/button/index.d.ts +1 -2
- package/dist/button/index.d.ts.map +1 -1
- package/dist/button/index.mjs +5 -0
- package/dist/button-DiBXU5vv.mjs +43 -0
- package/dist/button-aT0PtwWb.js +1 -0
- package/dist/calendar/calendar.d.ts +1 -1
- package/dist/calendar/calendar.d.ts.map +1 -1
- package/dist/calendar/index.cjs +1 -0
- package/dist/calendar/index.d.ts +1 -1
- package/dist/calendar/index.d.ts.map +1 -1
- package/dist/calendar/index.mjs +5 -0
- package/dist/calendar-DNNWdl0u.js +1 -0
- package/dist/calendar-J8_DzzGg.mjs +2983 -0
- package/dist/card/index.cjs +1 -0
- package/dist/card/index.mjs +10 -0
- package/dist/card-BaXkwYFf.js +1 -0
- package/dist/card-DGq_6AlR.mjs +91 -0
- package/dist/checkbox/checkbox.d.ts +1 -1
- package/dist/checkbox/checkbox.d.ts.map +1 -1
- package/dist/checkbox/index.cjs +1 -0
- package/dist/checkbox/index.d.ts +1 -1
- package/dist/checkbox/index.d.ts.map +1 -1
- package/dist/checkbox/index.mjs +4 -0
- package/dist/checkbox-D1ri7EyO.js +1 -0
- package/dist/checkbox-DtsOTrg0.mjs +48 -0
- package/dist/chevron-right-DcjcIxI2.mjs +72 -0
- package/dist/chevron-right-HwlOajQy.js +1 -0
- package/dist/close-provider-CEutdhG8.mjs +9 -0
- package/dist/close-provider-DRYce3-3.js +1 -0
- package/dist/combobox/combobox.d.ts +1 -1
- package/dist/combobox/combobox.d.ts.map +1 -1
- package/dist/combobox/index.cjs +1 -0
- package/dist/combobox/index.d.ts +1 -1
- package/dist/combobox/index.d.ts.map +1 -1
- package/dist/combobox/index.mjs +4 -0
- package/dist/combobox-Cm_xVD4l.js +4 -0
- package/dist/combobox-Dyen_KC6.mjs +1074 -0
- package/dist/counter-label/counter-label.d.ts +1 -1
- package/dist/counter-label/counter-label.d.ts.map +1 -1
- package/dist/counter-label/index.cjs +1 -0
- package/dist/counter-label/index.d.ts +1 -1
- package/dist/counter-label/index.d.ts.map +1 -1
- package/dist/counter-label/index.mjs +4 -0
- package/dist/counter-label-DRT5FsNV.mjs +49 -0
- package/dist/counter-label-c7hl9KSI.js +1 -0
- package/dist/description-CAH1nOgr.mjs +49 -0
- package/dist/description-DhdnQHiq.js +1 -0
- package/dist/dialog/dialog.d.ts +1 -1
- package/dist/dialog/dialog.d.ts.map +1 -1
- package/dist/dialog/index.cjs +1 -0
- package/dist/dialog/index.d.ts +1 -2
- package/dist/dialog/index.d.ts.map +1 -1
- package/dist/dialog/index.mjs +7 -0
- package/dist/dialog-gxgV-kdt.js +1 -0
- package/dist/dialog-nGcnK6o1.mjs +252 -0
- package/dist/disclosure/disclosure.d.ts +1 -1
- package/dist/disclosure/disclosure.d.ts.map +1 -1
- package/dist/disclosure/index.cjs +1 -0
- package/dist/disclosure/index.d.ts +1 -2
- package/dist/disclosure/index.d.ts.map +1 -1
- package/dist/disclosure/index.mjs +6 -0
- package/dist/disclosure-CA45jH3I.mjs +143 -0
- package/dist/disclosure-CGxPdR-8.js +1 -0
- package/dist/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu/index.cjs +1 -0
- package/dist/dropdown-menu/index.d.ts +1 -2
- package/dist/dropdown-menu/index.d.ts.map +1 -1
- package/dist/dropdown-menu/index.mjs +6 -0
- package/dist/dropdown-menu-BPMdVlet.js +1 -0
- package/dist/dropdown-menu-Bj9ftuBZ.mjs +358 -0
- package/dist/element-movement-B3AVr940.mjs +114 -0
- package/dist/element-movement-BjoSY4_c.js +1 -0
- package/dist/fieldset/fieldset.d.ts +1 -1
- package/dist/fieldset/fieldset.d.ts.map +1 -1
- package/dist/fieldset/index.cjs +1 -0
- package/dist/fieldset/index.d.ts +1 -1
- package/dist/fieldset/index.d.ts.map +1 -1
- package/dist/fieldset/index.mjs +4 -0
- package/dist/fieldset-6Fwn_pMQ.js +1 -0
- package/dist/fieldset-CCz_4O8_.mjs +34 -0
- package/dist/floating-CTjRm9bt.js +1 -0
- package/dist/floating-dEgEvBqv.mjs +1663 -0
- package/dist/focus-management-DDD7qKjm.js +1 -0
- package/dist/focus-management-DUVCz_zm.mjs +94 -0
- package/dist/form-fields-BV3kP6dg.js +1 -0
- package/dist/form-fields-CXtJvVC5.mjs +75 -0
- package/dist/frozen-Cpa22rmr.mjs +14 -0
- package/dist/frozen-DelF1VWc.js +1 -0
- package/dist/hidden-Blo8kfIB.mjs +13 -0
- package/dist/hidden-CVbikQhX.js +1 -0
- package/dist/icon-button/icon-button.d.ts +33 -0
- package/dist/icon-button/icon-button.d.ts.map +1 -0
- package/dist/icon-button/index.cjs +1 -0
- package/dist/icon-button/index.d.ts +3 -0
- package/dist/icon-button/index.d.ts.map +1 -0
- package/dist/icon-button/index.mjs +5 -0
- package/dist/icon-button-D-O7rLZy.mjs +101 -0
- package/dist/icon-button-RcLXyruu.js +1 -0
- package/dist/index-6ty0K2BA.js +1 -0
- package/dist/index-B9m5h7mD.mjs +34 -0
- package/dist/index-CuNisU0H.mjs +71 -0
- package/dist/index-NPCXPVlt.js +1 -0
- package/dist/index.cjs +1 -8
- package/dist/index.d.ts +28 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +322 -14601
- package/dist/input/index.cjs +1 -0
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.d.ts.map +1 -1
- package/dist/input/index.mjs +4 -0
- package/dist/input/input.d.ts +1 -1
- package/dist/input/input.d.ts.map +1 -1
- package/dist/input-7d_aQ5wz.js +1 -0
- package/dist/input-Bcf3N-e-.mjs +71 -0
- package/dist/keyboard-Bi11Rnr0.mjs +73 -0
- package/dist/keyboard-DFJ4Xn4Y.js +1 -0
- package/dist/label-BZhmBT_0.js +1 -0
- package/dist/label-DAaE-vxI.mjs +65 -0
- package/dist/listbox/index.cjs +1 -0
- package/dist/listbox/index.d.ts +1 -1
- package/dist/listbox/index.mjs +4 -0
- package/dist/listbox/listbox.d.ts +1 -1
- package/dist/listbox/listbox.d.ts.map +1 -1
- package/dist/listbox-BIwbzCji.js +1 -0
- package/dist/listbox-DZ4v8TYt.mjs +402 -0
- package/dist/open-closed-BkH8ZC7H.mjs +90 -0
- package/dist/open-closed-Blps4pTz.js +2 -0
- package/dist/page-layout/index.d.ts +3 -0
- package/dist/page-layout/index.d.ts.map +1 -0
- package/dist/page-layout/page-layout.d.ts +76 -0
- package/dist/page-layout/page-layout.d.ts.map +1 -0
- package/dist/popover/index.cjs +1 -0
- package/dist/popover/index.d.ts +1 -2
- package/dist/popover/index.d.ts.map +1 -1
- package/dist/popover/index.mjs +6 -0
- package/dist/popover/popover.d.ts +1 -1
- package/dist/popover/popover.d.ts.map +1 -1
- package/dist/popover-CnNxo6sT.js +1 -0
- package/dist/popover-H1AyJtro.mjs +293 -0
- package/dist/portal-BBLniC-d.js +1 -0
- package/dist/portal-BaBdcS83.mjs +514 -0
- package/dist/radio-group/index.cjs +1 -0
- package/dist/radio-group/index.d.ts +1 -1
- package/dist/radio-group/index.d.ts.map +1 -1
- package/dist/radio-group/index.mjs +4 -0
- package/dist/radio-group/radio-group.d.ts +1 -1
- package/dist/radio-group/radio-group.d.ts.map +1 -1
- package/dist/radio-group-CTf6mrDs.mjs +159 -0
- package/dist/radio-group-d2V69c7t.js +1 -0
- package/dist/relative-time/index.cjs +1 -0
- package/dist/relative-time/index.d.ts +3 -0
- package/dist/relative-time/index.d.ts.map +1 -0
- package/dist/relative-time/index.mjs +4 -0
- package/dist/relative-time/relative-time.d.ts +7 -0
- package/dist/relative-time/relative-time.d.ts.map +1 -0
- package/dist/relative-time-B6ex5AzD.mjs +560 -0
- package/dist/relative-time-DwsEaKLP.js +1 -0
- package/dist/select/index.cjs +1 -0
- package/dist/select/index.d.ts +1 -1
- package/dist/select/index.d.ts.map +1 -1
- package/dist/select/index.mjs +4 -0
- package/dist/select/select.d.ts +1 -1
- package/dist/select/select.d.ts.map +1 -1
- package/dist/select-CO8U4sj3.mjs +46 -0
- package/dist/select-wCk5MlT7.js +1 -0
- package/dist/skeleton/index.cjs +1 -0
- package/dist/skeleton/index.d.ts +1 -1
- package/dist/skeleton/index.d.ts.map +1 -1
- package/dist/skeleton/index.mjs +4 -0
- package/dist/skeleton/skeleton.d.ts +1 -1
- package/dist/skeleton/skeleton.d.ts.map +1 -1
- package/dist/skeleton-CK17S8WY.mjs +18 -0
- package/dist/skeleton-DPDwKcBd.js +1 -0
- package/dist/sonner/index.cjs +1 -0
- package/dist/sonner/index.d.ts +0 -1
- package/dist/sonner/index.d.ts.map +1 -1
- package/dist/sonner/index.mjs +4 -0
- package/dist/sonner/sonner.d.ts +0 -1
- package/dist/sonner/sonner.d.ts.map +1 -1
- package/dist/sonner-Ce9PJbum.mjs +775 -0
- package/dist/sonner-CuPfwlK5.js +1 -0
- package/dist/spinner/index.cjs +1 -0
- package/dist/spinner/index.d.ts +1 -1
- package/dist/spinner/index.mjs +4 -0
- package/dist/spinner/spinner.d.ts +1 -1
- package/dist/spinner/spinner.d.ts.map +1 -1
- package/dist/spinner-HqsnWxuN.mjs +44 -0
- package/dist/spinner-lA1Oe8w7.js +1 -0
- package/dist/switch/index.cjs +1 -0
- package/dist/switch/index.d.ts +1 -1
- package/dist/switch/index.d.ts.map +1 -1
- package/dist/switch/index.mjs +4 -0
- package/dist/switch/switch.d.ts +1 -1
- package/dist/switch/switch.d.ts.map +1 -1
- package/dist/switch-DKcD0IFH.mjs +125 -0
- package/dist/switch-DqAuXwa2.js +1 -0
- package/dist/tabs/index.cjs +1 -0
- package/dist/tabs/index.d.ts +1 -2
- package/dist/tabs/index.d.ts.map +1 -1
- package/dist/tabs/index.mjs +8 -0
- package/dist/tabs/tabs.d.ts +1 -1
- package/dist/tabs/tabs.d.ts.map +1 -1
- package/dist/tabs-DLqfQ301.mjs +253 -0
- package/dist/tabs-X4sPQQYs.js +1 -0
- package/dist/tailwind-D2U2F80P.js +1 -0
- package/dist/tailwind-DtaLkIY8.mjs +2776 -0
- package/dist/textarea/index.cjs +1 -0
- package/dist/textarea/index.d.ts +1 -1
- package/dist/textarea/index.d.ts.map +1 -1
- package/dist/textarea/index.mjs +4 -0
- package/dist/textarea/textarea.d.ts +1 -1
- package/dist/textarea/textarea.d.ts.map +1 -1
- package/dist/textarea-BKYgl79b.mjs +30 -0
- package/dist/textarea-_O_Tp3az.js +1 -0
- package/dist/theme/index.cjs +1 -0
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.mjs +5 -0
- package/dist/theme/theme-provider.d.ts +1 -1
- package/dist/theme/theme-provider.d.ts.map +1 -1
- package/dist/transition/index.cjs +1 -0
- package/dist/transition/index.d.ts +1 -1
- package/dist/transition/index.d.ts.map +1 -1
- package/dist/transition/index.mjs +4 -0
- package/dist/transition/transition.d.ts +1 -1
- package/dist/transition/transition.d.ts.map +1 -1
- package/dist/transition-B0MGuDho.mjs +139 -0
- package/dist/transition-D0HuUd2-.mjs +32 -0
- package/dist/transition-D0lrFviR.js +1 -0
- package/dist/transition-Dg805IZ4.js +1 -0
- package/dist/use-by-comparator-BeV-GNRZ.js +1 -0
- package/dist/use-by-comparator-Bmefvuy2.mjs +16 -0
- package/dist/use-event-listener-BjXsgSkG.mjs +15 -0
- package/dist/use-event-listener-EEU-ysaN.js +1 -0
- package/dist/use-inert-others-BCB16FKE.mjs +40 -0
- package/dist/use-inert-others-CfJSV8X0.js +1 -0
- package/dist/use-is-mounted-COmayWN0.mjs +11 -0
- package/dist/use-is-mounted-o0iZaudu.js +1 -0
- package/dist/use-resolve-button-type-637wy6MK.mjs +41 -0
- package/dist/use-resolve-button-type-DDyWUJvM.js +1 -0
- package/dist/use-sync-refs-B0fmGxD4.mjs +247 -0
- package/dist/use-sync-refs-DoZFQ57o.js +4 -0
- package/dist/use-tab-direction-BTonGsg0.mjs +47 -0
- package/dist/use-tab-direction-L_XwcquD.js +1 -0
- package/dist/use-text-value-BMXU9EaO.mjs +44 -0
- package/dist/use-text-value-D3Jlcm8N.js +1 -0
- package/dist/use-theme-BQOvga8h.mjs +60 -0
- package/dist/use-theme-u93yjrEf.js +1 -0
- package/dist/use-tree-walker-D25YXIMY.mjs +18 -0
- package/dist/use-tree-walker-FWwHzDNC.js +1 -0
- package/dist/useFocusRing-Bocdsy5M.mjs +446 -0
- package/dist/useFocusRing-uXUSOfAR.js +1 -0
- package/dist/utils/create-component.d.ts +5 -0
- package/dist/utils/create-component.d.ts.map +1 -0
- package/dist/utils/types/component-props.d.ts +9 -0
- package/dist/utils/types/component-props.d.ts.map +1 -0
- package/dist/visually-hidden/index.cjs +1 -0
- package/dist/visually-hidden/index.mjs +4 -0
- package/dist/visually-hidden-BJYGZ8_F.js +1 -0
- package/dist/visually-hidden-DUoKCWmA.mjs +19 -0
- package/fonts/plus-jakart-sans-medium.woff2 +0 -0
- package/fonts/plus-jakarta-sans-[wght].woff2 +0 -0
- package/fonts/plus-jakarta-sans-bold-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-bold.woff2 +0 -0
- package/fonts/plus-jakarta-sans-extra-bold-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-extra-bold.woff2 +0 -0
- package/fonts/plus-jakarta-sans-extra-light-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-extra-light.woff2 +0 -0
- package/fonts/plus-jakarta-sans-italic-[wght].woff2 +0 -0
- package/fonts/plus-jakarta-sans-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-light-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-light.woff2 +0 -0
- package/fonts/plus-jakarta-sans-medium-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-regular.woff2 +0 -0
- package/fonts/plus-jakarta-sans-semi-bold-italic.woff2 +0 -0
- package/fonts/plus-jakarta-sans-semi-bold.woff2 +0 -0
- package/package.json +372 -85
- package/styles.css +179 -0
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ npm install react@^19.2.1 react-dom@^19.2.1 tailwindcss@^4.1.17
|
|
|
22
22
|
|
|
23
23
|
## Setup
|
|
24
24
|
|
|
25
|
-
### 1. Import Tailwind
|
|
25
|
+
### 1. Import Tailwind base styles
|
|
26
26
|
|
|
27
27
|
Make sure Tailwind CSS is imported in your application:
|
|
28
28
|
|
|
@@ -31,7 +31,16 @@ Make sure Tailwind CSS is imported in your application:
|
|
|
31
31
|
@import 'tailwindcss';
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
### 2. Import
|
|
34
|
+
### 2. Import the design system styles
|
|
35
|
+
|
|
36
|
+
Pull in the design tokens, fonts, and utilities provided by the library:
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
/* src/index.css or your main CSS file, after tailwindcss */
|
|
40
|
+
@import '@forsyteco/product-ui/styles.css';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 3. Import components
|
|
35
44
|
|
|
36
45
|
```typescript
|
|
37
46
|
import { Spinner } from '@forsyteco/product-ui'
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useRef as a, useEffect as f } from "react";
|
|
2
|
+
import { a as s } from "./use-sync-refs-B0fmGxD4.mjs";
|
|
3
|
+
import { i as m } from "./keyboard-Bi11Rnr0.mjs";
|
|
4
|
+
import { E as l } from "./focus-management-DUVCz_zm.mjs";
|
|
5
|
+
function y(t, e) {
|
|
6
|
+
let n = a([]), r = s(t);
|
|
7
|
+
f(() => {
|
|
8
|
+
let d = [...n.current];
|
|
9
|
+
for (let [u, i] of e.entries()) if (n.current[u] !== i) {
|
|
10
|
+
let c = r(e, d);
|
|
11
|
+
return n.current = e, c;
|
|
12
|
+
}
|
|
13
|
+
}, [r, ...e]);
|
|
14
|
+
}
|
|
15
|
+
function p(t) {
|
|
16
|
+
function e() {
|
|
17
|
+
document.readyState !== "loading" && (t(), document.removeEventListener("DOMContentLoaded", e));
|
|
18
|
+
}
|
|
19
|
+
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", e), e());
|
|
20
|
+
}
|
|
21
|
+
let o = [];
|
|
22
|
+
p(() => {
|
|
23
|
+
function t(e) {
|
|
24
|
+
if (!m(e.target) || e.target === document.body || o[0] === e.target) return;
|
|
25
|
+
let n = e.target;
|
|
26
|
+
n = n.closest(l), o.unshift(n ?? e.target), o = o.filter((r) => r != null && r.isConnected), o.splice(10);
|
|
27
|
+
}
|
|
28
|
+
window.addEventListener("click", t, { capture: !0 }), window.addEventListener("mousedown", t, { capture: !0 }), window.addEventListener("focus", t, { capture: !0 }), document.body.addEventListener("click", t, { capture: !0 }), document.body.addEventListener("mousedown", t, { capture: !0 }), document.body.addEventListener("focus", t, { capture: !0 });
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
y as m,
|
|
32
|
+
o as n
|
|
33
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("react"),s=require("./use-sync-refs-DoZFQ57o.js"),a=require("./keyboard-DFJ4Xn4Y.js"),f=require("./focus-management-DDD7qKjm.js");function l(t,e){let n=u.useRef([]),r=s.o$1(t);u.useEffect(()=>{let o=[...n.current];for(let[d,c]of e.entries())if(n.current[d]!==c){let i=r(e,o);return n.current=e,i}},[r,...e])}function m(t){function e(){document.readyState!=="loading"&&(t(),document.removeEventListener("DOMContentLoaded",e))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",e),e())}exports.n=[];m(()=>{function t(e){if(!a.i(e.target)||e.target===document.body||exports.n[0]===e.target)return;let n=e.target;n=n.closest(f.E),exports.n.unshift(n??e.target),exports.n=exports.n.filter(r=>r!=null&&r.isConnected),exports.n.splice(10)}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})});exports.m=l;
|
package/dist/avatar/avatar.d.ts
CHANGED
|
@@ -22,5 +22,4 @@ type AvatarFallbackBoringProps = AvatarFallbackBaseProps & {
|
|
|
22
22
|
export type AvatarFallbackProps = AvatarFallbackDefaultProps | AvatarFallbackInitialsProps | AvatarFallbackBoringProps;
|
|
23
23
|
declare function AvatarFallback(props: AvatarFallbackProps): React.JSX.Element;
|
|
24
24
|
export { Avatar, AvatarFallback, AvatarImage };
|
|
25
|
-
export default Avatar;
|
|
26
25
|
//# sourceMappingURL=avatar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/avatar/avatar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAE5E,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,qBAQnD;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAErE,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,qBAY7D;AAED,KAAK,uBAAuB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,0BAA0B,GAAG,uBAAuB,GAAG;IAC1D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,KAAK,2BAA2B,GAAG,uBAAuB,GAAG;IAC3D,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,yBAAyB,GAAG,uBAAuB,GAAG;IACzD,OAAO,EAAE,QAAQ,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,0BAA0B,GAC1B,2BAA2B,GAC3B,yBAAyB,CAAC;AAY9B,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA8DjD;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../src/avatar/avatar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAE5E,iBAAS,MAAM,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,qBAQnD;AAED,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC;AAErE,iBAAS,WAAW,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,qBAY7D;AAED,KAAK,uBAAuB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IACvG,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,0BAA0B,GAAG,uBAAuB,GAAG;IAC1D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,KAAK,2BAA2B,GAAG,uBAAuB,GAAG;IAC3D,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,yBAAyB,GAAG,uBAAuB,GAAG;IACzD,OAAO,EAAE,QAAQ,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,0BAA0B,GAC1B,2BAA2B,GAC3B,yBAAyB,CAAC;AAY9B,iBAAS,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBA8DjD;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../avatar-BS1rK8jd.js");exports.Avatar=a.Avatar;exports.AvatarFallback=a.AvatarFallback;exports.AvatarImage=a.AvatarImage;
|
package/dist/avatar/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/D,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),k=require("react"),b=require("./tailwind-D2U2F80P.js");require("react-dom");const te=require("./index-6ty0K2BA.js");function re(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const s in r)if(s!=="default"){const l=Object.getOwnPropertyDescriptor(r,s);Object.defineProperty(i,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}return i.default=r,Object.freeze(i)}const x=re(k),F=r=>{let i=0;for(let s=0;s<r.length;s++){const l=r.charCodeAt(s);i=(i<<5)-i+l,i=i&i}return Math.abs(i)},X=(r,i)=>Math.floor(r/Math.pow(10,i)%10),z=(r,i)=>!(X(r,i)%2),m=(r,i,s)=>{const l=r%i;return s&&X(r,s)%2===0?-l:l},A=(r,i,s)=>i[r%s],ie=r=>{r.slice(0,1)==="#"&&(r=r.slice(1));const i=parseInt(r.substr(0,2),16),s=parseInt(r.substr(2,2),16),l=parseInt(r.substr(4,2),16);return(i*299+s*587+l*114)/1e3>=128?"#000000":"#FFFFFF"},se=4,d=80;function ne(r,i){const s=F(r),l=i&&i.length;return Array.from({length:se},(a,n)=>({color:A(s+n,i,l),translateX:m(s*(n+1),d/2-(n+17),1),translateY:m(s*(n+1),d/2-(n+17),2),rotate:m(s*(n+1),360),isSquare:z(s,2)}))}const $=({name:r,colors:i,title:s,square:l,size:a,...n})=>{const e=ne(r,i),o=x.useId();return t.jsxs("svg",{viewBox:"0 0 "+d+" "+d,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:a,height:a,...n,children:[s&&t.jsx("title",{children:r}),t.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:d,height:d,children:t.jsx("rect",{width:d,height:d,rx:l?void 0:d*2,fill:"#FFFFFF"})}),t.jsxs("g",{mask:`url(#${o})`,children:[t.jsx("rect",{width:d,height:d,fill:e[0].color}),t.jsx("rect",{x:(d-60)/2,y:(d-20)/2,width:d,height:e[1].isSquare?d:d/8,fill:e[1].color,transform:"translate("+e[1].translateX+" "+e[1].translateY+") rotate("+e[1].rotate+" "+d/2+" "+d/2+")"}),t.jsx("circle",{cx:d/2,cy:d/2,fill:e[2].color,r:d/5,transform:"translate("+e[2].translateX+" "+e[2].translateY+")"}),t.jsx("line",{x1:0,y1:d/2,x2:d,y2:d/2,strokeWidth:2,stroke:e[3].color,transform:"translate("+e[3].translateX+" "+e[3].translateY+") rotate("+e[3].rotate+" "+d/2+" "+d/2+")"})]})]})},O=90,ae=5;function le(r,i){const s=F(r),l=i&&i.length,a=Array.from({length:ae},(e,o)=>A(s+o,i,l)),n=[];return n[0]=a[0],n[1]=a[1],n[2]=a[1],n[3]=a[2],n[4]=a[2],n[5]=a[3],n[6]=a[3],n[7]=a[0],n[8]=a[4],n}const oe=({name:r,colors:i,title:s,square:l,size:a,...n})=>{const e=le(r,i),o=k.useId();return t.jsxs("svg",{viewBox:"0 0 "+O+" "+O,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:a,height:a,...n,children:[s&&t.jsx("title",{children:r}),t.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:O,height:O,children:t.jsx("rect",{width:O,height:O,rx:l?void 0:O*2,fill:"#FFFFFF"})}),t.jsxs("g",{mask:`url(#${o})`,children:[t.jsx("path",{d:"M0 0h90v45H0z",fill:e[0]}),t.jsx("path",{d:"M0 45h90v45H0z",fill:e[1]}),t.jsx("path",{d:"M83 45a38 38 0 00-76 0h76z",fill:e[2]}),t.jsx("path",{d:"M83 45a38 38 0 01-76 0h76z",fill:e[3]}),t.jsx("path",{d:"M77 45a32 32 0 10-64 0h64z",fill:e[4]}),t.jsx("path",{d:"M77 45a32 32 0 11-64 0h64z",fill:e[5]}),t.jsx("path",{d:"M71 45a26 26 0 00-52 0h52z",fill:e[6]}),t.jsx("path",{d:"M71 45a26 26 0 01-52 0h52z",fill:e[7]}),t.jsx("circle",{cx:45,cy:45,r:23,fill:e[8]})]})]})},ce=64,C=80;function he(r,i){const s=F(r),l=i&&i.length;return Array.from({length:ce},(a,n)=>A(s%(n+1),i,l))}const ue=({name:r,colors:i,title:s,square:l,size:a,...n})=>{const e=he(r,i),o=x.useId();return t.jsxs("svg",{viewBox:"0 0 "+C+" "+C,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:a,height:a,...n,children:[s&&t.jsx("title",{children:r}),t.jsx("mask",{id:o,"mask-type":"alpha",maskUnits:"userSpaceOnUse",x:0,y:0,width:C,height:C,children:t.jsx("rect",{width:C,height:C,rx:l?void 0:C*2,fill:"#FFFFFF"})}),t.jsxs("g",{mask:`url(#${o})`,children:[t.jsx("rect",{width:10,height:10,fill:e[0]}),t.jsx("rect",{x:20,width:10,height:10,fill:e[1]}),t.jsx("rect",{x:40,width:10,height:10,fill:e[2]}),t.jsx("rect",{x:60,width:10,height:10,fill:e[3]}),t.jsx("rect",{x:10,width:10,height:10,fill:e[4]}),t.jsx("rect",{x:30,width:10,height:10,fill:e[5]}),t.jsx("rect",{x:50,width:10,height:10,fill:e[6]}),t.jsx("rect",{x:70,width:10,height:10,fill:e[7]}),t.jsx("rect",{y:10,width:10,height:10,fill:e[8]}),t.jsx("rect",{y:20,width:10,height:10,fill:e[9]}),t.jsx("rect",{y:30,width:10,height:10,fill:e[10]}),t.jsx("rect",{y:40,width:10,height:10,fill:e[11]}),t.jsx("rect",{y:50,width:10,height:10,fill:e[12]}),t.jsx("rect",{y:60,width:10,height:10,fill:e[13]}),t.jsx("rect",{y:70,width:10,height:10,fill:e[14]}),t.jsx("rect",{x:20,y:10,width:10,height:10,fill:e[15]}),t.jsx("rect",{x:20,y:20,width:10,height:10,fill:e[16]}),t.jsx("rect",{x:20,y:30,width:10,height:10,fill:e[17]}),t.jsx("rect",{x:20,y:40,width:10,height:10,fill:e[18]}),t.jsx("rect",{x:20,y:50,width:10,height:10,fill:e[19]}),t.jsx("rect",{x:20,y:60,width:10,height:10,fill:e[20]}),t.jsx("rect",{x:20,y:70,width:10,height:10,fill:e[21]}),t.jsx("rect",{x:40,y:10,width:10,height:10,fill:e[22]}),t.jsx("rect",{x:40,y:20,width:10,height:10,fill:e[23]}),t.jsx("rect",{x:40,y:30,width:10,height:10,fill:e[24]}),t.jsx("rect",{x:40,y:40,width:10,height:10,fill:e[25]}),t.jsx("rect",{x:40,y:50,width:10,height:10,fill:e[26]}),t.jsx("rect",{x:40,y:60,width:10,height:10,fill:e[27]}),t.jsx("rect",{x:40,y:70,width:10,height:10,fill:e[28]}),t.jsx("rect",{x:60,y:10,width:10,height:10,fill:e[29]}),t.jsx("rect",{x:60,y:20,width:10,height:10,fill:e[30]}),t.jsx("rect",{x:60,y:30,width:10,height:10,fill:e[31]}),t.jsx("rect",{x:60,y:40,width:10,height:10,fill:e[32]}),t.jsx("rect",{x:60,y:50,width:10,height:10,fill:e[33]}),t.jsx("rect",{x:60,y:60,width:10,height:10,fill:e[34]}),t.jsx("rect",{x:60,y:70,width:10,height:10,fill:e[35]}),t.jsx("rect",{x:10,y:10,width:10,height:10,fill:e[36]}),t.jsx("rect",{x:10,y:20,width:10,height:10,fill:e[37]}),t.jsx("rect",{x:10,y:30,width:10,height:10,fill:e[38]}),t.jsx("rect",{x:10,y:40,width:10,height:10,fill:e[39]}),t.jsx("rect",{x:10,y:50,width:10,height:10,fill:e[40]}),t.jsx("rect",{x:10,y:60,width:10,height:10,fill:e[41]}),t.jsx("rect",{x:10,y:70,width:10,height:10,fill:e[42]}),t.jsx("rect",{x:30,y:10,width:10,height:10,fill:e[43]}),t.jsx("rect",{x:30,y:20,width:10,height:10,fill:e[44]}),t.jsx("rect",{x:30,y:30,width:10,height:10,fill:e[45]}),t.jsx("rect",{x:30,y:40,width:10,height:10,fill:e[46]}),t.jsx("rect",{x:30,y:50,width:10,height:10,fill:e[47]}),t.jsx("rect",{x:30,y:60,width:10,height:10,fill:e[48]}),t.jsx("rect",{x:30,y:70,width:10,height:10,fill:e[49]}),t.jsx("rect",{x:50,y:10,width:10,height:10,fill:e[50]}),t.jsx("rect",{x:50,y:20,width:10,height:10,fill:e[51]}),t.jsx("rect",{x:50,y:30,width:10,height:10,fill:e[52]}),t.jsx("rect",{x:50,y:40,width:10,height:10,fill:e[53]}),t.jsx("rect",{x:50,y:50,width:10,height:10,fill:e[54]}),t.jsx("rect",{x:50,y:60,width:10,height:10,fill:e[55]}),t.jsx("rect",{x:50,y:70,width:10,height:10,fill:e[56]}),t.jsx("rect",{x:70,y:10,width:10,height:10,fill:e[57]}),t.jsx("rect",{x:70,y:20,width:10,height:10,fill:e[58]}),t.jsx("rect",{x:70,y:30,width:10,height:10,fill:e[59]}),t.jsx("rect",{x:70,y:40,width:10,height:10,fill:e[60]}),t.jsx("rect",{x:70,y:50,width:10,height:10,fill:e[61]}),t.jsx("rect",{x:70,y:60,width:10,height:10,fill:e[62]}),t.jsx("rect",{x:70,y:70,width:10,height:10,fill:e[63]})]})]})},g=36;function de(r,i){const s=F(r),l=i&&i.length,a=A(s,i,l),n=m(s,10,1),e=n<5?n+g/9:n,o=m(s,10,2),c=o<5?o+g/9:o;return{wrapperColor:a,faceColor:ie(a),backgroundColor:A(s+13,i,l),wrapperTranslateX:e,wrapperTranslateY:c,wrapperRotate:m(s,360),wrapperScale:1+m(s,g/12)/10,isMouthOpen:z(s,2),isCircle:z(s,1),eyeSpread:m(s,5),mouthSpread:m(s,3),faceRotate:m(s,10,3),faceTranslateX:e>g/6?e/2:m(s,8,1),faceTranslateY:c>g/6?c/2:m(s,7,2)}}const q=({name:r,colors:i,title:s,square:l,size:a,...n})=>{const e=de(r,i),o=x.useId();return t.jsxs("svg",{viewBox:"0 0 "+g+" "+g,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:a,height:a,...n,children:[s&&t.jsx("title",{children:r}),t.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:g,height:g,children:t.jsx("rect",{width:g,height:g,rx:l?void 0:g*2,fill:"#FFFFFF"})}),t.jsxs("g",{mask:`url(#${o})`,children:[t.jsx("rect",{width:g,height:g,fill:e.backgroundColor}),t.jsx("rect",{x:"0",y:"0",width:g,height:g,transform:"translate("+e.wrapperTranslateX+" "+e.wrapperTranslateY+") rotate("+e.wrapperRotate+" "+g/2+" "+g/2+") scale("+e.wrapperScale+")",fill:e.wrapperColor,rx:e.isCircle?g:g/6}),t.jsxs("g",{transform:"translate("+e.faceTranslateX+" "+e.faceTranslateY+") rotate("+e.faceRotate+" "+g/2+" "+g/2+")",children:[e.isMouthOpen?t.jsx("path",{d:"M15 "+(19+e.mouthSpread)+"c2 1 4 1 6 0",stroke:e.faceColor,fill:"none",strokeLinecap:"round"}):t.jsx("path",{d:"M13,"+(19+e.mouthSpread)+" a1,0.75 0 0,0 10,0",fill:e.faceColor}),t.jsx("rect",{x:14-e.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:e.faceColor}),t.jsx("rect",{x:20+e.eyeSpread,y:14,width:1.5,height:2,rx:1,stroke:"none",fill:e.faceColor})]})]})]})},fe=4,y=80;function xe(r,i){const s=F(r),l=i&&i.length;return Array.from({length:fe},(a,n)=>A(s+n,i,l))}const ge=({name:r,colors:i,title:s,square:l,size:a,...n})=>{const e=xe(r,i),o=r.replace(/\s/g,""),c=x.useId();return t.jsxs("svg",{viewBox:"0 0 "+y+" "+y,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:a,height:a,...n,children:[s&&t.jsx("title",{children:r}),t.jsx("mask",{id:c,maskUnits:"userSpaceOnUse",x:0,y:0,width:y,height:y,children:t.jsx("rect",{width:y,height:y,rx:l?void 0:y*2,fill:"#FFFFFF"})}),t.jsxs("g",{mask:`url(#${c})`,children:[t.jsx("path",{fill:"url(#gradient_paint0_linear_"+o+")",d:"M0 0h80v40H0z"}),t.jsx("path",{fill:"url(#gradient_paint1_linear_"+o+")",d:"M0 40h80v40H0z"})]}),t.jsxs("defs",{children:[t.jsxs("linearGradient",{id:"gradient_paint0_linear_"+o,x1:y/2,y1:0,x2:y/2,y2:y/2,gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{stopColor:e[0]}),t.jsx("stop",{offset:1,stopColor:e[1]})]}),t.jsxs("linearGradient",{id:"gradient_paint1_linear_"+o,x1:y/2,y1:y/2,x2:y/2,y2:y,gradientUnits:"userSpaceOnUse",children:[t.jsx("stop",{stopColor:e[2]}),t.jsx("stop",{offset:1,stopColor:e[3]})]})]})]})},pe=3,j=80;function we(r,i){const s=F(r),l=i&&i.length;return Array.from({length:pe},(a,n)=>({color:A(s+n,i,l),translateX:m(s*(n+1),j/10,1),translateY:m(s*(n+1),j/10,2),scale:1.2+m(s*(n+1),j/20)/10,rotate:m(s*(n+1),360,1)}))}const V=({name:r,colors:i,title:s,square:l,size:a,...n})=>{const e=we(r,i),o=x.useId();return t.jsxs("svg",{viewBox:"0 0 "+j+" "+j,fill:"none",role:"img",xmlns:"http://www.w3.org/2000/svg",width:a,height:a,...n,children:[s&&t.jsx("title",{children:r}),t.jsx("mask",{id:o,maskUnits:"userSpaceOnUse",x:0,y:0,width:j,height:j,children:t.jsx("rect",{width:j,height:j,rx:l?void 0:j*2,fill:"#FFFFFF"})}),t.jsxs("g",{mask:`url(#${o})`,children:[t.jsx("rect",{width:j,height:j,fill:e[0].color}),t.jsx("path",{filter:`url(#filter_${o})`,d:"M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z",fill:e[1].color,transform:"translate("+e[1].translateX+" "+e[1].translateY+") rotate("+e[1].rotate+" "+j/2+" "+j/2+") scale("+e[2].scale+")"}),t.jsx("path",{filter:`url(#filter_${o})`,style:{mixBlendMode:"overlay"},d:"M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z",fill:e[2].color,transform:"translate("+e[2].translateX+" "+e[2].translateY+") rotate("+e[2].rotate+" "+j/2+" "+j/2+") scale("+e[2].scale+")"})]}),t.jsx("defs",{children:t.jsxs("filter",{id:`filter_${o}`,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[t.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),t.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),t.jsx("feGaussianBlur",{stdDeviation:7,result:"effect1_foregroundBlur"})]})})]})},je={pixel:ue,bauhaus:$,ring:oe,beam:q,sunset:ge,marble:V,geometric:q,abstract:$},me=({variant:r="marble",colors:i=["#92A1C6","#146A7C","#F0AB3D","#C271B4","#C20D90"],name:s="Clara Barton",title:l=!1,size:a="40px",square:n=!1,...e})=>{const o=je[r]||V;return t.jsx(o,{colors:i,name:s,title:l,size:a,square:n,...e})};var ve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],U=ve.reduce((r,i)=>{const s=te.createSlot(`Primitive.${i}`),l=x.forwardRef((a,n)=>{const{asChild:e,...o}=a,c=e?s:i;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(c,{...o,ref:n})});return l.displayName=`Primitive.${i}`,{...r,[i]:l}},{});function ye(r,i=[]){let s=[];function l(n,e){const o=x.createContext(e),c=s.length;s=[...s,e];const v=u=>{const{scope:p,children:h,...f}=u,w=p?.[r]?.[c]||o,S=x.useMemo(()=>f,Object.values(f));return t.jsx(w.Provider,{value:S,children:h})};v.displayName=n+"Provider";function _(u,p){const h=p?.[r]?.[c]||o,f=x.useContext(h);if(f)return f;if(e!==void 0)return e;throw new Error(`\`${u}\` must be used within \`${n}\``)}return[v,_]}const a=()=>{const n=s.map(e=>x.createContext(e));return function(o){const c=o?.[r]||n;return x.useMemo(()=>({[`__scope${r}`]:{...o,[r]:c}}),[o,c])}};return a.scopeName=r,[l,Se(a,...i)]}function Se(...r){const i=r[0];if(r.length===1)return i;const s=()=>{const l=r.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){const e=l.reduce((o,{useScope:c,scopeName:v})=>{const u=c(n)[`__scope${v}`];return{...o,...u}},{});return x.useMemo(()=>({[`__scope${i.scopeName}`]:e}),[e])}};return s.scopeName=i.scopeName,s}var N=globalThis?.document?x.useLayoutEffect:()=>{};function _e(r){const i=x.useRef(r);return x.useEffect(()=>{i.current=r}),x.useMemo(()=>(...s)=>i.current?.(...s),[])}var L={exports:{}},I={};var D;function Ee(){if(D)return I;D=1;var r=k;function i(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var s=typeof Object.is=="function"?Object.is:i,l=r.useState,a=r.useEffect,n=r.useLayoutEffect,e=r.useDebugValue;function o(u,p){var h=p(),f=l({inst:{value:h,getSnapshot:p}}),w=f[0].inst,S=f[1];return n(function(){w.value=h,w.getSnapshot=p,c(w)&&S({inst:w})},[u,h,p]),a(function(){return c(w)&&S({inst:w}),u(function(){c(w)&&S({inst:w})})},[u]),e(h),h}function c(u){var p=u.getSnapshot;u=u.value;try{var h=p();return!s(u,h)}catch{return!0}}function v(u,p){return p()}var _=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?v:o;return I.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:_,I}var M={};var G;function Oe(){return G||(G=1,process.env.NODE_ENV!=="production"&&(function(){function r(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}function i(h,f){_||a.startTransition===void 0||(_=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var w=f();if(!u){var S=f();n(w,S)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),u=!0)}S=e({inst:{value:w,getSnapshot:f}});var E=S[0].inst,R=S[1];return c(function(){E.value=w,E.getSnapshot=f,s(E)&&R({inst:E})},[h,w,f]),o(function(){return s(E)&&R({inst:E}),h(function(){s(E)&&R({inst:E})})},[h]),v(w),w}function s(h){var f=h.getSnapshot;h=h.value;try{var w=f();return!n(h,w)}catch{return!0}}function l(h,f){return f()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=k,n=typeof Object.is=="function"?Object.is:r,e=a.useState,o=a.useEffect,c=a.useLayoutEffect,v=a.useDebugValue,_=!1,u=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:i;M.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),M}var H;function Ce(){return H||(H=1,process.env.NODE_ENV==="production"?L.exports=Ee():L.exports=Oe()),L.exports}var Ae=Ce();function Fe(){return Ae.useSyncExternalStore(be,()=>!0,()=>!1)}function be(){return()=>{}}var B="Avatar",[Le]=ye(B),[ke,K]=Le(B),W=x.forwardRef((r,i)=>{const{__scopeAvatar:s,...l}=r,[a,n]=x.useState("idle");return t.jsx(ke,{scope:s,imageLoadingStatus:a,onImageLoadingStatusChange:n,children:t.jsx(U.span,{...l,ref:i})})});W.displayName=B;var J="AvatarImage",Q=x.forwardRef((r,i)=>{const{__scopeAvatar:s,src:l,onLoadingStatusChange:a=()=>{},...n}=r,e=K(J,s),o=Re(l,n),c=_e(v=>{a(v),e.onImageLoadingStatusChange(v)});return N(()=>{o!=="idle"&&c(o)},[o,c]),o==="loaded"?t.jsx(U.img,{...n,ref:i,src:l}):null});Q.displayName=J;var Z="AvatarFallback",ee=x.forwardRef((r,i)=>{const{__scopeAvatar:s,delayMs:l,...a}=r,n=K(Z,s),[e,o]=x.useState(l===void 0);return x.useEffect(()=>{if(l!==void 0){const c=window.setTimeout(()=>o(!0),l);return()=>window.clearTimeout(c)}},[l]),e&&n.imageLoadingStatus!=="loaded"?t.jsx(U.span,{...a,ref:i}):null});ee.displayName=Z;function P(r,i){return r?i?(r.src!==i&&(r.src=i),r.complete&&r.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Re(r,{referrerPolicy:i,crossOrigin:s}){const l=Fe(),a=x.useRef(null),n=l?(a.current||(a.current=new window.Image),a.current):null,[e,o]=x.useState(()=>P(n,r));return N(()=>{o(P(n,r))},[n,r]),N(()=>{const c=u=>()=>{o(u)};if(!n)return;const v=c("loaded"),_=c("error");return n.addEventListener("load",v),n.addEventListener("error",_),i&&(n.referrerPolicy=i),typeof s=="string"&&(n.crossOrigin=s),()=>{n.removeEventListener("load",v),n.removeEventListener("error",_)}},[n,s,i]),e}var Ie=W,Me=Q,T=ee;const Te=["#ff0000","#0000ff"];function ze({className:r,...i}){return t.jsx(Ie,{"data-slot":"avatar",className:b.cn("relative flex size-8 shrink-0 overflow-hidden rounded-full",r),...i})}function Ne({className:r,...i}){return t.jsx(Me,{asChild:!0,children:t.jsx("img",{"data-slot":"avatar-image",className:b.cn("aspect-square size-full",r),...i})})}function Y(r){return r.trim().split(/\s+/).filter(Boolean).slice(0,2).map(i=>i[0]?.toUpperCase()).join("")}function Ue(r){switch(r.variant){case void 0:case"default":{const{variant:i,children:s,className:l,...a}=r;return t.jsx(T,{"data-slot":"avatar-fallback",className:b.cn("flex size-full items-center justify-center rounded-full bg-muted text-xs font-medium uppercase text-foreground",l),...a,children:s})}case"initials":{const{variant:i,name:s,className:l,...a}=r;return t.jsx(T,{"data-slot":"avatar-fallback",className:b.cn("flex size-full items-center justify-center rounded-full bg-muted text-xs font-medium uppercase text-foreground",l),...a,children:Y(s)})}case"boring":{const{variant:i,name:s,className:l,...a}=r;return t.jsx(T,{"data-slot":"avatar-fallback",className:b.cn("relative flex size-full items-center justify-center overflow-hidden rounded-full",l),asChild:!0,...a,children:t.jsxs("div",{className:"relative size-full",children:[t.jsx(me,{variant:"beam",name:s,className:"size-full",colors:[...Te]}),t.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold uppercase text-foreground mix-blend-overlay",children:Y(s)})]})})}}}exports.Avatar=ze;exports.AvatarFallback=Ue;exports.AvatarImage=Ne;
|