@koide-labs/ui 0.0.14 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/-utils.d.ts +2 -2
- package/dist/-utils.js +1 -1
- package/dist/{Button-DrPFFzo7.js → Button-BmcVHRRW.js} +2 -2
- package/dist/{CompositeRoot-CVk5a-pR.js → CompositeRoot-CCgh2M64.js} +6 -6
- package/dist/{FloatingPortal-tWyuKRSN.js → FloatingPortal-BQsQhvIr.js} +27 -27
- package/dist/{FloatingPortalLite-DVyq6YhV.js → FloatingPortalLite-_ECdFE7b.js} +1 -1
- package/dist/{InternalBackdrop-jYAiOJ8v.js → InternalBackdrop-BSMKU-hc.js} +13 -13
- package/dist/{LabelableContext-BMvjVwor.js → LabelableContext-Be1u-eFg.js} +2 -2
- package/dist/accordion.css +1 -0
- package/dist/alert-dialog.css +1 -0
- package/dist/anchor.css +1 -0
- package/dist/avatar.css +1 -0
- package/dist/badge.css +1 -0
- package/dist/button.css +1 -0
- package/dist/checkbox.css +1 -0
- package/dist/code.css +1 -0
- package/dist/collapse.css +1 -0
- package/dist/command.css +1 -0
- package/dist/components/accordion/accordion.d.ts +19 -0
- package/dist/components/accordion/accordion.js +701 -0
- package/dist/components/accordion/index.d.ts +1 -12
- package/dist/components/accordion/index.js +2 -697
- package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
- package/dist/components/alert-dialog/alert-dialog.js +138 -0
- package/dist/components/alert-dialog/index.d.ts +1 -26
- package/dist/components/alert-dialog/index.js +2 -134
- package/dist/components/anchor/anchor.d.ts +12 -0
- package/dist/components/anchor/anchor.js +21 -0
- package/dist/components/anchor/index.d.ts +1 -8
- package/dist/components/anchor/index.js +2 -19
- package/dist/components/avatar/avatar.d.ts +25 -0
- package/dist/components/avatar/avatar.js +161 -0
- package/dist/components/avatar/index.d.ts +1 -21
- package/dist/components/avatar/index.js +2 -159
- package/dist/components/badge/badge.d.ts +20 -0
- package/dist/components/badge/badge.js +42 -0
- package/dist/components/badge/index.d.ts +1 -16
- package/dist/components/badge/index.js +2 -40
- package/dist/components/button/button.d.ts +27 -0
- package/dist/components/button/button.js +47 -0
- package/dist/components/button/index.d.ts +1 -24
- package/dist/components/button/index.js +2 -45
- package/dist/components/checkbox/checkbox.d.ts +13 -0
- package/dist/components/checkbox/checkbox.js +269 -0
- package/dist/components/checkbox/index.d.ts +1 -9
- package/dist/components/checkbox/index.js +2 -267
- package/dist/components/code/code.d.ts +13 -0
- package/dist/components/code/code.js +1206 -0
- package/dist/components/code/index.d.ts +1 -9
- package/dist/components/code/index.js +2 -1204
- package/dist/components/collapse/collapse.d.ts +14 -0
- package/dist/components/collapse/collapse.js +35 -0
- package/dist/components/collapse/index.d.ts +1 -11
- package/dist/components/collapse/index.js +2 -33
- package/dist/components/command/command.d.ts +36 -0
- package/dist/components/command/command.js +1695 -0
- package/dist/components/command/index.d.ts +1 -15
- package/dist/components/command/index.js +2 -1693
- package/dist/components/context-menu/context-menu.d.ts +82 -0
- package/dist/components/context-menu/context-menu.js +1445 -0
- package/dist/components/context-menu/index.d.ts +1 -42
- package/dist/components/context-menu/index.js +2 -1442
- package/dist/components/dialog/dialog.d.ts +22 -0
- package/dist/components/dialog/dialog.js +140 -0
- package/dist/components/dialog/dialog.types.d.ts +38 -0
- package/dist/components/dialog/index.d.ts +1 -48
- package/dist/components/dialog/index.js +2 -136
- package/dist/components/heading/heading.d.ts +25 -0
- package/dist/components/heading/heading.js +36 -0
- package/dist/components/heading/index.d.ts +1 -44
- package/dist/components/heading/index.js +2 -49
- package/dist/components/icon/icon.d.ts +28 -0
- package/dist/components/icon/icon.js +43 -0
- package/dist/components/icon/{icon-names.d.ts → icon.types.d.ts} +4 -0
- package/dist/components/icon/icon.types.js +1 -0
- package/dist/components/icon/index.d.ts +2 -24
- package/dist/components/icon/index.js +2 -41
- package/dist/components/icon-button/icon-button.d.ts +16 -0
- package/dist/components/icon-button/icon-button.js +46 -0
- package/dist/components/icon-button/index.d.ts +1 -12
- package/dist/components/icon-button/index.js +2 -44
- package/dist/components/inline-code/index.d.ts +1 -6
- package/dist/components/inline-code/index.js +2 -20
- package/dist/components/inline-code/inline-code.d.ts +10 -0
- package/dist/components/inline-code/inline-code.js +25 -0
- package/dist/components/input/index.d.ts +1 -3
- package/dist/components/input/index.js +2 -117
- package/dist/components/input/input.d.ts +9 -0
- package/dist/components/input/input.js +126 -0
- package/dist/components/meter/index.d.ts +1 -18
- package/dist/components/meter/index.js +2 -163
- package/dist/components/meter/meter.d.ts +22 -0
- package/dist/components/meter/meter.js +165 -0
- package/dist/components/multiline-input/index.d.ts +1 -6
- package/dist/components/multiline-input/index.js +2 -98
- package/dist/components/multiline-input/multiline-input.d.ts +10 -0
- package/dist/components/multiline-input/multiline-input.js +100 -0
- package/dist/components/number-input/index.d.ts +1 -10
- package/dist/components/number-input/index.js +2 -1167
- package/dist/components/number-input/number-input.d.ts +14 -0
- package/dist/components/number-input/number-input.js +1169 -0
- package/dist/components/password-input/index.d.ts +1 -2
- package/dist/components/password-input/index.js +2 -27
- package/dist/components/password-input/password-input.d.ts +7 -0
- package/dist/components/password-input/password-input.js +29 -0
- package/dist/components/pill/index.d.ts +1 -13
- package/dist/components/pill/index.js +2 -36
- package/dist/components/pill/pill.d.ts +17 -0
- package/dist/components/pill/pill.js +38 -0
- package/dist/components/popover/index.d.ts +1 -21
- package/dist/components/popover/index.js +2 -634
- package/dist/components/popover/popover.d.ts +22 -0
- package/dist/components/popover/popover.js +634 -0
- package/dist/components/preview-card/index.d.ts +1 -17
- package/dist/components/preview-card/index.js +2 -400
- package/dist/components/preview-card/preview-card.d.ts +21 -0
- package/dist/components/preview-card/preview-card.js +402 -0
- package/dist/components/radio-group/index.d.ts +1 -0
- package/dist/components/radio-group/index.js +5 -0
- package/dist/components/radio-group/radio-group.d.ts +25 -0
- package/dist/components/{radio/index.js → radio-group/radio-group.js} +91 -90
- package/dist/components/search-bar/index.d.ts +1 -12
- package/dist/components/search-bar/index.js +2 -46
- package/dist/components/search-bar/search-bar.d.ts +16 -0
- package/dist/components/search-bar/search-bar.js +43 -0
- package/dist/components/select/index.d.ts +1 -16
- package/dist/components/select/index.js +2 -1261
- package/dist/components/select/select.d.ts +22 -0
- package/dist/components/select/select.js +1263 -0
- package/dist/components/separator/index.d.ts +1 -7
- package/dist/components/separator/index.js +2 -4
- package/dist/components/separator/separator.d.ts +10 -0
- package/dist/components/separator/separator.js +6 -0
- package/dist/components/slider/index.d.ts +1 -5
- package/dist/components/slider/index.js +2 -900
- package/dist/components/slider/slider.d.ts +10 -0
- package/dist/components/slider/slider.js +899 -0
- package/dist/components/spinner/index.d.ts +1 -2
- package/dist/components/spinner/index.js +2 -11
- package/dist/components/spinner/spinner.d.ts +7 -0
- package/dist/components/spinner/spinner.js +13 -0
- package/dist/components/stacked-avatars/index.d.ts +1 -14
- package/dist/components/stacked-avatars/index.js +2 -90
- package/dist/components/stacked-avatars/stacked-avatars.d.ts +18 -0
- package/dist/components/stacked-avatars/stacked-avatars.js +92 -0
- package/dist/components/status-banner/index.d.ts +1 -17
- package/dist/components/status-banner/index.js +2 -69
- package/dist/components/status-banner/status-banner.d.ts +22 -0
- package/dist/components/status-banner/status-banner.js +71 -0
- package/dist/components/surface/index.d.ts +2 -27
- package/dist/components/surface/index.js +2 -39
- package/dist/components/surface/surface.d.ts +26 -0
- package/dist/components/surface/surface.js +36 -0
- package/dist/components/surface/surface.types.d.ts +1 -0
- package/dist/components/surface/surface.types.js +1 -0
- package/dist/components/switch/index.d.ts +1 -5
- package/dist/components/switch/index.js +2 -194
- package/dist/components/switch/switch.d.ts +10 -0
- package/dist/components/switch/switch.js +193 -0
- package/dist/components/tabs/index.d.ts +1 -18
- package/dist/components/tabs/index.js +2 -507
- package/dist/components/tabs/tabs.d.ts +28 -0
- package/dist/components/tabs/tabs.js +511 -0
- package/dist/components/text/index.d.ts +1 -26
- package/dist/components/text/index.js +2 -46
- package/dist/components/text/text.d.ts +29 -0
- package/dist/components/text/text.js +48 -0
- package/dist/components/theme-provider/index.d.ts +1 -1
- package/dist/components/theme-provider/theme-provider.d.ts +8 -4
- package/dist/components/theme-provider/theme-provider.js +3 -3
- package/dist/components/timestamp/index.d.ts +1 -23
- package/dist/components/timestamp/index.js +2 -1390
- package/dist/components/timestamp/timestamp.d.ts +26 -0
- package/dist/components/timestamp/timestamp.js +1391 -0
- package/dist/components/toaster/index.d.ts +2 -0
- package/dist/components/toaster/index.js +7 -0
- package/dist/components/toaster/toaster.d.ts +7 -0
- package/dist/components/toaster/toaster.js +923 -0
- package/dist/components/{toast → toaster}/use-toast-manager.d.ts +3 -3
- package/dist/components/tooltip/index.d.ts +1 -14
- package/dist/components/tooltip/index.js +2 -710
- package/dist/components/tooltip/tooltip.d.ts +24 -0
- package/dist/components/tooltip/tooltip.js +9 -0
- package/dist/components/view/index.d.ts +2 -30
- package/dist/components/view/index.js +2 -79
- package/dist/components/view/view.d.ts +31 -0
- package/dist/components/view/view.js +83 -0
- package/dist/components/view/view.types.d.ts +5 -0
- package/dist/components/view/view.types.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +5 -1
- package/dist/{composite-Bx7Szd_T.js → composite-BZzP-LlG.js} +3 -3
- package/dist/{composite-C9L5QmZL.js → composite-BwEK5cWH.js} +1 -1
- package/dist/context-menu.css +1 -0
- package/dist/{createBaseUIEventDetails-D8M2Yl-a.js → createBaseUIEventDetails-CCSfZ2vM.js} +7 -7
- package/dist/{detectBrowser-I-s3yzIE.js → detectBrowser-Bl8Ki_1I.js} +2 -2
- package/dist/dialog.css +1 -1
- package/dist/{dialog.module-BeF-6XAo.js → dialog.module-DsbQRp-d.js} +55 -55
- package/dist/{element-CZEOj04G.js → element-u5WgOZX1.js} +7 -7
- package/dist/{event-CKoGyQEJ.js → event-B89-Ng5h.js} +4 -4
- package/dist/{floating-ui.utils-C7pRWMZ_.js → floating-ui.utils-DUVaIF3G.js} +7 -7
- package/dist/{floating-ui.utils.dom-C7FS5id0.js → floating-ui.utils.dom-cbi420Pg.js} +4 -4
- package/dist/{getDisabledMountTransitionStyles-YfHPge6T.js → getDisabledMountTransitionStyles-E2x-_lte.js} +7 -7
- package/dist/heading.css +1 -0
- package/dist/icon-button.css +1 -0
- package/dist/icon.css +1 -0
- package/dist/index.d.ts +10 -10
- package/dist/index.js +86 -104
- package/dist/{inertValue-BCYGsdmf.js → inertValue-BTpPjX30.js} +1 -1
- package/dist/inline-code.css +1 -0
- package/dist/input.css +1 -1
- package/dist/input.module-CtE19OH8.js +8 -0
- package/dist/integrations/react-markdown/index.js +12 -12
- package/dist/meter.css +1 -0
- package/dist/number-input.css +1 -0
- package/dist/password-input.css +1 -0
- package/dist/pill.css +1 -0
- package/dist/popover.css +1 -0
- package/dist/preview-card.css +1 -0
- package/dist/radio-group.css +1 -0
- package/dist/safePolygon-DnkzOIur.js +558 -0
- package/dist/search-bar.css +1 -0
- package/dist/select.css +1 -0
- package/dist/{index-DVjyPAD4.js → separator-fh_wDZNf.js} +7 -11
- package/dist/separator.css +1 -0
- package/dist/slider.css +1 -0
- package/dist/spinner.css +1 -0
- package/dist/stacked-avatars.css +1 -0
- package/dist/status-banner.css +1 -0
- package/dist/styles/core.css +1 -1
- package/dist/surface.css +1 -0
- package/dist/switch.css +1 -0
- package/dist/tabs.css +1 -0
- package/dist/text.css +1 -0
- package/dist/timestamp.css +1 -0
- package/dist/toaster.css +1 -0
- package/dist/tooltip-oCp-elli.js +765 -0
- package/dist/tooltip.css +1 -0
- package/dist/transitions.css +1 -1
- package/dist/{transitions.module-CWX8e5cx.js → transitions.module-D9mMAtfI.js} +11 -11
- package/dist/{useAnimationFrame-451ugS_6.js → useAnimationFrame-DvK1s63A.js} +1 -1
- package/dist/{useButton-DfIwsdb8.js → useButton-d3_JgBNr.js} +3 -3
- package/dist/{useCompositeListItem-OkcAim_1.js → useCompositeListItem-CZp9WTnF.js} +2 -2
- package/dist/{useLabelableId-Ci_jDvmv.js → useLabelableId-CX4tcfzK.js} +3 -3
- package/dist/{useOpenChangeComplete-Dse9kY9E.js → useOpenChangeComplete-BHd-N7Ig.js} +5 -5
- package/dist/{useRender-CLx7dR_1.js → useRender-C3vlzS3t.js} +1 -1
- package/dist/{useRenderElement-DwToLA61.js → useRenderElement-DngNDu_P.js} +2 -2
- package/dist/{useRole-oDBdbuwQ.js → useRole-BD3OL1rr.js} +3 -3
- package/dist/{useStableCallback-CkTrVkNX.js → useStableCallback-DKZHlUAT.js} +1 -1
- package/dist/{useSyncedFloatingRootContext-Dorsv-jf.js → useSyncedFloatingRootContext-BB1vwkV-.js} +20 -20
- package/dist/{useTimeout-CflX-kz3.js → useTimeout-BNni6aw5.js} +1 -1
- package/dist/{useTransitionStatus-CUfcuGAV.js → useTransitionStatus-CmMyUh74.js} +1 -1
- package/dist/{useTypeahead-D85V2IUx.js → useTypeahead-BiL5IAVb.js} +11 -11
- package/dist/{useValueAsRef-HURLzret.js → useValueAsRef-B4EriRsI.js} +1 -1
- package/dist/{useValueChanged-DL757-yD.js → useValueChanged-MJRmEWz1.js} +1 -1
- package/dist/view.css +1 -1
- package/dist/view.module-Dj7wj0kk.js +6 -0
- package/dist/view2.css +1 -0
- package/package.json +16 -19
- package/dist/components/radio/index.d.ts +0 -13
- package/dist/components/toast/index.d.ts +0 -2
- package/dist/components/toast/index.js +0 -8
- package/dist/components/toast/toast.d.ts +0 -2
- package/dist/components/toast/toast.js +0 -921
- package/dist/components/tooltip/tooltip-arrow.d.ts +0 -3
- package/dist/components/tooltip/tooltip-arrow.js +0 -6
- package/dist/index10.css +0 -1
- package/dist/index11.css +0 -1
- package/dist/index12.css +0 -1
- package/dist/index13.css +0 -1
- package/dist/index14.css +0 -1
- package/dist/index15.css +0 -1
- package/dist/index16.css +0 -1
- package/dist/index17.css +0 -1
- package/dist/index18.css +0 -1
- package/dist/index19.css +0 -1
- package/dist/index20.css +0 -1
- package/dist/index21.css +0 -1
- package/dist/index22.css +0 -1
- package/dist/index23.css +0 -1
- package/dist/index24.css +0 -1
- package/dist/index25.css +0 -1
- package/dist/index26.css +0 -1
- package/dist/index27.css +0 -1
- package/dist/index28.css +0 -1
- package/dist/index29.css +0 -1
- package/dist/index3.css +0 -1
- package/dist/index30.css +0 -1
- package/dist/index31.css +0 -1
- package/dist/index32.css +0 -1
- package/dist/index33.css +0 -1
- package/dist/index34.css +0 -1
- package/dist/index35.css +0 -1
- package/dist/index36.css +0 -1
- package/dist/index37.css +0 -1
- package/dist/index4.css +0 -1
- package/dist/index5.css +0 -1
- package/dist/index6.css +0 -1
- package/dist/index7.css +0 -1
- package/dist/index8.css +0 -1
- package/dist/index9.css +0 -1
- package/dist/input.module-DDQY_Ij6.js +0 -7
- package/dist/safePolygon-DWy1dGKJ.js +0 -308
- package/dist/toast.css +0 -1
- package/dist/tooltip-arrow-cs6vjjqZ.js +0 -24
- package/dist/tooltip-arrow.css +0 -1
- package/dist/useHoverReferenceInteraction-SfOBPoXM.js +0 -264
- package/dist/usePopupAutoResize-CNR6Ekmx.js +0 -85
- package/dist/view.module-DfDLgJE0.js +0 -6
- /package/dist/components/{icon/icon-names.js → dialog/dialog.types.js} +0 -0
- /package/dist/components/{toast → toaster}/use-toast-manager.js +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
|
|
2
|
+
import { Button } from '../button';
|
|
3
|
+
import { BaseDialogProps } from '../dialog/dialog.types';
|
|
4
|
+
/**
|
|
5
|
+
* General guidance:
|
|
6
|
+
*
|
|
7
|
+
* Should you have nested modals? Absolutely not. It's confusing to navigate and
|
|
8
|
+
* obliterates the stacking context by putting multiple root surfaces on top of
|
|
9
|
+
* each other.
|
|
10
|
+
*
|
|
11
|
+
* Should you have payloads? Probably not... Currently unsupported but that
|
|
12
|
+
* style of generalization feels kind of anti-composition
|
|
13
|
+
*/
|
|
14
|
+
interface AlertDialogRootProps extends Omit<AlertDialogPrimitive.Root.Props, "children">, BaseDialogProps {
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* The actions to display in the alert dialog. You must have at least two
|
|
18
|
+
* actions. By default, actions will be `interactive` and the last action will
|
|
19
|
+
* have `colorway` "negative_fill".
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
actions: Array<Button.Props>;
|
|
23
|
+
}
|
|
24
|
+
declare function AlertDialogRoot({ title, description, children, actions, trigger, width, background, centered, className, ...props }: AlertDialogRootProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
type AlertDialogCloseProps = Button.Props;
|
|
26
|
+
declare function AlertDialogClose(props: AlertDialogCloseProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const AlertDialog: typeof AlertDialogRoot & {
|
|
28
|
+
Close: typeof AlertDialogClose;
|
|
29
|
+
};
|
|
30
|
+
export declare namespace AlertDialog {
|
|
31
|
+
type Props = AlertDialogRootProps;
|
|
32
|
+
namespace Close {
|
|
33
|
+
type Props = AlertDialogCloseProps;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { jsx as o, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { c as _ } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import { t as h } from "../../transitions.module-D9mMAtfI.js";
|
|
4
|
+
import { u as v, D as y, a as I, b as T, c as b, d as O, e as w, s as n, f as N, g as S, h as k, i as A } from "../../dialog.module-DsbQRp-d.js";
|
|
5
|
+
import { Surface as B } from "../surface/surface.js";
|
|
6
|
+
import { View as C } from "../view/view.js";
|
|
7
|
+
import { Text as D } from "../text/text.js";
|
|
8
|
+
import { Button as j } from "../button/button.js";
|
|
9
|
+
import * as V from "react";
|
|
10
|
+
import { a as $ } from "../../useRenderElement-DngNDu_P.js";
|
|
11
|
+
import '../../alert-dialog.css';function z(t) {
|
|
12
|
+
const {
|
|
13
|
+
children: r,
|
|
14
|
+
open: i,
|
|
15
|
+
defaultOpen: a = !1,
|
|
16
|
+
onOpenChange: s,
|
|
17
|
+
onOpenChangeComplete: p,
|
|
18
|
+
actionsRef: m,
|
|
19
|
+
handle: f,
|
|
20
|
+
triggerId: l,
|
|
21
|
+
defaultTriggerId: c = null
|
|
22
|
+
} = t, d = v(), g = !!d, e = $(() => f?.store ?? new y({
|
|
23
|
+
open: i ?? a,
|
|
24
|
+
activeTriggerId: l !== void 0 ? l : c,
|
|
25
|
+
modal: !0,
|
|
26
|
+
disablePointerDismissal: !0,
|
|
27
|
+
nested: g,
|
|
28
|
+
role: "alertdialog"
|
|
29
|
+
})).current;
|
|
30
|
+
e.useControlledProp("open", i, a), e.useControlledProp("activeTriggerId", l, c), e.useSyncedValue("nested", g), e.useContextCallback("onOpenChange", s), e.useContextCallback("onOpenChangeComplete", p);
|
|
31
|
+
const P = e.useState("payload");
|
|
32
|
+
I({
|
|
33
|
+
store: e,
|
|
34
|
+
actionsRef: m,
|
|
35
|
+
parentContext: d?.store.context
|
|
36
|
+
});
|
|
37
|
+
const R = V.useMemo(() => ({
|
|
38
|
+
store: e
|
|
39
|
+
}), [e]);
|
|
40
|
+
return /* @__PURE__ */ o(T.Provider, {
|
|
41
|
+
value: R,
|
|
42
|
+
children: typeof r == "function" ? r({
|
|
43
|
+
payload: P
|
|
44
|
+
}) : r
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const M = {
|
|
48
|
+
"alert-dialog__actions": "_alert-dialog__actions_ndpfw_2"
|
|
49
|
+
};
|
|
50
|
+
function W({
|
|
51
|
+
title: t,
|
|
52
|
+
description: r,
|
|
53
|
+
children: i,
|
|
54
|
+
actions: a,
|
|
55
|
+
trigger: s,
|
|
56
|
+
width: p = "md",
|
|
57
|
+
background: m = "root",
|
|
58
|
+
centered: f = !1,
|
|
59
|
+
className: l,
|
|
60
|
+
...c
|
|
61
|
+
}) {
|
|
62
|
+
return a.length < 2 && console.error("You must have at least two actions."), /* @__PURE__ */ u(z, { ...c, children: [
|
|
63
|
+
s ? /* @__PURE__ */ o(b, { render: s }) : null,
|
|
64
|
+
/* @__PURE__ */ u(O, { children: [
|
|
65
|
+
/* @__PURE__ */ o(
|
|
66
|
+
w,
|
|
67
|
+
{
|
|
68
|
+
className: _(
|
|
69
|
+
n.dialog__backdrop,
|
|
70
|
+
h.transition_opacity
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
/* @__PURE__ */ o(
|
|
75
|
+
N,
|
|
76
|
+
{
|
|
77
|
+
className: _(
|
|
78
|
+
n.dialog__popup,
|
|
79
|
+
f && n.dialog__popup_centered,
|
|
80
|
+
h.transition_scale
|
|
81
|
+
),
|
|
82
|
+
children: /* @__PURE__ */ u(
|
|
83
|
+
B,
|
|
84
|
+
{
|
|
85
|
+
background: m,
|
|
86
|
+
className: _(
|
|
87
|
+
n.dialog__content,
|
|
88
|
+
n[`dialog__content_width_${p}`],
|
|
89
|
+
l
|
|
90
|
+
),
|
|
91
|
+
children: [
|
|
92
|
+
t || r ? /* @__PURE__ */ u(C, { className: n.dialog__header, children: [
|
|
93
|
+
t ? /* @__PURE__ */ o(D, { render: /* @__PURE__ */ o(S, {}), size: "2xl", children: t }) : null,
|
|
94
|
+
r ? /* @__PURE__ */ o(
|
|
95
|
+
D,
|
|
96
|
+
{
|
|
97
|
+
multiline: !0,
|
|
98
|
+
color: "dimmer",
|
|
99
|
+
render: /* @__PURE__ */ o(k, {}),
|
|
100
|
+
children: r
|
|
101
|
+
}
|
|
102
|
+
) : null
|
|
103
|
+
] }) : null,
|
|
104
|
+
i,
|
|
105
|
+
/* @__PURE__ */ o(C, { className: M["alert-dialog__actions"], children: a.map(({ children: d, ...g }, e) => /* @__PURE__ */ o(
|
|
106
|
+
x,
|
|
107
|
+
{
|
|
108
|
+
...Y(g, e + 1 === a.length),
|
|
109
|
+
children: d
|
|
110
|
+
},
|
|
111
|
+
e
|
|
112
|
+
)) })
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] })
|
|
119
|
+
] });
|
|
120
|
+
}
|
|
121
|
+
function x(t) {
|
|
122
|
+
return /* @__PURE__ */ o(A, { render: /* @__PURE__ */ o(j, { ...t }) });
|
|
123
|
+
}
|
|
124
|
+
function Y(t, r) {
|
|
125
|
+
return r ? {
|
|
126
|
+
interactive: "negative_fill",
|
|
127
|
+
...t
|
|
128
|
+
} : {
|
|
129
|
+
interactive: !0,
|
|
130
|
+
...t
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const U = Object.assign(W, {
|
|
134
|
+
Close: x
|
|
135
|
+
});
|
|
136
|
+
export {
|
|
137
|
+
U as AlertDialog
|
|
138
|
+
};
|
|
@@ -1,26 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
import { ButtonProps } from '../button';
|
|
4
|
-
import { BaseDialogProps } from '../dialog';
|
|
5
|
-
/**
|
|
6
|
-
* General guidance:
|
|
7
|
-
*
|
|
8
|
-
* Should you have nested modals? Absolutely not. It's confusing to navigate and
|
|
9
|
-
* obliterates the stacking context by putting multiple root surfaces on top of
|
|
10
|
-
* each other.
|
|
11
|
-
*
|
|
12
|
-
* Should you have payloads? Probably not... Currently unsupported but that
|
|
13
|
-
* style of generalization feels kind of anti-composition
|
|
14
|
-
*/
|
|
15
|
-
export type AlertDialogProps = ComponentProps<typeof AlertDialogPrimitive.Root> & BaseDialogProps & {
|
|
16
|
-
/**
|
|
17
|
-
*
|
|
18
|
-
* The actions to display in the alert dialog. You must have at least two
|
|
19
|
-
* actions. By default, actions will be `interactive` and the last action will
|
|
20
|
-
* have `colorway` "negative_fill".
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
actions: Array<ButtonProps>;
|
|
24
|
-
};
|
|
25
|
-
export declare function AlertDialog({ title, description, children, actions, trigger, width, background, centered, className, ...props }: AlertDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
export declare function AlertDialogClose(props: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export { AlertDialog } from './alert-dialog';
|
|
@@ -1,137 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { c as _ } from "../../clsx-OuTLNxxd.js";
|
|
4
|
-
import { Button as v } from "../button/index.js";
|
|
5
|
-
import { Surface as y } from "../surface/index.js";
|
|
6
|
-
import { Text as h } from "../text/index.js";
|
|
7
|
-
import { View as C } from "../view/index.js";
|
|
8
|
-
import { t as D } from "../../transitions.module-CWX8e5cx.js";
|
|
9
|
-
import { u as R, a as I, D as T, b, c as w, d as N, e as O, f as S, s as n, g as k, h as B, i as j } from "../../dialog.module-BeF-6XAo.js";
|
|
10
|
-
import * as A from "react";
|
|
11
|
-
import { a as V } from "../../useRenderElement-DwToLA61.js";
|
|
12
|
-
import '../../index19.css';function $(t) {
|
|
13
|
-
const {
|
|
14
|
-
children: r,
|
|
15
|
-
open: i,
|
|
16
|
-
defaultOpen: a = !1,
|
|
17
|
-
onOpenChange: s,
|
|
18
|
-
onOpenChangeComplete: p,
|
|
19
|
-
actionsRef: m,
|
|
20
|
-
handle: f,
|
|
21
|
-
triggerId: l,
|
|
22
|
-
defaultTriggerId: c = null
|
|
23
|
-
} = t, d = R(), u = !!d, e = V(() => f?.store ?? new b({
|
|
24
|
-
open: i ?? a,
|
|
25
|
-
activeTriggerId: l !== void 0 ? l : c,
|
|
26
|
-
modal: !0,
|
|
27
|
-
disablePointerDismissal: !0,
|
|
28
|
-
nested: u,
|
|
29
|
-
role: "alertdialog"
|
|
30
|
-
})).current;
|
|
31
|
-
e.useControlledProp("open", i, a), e.useControlledProp("activeTriggerId", l, c), e.useSyncedValue("nested", u), e.useContextCallback("onOpenChange", s), e.useContextCallback("onOpenChangeComplete", p);
|
|
32
|
-
const x = e.useState("payload");
|
|
33
|
-
I({
|
|
34
|
-
store: e,
|
|
35
|
-
actionsRef: m,
|
|
36
|
-
parentContext: d?.store.context
|
|
37
|
-
});
|
|
38
|
-
const P = A.useMemo(() => ({
|
|
39
|
-
store: e
|
|
40
|
-
}), [e]);
|
|
41
|
-
return /* @__PURE__ */ o(T.Provider, {
|
|
42
|
-
value: P,
|
|
43
|
-
children: typeof r == "function" ? r({
|
|
44
|
-
payload: x
|
|
45
|
-
}) : r
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
const z = {
|
|
49
|
-
"alert-dialog__actions": "_alert-dialog__actions_f5jwc_1"
|
|
50
|
-
};
|
|
51
|
-
function Q({
|
|
52
|
-
title: t,
|
|
53
|
-
description: r,
|
|
54
|
-
children: i,
|
|
55
|
-
actions: a,
|
|
56
|
-
trigger: s,
|
|
57
|
-
width: p = "md",
|
|
58
|
-
background: m = "root",
|
|
59
|
-
centered: f = !1,
|
|
60
|
-
className: l,
|
|
61
|
-
...c
|
|
62
|
-
}) {
|
|
63
|
-
return a.length < 2 && console.error("You must have at least two actions."), /* @__PURE__ */ g($, { ...c, children: [
|
|
64
|
-
s ? /* @__PURE__ */ o(w, { render: s }) : null,
|
|
65
|
-
/* @__PURE__ */ g(N, { children: [
|
|
66
|
-
/* @__PURE__ */ o(
|
|
67
|
-
O,
|
|
68
|
-
{
|
|
69
|
-
className: _(
|
|
70
|
-
n.dialog__backdrop,
|
|
71
|
-
D.transition_opacity
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
/* @__PURE__ */ o(
|
|
76
|
-
S,
|
|
77
|
-
{
|
|
78
|
-
className: _(
|
|
79
|
-
n.dialog__popup,
|
|
80
|
-
f && n.dialog__popup_centered,
|
|
81
|
-
D.transition_scale
|
|
82
|
-
),
|
|
83
|
-
children: /* @__PURE__ */ g(
|
|
84
|
-
y,
|
|
85
|
-
{
|
|
86
|
-
background: m,
|
|
87
|
-
className: _(
|
|
88
|
-
n.dialog__content,
|
|
89
|
-
n[`dialog__content_width_${p}`],
|
|
90
|
-
l
|
|
91
|
-
),
|
|
92
|
-
children: [
|
|
93
|
-
t || r ? /* @__PURE__ */ g(C, { className: n.dialog__header, children: [
|
|
94
|
-
t ? /* @__PURE__ */ o(h, { render: /* @__PURE__ */ o(k, {}), size: "2xl", children: t }) : null,
|
|
95
|
-
r ? /* @__PURE__ */ o(
|
|
96
|
-
h,
|
|
97
|
-
{
|
|
98
|
-
multiline: !0,
|
|
99
|
-
color: "dimmer",
|
|
100
|
-
render: /* @__PURE__ */ o(B, {}),
|
|
101
|
-
children: r
|
|
102
|
-
}
|
|
103
|
-
) : null
|
|
104
|
-
] }) : null,
|
|
105
|
-
i,
|
|
106
|
-
/* @__PURE__ */ o(C, { className: z["alert-dialog__actions"], children: a.map(({ children: d, ...u }, e) => /* @__PURE__ */ o(
|
|
107
|
-
M,
|
|
108
|
-
{
|
|
109
|
-
...W(u, e + 1 === a.length),
|
|
110
|
-
children: d
|
|
111
|
-
},
|
|
112
|
-
e
|
|
113
|
-
)) })
|
|
114
|
-
]
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
] })
|
|
120
|
-
] });
|
|
121
|
-
}
|
|
122
|
-
function M(t) {
|
|
123
|
-
return /* @__PURE__ */ o(j, { render: /* @__PURE__ */ o(v, { ...t }) });
|
|
124
|
-
}
|
|
125
|
-
function W(t, r) {
|
|
126
|
-
return r ? {
|
|
127
|
-
interactive: "negative_fill",
|
|
128
|
-
...t
|
|
129
|
-
} : {
|
|
130
|
-
interactive: !0,
|
|
131
|
-
...t
|
|
132
|
-
};
|
|
133
|
-
}
|
|
2
|
+
import { AlertDialog as o } from "./alert-dialog.js";
|
|
134
3
|
export {
|
|
135
|
-
|
|
136
|
-
M as AlertDialogClose
|
|
4
|
+
o as AlertDialog
|
|
137
5
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useRender } from '@base-ui/react';
|
|
2
|
+
interface AnchorProps extends useRender.ComponentProps<"a"> {
|
|
3
|
+
/**
|
|
4
|
+
* Open this link in a new tab
|
|
5
|
+
*/
|
|
6
|
+
external?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function Anchor({ external, render, ...props }: AnchorProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
9
|
+
export { Anchor };
|
|
10
|
+
export declare namespace Anchor {
|
|
11
|
+
type Props = AnchorProps;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { u as n } from "../../useRender-C3vlzS3t.js";
|
|
2
|
+
import { m as a } from "../../useRenderElement-DngNDu_P.js";
|
|
3
|
+
import '../../anchor.css';const t = "_anchor_1bdhy_2", s = {
|
|
4
|
+
anchor: t
|
|
5
|
+
};
|
|
6
|
+
function h({ external: e, render: r, ...o }) {
|
|
7
|
+
return n({
|
|
8
|
+
defaultTagName: "a",
|
|
9
|
+
render: r,
|
|
10
|
+
props: a(o, {
|
|
11
|
+
className: s.anchor,
|
|
12
|
+
...e ? {
|
|
13
|
+
target: "_blank",
|
|
14
|
+
rel: "noreferrer"
|
|
15
|
+
} : {}
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
h as Anchor
|
|
21
|
+
};
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export type AnchorProps = useRender.ComponentProps<"a"> & {
|
|
3
|
-
/**
|
|
4
|
-
* Open this link in a new tab
|
|
5
|
-
*/
|
|
6
|
-
external?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function Anchor({ external, render, ...props }: AnchorProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
|
|
1
|
+
export { Anchor } from './anchor';
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { m as t } from "../../useRenderElement-DwToLA61.js";
|
|
4
|
-
import '../../index7.css';const a = "_anchor_zl00p_1", s = {
|
|
5
|
-
anchor: a
|
|
6
|
-
};
|
|
7
|
-
function p({ external: e, render: r, ...n }) {
|
|
8
|
-
return o({
|
|
9
|
-
defaultTagName: "a",
|
|
10
|
-
render: r,
|
|
11
|
-
props: t(n, {
|
|
12
|
-
className: s.anchor,
|
|
13
|
-
...e ? {
|
|
14
|
-
target: "_blank",
|
|
15
|
-
rel: "noreferrer"
|
|
16
|
-
} : {}
|
|
17
|
-
})
|
|
18
|
-
});
|
|
19
|
-
}
|
|
2
|
+
import { Anchor as r } from "./anchor.js";
|
|
20
3
|
export {
|
|
21
|
-
|
|
4
|
+
r as Anchor
|
|
22
5
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Avatar as AvatarPrimitive } from '@base-ui/react/avatar';
|
|
2
|
+
import { Size } from '../../styles/tokens';
|
|
3
|
+
interface AvatarProps extends AvatarPrimitive.Root.Props {
|
|
4
|
+
/**
|
|
5
|
+
* Avatar url; if not provided, uses fallback based on username or fullName.
|
|
6
|
+
*/
|
|
7
|
+
image?: string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Used for initials if avatar image is not provided.
|
|
10
|
+
*/
|
|
11
|
+
username: string;
|
|
12
|
+
/**
|
|
13
|
+
* User's first & last name. Used for initials, takes precedence over username.
|
|
14
|
+
*/
|
|
15
|
+
fullName?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Size of the avatar, defaults to "md".
|
|
18
|
+
*/
|
|
19
|
+
size?: Size;
|
|
20
|
+
}
|
|
21
|
+
declare function Avatar({ image, username, fullName, size, className, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export { Avatar };
|
|
23
|
+
export declare namespace Avatar {
|
|
24
|
+
type Props = AvatarProps;
|
|
25
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { jsx as v, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import { c as R } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import * as o from "react";
|
|
4
|
+
import { u as f, N as h } from "../../useRenderElement-DngNDu_P.js";
|
|
5
|
+
import { f as k } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
6
|
+
import { u as C } from "../../useStableCallback-DKZHlUAT.js";
|
|
7
|
+
import { u as N } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
8
|
+
import { u as M } from "../../useTimeout-BNni6aw5.js";
|
|
9
|
+
import '../../avatar.css';const g = /* @__PURE__ */ o.createContext(void 0);
|
|
10
|
+
process.env.NODE_ENV !== "production" && (g.displayName = "AvatarRootContext");
|
|
11
|
+
function b() {
|
|
12
|
+
const e = o.useContext(g);
|
|
13
|
+
if (e === void 0)
|
|
14
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: AvatarRootContext is missing. Avatar parts must be placed within <Avatar.Root>." : k(13));
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
const p = {
|
|
18
|
+
imageLoadingStatus: () => null
|
|
19
|
+
}, z = /* @__PURE__ */ o.forwardRef(function(a, s) {
|
|
20
|
+
const {
|
|
21
|
+
className: l,
|
|
22
|
+
render: i,
|
|
23
|
+
...r
|
|
24
|
+
} = a, [t, c] = o.useState("idle"), _ = o.useMemo(() => ({
|
|
25
|
+
imageLoadingStatus: t
|
|
26
|
+
}), [t]), u = o.useMemo(() => ({
|
|
27
|
+
imageLoadingStatus: t,
|
|
28
|
+
setImageLoadingStatus: c
|
|
29
|
+
}), [t, c]), n = f("span", a, {
|
|
30
|
+
state: _,
|
|
31
|
+
ref: s,
|
|
32
|
+
props: r,
|
|
33
|
+
stateAttributesMapping: p
|
|
34
|
+
});
|
|
35
|
+
return /* @__PURE__ */ v(g.Provider, {
|
|
36
|
+
value: u,
|
|
37
|
+
children: n
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
process.env.NODE_ENV !== "production" && (z.displayName = "AvatarRoot");
|
|
41
|
+
function w(e, {
|
|
42
|
+
referrerPolicy: a,
|
|
43
|
+
crossOrigin: s
|
|
44
|
+
}) {
|
|
45
|
+
const [l, i] = o.useState("idle");
|
|
46
|
+
return N(() => {
|
|
47
|
+
if (!e)
|
|
48
|
+
return i("error"), h;
|
|
49
|
+
let r = !0;
|
|
50
|
+
const t = new window.Image(), c = (_) => () => {
|
|
51
|
+
r && i(_);
|
|
52
|
+
};
|
|
53
|
+
return i("loading"), t.onload = c("loaded"), t.onerror = c("error"), a && (t.referrerPolicy = a), t.crossOrigin = s ?? null, t.src = e, () => {
|
|
54
|
+
r = !1;
|
|
55
|
+
};
|
|
56
|
+
}, [e, s, a]), l;
|
|
57
|
+
}
|
|
58
|
+
const S = /* @__PURE__ */ o.forwardRef(function(a, s) {
|
|
59
|
+
const {
|
|
60
|
+
className: l,
|
|
61
|
+
render: i,
|
|
62
|
+
onLoadingStatusChange: r,
|
|
63
|
+
referrerPolicy: t,
|
|
64
|
+
crossOrigin: c,
|
|
65
|
+
..._
|
|
66
|
+
} = a, u = b(), n = w(a.src, {
|
|
67
|
+
referrerPolicy: t,
|
|
68
|
+
crossOrigin: c
|
|
69
|
+
}), d = C((x) => {
|
|
70
|
+
r?.(x), u.setImageLoadingStatus(x);
|
|
71
|
+
});
|
|
72
|
+
N(() => {
|
|
73
|
+
n !== "idle" && d(n);
|
|
74
|
+
}, [n, d]);
|
|
75
|
+
const A = o.useMemo(() => ({
|
|
76
|
+
imageLoadingStatus: n
|
|
77
|
+
}), [n]);
|
|
78
|
+
return f("img", a, {
|
|
79
|
+
state: A,
|
|
80
|
+
ref: s,
|
|
81
|
+
props: _,
|
|
82
|
+
stateAttributesMapping: p,
|
|
83
|
+
enabled: n === "loaded"
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
process.env.NODE_ENV !== "production" && (S.displayName = "AvatarImage");
|
|
87
|
+
const E = /* @__PURE__ */ o.forwardRef(function(a, s) {
|
|
88
|
+
const {
|
|
89
|
+
className: l,
|
|
90
|
+
render: i,
|
|
91
|
+
delay: r,
|
|
92
|
+
...t
|
|
93
|
+
} = a, {
|
|
94
|
+
imageLoadingStatus: c
|
|
95
|
+
} = b(), [_, u] = o.useState(r === void 0), n = M();
|
|
96
|
+
o.useEffect(() => (r !== void 0 && n.start(r, () => u(!0)), n.clear), [n, r]);
|
|
97
|
+
const d = o.useMemo(() => ({
|
|
98
|
+
imageLoadingStatus: c
|
|
99
|
+
}), [c]);
|
|
100
|
+
return f("span", a, {
|
|
101
|
+
state: d,
|
|
102
|
+
ref: s,
|
|
103
|
+
props: t,
|
|
104
|
+
stateAttributesMapping: p,
|
|
105
|
+
enabled: c !== "loaded" && _
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
process.env.NODE_ENV !== "production" && (E.displayName = "AvatarFallback");
|
|
109
|
+
const y = "_avatar_1886r_2", I = "_avatar__image_1886r_16", O = "_avatar__fallback_1886r_22", D = "_avatar_size_sm_1886r_35", V = "_avatar_size_md_1886r_39", F = "_avatar_size_lg_1886r_43", P = "_avatar_size_xl_1886r_47", j = "_avatar_size_2xl_1886r_51", U = "_avatar_size_3xl_1886r_55", m = {
|
|
110
|
+
avatar: y,
|
|
111
|
+
avatar__image: I,
|
|
112
|
+
avatar__fallback: O,
|
|
113
|
+
avatar_size_sm: D,
|
|
114
|
+
avatar_size_md: V,
|
|
115
|
+
avatar_size_lg: F,
|
|
116
|
+
avatar_size_xl: P,
|
|
117
|
+
avatar_size_2xl: j,
|
|
118
|
+
avatar_size_3xl: U
|
|
119
|
+
};
|
|
120
|
+
function W({
|
|
121
|
+
image: e,
|
|
122
|
+
username: a,
|
|
123
|
+
fullName: s,
|
|
124
|
+
size: l = "md",
|
|
125
|
+
className: i,
|
|
126
|
+
...r
|
|
127
|
+
}) {
|
|
128
|
+
const t = B(a, s);
|
|
129
|
+
return /* @__PURE__ */ L(
|
|
130
|
+
z,
|
|
131
|
+
{
|
|
132
|
+
className: R(
|
|
133
|
+
m.avatar,
|
|
134
|
+
m[`avatar_size_${l}`],
|
|
135
|
+
i
|
|
136
|
+
),
|
|
137
|
+
...r,
|
|
138
|
+
children: [
|
|
139
|
+
e ? /* @__PURE__ */ v(
|
|
140
|
+
S,
|
|
141
|
+
{
|
|
142
|
+
src: e,
|
|
143
|
+
className: m.avatar__image
|
|
144
|
+
}
|
|
145
|
+
) : null,
|
|
146
|
+
/* @__PURE__ */ v(E, { className: m.avatar__fallback, children: t })
|
|
147
|
+
]
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
function B(e, a) {
|
|
152
|
+
let s = e.substring(0, 2);
|
|
153
|
+
if (a) {
|
|
154
|
+
const [l, i] = a.split(" ");
|
|
155
|
+
s = l && i ? l.charAt(0) + i.charAt(0) : a.substring(0, 2);
|
|
156
|
+
}
|
|
157
|
+
return s.toLocaleUpperCase();
|
|
158
|
+
}
|
|
159
|
+
export {
|
|
160
|
+
W as Avatar
|
|
161
|
+
};
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { Size } from '../../styles/tokens';
|
|
3
|
-
export interface AvatarProps extends AvatarPrimitive.Root.Props {
|
|
4
|
-
/**
|
|
5
|
-
* Avatar url; if not provided, uses fallback based on username or fullName.
|
|
6
|
-
*/
|
|
7
|
-
image?: string | null;
|
|
8
|
-
/**
|
|
9
|
-
* Used for initials if avatar image is not provided.
|
|
10
|
-
*/
|
|
11
|
-
username: string;
|
|
12
|
-
/**
|
|
13
|
-
* User's first & last name. Used for initials, takes precedence over username.
|
|
14
|
-
*/
|
|
15
|
-
fullName?: string;
|
|
16
|
-
/**
|
|
17
|
-
* Size of the avatar, defaults to "md".
|
|
18
|
-
*/
|
|
19
|
-
size?: Size;
|
|
20
|
-
}
|
|
21
|
-
export declare function Avatar({ image, username, fullName, size, className, ...props }: AvatarProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export { Avatar } from './avatar';
|