@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,308 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as ee } from "./visually-hidden-BJdvqqvn.js";
|
|
6
|
+
import { a as te, c as a, d as o, f as ne, g as s, h as re, i as ie, l as ae, m as c, n as l, o as oe, p as se, r as u, s as ce, t as d, u as le } from "./use-slider-interaction-ChL-208h.js";
|
|
7
|
+
import { useState as ue } from "react";
|
|
8
|
+
import { vars as f } from "@jfrader/tokens/vars";
|
|
9
|
+
import { createElement as p } from "@emotion/react";
|
|
10
|
+
import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
|
|
11
|
+
import { MotionConfig as g, motion as _, useReducedMotion as de } from "motion/react";
|
|
12
|
+
//#region src/components/slider/slider.tsx
|
|
13
|
+
var fe = {
|
|
14
|
+
type: "spring",
|
|
15
|
+
stiffness: 420,
|
|
16
|
+
damping: 30
|
|
17
|
+
}, pe = 8, me = e(c, { label: "slider" }), he = e({
|
|
18
|
+
position: "absolute",
|
|
19
|
+
insetInline: 0,
|
|
20
|
+
insetBlockStart: "50%",
|
|
21
|
+
transform: "translateY(-50%)",
|
|
22
|
+
blockSize: f.space[1],
|
|
23
|
+
boxSizing: "border-box",
|
|
24
|
+
border: `1px solid ${f.color.borderControl}`,
|
|
25
|
+
borderRadius: f.radius.full,
|
|
26
|
+
background: f.color.surfaceInset,
|
|
27
|
+
pointerEvents: "none",
|
|
28
|
+
[r]: {
|
|
29
|
+
forcedColorAdjust: "none",
|
|
30
|
+
background: "Canvas",
|
|
31
|
+
borderColor: "CanvasText"
|
|
32
|
+
}
|
|
33
|
+
}), ge = e({
|
|
34
|
+
position: "absolute",
|
|
35
|
+
insetBlock: 0,
|
|
36
|
+
background: f.color.accent,
|
|
37
|
+
borderRadius: f.radius.full,
|
|
38
|
+
[r]: { background: "Highlight" }
|
|
39
|
+
}), _e = e({
|
|
40
|
+
position: "absolute",
|
|
41
|
+
insetBlockStart: "50%",
|
|
42
|
+
transform: "translate(-50%, -50%)",
|
|
43
|
+
"&:dir(rtl)": { transform: "translate(50%, -50%)" },
|
|
44
|
+
inlineSize: f.space[8],
|
|
45
|
+
blockSize: f.space[8],
|
|
46
|
+
display: "grid",
|
|
47
|
+
placeItems: "center",
|
|
48
|
+
borderRadius: f.radius.full,
|
|
49
|
+
cursor: "grab",
|
|
50
|
+
"&:focus-visible": {
|
|
51
|
+
...n,
|
|
52
|
+
zIndex: 2
|
|
53
|
+
},
|
|
54
|
+
"&[data-dragging]": {
|
|
55
|
+
cursor: "grabbing",
|
|
56
|
+
zIndex: 3
|
|
57
|
+
},
|
|
58
|
+
"&[aria-disabled=\"true\"]": { cursor: "default" }
|
|
59
|
+
}), ve = e({
|
|
60
|
+
inlineSize: f.space[6],
|
|
61
|
+
blockSize: f.space[6],
|
|
62
|
+
boxSizing: "border-box",
|
|
63
|
+
border: `2px solid ${f.color.borderControl}`,
|
|
64
|
+
borderRadius: f.radius.full,
|
|
65
|
+
background: f.color.surfaceRaised,
|
|
66
|
+
boxShadow: f.shadow.raised,
|
|
67
|
+
pointerEvents: "none",
|
|
68
|
+
[r]: {
|
|
69
|
+
forcedColorAdjust: "none",
|
|
70
|
+
background: "Canvas",
|
|
71
|
+
borderColor: "CanvasText",
|
|
72
|
+
boxShadow: "none"
|
|
73
|
+
}
|
|
74
|
+
}), ye = e({
|
|
75
|
+
position: "absolute",
|
|
76
|
+
insetBlockEnd: `calc(100% + ${f.space[2]})`,
|
|
77
|
+
paddingInline: f.space[2],
|
|
78
|
+
paddingBlock: f.space[1],
|
|
79
|
+
inlineSize: "max-content",
|
|
80
|
+
maxInlineSize: "min(24rem, 80vw)",
|
|
81
|
+
overflowWrap: "anywhere",
|
|
82
|
+
border: `1px solid ${f.color.borderControl}`,
|
|
83
|
+
borderRadius: f.radius.md,
|
|
84
|
+
background: f.color.surfaceRaised,
|
|
85
|
+
color: f.color.text,
|
|
86
|
+
boxShadow: f.shadow.raised,
|
|
87
|
+
pointerEvents: "none",
|
|
88
|
+
fontSize: f.textSize.xs,
|
|
89
|
+
opacity: 0,
|
|
90
|
+
transition: `opacity ${f.motion.duration.fast} ${f.motion.easeStandard}`,
|
|
91
|
+
"[data-dragging] > &, [data-slider-thumb]:focus-visible > &": { opacity: 1 },
|
|
92
|
+
[i]: { transitionDuration: "0s" },
|
|
93
|
+
[r]: {
|
|
94
|
+
borderColor: "CanvasText",
|
|
95
|
+
boxShadow: "none"
|
|
96
|
+
}
|
|
97
|
+
}), be = e({
|
|
98
|
+
position: "absolute",
|
|
99
|
+
insetBlockStart: "50%",
|
|
100
|
+
transform: "translate(-50%, -50%)",
|
|
101
|
+
inlineSize: f.space[1],
|
|
102
|
+
blockSize: f.space[2],
|
|
103
|
+
border: `1px solid ${f.color.borderControl}`,
|
|
104
|
+
background: f.color.surfaceRaised,
|
|
105
|
+
boxSizing: "border-box",
|
|
106
|
+
pointerEvents: "none",
|
|
107
|
+
[r]: {
|
|
108
|
+
background: "Canvas",
|
|
109
|
+
borderColor: "CanvasText"
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
function v(e) {
|
|
113
|
+
let { ref: n, type: r = "single", value: i, defaultValue: c, label: f, description: v, error: y, invalid: b = !1, disabled: x = !1, min: S = 0, max: C = 100, step: w = 1, largeStep: T, minStepsBetweenThumbs: E = 0, marks: D = [], thumbLabels: O, locale: k, formatOptions: A, formatValue: j, showValue: M = !0, start: N, end: P, name: F, size: I = "md", slotProps: L, onValueChange: xe, onValueCommit: Se, className: Ce, sx: we, onKeyDown: Te, "aria-label": Ee, "aria-labelledby": De, "aria-describedby": Oe, "aria-invalid": ke, ...Ae } = e, R = r === "range", z = de(), [je, B] = ue(0), V = te({
|
|
114
|
+
component: "Slider",
|
|
115
|
+
range: R,
|
|
116
|
+
value: i,
|
|
117
|
+
defaultValue: c,
|
|
118
|
+
min: S,
|
|
119
|
+
max: C,
|
|
120
|
+
step: w,
|
|
121
|
+
largeStep: T,
|
|
122
|
+
minStepsBetweenThumbs: E,
|
|
123
|
+
disabled: x,
|
|
124
|
+
onValueChange: (t) => {
|
|
125
|
+
e.type, e.onValueChange?.(t);
|
|
126
|
+
},
|
|
127
|
+
onValueCommit: (t) => {
|
|
128
|
+
e.type, e.onValueCommit?.(t);
|
|
129
|
+
},
|
|
130
|
+
onPointerSample: ({ raw: e, low: t, high: n, rtl: r }) => B(z ? 0 : Math.max(-8, Math.min(pe, (e - Math.max(t, Math.min(n, e))) * (r ? -1 : 1)))),
|
|
131
|
+
onGestureEnd: () => B(0)
|
|
132
|
+
}), { id: H, current: U, values: W, active: G, bounds: Me, percent: K } = V, { formatter: q, format: J } = ie(k, A, j), Ne = typeof U == "number" ? J(U) : !j && "formatRange" in q ? q.formatRange(U[0], U[1]) : `${J(U[0])} – ${J(U[1])}`, Y = V.normalizeMarks(D), X = R ? K(W[0]) : 0, Pe = K(W[+!!R]), Z = d(f), Q = d(v), $ = d(y);
|
|
133
|
+
return /* @__PURE__ */ m(g, {
|
|
134
|
+
reducedMotion: "user",
|
|
135
|
+
children: /* @__PURE__ */ m(t, {
|
|
136
|
+
className: Ce,
|
|
137
|
+
styles: me,
|
|
138
|
+
sx: we,
|
|
139
|
+
children: (e) => /* @__PURE__ */ h("div", {
|
|
140
|
+
...Ae,
|
|
141
|
+
ref: n,
|
|
142
|
+
className: e,
|
|
143
|
+
"data-ui": "slider",
|
|
144
|
+
"data-disabled": x || void 0,
|
|
145
|
+
onKeyDown: (e) => {
|
|
146
|
+
Te?.(e), V.handleRootKeyDown(e);
|
|
147
|
+
},
|
|
148
|
+
children: [
|
|
149
|
+
(Z || M) && /* @__PURE__ */ h("div", {
|
|
150
|
+
css: ae,
|
|
151
|
+
children: [Z && /* @__PURE__ */ m("span", {
|
|
152
|
+
...L?.label,
|
|
153
|
+
id: `${H}-label`,
|
|
154
|
+
css: [le, L?.label?.css],
|
|
155
|
+
children: f
|
|
156
|
+
}), M && /* @__PURE__ */ m("span", {
|
|
157
|
+
...L?.readout,
|
|
158
|
+
"aria-hidden": "true",
|
|
159
|
+
css: [se, L?.readout?.css],
|
|
160
|
+
children: Ne
|
|
161
|
+
})]
|
|
162
|
+
}),
|
|
163
|
+
Q && /* @__PURE__ */ m("div", {
|
|
164
|
+
...L?.description,
|
|
165
|
+
id: `${H}-description`,
|
|
166
|
+
css: [ce, L?.description?.css],
|
|
167
|
+
children: v
|
|
168
|
+
}),
|
|
169
|
+
$ && /* @__PURE__ */ m("div", {
|
|
170
|
+
...L?.error,
|
|
171
|
+
id: `${H}-error`,
|
|
172
|
+
role: "alert",
|
|
173
|
+
css: [a, L?.error?.css],
|
|
174
|
+
children: y
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ h("div", {
|
|
177
|
+
css: re,
|
|
178
|
+
children: [
|
|
179
|
+
d(N) && /* @__PURE__ */ m("div", {
|
|
180
|
+
...L?.start,
|
|
181
|
+
children: N
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ h("div", {
|
|
184
|
+
...L?.control,
|
|
185
|
+
...V.controlHandlers(L?.control),
|
|
186
|
+
css: [
|
|
187
|
+
oe,
|
|
188
|
+
s[I],
|
|
189
|
+
L?.control?.css
|
|
190
|
+
],
|
|
191
|
+
"data-ui": "slider-control",
|
|
192
|
+
"data-disabled": x || void 0,
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ m("div", {
|
|
195
|
+
...L?.track,
|
|
196
|
+
"data-ui": "slider-track",
|
|
197
|
+
"aria-hidden": "true",
|
|
198
|
+
css: [he, L?.track?.css],
|
|
199
|
+
children: /* @__PURE__ */ m("div", {
|
|
200
|
+
...L?.fill,
|
|
201
|
+
"data-ui": "slider-fill",
|
|
202
|
+
css: [ge, L?.fill?.css],
|
|
203
|
+
style: {
|
|
204
|
+
...L?.fill?.style,
|
|
205
|
+
insetInlineStart: `${X}%`,
|
|
206
|
+
inlineSize: `${Pe - X}%`
|
|
207
|
+
}
|
|
208
|
+
})
|
|
209
|
+
}),
|
|
210
|
+
Y.map((e, t) => /* @__PURE__ */ m("span", {
|
|
211
|
+
"aria-hidden": "true",
|
|
212
|
+
css: be,
|
|
213
|
+
style: { insetInlineStart: `${K(e.value)}%` }
|
|
214
|
+
}, t)),
|
|
215
|
+
W.map((e, t) => {
|
|
216
|
+
let n = l(L?.thumb, t), [r, i] = Me(t);
|
|
217
|
+
return /* @__PURE__ */ p("div", {
|
|
218
|
+
...n,
|
|
219
|
+
key: t,
|
|
220
|
+
id: `${H}-thumb-${t}`,
|
|
221
|
+
"data-slider-thumb": t,
|
|
222
|
+
"data-dragging": G === t || void 0,
|
|
223
|
+
role: "slider",
|
|
224
|
+
tabIndex: x ? -1 : 0,
|
|
225
|
+
"aria-orientation": "horizontal",
|
|
226
|
+
"aria-disabled": x,
|
|
227
|
+
"aria-invalid": $ || b ? !0 : n?.["aria-invalid"] ?? ke,
|
|
228
|
+
"aria-valuemin": r,
|
|
229
|
+
"aria-valuemax": i,
|
|
230
|
+
"aria-valuenow": e,
|
|
231
|
+
"aria-valuetext": J(e),
|
|
232
|
+
"aria-label": n?.["aria-label"] ?? (R ? O?.[t] : Ee),
|
|
233
|
+
"aria-labelledby": u(De, n?.["aria-labelledby"], R ? `${H}-name-${t}` : Z && `${H}-label`),
|
|
234
|
+
"aria-describedby": u(Oe, n?.["aria-describedby"], Q && `${H}-description`, $ && `${H}-error`),
|
|
235
|
+
css: [_e, n?.css],
|
|
236
|
+
style: {
|
|
237
|
+
...n?.style,
|
|
238
|
+
insetInlineStart: `${K(e)}%`
|
|
239
|
+
},
|
|
240
|
+
onFocus: (e) => {
|
|
241
|
+
V.noteFocus(t), n?.onFocus?.(e);
|
|
242
|
+
},
|
|
243
|
+
onKeyDown: (e) => {
|
|
244
|
+
n?.onKeyDown?.(e);
|
|
245
|
+
}
|
|
246
|
+
}, /* @__PURE__ */ m(_.span, {
|
|
247
|
+
"aria-hidden": "true",
|
|
248
|
+
css: ve,
|
|
249
|
+
animate: {
|
|
250
|
+
scale: z ? 1 : G === t ? .95 : 1,
|
|
251
|
+
x: z ? 0 : G === t ? je : 0
|
|
252
|
+
},
|
|
253
|
+
transition: z ? { duration: 0 } : fe
|
|
254
|
+
}), R && /* @__PURE__ */ m("span", {
|
|
255
|
+
id: `${H}-name-${t}`,
|
|
256
|
+
css: ee,
|
|
257
|
+
children: O?.[t]
|
|
258
|
+
}), /* @__PURE__ */ m("span", {
|
|
259
|
+
...L?.bubble,
|
|
260
|
+
"data-ui": "slider-bubble",
|
|
261
|
+
"aria-hidden": "true",
|
|
262
|
+
css: [ye, L?.bubble?.css],
|
|
263
|
+
style: {
|
|
264
|
+
...L?.bubble?.style,
|
|
265
|
+
...K(e) <= 50 ? { insetInlineStart: 0 } : { insetInlineEnd: 0 }
|
|
266
|
+
},
|
|
267
|
+
children: J(e)
|
|
268
|
+
}));
|
|
269
|
+
})
|
|
270
|
+
]
|
|
271
|
+
}),
|
|
272
|
+
d(P) && /* @__PURE__ */ m("div", {
|
|
273
|
+
...L?.end,
|
|
274
|
+
children: P
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
}),
|
|
278
|
+
Y.some((e) => d(e.label)) && /* @__PURE__ */ m("div", {
|
|
279
|
+
css: ne,
|
|
280
|
+
children: Y.map((e, t) => {
|
|
281
|
+
if (!d(e.label)) return null;
|
|
282
|
+
let n = l(L?.mark, t);
|
|
283
|
+
return /* @__PURE__ */ p("button", {
|
|
284
|
+
...n,
|
|
285
|
+
key: t,
|
|
286
|
+
type: "button",
|
|
287
|
+
disabled: x,
|
|
288
|
+
css: [o, n?.css],
|
|
289
|
+
onClick: (t) => {
|
|
290
|
+
n?.onClick?.(t), t.defaultPrevented || V.selectMark(e.value);
|
|
291
|
+
}
|
|
292
|
+
}, e.label);
|
|
293
|
+
})
|
|
294
|
+
}),
|
|
295
|
+
F !== void 0 && W.map((e, t) => /* @__PURE__ */ m("input", {
|
|
296
|
+
type: "hidden",
|
|
297
|
+
disabled: x,
|
|
298
|
+
name: typeof F == "string" ? F : F[t],
|
|
299
|
+
value: e
|
|
300
|
+
}, t))
|
|
301
|
+
]
|
|
302
|
+
})
|
|
303
|
+
})
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
v.displayName = "Slider";
|
|
307
|
+
//#endregion
|
|
308
|
+
export { v as t };
|
package/dist/slider.js
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
+
import { t as n } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as a } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
+
import { t as o } from "./visually-hidden-BJdvqqvn.js";
|
|
7
|
+
import { t as s } from "./renderable-DzcIj1Lo.js";
|
|
8
|
+
import { t as ee } from "./button-NLY0h6EJ.js";
|
|
9
|
+
import { t as c } from "./checkbox-DKSzExj2.js";
|
|
10
|
+
import { useEffect as te, useId as ne, useLayoutEffect as re, useMemo as l, useRef as u, useState as ie } from "react";
|
|
11
|
+
import { vars as d } from "@jfrader/tokens/vars";
|
|
12
|
+
import { jsx as f, jsxs as p } from "@emotion/react/jsx-runtime";
|
|
13
|
+
//#region src/components/sortable-data-table/sortable-data-table.tsx
|
|
14
|
+
var ae = {
|
|
15
|
+
empty: "No records",
|
|
16
|
+
missing: "—",
|
|
17
|
+
clear: "Clear selection",
|
|
18
|
+
scrollLabel: "Scrollable table",
|
|
19
|
+
sortButton: (e, t) => `${e}: sort ${t === "asc" ? "descending" : "ascending"}`,
|
|
20
|
+
sortStatus: (e, t) => `${e}, ${t === "asc" ? "ascending" : "descending"}`,
|
|
21
|
+
selectRow: (e) => `Select ${e}`,
|
|
22
|
+
selectAll: "Select all visible rows",
|
|
23
|
+
selectionStatus: (e, t, n, r) => `${r.visibleSelected} of ${r.visibleRows} visible selected; ${r.totalSelected} selected in total`
|
|
24
|
+
}, oe = e({
|
|
25
|
+
minInlineSize: 0,
|
|
26
|
+
maxInlineSize: "100%",
|
|
27
|
+
color: d.color.text,
|
|
28
|
+
backgroundColor: d.color.surface,
|
|
29
|
+
fontFamily: d.font.sans,
|
|
30
|
+
fontSize: d.textSize.sm,
|
|
31
|
+
lineHeight: d.lineHeight.base
|
|
32
|
+
}), se = e({
|
|
33
|
+
overflowX: "auto",
|
|
34
|
+
maxInlineSize: "100%",
|
|
35
|
+
border: `1px solid ${d.color.border}`,
|
|
36
|
+
borderRadius: d.radius.md,
|
|
37
|
+
"&:focus-visible": n
|
|
38
|
+
}), ce = e({
|
|
39
|
+
inlineSize: "100%",
|
|
40
|
+
borderCollapse: "separate",
|
|
41
|
+
borderSpacing: 0,
|
|
42
|
+
tableLayout: "auto"
|
|
43
|
+
}), le = e({
|
|
44
|
+
textAlign: "start",
|
|
45
|
+
padding: d.space[4],
|
|
46
|
+
fontWeight: d.fontWeight.medium
|
|
47
|
+
}), m = e({
|
|
48
|
+
paddingInline: d.space[3],
|
|
49
|
+
textAlign: "start",
|
|
50
|
+
verticalAlign: "middle",
|
|
51
|
+
overflowWrap: "anywhere",
|
|
52
|
+
borderBlockEnd: `1px solid ${d.color.borderSubtle}`,
|
|
53
|
+
"&[data-numeric]": {
|
|
54
|
+
textAlign: "end",
|
|
55
|
+
fontVariantNumeric: "tabular-nums",
|
|
56
|
+
"& button": { justifyContent: "flex-end" }
|
|
57
|
+
}
|
|
58
|
+
}), h = {
|
|
59
|
+
sm: e({ paddingBlock: d.space[2] }),
|
|
60
|
+
md: e({ paddingBlock: d.space[3] })
|
|
61
|
+
}, g = e({
|
|
62
|
+
position: "sticky",
|
|
63
|
+
insetBlockStart: 0,
|
|
64
|
+
zIndex: 1,
|
|
65
|
+
backgroundColor: d.color.surfaceRaised,
|
|
66
|
+
fontWeight: d.fontWeight.medium
|
|
67
|
+
}), ue = e({
|
|
68
|
+
display: "inline-flex",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
justifyContent: "space-between",
|
|
71
|
+
gap: d.space[2],
|
|
72
|
+
inlineSize: "100%",
|
|
73
|
+
minBlockSize: d.space[8],
|
|
74
|
+
minInlineSize: d.space[8],
|
|
75
|
+
paddingInline: d.space[2],
|
|
76
|
+
paddingBlock: d.space[1],
|
|
77
|
+
border: `1px solid ${d.color.borderControl}`,
|
|
78
|
+
borderRadius: d.radius.sm,
|
|
79
|
+
backgroundColor: "transparent",
|
|
80
|
+
color: "inherit",
|
|
81
|
+
font: "inherit",
|
|
82
|
+
textAlign: "inherit",
|
|
83
|
+
cursor: "pointer",
|
|
84
|
+
transitionProperty: "background-color, color",
|
|
85
|
+
transitionDuration: d.motion.duration.fast,
|
|
86
|
+
transitionTimingFunction: d.motion.easeStandard,
|
|
87
|
+
"&:hover": { backgroundColor: d.color.surfaceHover },
|
|
88
|
+
"&:focus-visible": n,
|
|
89
|
+
[i]: { transitionDuration: "0s" },
|
|
90
|
+
[r]: {
|
|
91
|
+
borderColor: "ButtonText",
|
|
92
|
+
color: "ButtonText"
|
|
93
|
+
}
|
|
94
|
+
}), de = e({
|
|
95
|
+
"&[data-selected]": { backgroundColor: d.color.accentSoft },
|
|
96
|
+
[r]: { "&[data-selected]": {
|
|
97
|
+
outline: "1px solid Highlight",
|
|
98
|
+
outlineOffset: "-1px"
|
|
99
|
+
} }
|
|
100
|
+
}), fe = e({
|
|
101
|
+
display: "flex",
|
|
102
|
+
flexWrap: "wrap",
|
|
103
|
+
alignItems: "center",
|
|
104
|
+
justifyContent: "space-between",
|
|
105
|
+
gap: d.space[3],
|
|
106
|
+
padding: d.space[3]
|
|
107
|
+
}), pe = e({
|
|
108
|
+
minBlockSize: d.space[8],
|
|
109
|
+
minInlineSize: d.space[8],
|
|
110
|
+
justifyContent: "center"
|
|
111
|
+
}), me = [], _ = (e) => e.sortable !== !1 && !!(e.accessor || e.compare), he = (e) => e.sortLabel ?? (typeof e.header == "string" ? e.header : ""), v = (e) => e == null || e === "" || typeof e == "number" && !Number.isFinite(e) || e instanceof Date && !Number.isFinite(e.getTime()), y = (e) => [...new Set(e)], ge = (e, t) => {
|
|
112
|
+
let n = new Set(t);
|
|
113
|
+
return e.length === n.size && e.every((e) => n.has(e));
|
|
114
|
+
};
|
|
115
|
+
function _e(e, t, n) {
|
|
116
|
+
return typeof e == "number" && typeof t == "number" ? e - t : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "string" && typeof t == "string" ? n.compare(e, t) : 0;
|
|
117
|
+
}
|
|
118
|
+
function b({ ref: e, rows: n, columns: r, getRowId: i, caption: d, captionHidden: b = !1, value: ve, defaultValue: ye = null, onValueChange: be, sortMode: x = "client", selectable: S = !1, getRowLabel: xe, selectedKeys: Se, defaultSelectedKeys: Ce = me, onSelectionChange: we, locale: C, dateFormatOptions: w, timeZone: T, messages: Te, empty: E, loading: Ee = !1, size: D = "md", tableRef: De, slotProps: O, className: Oe, sx: ke, ...k }) {
|
|
119
|
+
let A = {
|
|
120
|
+
...ae,
|
|
121
|
+
...Te
|
|
122
|
+
}, Ae = ne(), [j, je] = a(ve, ye, be), [Me, Ne] = a(Se, Ce, we), M = y(Me ?? me), N = new Set(M), P = r.find((e) => e.id === j?.columnId && _(e)), F = P && j ? j : null, I = l(() => new Intl.NumberFormat(C), [C]), Pe = l(() => new Intl.DateTimeFormat(C, {
|
|
123
|
+
...w,
|
|
124
|
+
...T ? { timeZone: T } : {}
|
|
125
|
+
}), [
|
|
126
|
+
C,
|
|
127
|
+
w,
|
|
128
|
+
T
|
|
129
|
+
]), L = l(() => new Intl.Collator(C, {
|
|
130
|
+
numeric: !0,
|
|
131
|
+
sensitivity: "base"
|
|
132
|
+
}), [C]), R = l(() => x === "manual" || !F || !P ? n : n.map((e, t) => ({
|
|
133
|
+
row: e,
|
|
134
|
+
index: t
|
|
135
|
+
})).sort((e, t) => {
|
|
136
|
+
let n = P.accessor?.(e.row), r = P.accessor?.(t.row);
|
|
137
|
+
if (P.accessor && (v(n) || v(r))) return Number(v(n)) - Number(v(r)) || e.index - t.index;
|
|
138
|
+
let i = P.compare ? P.compare(e.row, t.row) : _e(n, r, L);
|
|
139
|
+
return (Number.isFinite(i) ? i : 0) * (F.direction === "asc" ? 1 : -1) || e.index - t.index;
|
|
140
|
+
}).map(({ row: e }) => e), [
|
|
141
|
+
n,
|
|
142
|
+
F?.columnId,
|
|
143
|
+
F?.direction,
|
|
144
|
+
x,
|
|
145
|
+
P,
|
|
146
|
+
L
|
|
147
|
+
]), z = R.map(i), B = z.filter((e) => N.has(e)).length, V = z.length > 0 && B === z.length, Fe = B > 0 && !V, H = A.selectionStatus(B, M.length, z.length, {
|
|
148
|
+
visibleSelected: I.format(B),
|
|
149
|
+
totalSelected: I.format(M.length),
|
|
150
|
+
visibleRows: I.format(z.length)
|
|
151
|
+
}), U = u(null), W = u(null), G = u(null), K = u(!1), q = u(null), J = u(null), Y = u(null), X = F ? `${F.columnId}:${F.direction}` : "", Z = JSON.stringify([...M].sort()), Q = u({
|
|
152
|
+
sort: X,
|
|
153
|
+
selection: Z
|
|
154
|
+
}), [Ie, Le] = ie("");
|
|
155
|
+
te(() => {
|
|
156
|
+
let e = Q.current.sort !== X || Q.current.selection !== Z, t = [];
|
|
157
|
+
Q.current.sort !== X && F && P && t.push(A.sortStatus(he(P), F.direction)), Q.current.selection !== Z && S && t.push(H), Q.current = {
|
|
158
|
+
sort: X,
|
|
159
|
+
selection: Z
|
|
160
|
+
}, e && Le(t.join(". "));
|
|
161
|
+
}, [
|
|
162
|
+
X,
|
|
163
|
+
Z,
|
|
164
|
+
S,
|
|
165
|
+
H,
|
|
166
|
+
P,
|
|
167
|
+
A.sortStatus,
|
|
168
|
+
F?.direction
|
|
169
|
+
]), re(() => {
|
|
170
|
+
if (K.current && M.length === 0) {
|
|
171
|
+
K.current = !1;
|
|
172
|
+
let e = W.current?.ownerDocument;
|
|
173
|
+
e?.activeElement === e?.body && W.current?.focus();
|
|
174
|
+
}
|
|
175
|
+
let e = q.current;
|
|
176
|
+
if (!e) return;
|
|
177
|
+
let t = z.indexOf(e.key);
|
|
178
|
+
if (t >= 0) {
|
|
179
|
+
e.index = t;
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
let n = J.current;
|
|
183
|
+
if (n && n.ownerDocument.activeElement === n.ownerDocument.body) {
|
|
184
|
+
let t = n.rows[Math.min(e.index, n.rows.length - 1)]?.querySelectorAll("input, button, a[href], select, textarea, [tabindex=\"0\"]");
|
|
185
|
+
(t?.[Math.min(e.control, t.length - 1)] ?? W.current ?? Y.current)?.focus();
|
|
186
|
+
}
|
|
187
|
+
q.current = null;
|
|
188
|
+
});
|
|
189
|
+
let Re = (e) => {
|
|
190
|
+
let t = y(e);
|
|
191
|
+
ge(M, t) || Ne(t);
|
|
192
|
+
}, $ = (e, t) => Re(t ? [...M, ...e] : M.filter((t) => !e.includes(t))), ze = (e, t) => {
|
|
193
|
+
if (e.cell) return e.cell(t);
|
|
194
|
+
let n = e.accessor?.(t);
|
|
195
|
+
return v(n) ? A.missing : typeof n == "number" ? I.format(n) : n instanceof Date ? Pe.format(n) : n;
|
|
196
|
+
}, Be = (e, t) => /* @__PURE__ */ f(c, {
|
|
197
|
+
"aria-label": A.selectRow(xe(e)),
|
|
198
|
+
checked: N.has(t),
|
|
199
|
+
slotProps: { root: { css: pe } },
|
|
200
|
+
onChange: (e) => {
|
|
201
|
+
if (e.defaultPrevented || e.nativeEvent.defaultPrevented) return;
|
|
202
|
+
let n = e.nativeEvent, r = U.current === null ? -1 : z.indexOf(U.current), i = z.indexOf(t), a = n.shiftKey && r >= 0 ? z.slice(Math.min(r, i), Math.max(r, i) + 1) : [t];
|
|
203
|
+
$(a, e.currentTarget.checked), U.current = t;
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
return /* @__PURE__ */ f(t, {
|
|
207
|
+
className: Oe,
|
|
208
|
+
styles: [oe],
|
|
209
|
+
sx: ke,
|
|
210
|
+
children: (t) => /* @__PURE__ */ p("div", {
|
|
211
|
+
...k,
|
|
212
|
+
ref: e,
|
|
213
|
+
className: t,
|
|
214
|
+
"data-ui": "sortable-data-table",
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ f("div", {
|
|
217
|
+
ref: Y,
|
|
218
|
+
role: "region",
|
|
219
|
+
"aria-label": A.scrollLabel,
|
|
220
|
+
"aria-describedby": k["aria-describedby"],
|
|
221
|
+
tabIndex: 0,
|
|
222
|
+
"data-ui": "sortable-data-table-scroller",
|
|
223
|
+
className: O?.scroller?.className,
|
|
224
|
+
css: [se, O?.scroller?.css],
|
|
225
|
+
children: /* @__PURE__ */ p("table", {
|
|
226
|
+
ref: De,
|
|
227
|
+
"aria-busy": Ee || void 0,
|
|
228
|
+
className: O?.table?.className,
|
|
229
|
+
css: [ce, O?.table?.css],
|
|
230
|
+
children: [
|
|
231
|
+
s(d) && /* @__PURE__ */ f("caption", {
|
|
232
|
+
id: Ae,
|
|
233
|
+
className: O?.caption?.className,
|
|
234
|
+
css: [
|
|
235
|
+
le,
|
|
236
|
+
b && o,
|
|
237
|
+
O?.caption?.css
|
|
238
|
+
],
|
|
239
|
+
children: d
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ p("colgroup", { children: [S && /* @__PURE__ */ f("col", {}), r.map((e) => /* @__PURE__ */ f("col", { style: { width: e.width } }, e.id))] }),
|
|
242
|
+
/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [S && /* @__PURE__ */ f("th", {
|
|
243
|
+
scope: "col",
|
|
244
|
+
css: [
|
|
245
|
+
m,
|
|
246
|
+
h[D],
|
|
247
|
+
g
|
|
248
|
+
],
|
|
249
|
+
children: /* @__PURE__ */ f(c, {
|
|
250
|
+
ref: W,
|
|
251
|
+
"aria-label": A.selectAll,
|
|
252
|
+
checked: V,
|
|
253
|
+
indeterminate: Fe,
|
|
254
|
+
disabled: !z.length,
|
|
255
|
+
slotProps: { root: { css: pe } },
|
|
256
|
+
onChange: (e) => {
|
|
257
|
+
!e.defaultPrevented && !e.nativeEvent.defaultPrevented && $(z, e.currentTarget.checked);
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
}), r.map((e) => /* @__PURE__ */ f("th", {
|
|
261
|
+
scope: "col",
|
|
262
|
+
"data-numeric": e.numeric || void 0,
|
|
263
|
+
"aria-sort": F?.columnId === e.id ? F.direction === "asc" ? "ascending" : "descending" : void 0,
|
|
264
|
+
className: O?.headerCell?.className,
|
|
265
|
+
css: [
|
|
266
|
+
m,
|
|
267
|
+
h[D],
|
|
268
|
+
g,
|
|
269
|
+
O?.headerCell?.css
|
|
270
|
+
],
|
|
271
|
+
children: _(e) ? /* @__PURE__ */ p("button", {
|
|
272
|
+
type: "button",
|
|
273
|
+
"aria-label": A.sortButton(he(e), F?.columnId === e.id ? F.direction : null),
|
|
274
|
+
className: O?.sortButton?.className,
|
|
275
|
+
css: [ue, O?.sortButton?.css],
|
|
276
|
+
onClick: (t) => {
|
|
277
|
+
t.defaultPrevented || je({
|
|
278
|
+
columnId: e.id,
|
|
279
|
+
direction: F?.columnId === e.id && F.direction === "asc" ? "desc" : "asc"
|
|
280
|
+
});
|
|
281
|
+
},
|
|
282
|
+
children: [s(e.header) && e.header, /* @__PURE__ */ f("span", {
|
|
283
|
+
"aria-hidden": "true",
|
|
284
|
+
children: F?.columnId === e.id ? F.direction === "asc" ? "▲" : "▼" : "♢"
|
|
285
|
+
})]
|
|
286
|
+
}) : s(e.header) && e.header
|
|
287
|
+
}, e.id))] }) }),
|
|
288
|
+
/* @__PURE__ */ f("tbody", {
|
|
289
|
+
ref: J,
|
|
290
|
+
children: R.length ? R.map((e, t) => {
|
|
291
|
+
let n = i(e);
|
|
292
|
+
return /* @__PURE__ */ p("tr", {
|
|
293
|
+
"data-selected": S && N.has(n) || void 0,
|
|
294
|
+
className: O?.row?.className,
|
|
295
|
+
css: [de, O?.row?.css],
|
|
296
|
+
onFocusCapture: (e) => {
|
|
297
|
+
let r = Array.from(e.currentTarget.querySelectorAll("input, button, a[href], select, textarea, [tabindex=\"0\"]"));
|
|
298
|
+
q.current = {
|
|
299
|
+
key: n,
|
|
300
|
+
index: t,
|
|
301
|
+
control: r.indexOf(e.target)
|
|
302
|
+
};
|
|
303
|
+
},
|
|
304
|
+
onBlurCapture: (e) => {
|
|
305
|
+
e.relatedTarget && !J.current?.contains(e.relatedTarget) && (q.current = null);
|
|
306
|
+
},
|
|
307
|
+
children: [S && /* @__PURE__ */ f("td", {
|
|
308
|
+
css: [m, h[D]],
|
|
309
|
+
children: Be(e, n)
|
|
310
|
+
}), r.map((t) => /* @__PURE__ */ f("td", {
|
|
311
|
+
"data-numeric": t.numeric || void 0,
|
|
312
|
+
className: O?.cell?.className,
|
|
313
|
+
css: [
|
|
314
|
+
m,
|
|
315
|
+
h[D],
|
|
316
|
+
O?.cell?.css
|
|
317
|
+
],
|
|
318
|
+
children: ze(t, e)
|
|
319
|
+
}, t.id))]
|
|
320
|
+
}, n);
|
|
321
|
+
}) : /* @__PURE__ */ f("tr", { children: /* @__PURE__ */ f("td", {
|
|
322
|
+
colSpan: r.length + Number(S),
|
|
323
|
+
className: O?.cell?.className,
|
|
324
|
+
css: [
|
|
325
|
+
m,
|
|
326
|
+
h[D],
|
|
327
|
+
O?.cell?.css
|
|
328
|
+
],
|
|
329
|
+
children: E === void 0 ? A.empty : s(E) && E
|
|
330
|
+
}) })
|
|
331
|
+
})
|
|
332
|
+
]
|
|
333
|
+
})
|
|
334
|
+
}),
|
|
335
|
+
S && /* @__PURE__ */ p("div", {
|
|
336
|
+
className: O?.footer?.className,
|
|
337
|
+
css: [fe, O?.footer?.css],
|
|
338
|
+
children: [/* @__PURE__ */ f("span", { children: H }), M.length > 0 && /* @__PURE__ */ f(ee, {
|
|
339
|
+
ref: G,
|
|
340
|
+
size: "sm",
|
|
341
|
+
variant: "ghost",
|
|
342
|
+
onClick: (e) => {
|
|
343
|
+
e.defaultPrevented || (K.current = G.current?.ownerDocument.activeElement === G.current, Re([]));
|
|
344
|
+
},
|
|
345
|
+
onBlur: (e) => {
|
|
346
|
+
e.relatedTarget && (K.current = !1);
|
|
347
|
+
},
|
|
348
|
+
children: A.clear
|
|
349
|
+
})]
|
|
350
|
+
}),
|
|
351
|
+
/* @__PURE__ */ f("p", {
|
|
352
|
+
role: "status",
|
|
353
|
+
"aria-live": "polite",
|
|
354
|
+
"aria-atomic": "true",
|
|
355
|
+
className: O?.status?.className,
|
|
356
|
+
css: [o, O?.status?.css],
|
|
357
|
+
children: Ie
|
|
358
|
+
})
|
|
359
|
+
]
|
|
360
|
+
})
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
b.displayName = "SortableDataTable";
|
|
364
|
+
//#endregion
|
|
365
|
+
export { b as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { r as e, t } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { n } from "./media-
|
|
3
|
+
import { r as n } from "./media-8yrN85VT.js";
|
|
4
4
|
import { t as r } from "./visually-hidden-BJdvqqvn.js";
|
|
5
5
|
import { n as i, t as a } from "./loading-ring-B8-30Dl1.js";
|
|
6
6
|
import { vars as o } from "@jfrader/tokens/vars";
|
package/dist/spinner.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Spinner } from "./spinner-
|
|
2
|
+
export { t as Spinner } from "./spinner-DtxvDPdM.js";
|