@jfrader/ui 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/accordion-DLul6vIl.js +205 -0
- package/dist/accordion.js +1 -1
- package/dist/{alert-BBqaKI4k.js → alert-DS_einpy.js} +1 -1
- package/dist/alert.js +1 -1
- package/dist/announcement-bar-Dlbq5-9D.js +382 -0
- package/dist/announcement-bar.js +2 -0
- package/dist/avatar-CaGJHy1N.js +145 -0
- package/dist/avatar-group-M1opAQEG.js +138 -0
- package/dist/avatar-group.js +2 -0
- package/dist/avatar.js +1 -1
- package/dist/badge-CjM5Agqk.js +119 -0
- package/dist/badge.js +1 -1
- package/dist/bottom-sheet-DjZOPq4k.js +674 -0
- package/dist/bottom-sheet.js +2 -0
- package/dist/{breadcrumbs-DVAOxfvL.js → breadcrumbs-BDK_LiwH.js} +11 -4
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-P2e7_44z.js → button-NLY0h6EJ.js} +8 -8
- package/dist/button.js +1 -1
- package/dist/calendar-BzJdv_SZ.js +449 -0
- package/dist/calendar.js +1 -1
- package/dist/card-Ca4KQKYQ.js +154 -0
- package/dist/card.js +1 -1
- package/dist/carousel-B7OrvD6J.js +474 -0
- package/dist/carousel.js +2 -0
- package/dist/{checkbox-COYG6L7d.js → checkbox-DKSzExj2.js} +17 -16
- package/dist/checkbox.js +1 -1
- package/dist/chip-group-DjQ0_6Y9.js +290 -0
- package/dist/chip-group.js +2 -0
- package/dist/code-block/shiki.js +147 -0
- package/dist/code-block-B5we2lZa.js +293 -0
- package/dist/code-block.js +2 -0
- package/dist/collection-registry-k6JcD3Jr.js +44 -0
- package/dist/combobox-DFFqOBCi.js +339 -0
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BmQu2w4H.js +391 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-ASaXDcGo.js +1410 -0
- package/dist/comment-thread.js +2 -0
- package/dist/context-menu-__1c2Dk9.js +370 -0
- package/dist/context-menu.js +2 -0
- package/dist/copy-button-DCSLcYS-.js +252 -0
- package/dist/copy-button.js +2 -0
- package/dist/countdown-Dp_TD1VP.js +293 -0
- package/dist/countdown.js +2 -0
- package/dist/date-picker-BiPN7yeK.js +255 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-DQpUeKqV.js +570 -0
- package/dist/date-range-picker.js +2 -0
- package/dist/{dialog-xaydbXl2.js → dialog-BX1zYMs-.js} +21 -20
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-Cp7aNbhM.js} +21 -20
- package/dist/divider.js +1 -1
- package/dist/drawer-DsASTiP-.js +553 -0
- package/dist/drawer.js +2 -0
- package/dist/elastic-slider-BG6K019r.js +395 -0
- package/dist/elastic-slider.js +2 -0
- package/dist/empty-state-CDgrjPPf.js +142 -0
- package/dist/empty-state.js +2 -0
- package/dist/expandable-card-rUATve0o.js +347 -0
- package/dist/expandable-card.js +2 -0
- package/dist/expanding-search-BxOwtdwt.js +238 -0
- package/dist/expanding-search.js +2 -0
- package/dist/field-anatomy-COVdNpf5.js +84 -0
- package/dist/file-dropzone-BuXm3Tea.js +457 -0
- package/dist/file-dropzone.js +2 -0
- package/dist/filter-toolbar-Cy5Hqur-.js +314 -0
- package/dist/filter-toolbar.js +2 -0
- package/dist/hold-to-confirm-DjB2EVjM.js +294 -0
- package/dist/hold-to-confirm.js +2 -0
- package/dist/hover-card-CoMJKg1g.js +347 -0
- package/dist/hover-card.js +2 -0
- package/dist/image-compare-BxY8Ykzt.js +415 -0
- package/dist/image-compare.js +2 -0
- package/dist/index.js +84 -38
- package/dist/inline-edit-C0eeml65.js +535 -0
- package/dist/inline-edit.js +2 -0
- package/dist/input-control-DmMuAuPS.js +34 -0
- package/dist/json-viewer-DgWqyU75.js +802 -0
- package/dist/json-viewer.js +2 -0
- package/dist/listbox-style-WX-RASp1.js +59 -0
- package/dist/{media-D_eA_I-e.js → media-8yrN85VT.js} +2 -2
- package/dist/mention-input-sq61si9L.js +600 -0
- package/dist/mention-input.js +2 -0
- package/dist/menu-DDKgmK2F.js +295 -0
- package/dist/menu.js +1 -1
- package/dist/metric-card--lVTz5Wn.js +118 -0
- package/dist/metric-card.js +2 -0
- package/dist/multi-select-DG1BCFX7.js +598 -0
- package/dist/multi-select.js +2 -0
- package/dist/{navigation-DhnKriOp.js → navigation-CC26JDr-.js} +24 -18
- package/dist/navigation.js +1 -1
- package/dist/overlay-layer-qEbpEtb8.js +78 -0
- package/dist/overlay-portal-C4JZFq2M.js +15 -0
- package/dist/{pagination-DYdwsxwe.js → pagination-BfkeWbmP.js} +24 -23
- package/dist/pagination.js +1 -1
- package/dist/password-field-03pWRkuY.js +250 -0
- package/dist/password-field.js +2 -0
- package/dist/pill-BaS-uIbn.js +58 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CErIw2q3.js +125 -0
- package/dist/popover.js +1 -1
- package/dist/{progress-BpJswTG4.js → progress-DAQkfhPd.js} +5 -5
- package/dist/progress.js +1 -1
- package/dist/radio-cards-Cu9cBssN.js +456 -0
- package/dist/radio-cards.js +2 -0
- package/dist/{radio-group-Ce0_IWQr.js → radio-group-TIK0-iPX.js} +22 -19
- package/dist/radio-group.js +1 -1
- package/dist/resizable-panels-DUpQEpwG.js +520 -0
- package/dist/resizable-panels.js +2 -0
- package/dist/scroll-area-CcZyiSOQ.js +371 -0
- package/dist/scroll-area.js +2 -0
- package/dist/search-field-DMvho0KQ.js +274 -0
- package/dist/search-field.js +2 -0
- package/dist/segmented-control-8ZUGnsZm.js +327 -0
- package/dist/segmented-control.js +2 -0
- package/dist/select-D5rhJ8gi.js +293 -0
- package/dist/select.js +1 -1
- package/dist/signature-pad-_bTeguN9.js +645 -0
- package/dist/signature-pad.js +2 -0
- package/dist/{skeleton-OoFlOEXO.js → skeleton-XQQDkCHd.js} +1 -1
- package/dist/skeleton.js +1 -1
- package/dist/slider-DVG6-Awh.js +308 -0
- package/dist/slider.js +2 -0
- package/dist/sortable-data-table-CYKT_Ng7.js +365 -0
- package/dist/sortable-data-table.js +2 -0
- package/dist/{spinner-C2YDoiMn.js → spinner-DtxvDPdM.js} +1 -1
- package/dist/spinner.js +1 -1
- package/dist/split-button-BCw4zZom.js +262 -0
- package/dist/split-button.js +2 -0
- package/dist/stepper-CruHbXxX.js +480 -0
- package/dist/stepper.js +2 -0
- package/dist/swipe-actions-CBuJREU1.js +420 -0
- package/dist/swipe-actions.js +2 -0
- package/dist/switch-C1WrKrf-.js +145 -0
- package/dist/switch.js +1 -1
- package/dist/tabs-XluwRjgg.js +210 -0
- package/dist/tabs.js +1 -1
- package/dist/tag-input-DSRCyrX2.js +418 -0
- package/dist/tag-input.js +2 -0
- package/dist/{text-field-D60ok14S.js → text-field-hU72iSVS.js} +20 -17
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DyfjtP0A.js → textarea-3k4Y0QQ3.js} +23 -20
- package/dist/textarea.js +1 -1
- package/dist/theme-root.js +1 -1
- package/dist/theme-switch-C505TtU8.js +166 -0
- package/dist/theme-switch.js +2 -0
- package/dist/time-picker-CPlhW0tr.js +311 -0
- package/dist/time-picker.js +2 -0
- package/dist/timeline-B0uAAVfT.js +624 -0
- package/dist/timeline.js +2 -0
- package/dist/toast-B7wo3sX1.js +371 -0
- package/dist/toast-stack-B40VpS4M.js +197 -0
- package/dist/toast-stack.js +2 -0
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-CI0e7hFm.js → toggle-group-B2fpFZwV.js} +5 -5
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-BvgVTCTN.js +120 -0
- package/dist/tooltip.js +1 -1
- package/dist/tree-view-j8qLqkb_.js +364 -0
- package/dist/tree-view.js +2 -0
- package/dist/types/components/announcement-bar/announcement-bar.d.ts +75 -0
- package/dist/types/components/announcement-bar/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +43 -0
- package/dist/types/components/avatar-group/index.d.ts +2 -0
- package/dist/types/components/bottom-sheet/bottom-sheet.d.ts +60 -0
- package/dist/types/components/bottom-sheet/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +25 -1
- package/dist/types/components/calendar/index.d.ts +1 -1
- package/dist/types/components/carousel/carousel.d.ts +73 -0
- package/dist/types/components/carousel/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/chip-group/chip-group.d.ts +54 -0
- package/dist/types/components/chip-group/index.d.ts +1 -0
- package/dist/types/components/code-block/code-block.d.ts +58 -0
- package/dist/types/components/code-block/index.d.ts +1 -0
- package/dist/types/components/code-block/shiki.d.ts +3 -0
- package/dist/types/components/combobox/combobox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +2 -2
- package/dist/types/components/comment-thread/comment-thread.d.ts +118 -0
- package/dist/types/components/comment-thread/index.d.ts +1 -0
- package/dist/types/components/comment-thread/thread-core.d.ts +96 -0
- package/dist/types/components/comment-thread/thread-parts.d.ts +114 -0
- package/dist/types/components/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- package/dist/types/components/copy-button/copy-button.d.ts +49 -0
- package/dist/types/components/copy-button/index.d.ts +2 -0
- package/dist/types/components/countdown/countdown.d.ts +37 -0
- package/dist/types/components/countdown/index.d.ts +1 -0
- package/dist/types/components/date-picker/date-picker.d.ts +1 -1
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +103 -0
- package/dist/types/components/date-range-picker/index.d.ts +2 -0
- package/dist/types/components/drawer/drawer.d.ts +59 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +53 -0
- package/dist/types/components/elastic-slider/index.d.ts +1 -0
- package/dist/types/components/empty-state/empty-state.d.ts +36 -0
- package/dist/types/components/empty-state/index.d.ts +2 -0
- package/dist/types/components/expandable-card/expandable-card.d.ts +28 -0
- package/dist/types/components/expandable-card/index.d.ts +2 -0
- package/dist/types/components/expanding-search/expanding-search.d.ts +22 -0
- package/dist/types/components/expanding-search/index.d.ts +1 -0
- package/dist/types/components/field/field-anatomy.d.ts +4 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +93 -0
- package/dist/types/components/file-dropzone/index.d.ts +2 -0
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +70 -0
- package/dist/types/components/filter-toolbar/index.d.ts +1 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +32 -0
- package/dist/types/components/hold-to-confirm/index.d.ts +2 -0
- package/dist/types/components/hover-card/hover-card.d.ts +97 -0
- package/dist/types/components/hover-card/index.d.ts +2 -0
- package/dist/types/components/image-compare/image-compare.d.ts +54 -0
- package/dist/types/components/image-compare/index.d.ts +1 -0
- package/dist/types/components/inline-edit/index.d.ts +2 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +93 -0
- package/dist/types/components/json-viewer/index.d.ts +2 -0
- package/dist/types/components/json-viewer/json-viewer.d.ts +82 -0
- package/dist/types/components/mention-input/index.d.ts +2 -0
- package/dist/types/components/mention-input/mention-input.d.ts +87 -0
- package/dist/types/components/menu/menu.d.ts +68 -7
- package/dist/types/components/metric-card/index.d.ts +1 -0
- package/dist/types/components/metric-card/metric-card.d.ts +37 -0
- package/dist/types/components/multi-select/index.d.ts +2 -0
- package/dist/types/components/multi-select/multi-select.d.ts +73 -0
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/password-field/index.d.ts +2 -0
- package/dist/types/components/password-field/password-field.d.ts +34 -0
- package/dist/types/components/popover/popover.d.ts +1 -1
- package/dist/types/components/radio-cards/index.d.ts +1 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +42 -0
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/resizable-panels/index.d.ts +2 -0
- package/dist/types/components/resizable-panels/resizable-panels.d.ts +42 -0
- package/dist/types/components/scroll-area/index.d.ts +2 -0
- package/dist/types/components/scroll-area/scroll-area.d.ts +34 -0
- package/dist/types/components/search-field/index.d.ts +1 -0
- package/dist/types/components/search-field/search-field.d.ts +31 -0
- package/dist/types/components/segmented-control/index.d.ts +2 -0
- package/dist/types/components/segmented-control/segmented-control.d.ts +32 -0
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/signature-pad/index.d.ts +2 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +104 -0
- package/dist/types/components/slider/index.d.ts +1 -0
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +62 -0
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/sortable-data-table/index.d.ts +1 -0
- package/dist/types/components/sortable-data-table/sortable-data-table.d.ts +76 -0
- package/dist/types/components/split-button/index.d.ts +2 -0
- package/dist/types/components/split-button/split-button.d.ts +55 -0
- package/dist/types/components/stepper/index.d.ts +2 -0
- package/dist/types/components/stepper/stepper.d.ts +85 -0
- package/dist/types/components/swipe-actions/index.d.ts +2 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +44 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- package/dist/types/components/tag-input/index.d.ts +2 -0
- package/dist/types/components/tag-input/tag-input.d.ts +66 -0
- package/dist/types/components/text-field/text-field.d.ts +1 -1
- package/dist/types/components/textarea/textarea.d.ts +1 -1
- package/dist/types/components/theme-switch/index.d.ts +1 -0
- package/dist/types/components/theme-switch/theme-switch.d.ts +33 -0
- package/dist/types/components/time-picker/index.d.ts +2 -0
- package/dist/types/components/time-picker/time-picker.d.ts +48 -0
- package/dist/types/components/timeline/index.d.ts +2 -0
- package/dist/types/components/timeline/timeline.d.ts +66 -0
- package/dist/types/components/toast/toast.d.ts +37 -2
- package/dist/types/components/toast-stack/index.d.ts +2 -0
- package/dist/types/components/toast-stack/toast-stack.d.ts +28 -0
- package/dist/types/components/tooltip/tooltip.d.ts +2 -2
- package/dist/types/components/tree-view/index.d.ts +1 -0
- package/dist/types/components/tree-view/tree-view.d.ts +47 -0
- package/dist/types/components/usage-meter/index.d.ts +2 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +83 -0
- package/dist/types/index.d.ts +45 -0
- package/dist/types/overlay/overlay-layer.d.ts +53 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +19 -2
- package/dist/types/styling/media.d.ts +1 -0
- package/dist/types/styling/theme.d.ts +12 -0
- package/dist/types/utils/use-controlled-state.d.ts +2 -1
- package/dist/usage-meter-qyQ3rYVv.js +463 -0
- package/dist/usage-meter.js +2 -0
- package/dist/use-controlled-state-DpeVQZNR.js +20 -0
- package/dist/use-latest-callback-cj1OOQL6.js +11 -0
- package/dist/use-overlay-floating-Bx2jBKAA.js +33 -0
- package/dist/use-slider-interaction-ChL-208h.js +234 -0
- package/package.json +195 -3
- package/dist/accordion-Bd-j04hW.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-C9Yad_-w.js +0 -394
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/collection-registry-BTYi6zGh.js +0 -98
- package/dist/combobox-DiMC2g_u.js +0 -327
- package/dist/command-palette-V_2pEay7.js +0 -379
- package/dist/date-picker-C29Uo4Tx.js +0 -250
- package/dist/field-anatomy-D2ToMeRa.js +0 -109
- package/dist/menu-CGPTNRnF.js +0 -216
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-CdRXjQqI.js +0 -113
- package/dist/select-BgG7WgSh.js +0 -286
- package/dist/switch-Dr-qjmT4.js +0 -142
- package/dist/tabs-CK_g1RKa.js +0 -203
- package/dist/toast-CjmELMZZ.js +0 -283
- package/dist/tooltip-CaL3rKbV.js +0 -108
- package/dist/use-controlled-state-CVXDa-qM.js +0 -21
- package/dist/use-overlay-floating-Bit-f0FU.js +0 -31
- package/dist/{theme-root-BbTBuLMQ.js → theme-root-Bs1U3uPA.js} +2 -2
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./media-8yrN85VT.js";
|
|
4
|
+
import { useState as r } from "react";
|
|
5
|
+
import { vars as i } from "@jfrader/tokens/vars";
|
|
6
|
+
import { jsx as a, jsxs as o } from "@emotion/react/jsx-runtime";
|
|
7
|
+
//#region src/components/avatar/avatar.tsx
|
|
8
|
+
var s = 2, c = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
9
|
+
function l(e) {
|
|
10
|
+
let t = Array.from(c.segment(e), ({ segment: e }) => e), n = t[0] ?? "";
|
|
11
|
+
if (!/\p{Extended_Pictographic}/u.test(n)) return n;
|
|
12
|
+
let r = "";
|
|
13
|
+
for (let e of t) {
|
|
14
|
+
if (!/\p{Extended_Pictographic}/u.test(e)) break;
|
|
15
|
+
r += e;
|
|
16
|
+
}
|
|
17
|
+
return r;
|
|
18
|
+
}
|
|
19
|
+
function u(e) {
|
|
20
|
+
return e.trim().split(/\s+/).filter(Boolean).slice(0, s).map(l).join("").toLocaleUpperCase();
|
|
21
|
+
}
|
|
22
|
+
var d = e({
|
|
23
|
+
position: "relative",
|
|
24
|
+
display: "inline-flex",
|
|
25
|
+
alignItems: "center",
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
flexShrink: 0,
|
|
28
|
+
boxSizing: "border-box",
|
|
29
|
+
borderRadius: i.radius.full,
|
|
30
|
+
backgroundColor: i.color.surfaceHover,
|
|
31
|
+
color: i.color.text,
|
|
32
|
+
fontWeight: i.fontWeight.medium,
|
|
33
|
+
lineHeight: 1,
|
|
34
|
+
userSelect: "none",
|
|
35
|
+
verticalAlign: "middle",
|
|
36
|
+
[n]: { outline: "1px solid CanvasText" }
|
|
37
|
+
}), f = {
|
|
38
|
+
sm: e({
|
|
39
|
+
inlineSize: i.space[6],
|
|
40
|
+
blockSize: i.space[6],
|
|
41
|
+
fontSize: i.textSize.xs
|
|
42
|
+
}),
|
|
43
|
+
md: e({
|
|
44
|
+
inlineSize: i.space[8],
|
|
45
|
+
blockSize: i.space[8],
|
|
46
|
+
fontSize: i.textSize.sm
|
|
47
|
+
}),
|
|
48
|
+
lg: e({
|
|
49
|
+
inlineSize: i.space[10],
|
|
50
|
+
blockSize: i.space[10],
|
|
51
|
+
fontSize: i.textSize.md
|
|
52
|
+
})
|
|
53
|
+
}, p = e({
|
|
54
|
+
display: "block",
|
|
55
|
+
inlineSize: "100%",
|
|
56
|
+
blockSize: "100%",
|
|
57
|
+
borderRadius: i.radius.full,
|
|
58
|
+
objectFit: "cover"
|
|
59
|
+
}), m = e({
|
|
60
|
+
position: "absolute",
|
|
61
|
+
insetBlockEnd: 0,
|
|
62
|
+
insetInlineEnd: 0,
|
|
63
|
+
inlineSize: "25%",
|
|
64
|
+
blockSize: "25%",
|
|
65
|
+
"&::before": {
|
|
66
|
+
content: "\"\"",
|
|
67
|
+
position: "absolute",
|
|
68
|
+
insetBlockStart: 0,
|
|
69
|
+
insetInlineStart: 0,
|
|
70
|
+
inlineSize: "100%",
|
|
71
|
+
blockSize: "100%",
|
|
72
|
+
boxSizing: "border-box",
|
|
73
|
+
borderRadius: i.radius.full,
|
|
74
|
+
boxShadow: `0 0 0 2px ${i.color.bg}`
|
|
75
|
+
}
|
|
76
|
+
}), h = {
|
|
77
|
+
online: e({ "&::before": { backgroundColor: i.color.success } }),
|
|
78
|
+
away: e({ "&::before": {
|
|
79
|
+
border: `2px solid ${i.color.warning}`,
|
|
80
|
+
backgroundColor: "transparent"
|
|
81
|
+
} }),
|
|
82
|
+
busy: e({ "&::before": {
|
|
83
|
+
backgroundColor: i.color.danger,
|
|
84
|
+
blockSize: "30%",
|
|
85
|
+
insetBlockStart: "35%"
|
|
86
|
+
} }),
|
|
87
|
+
offline: e({ "&::before": {
|
|
88
|
+
backgroundColor: i.color.textSubtle,
|
|
89
|
+
inlineSize: "60%",
|
|
90
|
+
blockSize: "60%",
|
|
91
|
+
insetBlockStart: "20%",
|
|
92
|
+
insetInlineStart: "20%"
|
|
93
|
+
} })
|
|
94
|
+
}, g = e({ [n]: {
|
|
95
|
+
"&::before": {
|
|
96
|
+
forcedColorAdjust: "none",
|
|
97
|
+
backgroundColor: "CanvasText",
|
|
98
|
+
outline: "2px solid Canvas"
|
|
99
|
+
},
|
|
100
|
+
"&[data-status=\"away\"]::before": {
|
|
101
|
+
borderColor: "CanvasText",
|
|
102
|
+
backgroundColor: "Canvas"
|
|
103
|
+
}
|
|
104
|
+
} });
|
|
105
|
+
function _({ ref: e, name: n, src: i, size: s = "md", status: c, statusLabel: l, slotProps: _, className: v, sx: y, ...b }) {
|
|
106
|
+
let [x, S] = r(), C = i !== void 0 && i !== "" && i !== x, w = c === void 0 ? n : `${n}, ${l ?? c}`;
|
|
107
|
+
return /* @__PURE__ */ a(t, {
|
|
108
|
+
className: v,
|
|
109
|
+
styles: [d, f[s]],
|
|
110
|
+
sx: y,
|
|
111
|
+
children: (t) => /* @__PURE__ */ o("span", {
|
|
112
|
+
...b,
|
|
113
|
+
ref: e,
|
|
114
|
+
"data-ui": "avatar",
|
|
115
|
+
role: "img",
|
|
116
|
+
"aria-label": w,
|
|
117
|
+
className: t,
|
|
118
|
+
children: [C ? /* @__PURE__ */ a("img", {
|
|
119
|
+
src: i,
|
|
120
|
+
alt: "",
|
|
121
|
+
onError: () => S(i),
|
|
122
|
+
className: _?.image?.className,
|
|
123
|
+
css: [p, _?.image?.css]
|
|
124
|
+
}) : /* @__PURE__ */ a("span", {
|
|
125
|
+
"aria-hidden": "true",
|
|
126
|
+
className: _?.fallback?.className,
|
|
127
|
+
css: _?.fallback?.css,
|
|
128
|
+
children: u(n)
|
|
129
|
+
}), c !== void 0 && /* @__PURE__ */ a("span", {
|
|
130
|
+
"aria-hidden": "true",
|
|
131
|
+
"data-status": c,
|
|
132
|
+
className: _?.status?.className,
|
|
133
|
+
css: [
|
|
134
|
+
m,
|
|
135
|
+
h[c],
|
|
136
|
+
g,
|
|
137
|
+
_?.status?.css
|
|
138
|
+
]
|
|
139
|
+
})]
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
_.displayName = "Avatar";
|
|
144
|
+
//#endregion
|
|
145
|
+
export { _ as t };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as r } from "./visually-hidden-BJdvqqvn.js";
|
|
5
|
+
import { t as i } from "./avatar-CaGJHy1N.js";
|
|
6
|
+
import { useId as a } from "react";
|
|
7
|
+
import { vars as o } from "@jfrader/tokens/vars";
|
|
8
|
+
import { jsx as s, jsxs as c } from "@emotion/react/jsx-runtime";
|
|
9
|
+
//#region src/components/avatar-group/avatar-group.tsx
|
|
10
|
+
var l = new Intl.PluralRules("en");
|
|
11
|
+
function u(e, t) {
|
|
12
|
+
return l.select(e) === "one" ? `${t} more member` : `${t} more members`;
|
|
13
|
+
}
|
|
14
|
+
function d(e, t) {
|
|
15
|
+
return l.select(e) === "one" ? `${t} member` : `${t} members`;
|
|
16
|
+
}
|
|
17
|
+
var f = e({
|
|
18
|
+
position: "relative",
|
|
19
|
+
display: "inline-flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
flexWrap: "nowrap",
|
|
22
|
+
minInlineSize: 0,
|
|
23
|
+
verticalAlign: "middle"
|
|
24
|
+
}), p = e({
|
|
25
|
+
position: "relative",
|
|
26
|
+
display: "inline-flex",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
justifyContent: "center",
|
|
29
|
+
flexShrink: 0,
|
|
30
|
+
borderRadius: o.radius.full,
|
|
31
|
+
verticalAlign: "middle",
|
|
32
|
+
"&:not(:first-of-type)": { marginInlineStart: `calc(-1 * ${o.space[1]})` }
|
|
33
|
+
}), m = e({
|
|
34
|
+
boxSizing: "border-box",
|
|
35
|
+
border: `2px solid ${o.color.surface}`,
|
|
36
|
+
[n]: { borderColor: "Canvas" }
|
|
37
|
+
}), h = e({
|
|
38
|
+
position: "relative",
|
|
39
|
+
display: "inline-flex",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
justifyContent: "center",
|
|
42
|
+
flexShrink: 0,
|
|
43
|
+
boxSizing: "border-box",
|
|
44
|
+
borderRadius: o.radius.full,
|
|
45
|
+
backgroundColor: o.color.surfaceHover,
|
|
46
|
+
color: o.color.text,
|
|
47
|
+
fontWeight: o.fontWeight.medium,
|
|
48
|
+
fontVariantNumeric: "tabular-nums",
|
|
49
|
+
lineHeight: 1,
|
|
50
|
+
whiteSpace: "nowrap",
|
|
51
|
+
userSelect: "none",
|
|
52
|
+
verticalAlign: "middle",
|
|
53
|
+
border: `2px solid ${o.color.surface}`,
|
|
54
|
+
"&:not(:first-of-type)": { marginInlineStart: `calc(-1 * ${o.space[1]})` },
|
|
55
|
+
[n]: {
|
|
56
|
+
borderColor: "Canvas",
|
|
57
|
+
color: "CanvasText",
|
|
58
|
+
backgroundColor: "Canvas"
|
|
59
|
+
}
|
|
60
|
+
}), g = {
|
|
61
|
+
sm: e({
|
|
62
|
+
minInlineSize: o.space[6],
|
|
63
|
+
blockSize: o.space[6],
|
|
64
|
+
paddingInline: `calc(${o.space[1]} / 2)`,
|
|
65
|
+
fontSize: o.textSize.xs
|
|
66
|
+
}),
|
|
67
|
+
md: e({
|
|
68
|
+
minInlineSize: o.space[8],
|
|
69
|
+
blockSize: o.space[8],
|
|
70
|
+
paddingInline: o.space[1],
|
|
71
|
+
fontSize: o.textSize.sm
|
|
72
|
+
}),
|
|
73
|
+
lg: e({
|
|
74
|
+
minInlineSize: o.space[10],
|
|
75
|
+
blockSize: o.space[10],
|
|
76
|
+
paddingInline: o.space[1],
|
|
77
|
+
fontSize: o.textSize.md
|
|
78
|
+
})
|
|
79
|
+
};
|
|
80
|
+
function _({ ref: e, members: n, max: o = 4, size: l = "md", label: _ = "Team members", locale: v, getOverflowLabel: y = u, getSummaryLabel: b = d, slotProps: x, avatarProps: S, className: C, sx: w, ...T }) {
|
|
81
|
+
let E = a(), D = typeof o == "number" && Number.isFinite(o) ? Math.max(0, Math.floor(o)) : 4, O = n.length, k = n.slice(0, D), A = O - k.length, j = A > 0, M = new Intl.NumberFormat(v), N = M.format(A), P = M.format(O), F = y(A, N), I = b(O, P), L = !!T["aria-labelledby"]?.trim(), R = T["aria-label"] ?? (L ? void 0 : _), z = [T["aria-describedby"], E].filter(Boolean).join(" ");
|
|
82
|
+
return /* @__PURE__ */ s(t, {
|
|
83
|
+
className: C,
|
|
84
|
+
styles: f,
|
|
85
|
+
sx: w,
|
|
86
|
+
children: (t) => /* @__PURE__ */ c("div", {
|
|
87
|
+
...T,
|
|
88
|
+
ref: e,
|
|
89
|
+
"data-ui": "avatar-group",
|
|
90
|
+
role: "group",
|
|
91
|
+
"aria-label": R,
|
|
92
|
+
"aria-describedby": z,
|
|
93
|
+
className: t,
|
|
94
|
+
children: [
|
|
95
|
+
k.map((e) => /* @__PURE__ */ s("span", {
|
|
96
|
+
"data-ui": "avatar-group-member",
|
|
97
|
+
className: x?.member?.className,
|
|
98
|
+
css: [p, x?.member?.css],
|
|
99
|
+
children: /* @__PURE__ */ s(i, {
|
|
100
|
+
size: l,
|
|
101
|
+
name: e.name,
|
|
102
|
+
src: e.src,
|
|
103
|
+
status: e.status,
|
|
104
|
+
statusLabel: e.statusLabel,
|
|
105
|
+
slotProps: S?.slotProps,
|
|
106
|
+
className: S?.className,
|
|
107
|
+
sx: [m, S?.sx]
|
|
108
|
+
})
|
|
109
|
+
}, e.id)),
|
|
110
|
+
j && /* @__PURE__ */ s("span", {
|
|
111
|
+
"data-ui": "avatar-group-overflow",
|
|
112
|
+
role: "img",
|
|
113
|
+
"aria-label": F,
|
|
114
|
+
className: x?.overflow?.className,
|
|
115
|
+
css: [
|
|
116
|
+
h,
|
|
117
|
+
g[l],
|
|
118
|
+
x?.overflow?.css
|
|
119
|
+
],
|
|
120
|
+
children: /* @__PURE__ */ c("span", {
|
|
121
|
+
"aria-hidden": "true",
|
|
122
|
+
children: ["+", N]
|
|
123
|
+
})
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ s("span", {
|
|
126
|
+
id: E,
|
|
127
|
+
"data-ui": "avatar-group-summary",
|
|
128
|
+
className: x?.summary?.className,
|
|
129
|
+
css: [r, x?.summary?.css],
|
|
130
|
+
children: I
|
|
131
|
+
})
|
|
132
|
+
]
|
|
133
|
+
})
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
_.displayName = "AvatarGroup";
|
|
137
|
+
//#endregion
|
|
138
|
+
export { _ as t };
|
package/dist/avatar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Avatar } from "./avatar-
|
|
2
|
+
export { t as Avatar } from "./avatar-CaGJHy1N.js";
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as r } from "./renderable-DzcIj1Lo.js";
|
|
5
|
+
import { vars as i } from "@jfrader/tokens/vars";
|
|
6
|
+
import { jsx as a, jsxs as o } from "@emotion/react/jsx-runtime";
|
|
7
|
+
//#region src/components/badge/badge.tsx
|
|
8
|
+
var s = 99, c = e({
|
|
9
|
+
position: "relative",
|
|
10
|
+
display: "inline-flex",
|
|
11
|
+
flexShrink: 0,
|
|
12
|
+
verticalAlign: "middle"
|
|
13
|
+
}), l = e({
|
|
14
|
+
position: "absolute",
|
|
15
|
+
display: "flex",
|
|
16
|
+
alignItems: "center",
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
boxSizing: "border-box",
|
|
19
|
+
boxShadow: `0 0 0 2px ${i.color.bg}`,
|
|
20
|
+
fontWeight: i.fontWeight.medium,
|
|
21
|
+
lineHeight: 1,
|
|
22
|
+
whiteSpace: "nowrap",
|
|
23
|
+
pointerEvents: "none",
|
|
24
|
+
[n]: {
|
|
25
|
+
outline: "1px solid CanvasText",
|
|
26
|
+
backgroundColor: "Canvas"
|
|
27
|
+
}
|
|
28
|
+
}), u = {
|
|
29
|
+
standard: e({
|
|
30
|
+
blockSize: i.space[5],
|
|
31
|
+
minInlineSize: i.space[5],
|
|
32
|
+
paddingInline: i.space[1],
|
|
33
|
+
fontSize: i.textSize.xs
|
|
34
|
+
}),
|
|
35
|
+
dot: e({
|
|
36
|
+
blockSize: i.space[2],
|
|
37
|
+
inlineSize: i.space[2],
|
|
38
|
+
borderRadius: i.radius.full,
|
|
39
|
+
[n]: {
|
|
40
|
+
backgroundColor: "CanvasText",
|
|
41
|
+
forcedColorAdjust: "none",
|
|
42
|
+
outline: "none"
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
}, d = {
|
|
46
|
+
rectangular: e({ borderRadius: i.radius.sm }),
|
|
47
|
+
circular: e({ borderRadius: i.radius.full })
|
|
48
|
+
}, f = {
|
|
49
|
+
"top-start": e({
|
|
50
|
+
insetBlockStart: 0,
|
|
51
|
+
insetInlineStart: 0,
|
|
52
|
+
transform: "translate(-50%, -50%)",
|
|
53
|
+
"&:dir(rtl)": { transform: "translate(50%, -50%)" }
|
|
54
|
+
}),
|
|
55
|
+
"top-end": e({
|
|
56
|
+
insetBlockStart: 0,
|
|
57
|
+
insetInlineEnd: 0,
|
|
58
|
+
transform: "translate(50%, -50%)",
|
|
59
|
+
"&:dir(rtl)": { transform: "translate(-50%, -50%)" }
|
|
60
|
+
}),
|
|
61
|
+
"bottom-start": e({
|
|
62
|
+
insetBlockEnd: 0,
|
|
63
|
+
insetInlineStart: 0,
|
|
64
|
+
transform: "translate(-50%, 50%)",
|
|
65
|
+
"&:dir(rtl)": { transform: "translate(50%, 50%)" }
|
|
66
|
+
}),
|
|
67
|
+
"bottom-end": e({
|
|
68
|
+
insetBlockEnd: 0,
|
|
69
|
+
insetInlineEnd: 0,
|
|
70
|
+
transform: "translate(50%, 50%)",
|
|
71
|
+
"&:dir(rtl)": { transform: "translate(-50%, 50%)" }
|
|
72
|
+
})
|
|
73
|
+
}, p = {
|
|
74
|
+
accent: e({
|
|
75
|
+
backgroundColor: i.color.accent,
|
|
76
|
+
color: i.color.accentContrast
|
|
77
|
+
}),
|
|
78
|
+
danger: e({
|
|
79
|
+
backgroundColor: i.color.danger,
|
|
80
|
+
color: i.color.dangerContrast
|
|
81
|
+
}),
|
|
82
|
+
neutral: e({
|
|
83
|
+
backgroundColor: i.color.textMuted,
|
|
84
|
+
color: i.color.bg
|
|
85
|
+
})
|
|
86
|
+
};
|
|
87
|
+
function m({ ref: e, children: n, badgeContent: i, max: m = s, showZero: h = !1, invisible: g = !1, variant: _ = "standard", tone: v = "accent", anchor: y, overlap: b = "rectangular", slotProps: x, className: S, sx: C, ...w }) {
|
|
88
|
+
let T = _ === "dot", E = g || _ !== "dot" && (!r(i) || i === 0 && !h), D = typeof i == "number" && i > m ? `${m}+` : i, O = `${y?.vertical ?? "top"}-${y?.horizontal ?? "end"}`, k = [S, x?.root?.className].filter(Boolean).join(" ") || void 0;
|
|
89
|
+
return /* @__PURE__ */ a(t, {
|
|
90
|
+
className: k,
|
|
91
|
+
styles: [c, x?.root?.css],
|
|
92
|
+
sx: C,
|
|
93
|
+
children: (t) => /* @__PURE__ */ o("span", {
|
|
94
|
+
...w,
|
|
95
|
+
ref: e,
|
|
96
|
+
"data-ui": "badge",
|
|
97
|
+
className: t,
|
|
98
|
+
children: [n, !E && /* @__PURE__ */ a("span", {
|
|
99
|
+
"data-ui": "badge-marker",
|
|
100
|
+
"data-variant": _,
|
|
101
|
+
"data-tone": v,
|
|
102
|
+
"aria-hidden": T ? "true" : void 0,
|
|
103
|
+
className: x?.badge?.className,
|
|
104
|
+
css: [
|
|
105
|
+
l,
|
|
106
|
+
u[_],
|
|
107
|
+
!T && d[b],
|
|
108
|
+
f[O],
|
|
109
|
+
p[v],
|
|
110
|
+
x?.badge?.css
|
|
111
|
+
],
|
|
112
|
+
children: T ? null : D
|
|
113
|
+
})]
|
|
114
|
+
})
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
m.displayName = "Badge";
|
|
118
|
+
//#endregion
|
|
119
|
+
export { m as t };
|
package/dist/badge.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Badge } from "./badge-
|
|
2
|
+
export { t as Badge } from "./badge-CjM5Agqk.js";
|