@jfrader/ui 0.5.0 → 0.6.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/README.md +18 -1
- package/dist/accordion-D6myONB9.js +206 -0
- package/dist/accordion.js +1 -1
- package/dist/activity-rings-Uszvwqdl.js +528 -0
- package/dist/activity-rings.js +2 -0
- package/dist/{alert-DS_einpy.js → alert-Bhj-qSMs.js} +15 -14
- package/dist/alert.js +1 -1
- package/dist/{announcement-bar-B58xempt.js → announcement-bar-B5J33QUh.js} +132 -131
- package/dist/announcement-bar.js +1 -1
- package/dist/avatar-B6idYC59.js +146 -0
- package/dist/{avatar-group-DOQQuV51.js → avatar-group-DvP8mAE-.js} +10 -9
- package/dist/avatar-group.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/badge-CfhTcA-Z.js +120 -0
- package/dist/badge.js +1 -1
- package/dist/billing-toggle-CgC7yxxo.js +349 -0
- package/dist/billing-toggle.js +2 -0
- package/dist/{bottom-sheet-DPJBFkie.js → bottom-sheet-BFQKO0Wo.js} +287 -268
- package/dist/bottom-sheet.js +1 -1
- package/dist/{breadcrumbs-Cfw_hgt2.js → breadcrumbs-CG3akw-b.js} +28 -20
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-C92uYFJW.js → button-C6OV0C7J.js} +21 -20
- package/dist/button-group-B9wP2ddS.js +611 -0
- package/dist/button-group.js +2 -0
- package/dist/button.js +1 -1
- package/dist/calendar-Bg6D2sul.js +377 -0
- package/dist/calendar.js +1 -1
- package/dist/calendar.utils-azmB4Ej7.js +79 -0
- package/dist/card-C008OQCp.js +164 -0
- package/dist/card.js +1 -1
- package/dist/carousel-lTH4Foke.js +475 -0
- package/dist/carousel.js +1 -1
- package/dist/chat-thread-DVa17BRC.js +864 -0
- package/dist/chat-thread.js +2 -0
- package/dist/{checkbox-cFquiSdy.js → checkbox-CClE61GV.js} +23 -21
- package/dist/checkbox.js +1 -1
- package/dist/{chip-group-DTQd_M-G.js → chip-group-BZUX9KPF.js} +19 -17
- package/dist/chip-group.js +1 -1
- package/dist/{choice-control-5kJkLXgv.js → choice-control-BsWOZPc9.js} +1 -1
- package/dist/{code-block-ahnRi-g8.js → code-block-CYP89_6h.js} +99 -97
- package/dist/code-block.js +1 -1
- package/dist/{combobox-Bhzvu9ma.js → combobox-D2Oc-co7.js} +131 -125
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BrT1n9bb.js +394 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-BnUHxviq.js +772 -0
- package/dist/comment-thread.js +2 -0
- package/dist/{container-BOaSptJa.js → container-BxtwJSSD.js} +3 -2
- package/dist/container.js +1 -1
- package/dist/context-menu-I4i0LRpm.js +371 -0
- package/dist/context-menu.js +2 -0
- package/dist/{copy-button-ByiA6D3R.js → copy-button-C0p_qrgf.js} +4 -4
- package/dist/copy-button.js +1 -1
- package/dist/{countdown-Dp_TD1VP.js → countdown-EcpV6rXy.js} +18 -17
- package/dist/countdown.js +1 -1
- package/dist/css-BYJhdGh-.js +2 -0
- package/dist/{date-picker-5zKSSuFF.js → date-picker-D-bn-iHs.js} +15 -14
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-rXcZsI1Y.js +589 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/dialog-CR1xdkrC.js +222 -0
- package/dist/dialog.js +1 -1
- package/dist/{divider-DYoJf0I_.js → divider-zOJzkcHh.js} +23 -21
- package/dist/divider.js +1 -1
- package/dist/drawer-CceaEhCr.js +590 -0
- package/dist/drawer.js +1 -1
- package/dist/{empty-state-CDgrjPPf.js → empty-state-DO0ApylK.js} +2 -1
- package/dist/empty-state.js +1 -1
- package/dist/{expandable-card-C-qJcZ14.js → expandable-card-W97vjix9.js} +59 -51
- package/dist/expandable-card.js +1 -1
- package/dist/expanding-search-Bb2_YfNx.js +239 -0
- package/dist/expanding-search.js +2 -0
- package/dist/{field-anatomy-COVdNpf5.js → field-anatomy-BDIP42MI.js} +2 -1
- package/dist/file-dropzone-Bi5ikRIz.js +458 -0
- package/dist/file-dropzone.js +1 -1
- package/dist/{filter-toolbar-D5KEKTSe.js → filter-toolbar-QRnC4S_H.js} +36 -33
- package/dist/filter-toolbar.js +1 -1
- package/dist/{flex-Dh-_J5-U.js → flex-CS7eMRcK.js} +2 -2
- package/dist/flex.js +1 -1
- package/dist/{hold-to-confirm-DjB2EVjM.js → hold-to-confirm-CVBA0wNT.js} +18 -17
- package/dist/hold-to-confirm.js +1 -1
- package/dist/{hover-card-B-nrCIy2.js → hover-card-DN1EAlQA.js} +26 -25
- package/dist/hover-card.js +1 -1
- package/dist/{icon-wrapper-stN8sD7R.js → icon-wrapper-C-zMD0uL.js} +1 -1
- package/dist/{image-compare-ciuhPtQZ.js → image-compare-Ln2UUqTU.js} +20 -19
- package/dist/image-compare.js +1 -1
- package/dist/index.js +98 -78
- package/dist/{inline-edit-C0eeml65.js → inline-edit-D-pR2RPC.js} +22 -21
- package/dist/inline-edit.js +1 -1
- package/dist/{input-control-DmMuAuPS.js → input-control-B6HVBgwl.js} +1 -1
- package/dist/{json-viewer-BcySQfjZ.js → json-viewer-Dro3WrjS.js} +34 -29
- package/dist/json-viewer.js +1 -1
- package/dist/{kbd-C3ACoMoE.js → kbd-BI_9qzYr.js} +2 -1
- package/dist/kbd.js +1 -1
- package/dist/keycap-keyboard-Cdx-OAS1.js +311 -0
- package/dist/keycap-keyboard.js +2 -0
- package/dist/{layout-style-Cbd1Vilw.js → layout-style-BE0gSqrH.js} +1 -1
- package/dist/lightbox-gallery-D0YaSTut.js +777 -0
- package/dist/lightbox-gallery.js +2 -0
- package/dist/link-unfurl-CReyIjyy.js +695 -0
- package/dist/link-unfurl.js +2 -0
- package/dist/{listbox-style-WX-RASp1.js → listbox-style-DNOxAulu.js} +1 -1
- package/dist/{loading-ring-B8-30Dl1.js → loading-ring-D0lGrK8z.js} +1 -1
- package/dist/locale-switcher-CZF7XNYG.js +295 -0
- package/dist/locale-switcher.js +2 -0
- package/dist/mention-input-BjjAbJCf.js +600 -0
- package/dist/mention-input.js +1 -1
- package/dist/menu-CVzpsyXn.js +312 -0
- package/dist/menu.js +1 -1
- package/dist/{metric-card-Bh9K4fZs.js → metric-card-BnFssTXj.js} +12 -11
- package/dist/metric-card.js +1 -1
- package/dist/{multi-select-Pce_IYnz.js → multi-select-B3puEVo0.js} +78 -69
- package/dist/multi-select.js +1 -1
- package/dist/{navigation-sP5fiuQS.js → navigation-C_JD43gA.js} +56 -49
- package/dist/navigation.js +1 -1
- package/dist/next.js +65 -0
- package/dist/now-playing-DjVm1Phm.js +439 -0
- package/dist/now-playing.js +2 -0
- package/dist/{overlay-layer-SeUyyEPD.js → overlay-layer-qEbpEtb8.js} +16 -2
- package/dist/overlay-motion-Cr77ihn2.js +90 -0
- package/dist/{overlay-portal-C4JZFq2M.js → overlay-portal-C9igMHnC.js} +1 -1
- package/dist/{pagination-DmXZ8E85.js → pagination-Dkh4bJQh.js} +31 -29
- package/dist/pagination.js +1 -1
- package/dist/{password-field-03pWRkuY.js → password-field-Da58GP1g.js} +4 -4
- package/dist/password-field.js +1 -1
- package/dist/photo-grid-Dtl17D74.js +830 -0
- package/dist/photo-grid.js +2 -0
- package/dist/pill-Dd7pog19.js +59 -0
- package/dist/pill.js +1 -1
- package/dist/popover-CUMOcMtj.js +126 -0
- package/dist/popover.js +1 -1
- package/dist/presence-spring-4zwtUDQN.js +12 -0
- package/dist/{progress-CbOWBUdA.js → progress-Bcuz3Ob4.js} +12 -11
- package/dist/progress.js +1 -1
- package/dist/{radio-cards-D2QZENI_.js → radio-cards-FkAhESb5.js} +65 -63
- package/dist/radio-cards.js +1 -1
- package/dist/{radio-group-E6mMRgo7.js → radio-group-DItMf2YM.js} +32 -28
- package/dist/radio-group.js +1 -1
- package/dist/{resizable-panels-BhjUVXZZ.js → resizable-panels-61h9hA3B.js} +16 -14
- package/dist/resizable-panels.js +1 -1
- package/dist/{scroll-area-CcZyiSOQ.js → scroll-area-B8KkCPOM.js} +16 -15
- package/dist/scroll-area.js +1 -1
- package/dist/{search-field-IxF0IJXm.js → search-field-CbsajaZb.js} +94 -93
- package/dist/search-field.js +1 -1
- package/dist/{segmented-control-yO1K1nbi.js → segmented-control-DCh-4ca-.js} +28 -26
- package/dist/segmented-control.js +1 -1
- package/dist/{select-n_H52W1Z.js → select-SrcQqZjo.js} +29 -27
- package/dist/select.js +1 -1
- package/dist/sheet-stack-DYX1SGSB.js +820 -0
- package/dist/sheet-stack.js +2 -0
- package/dist/shortcut-recorder-VgTQdjjn.js +688 -0
- package/dist/shortcut-recorder.js +2 -0
- package/dist/signature-pad-khL2yhQI.js +646 -0
- package/dist/signature-pad.js +1 -1
- package/dist/{skeleton-XQQDkCHd.js → skeleton-LJsQsveI.js} +9 -8
- package/dist/skeleton.js +1 -1
- package/dist/slider-DjAnGmlC.js +535 -0
- package/dist/slider.js +1 -1
- package/dist/{sortable-data-table-tirqlLY2.js → sortable-data-table-Bpitup_d.js} +29 -28
- package/dist/sortable-data-table.js +1 -1
- package/dist/{spinner-DtxvDPdM.js → spinner-CvzajSg9.js} +11 -10
- package/dist/spinner.js +1 -1
- package/dist/{split-button-Cb3EHs64.js → split-button-Bu41f2AY.js} +88 -93
- package/dist/split-button.js +1 -1
- package/dist/{stack-DC3IbtWk.js → stack-Bac4sJeI.js} +2 -2
- package/dist/stack.js +1 -1
- package/dist/{stepper-CruHbXxX.js → stepper-C8Ncavbr.js} +22 -21
- package/dist/stepper.js +1 -1
- package/dist/stretch-refresh-OrnTEj7P.js +349 -0
- package/dist/stretch-refresh.js +2 -0
- package/dist/{surface-DZ4d-2aL.js → surface-C69kwSuk.js} +13 -3
- package/dist/{swipe-actions-DiZC57-3.js → swipe-actions-1H5UOZKE.js} +29 -26
- package/dist/swipe-actions.js +1 -1
- package/dist/switch-79-hkQqg.js +146 -0
- package/dist/switch.js +1 -1
- package/dist/sx-BJXJ2xJK.js +23 -0
- package/dist/tabs-Bb5-noYE.js +211 -0
- package/dist/tabs.js +1 -1
- package/dist/{tag-input-DSRCyrX2.js → tag-input-BQaueKEb.js} +5 -5
- package/dist/tag-input.js +1 -1
- package/dist/{text-field-C8TWG-tY.js → text-field-D0VP7b4P.js} +18 -16
- package/dist/text-field.js +1 -1
- package/dist/{textarea-BrW0XcG_.js → textarea-D1YwEPmn.js} +21 -19
- package/dist/textarea.js +1 -1
- package/dist/theme-provider-BvcY-iJu.js +20 -0
- package/dist/theme-root-BrYVcTzt.js +163 -0
- package/dist/theme-root.js +1 -1
- package/dist/theme-scope-DGWy4H0C.js +62 -0
- package/dist/theme-switch-CP42mVDb.js +167 -0
- package/dist/theme-switch.js +2 -0
- package/dist/thread-parts-DfZNz70v.js +683 -0
- package/dist/{time-picker-Db8D49cP.js → time-picker-Tnd-JBLC.js} +39 -32
- package/dist/time-picker.js +1 -1
- package/dist/{timeline-k3nURuCP.js → timeline-DaldDMX7.js} +28 -21
- package/dist/timeline.js +1 -1
- package/dist/{toast-BHxI32ZA.js → toast-CSAbl5yK.js} +107 -87
- package/dist/{toast-stack-DqrAzdg5.js → toast-stack-BCR4Cu7V.js} +25 -10
- package/dist/toast-stack.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-fcjzpifI.js → toggle-group-C7ye1v4s.js} +24 -23
- package/dist/toggle-group.js +1 -1
- package/dist/tooltip-IajLwdUb.js +129 -0
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-C2liIxqy.js → tree-view-CoW4oJIZ.js} +18 -13
- package/dist/tree-view.js +1 -1
- package/dist/{trigger-style-B1KVC8O1.js → trigger-style-CtOrdPk4.js} +1 -1
- package/dist/types/components/activity-rings/activity-rings.d.ts +115 -0
- package/dist/types/components/activity-rings/index.d.ts +2 -0
- package/dist/types/components/billing-toggle/billing-toggle.d.ts +57 -0
- package/dist/types/components/billing-toggle/index.d.ts +2 -0
- package/dist/types/components/button-group/button-group.d.ts +72 -0
- package/dist/types/components/button-group/index.d.ts +2 -0
- package/dist/types/components/card/card.d.ts +4 -1
- package/dist/types/components/chat-thread/chat-thread.d.ts +130 -0
- package/dist/types/components/chat-thread/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- 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/context-menu/context-menu.d.ts +55 -0
- package/dist/types/components/context-menu/index.d.ts +2 -0
- package/dist/types/components/date-range-picker/date-range-picker.d.ts +1 -1
- package/dist/types/components/drawer/drawer.d.ts +7 -1
- 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/keycap-keyboard/index.d.ts +2 -0
- package/dist/types/components/keycap-keyboard/keycap-keyboard.d.ts +32 -0
- package/dist/types/components/lightbox-gallery/index.d.ts +2 -0
- package/dist/types/components/lightbox-gallery/lightbox-gallery.d.ts +74 -0
- package/dist/types/components/link-unfurl/index.d.ts +2 -0
- package/dist/types/components/link-unfurl/link-unfurl.d.ts +94 -0
- package/dist/types/components/locale-switcher/index.d.ts +2 -0
- package/dist/types/components/locale-switcher/locale-switcher.d.ts +58 -0
- package/dist/types/components/menu/menu.d.ts +74 -7
- package/dist/types/components/next/emotion-registry.d.ts +16 -0
- package/dist/types/components/next/index.d.ts +2 -0
- package/dist/types/components/next/registry.d.ts +21 -0
- package/dist/types/components/now-playing/index.d.ts +1 -0
- package/dist/types/components/now-playing/now-playing.d.ts +88 -0
- package/dist/types/components/pagination/pagination.d.ts +1 -1
- package/dist/types/components/photo-grid/index.d.ts +2 -0
- package/dist/types/components/photo-grid/photo-grid.d.ts +82 -0
- package/dist/types/components/radio-cards/radio-cards.d.ts +1 -1
- package/dist/types/components/radio-group/radio-group.d.ts +1 -1
- package/dist/types/components/sheet-stack/index.d.ts +2 -0
- package/dist/types/components/sheet-stack/sheet-stack.d.ts +78 -0
- package/dist/types/components/shortcut-recorder/index.d.ts +2 -0
- package/dist/types/components/shortcut-recorder/shortcut-recorder.d.ts +117 -0
- package/dist/types/components/slider/slider-style.d.ts +14 -0
- package/dist/types/components/slider/slider.d.ts +2 -10
- package/dist/types/components/slider/use-slider-interaction.d.ts +79 -0
- package/dist/types/components/split-button/split-button.d.ts +2 -2
- package/dist/types/components/stretch-refresh/index.d.ts +1 -0
- package/dist/types/components/stretch-refresh/stretch-refresh.d.ts +49 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -1
- 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-root/index.d.ts +1 -0
- package/dist/types/components/theme-root/theme-root.d.ts +9 -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/thread/thread-core.d.ts +96 -0
- package/dist/types/components/thread/thread-parts.d.ts +119 -0
- package/dist/types/components/tooltip/tooltip.d.ts +9 -2
- package/dist/types/components/usage-meter/usage-meter.d.ts +2 -12
- package/dist/types/components/usage-meter/usage-model.d.ts +30 -0
- package/dist/types/components/user-menu/index.d.ts +2 -0
- package/dist/types/components/user-menu/user-menu.d.ts +119 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/overlay/exit-motion.d.ts +24 -0
- package/dist/types/overlay/overlay-layer.d.ts +20 -0
- package/dist/types/overlay/presence-spring.d.ts +12 -0
- package/dist/types/overlay/use-native-dialog.d.ts +10 -1
- package/dist/types/overlay/use-overlay-floating.d.ts +9 -2
- package/dist/types/styling/create-theme.d.ts +24 -0
- package/dist/types/styling/css.d.ts +1 -1
- package/dist/types/styling/overlay-motion.d.ts +95 -0
- package/dist/types/styling/surface.d.ts +7 -0
- package/dist/types/styling/theme-scope.d.ts +29 -3
- package/dist/types/styling/theme.d.ts +5 -0
- package/dist/{usage-meter-qyQ3rYVv.js → usage-meter-CYvlB6l3.js} +165 -175
- package/dist/usage-meter.js +1 -1
- package/dist/usage-model-C0fS47w4.js +32 -0
- package/dist/use-native-dialog-FB0p7lkg.js +93 -0
- package/dist/{use-overlay-floating-DvJifLpF.js → use-overlay-floating-Bx2jBKAA.js} +8 -6
- package/dist/use-scroll-lock-40gXwwAy.js +23 -0
- package/dist/user-menu-DzELTg1x.js +757 -0
- package/dist/user-menu.js +2 -0
- package/dist/{visually-hidden-BJdvqqvn.js → visually-hidden-DgVO3NaB.js} +1 -1
- package/package.json +88 -2
- package/dist/accordion-xCI_u0BV.js +0 -198
- package/dist/avatar-BahDVO9t.js +0 -132
- package/dist/badge-B_sLygxU.js +0 -108
- package/dist/calendar-B3Svu0X2.js +0 -447
- package/dist/card-D-aI2QHx.js +0 -158
- package/dist/carousel-IvPqN-oM.js +0 -472
- package/dist/command-palette-BQ5LleGb.js +0 -384
- package/dist/date-range-picker-B5uFWsm-.js +0 -562
- package/dist/dialog-ciiv9H2b.js +0 -218
- package/dist/drawer-DsASTiP-.js +0 -553
- package/dist/file-dropzone-pR4v7owg.js +0 -457
- package/dist/mention-input-BcQKX2EJ.js +0 -599
- package/dist/menu-xwOOUtWP.js +0 -275
- package/dist/pill-DO2gHzMb.js +0 -56
- package/dist/popover-QHcEvf9c.js +0 -119
- package/dist/signature-pad-q2SAsrdD.js +0 -640
- package/dist/slider-t0B5cecO.js +0 -477
- package/dist/switch-qwv8jQnR.js +0 -142
- package/dist/sx-Dx9JUKp5.js +0 -23
- package/dist/tabs-CAVJndX1.js +0 -203
- package/dist/theme-root-BbTBuLMQ.js +0 -46
- package/dist/theme-scope-t7nAKc2c.js +0 -27
- package/dist/tooltip-CkeiW9C1.js +0 -113
- package/dist/use-native-dialog-DWpIUVO1.js +0 -84
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { t } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as r } from "./sx-BJXJ2xJK.js";
|
|
6
|
+
import { t as i } from "./use-controlled-state-DpeVQZNR.js";
|
|
7
|
+
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
8
|
+
import { t as o } from "./button-C6OV0C7J.js";
|
|
9
|
+
import { useEffect as s, useId as ee, useLayoutEffect as te, useRef as c, useState as l } from "react";
|
|
10
|
+
import { vars as u } from "@jfrader/tokens/vars";
|
|
11
|
+
import { createElement as ne } from "@emotion/react";
|
|
12
|
+
import { jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
|
|
13
|
+
import { MotionConfig as re, animate as p, cubicBezier as m, motion as h, useMotionValue as g, useReducedMotion as ie } from "motion/react";
|
|
14
|
+
import { base as _ } from "@jfrader/tokens";
|
|
15
|
+
import { useMergeRefs as ae } from "@floating-ui/react";
|
|
16
|
+
//#region src/components/stretch-refresh/stretch-refresh.tsx
|
|
17
|
+
var v = 72, oe = 8, y = 2, se = {
|
|
18
|
+
type: "spring",
|
|
19
|
+
stiffness: 420,
|
|
20
|
+
damping: 40,
|
|
21
|
+
mass: 1
|
|
22
|
+
}, ce = Number.parseFloat(_.motion.duration.base) / 1e3, le = .85, b = _.motion.easeStandard.match(/[\d.]+/g).map(Number), ue = m(...b), de = {
|
|
23
|
+
refresh: "Refresh",
|
|
24
|
+
refreshing: "Refreshing",
|
|
25
|
+
pull: "Pull to refresh",
|
|
26
|
+
release: "Release to refresh",
|
|
27
|
+
done: "Updated",
|
|
28
|
+
error: "Could not refresh. Try again."
|
|
29
|
+
}, fe = "a[href],button,input,select,textarea,label,summary,[contenteditable]:not([contenteditable=\"false\"]),[role=\"button\"],[tabindex]", pe = e({
|
|
30
|
+
label: "stretch-refresh",
|
|
31
|
+
display: "flex",
|
|
32
|
+
flexDirection: "column",
|
|
33
|
+
minBlockSize: 0,
|
|
34
|
+
minInlineSize: 0,
|
|
35
|
+
fontFamily: u.font.sans,
|
|
36
|
+
lineHeight: u.lineHeight.base,
|
|
37
|
+
color: u.color.text,
|
|
38
|
+
background: u.color.surface,
|
|
39
|
+
border: `1px solid ${u.color.borderControl}`,
|
|
40
|
+
borderRadius: u.radius.md
|
|
41
|
+
}), me = e({
|
|
42
|
+
display: "flex",
|
|
43
|
+
flexWrap: "wrap",
|
|
44
|
+
alignItems: "center",
|
|
45
|
+
gap: u.space[3],
|
|
46
|
+
padding: u.space[4]
|
|
47
|
+
}), he = e({
|
|
48
|
+
flex: "1 1 auto",
|
|
49
|
+
margin: 0,
|
|
50
|
+
minInlineSize: 0,
|
|
51
|
+
overflowWrap: "anywhere",
|
|
52
|
+
fontSize: u.textSize.md,
|
|
53
|
+
fontWeight: u.fontWeight.semibold
|
|
54
|
+
}), ge = e({
|
|
55
|
+
flexBasis: "100%",
|
|
56
|
+
fontSize: u.textSize.sm,
|
|
57
|
+
color: u.color.textMuted,
|
|
58
|
+
overflowWrap: "anywhere"
|
|
59
|
+
}), _e = e({
|
|
60
|
+
minBlockSize: u.space[8],
|
|
61
|
+
blockSize: "auto",
|
|
62
|
+
paddingBlock: u.space[2],
|
|
63
|
+
whiteSpace: "normal",
|
|
64
|
+
overflowWrap: "anywhere",
|
|
65
|
+
maxInlineSize: "100%"
|
|
66
|
+
}), ve = e({
|
|
67
|
+
overflow: "auto",
|
|
68
|
+
flex: "1 1 auto",
|
|
69
|
+
minBlockSize: 0,
|
|
70
|
+
minInlineSize: 0,
|
|
71
|
+
padding: u.space[2],
|
|
72
|
+
overscrollBehaviorY: "contain",
|
|
73
|
+
"&:focus-visible": t
|
|
74
|
+
}), ye = e({
|
|
75
|
+
padding: u.space[2],
|
|
76
|
+
fontSize: u.textSize.sm,
|
|
77
|
+
color: u.color.accentText,
|
|
78
|
+
[n]: { color: "CanvasText" }
|
|
79
|
+
}), be = e({
|
|
80
|
+
display: "block",
|
|
81
|
+
marginBlockStart: u.space[1],
|
|
82
|
+
blockSize: u.space[1],
|
|
83
|
+
background: u.color.accentText,
|
|
84
|
+
transformOrigin: "center",
|
|
85
|
+
[n]: {
|
|
86
|
+
background: "CanvasText",
|
|
87
|
+
outline: "1px solid CanvasText"
|
|
88
|
+
}
|
|
89
|
+
}), xe = e({
|
|
90
|
+
listStyle: "none",
|
|
91
|
+
padding: 0,
|
|
92
|
+
margin: 0
|
|
93
|
+
}), Se = e({
|
|
94
|
+
padding: u.space[3],
|
|
95
|
+
overflowWrap: "anywhere",
|
|
96
|
+
borderBlockEnd: `1px solid ${u.color.borderControl}`,
|
|
97
|
+
"& :is(button,a,input,select,textarea):focus-visible": t
|
|
98
|
+
}), Ce = e({
|
|
99
|
+
paddingInline: u.space[4],
|
|
100
|
+
paddingBlock: u.space[2],
|
|
101
|
+
fontSize: u.textSize.sm,
|
|
102
|
+
overflowWrap: "anywhere"
|
|
103
|
+
}), we = e({
|
|
104
|
+
padding: u.space[4],
|
|
105
|
+
color: u.color.textMuted
|
|
106
|
+
}), x = (...e) => e.filter(Boolean).join(" ") || void 0;
|
|
107
|
+
function S({ title: e, headingLevel: t = 2, subtitle: n, items: u, getKey: m, renderItem: _, onRefresh: b, refreshing: S, defaultRefreshing: Te = !1, onRefreshingChange: C, disabled: w = !1, threshold: T = v, emptyContent: E, labels: Ee, slotProps: D, ref: De, className: Oe, sx: ke, onKeyDown: Ae, ...je }) {
|
|
108
|
+
let O = ee(), Me = `h${t}`, k = {
|
|
109
|
+
...de,
|
|
110
|
+
...Ee
|
|
111
|
+
}, A = Number.isFinite(T) && T > 0 ? T : v, [j = !1, M] = i(S, Te, C), [N, P] = l(null), [F, I] = l(0), L = c(null), Ne = ae([L, D?.feed?.ref]), R = c(null), z = c(!1), B = c(!1), V = c(!1), H = c(void 0), U = g(0), W = g(0), G = g(1), K = ie(), q = () => {
|
|
112
|
+
!B.current && z.current && (V.current = !1, H.current !== void 0 && (L.current?.ownerDocument.defaultView?.cancelAnimationFrame(H.current), H.current = void 0), B.current = !0, P(null), Promise.resolve().then(b).then((e) => J({
|
|
113
|
+
phase: "done",
|
|
114
|
+
message: e ?? k.done
|
|
115
|
+
}), () => J({
|
|
116
|
+
phase: "error",
|
|
117
|
+
message: k.error
|
|
118
|
+
})));
|
|
119
|
+
}, J = (e) => {
|
|
120
|
+
z.current && (B.current = !1, P(e), S === void 0 ? M(!1) : C?.(!1));
|
|
121
|
+
}, Y = () => {
|
|
122
|
+
if (!(w || j || B.current || V.current)) {
|
|
123
|
+
if (V.current = !0, S === void 0) M(!0), q();
|
|
124
|
+
else {
|
|
125
|
+
let e = L.current?.ownerDocument.defaultView;
|
|
126
|
+
H.current = e?.requestAnimationFrame(() => {
|
|
127
|
+
V.current = !1, H.current = void 0;
|
|
128
|
+
}), M(!0);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
te(() => {
|
|
133
|
+
w && (V.current = !1), V.current && j && !w && q();
|
|
134
|
+
}, [j, w]);
|
|
135
|
+
let X = (e) => {
|
|
136
|
+
let t = R.current;
|
|
137
|
+
if (t) {
|
|
138
|
+
R.current = null, t.cleanup(), t.node.hasPointerCapture(t.pointer) && t.node.releasePointerCapture(t.pointer), I(0);
|
|
139
|
+
for (let e of [U, W]) K || t.node.ownerDocument.hidden ? e.jump(0) : p(e, 0, se);
|
|
140
|
+
e && t.locked && t.distance >= A && Y();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
s(() => {
|
|
144
|
+
z.current = !0;
|
|
145
|
+
let e = L.current?.ownerDocument.defaultView;
|
|
146
|
+
return () => {
|
|
147
|
+
z.current = !1, V.current = !1, R.current?.cleanup(), R.current = null, H.current !== void 0 && e?.cancelAnimationFrame(H.current), U.stop(), W.stop();
|
|
148
|
+
};
|
|
149
|
+
}, [U, W]), s(() => {
|
|
150
|
+
K && (U.jump(0), W.jump(0));
|
|
151
|
+
}, [
|
|
152
|
+
K,
|
|
153
|
+
U,
|
|
154
|
+
W
|
|
155
|
+
]), s(() => {
|
|
156
|
+
if (!N || K || L.current?.ownerDocument.hidden) {
|
|
157
|
+
G.jump(1);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
let e = p(G, [le, 1], {
|
|
161
|
+
duration: ce,
|
|
162
|
+
ease: ue
|
|
163
|
+
});
|
|
164
|
+
return () => e.stop();
|
|
165
|
+
}, [
|
|
166
|
+
N,
|
|
167
|
+
K,
|
|
168
|
+
G
|
|
169
|
+
]), s(() => {
|
|
170
|
+
(w || j) && X(!1);
|
|
171
|
+
}, [w, j]), s(() => {
|
|
172
|
+
let e = L.current?.ownerDocument, t = () => {
|
|
173
|
+
e?.hidden && (X(!1), U.jump(0), W.jump(0), G.jump(1));
|
|
174
|
+
};
|
|
175
|
+
return e?.addEventListener("visibilitychange", t), () => e?.removeEventListener("visibilitychange", t);
|
|
176
|
+
}, [
|
|
177
|
+
U,
|
|
178
|
+
W,
|
|
179
|
+
G
|
|
180
|
+
]), s(() => {
|
|
181
|
+
if (process.env.NODE_ENV === "production") return;
|
|
182
|
+
let e = u.map(m);
|
|
183
|
+
new Set(e).size !== e.length && console.warn("StretchRefresh: getKey must return unique keys.");
|
|
184
|
+
}, [u, m]);
|
|
185
|
+
let Z = (e, t, n) => {
|
|
186
|
+
let r = R.current;
|
|
187
|
+
if (!r) return;
|
|
188
|
+
let i = e - r.x, a = t - r.y;
|
|
189
|
+
if (!r.locked) {
|
|
190
|
+
if (Math.max(Math.abs(i), Math.abs(a)) < oe) return;
|
|
191
|
+
if (a <= 0 || Math.abs(i) > a || r.node.scrollTop > 0) {
|
|
192
|
+
X(!1);
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
r.locked = !0, r.touch || r.node.setPointerCapture(r.pointer);
|
|
196
|
+
}
|
|
197
|
+
n(), r.distance = y * A * (1 - Math.exp(-Math.max(0, a) / (y * A))), I(r.distance), U.stop(), U.set(K ? 0 : r.distance), W.stop(), W.set(K ? 0 : Math.min(1, r.distance / A));
|
|
198
|
+
}, Pe = (e) => {
|
|
199
|
+
let t = e.currentTarget, n = e.target.closest(fe);
|
|
200
|
+
if (e.defaultPrevented || w || j || B.current || V.current || R.current || !e.isPrimary || e.button !== 0 || t.scrollTop > 0 || n && n !== t || t.ownerDocument.getSelection()?.toString()) return;
|
|
201
|
+
let r = t.ownerDocument, i = (e) => {
|
|
202
|
+
R.current?.pointer === e.pointerId && !t.contains(e.target) && X(!1);
|
|
203
|
+
}, a = (e) => {
|
|
204
|
+
if (e.touches.length !== 1) {
|
|
205
|
+
X(!1);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
let t = e.touches[0];
|
|
209
|
+
t && !e.defaultPrevented && Z(t.clientX, t.clientY, () => e.preventDefault());
|
|
210
|
+
}, o = (e) => X(e.type === "touchend" && !e.defaultPrevented);
|
|
211
|
+
r.addEventListener("pointerup", i, !0), r.addEventListener("pointercancel", i, !0), e.pointerType === "touch" && (t.addEventListener("touchmove", a, { passive: !1 }), r.addEventListener("touchend", o), r.addEventListener("touchcancel", o)), R.current = {
|
|
212
|
+
pointer: e.pointerId,
|
|
213
|
+
touch: e.pointerType === "touch",
|
|
214
|
+
x: e.clientX,
|
|
215
|
+
y: e.clientY,
|
|
216
|
+
distance: 0,
|
|
217
|
+
locked: !1,
|
|
218
|
+
node: t,
|
|
219
|
+
cleanup: () => {
|
|
220
|
+
r.removeEventListener("pointerup", i, !0), r.removeEventListener("pointercancel", i, !0), t.removeEventListener("touchmove", a), r.removeEventListener("touchend", o), r.removeEventListener("touchcancel", o);
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}, Fe = j ? "refreshing" : F >= A ? "armed" : F > 0 ? "pulling" : N?.phase ?? "idle", Ie = j ? k.refreshing : Fe === "armed" ? k.release : k.pull, Le = a(n) && n !== "", Re = D?.title?.id ?? `${O}-title`, Q = D?.subtitle?.id ?? `${O}-subtitle`, $ = D?.feed, ze = $?.["aria-labelledby"] || !$?.["aria-label"] ? Re : void 0, Be = N?.message ?? (j ? k.refreshing : "");
|
|
224
|
+
return /* @__PURE__ */ d(re, {
|
|
225
|
+
reducedMotion: "user",
|
|
226
|
+
children: /* @__PURE__ */ d(r, {
|
|
227
|
+
className: Oe,
|
|
228
|
+
styles: pe,
|
|
229
|
+
sx: ke,
|
|
230
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
231
|
+
...je,
|
|
232
|
+
ref: De,
|
|
233
|
+
className: t,
|
|
234
|
+
"data-ui": "stretch-refresh",
|
|
235
|
+
"data-state": Fe,
|
|
236
|
+
onKeyDown: (e) => {
|
|
237
|
+
Ae?.(e), !e.defaultPrevented && e.key === "Escape" && (R.current || V.current) && (e.preventDefault(), V.current = !1, X(!1));
|
|
238
|
+
},
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ f("header", {
|
|
241
|
+
...D?.header,
|
|
242
|
+
role: D?.header?.role ?? "presentation",
|
|
243
|
+
css: [me, D?.header?.css],
|
|
244
|
+
children: [
|
|
245
|
+
/* @__PURE__ */ d(Me, {
|
|
246
|
+
...D?.title,
|
|
247
|
+
id: Re,
|
|
248
|
+
css: [he, D?.title?.css],
|
|
249
|
+
children: e
|
|
250
|
+
}),
|
|
251
|
+
/* @__PURE__ */ d(o, {
|
|
252
|
+
variant: "outline",
|
|
253
|
+
size: "sm",
|
|
254
|
+
...D?.refreshButton,
|
|
255
|
+
type: "button",
|
|
256
|
+
disabled: w,
|
|
257
|
+
"aria-disabled": j || B.current || D?.refreshButton?.["aria-disabled"],
|
|
258
|
+
css: [_e, D?.refreshButton?.css],
|
|
259
|
+
onClick: (e) => {
|
|
260
|
+
D?.refreshButton?.onClick?.(e), e.defaultPrevented || Y();
|
|
261
|
+
},
|
|
262
|
+
children: k.refresh
|
|
263
|
+
}),
|
|
264
|
+
Le && /* @__PURE__ */ d("div", {
|
|
265
|
+
...D?.subtitle,
|
|
266
|
+
id: Q,
|
|
267
|
+
"data-ui": "stretch-refresh-subtitle",
|
|
268
|
+
css: [ge, D?.subtitle?.css],
|
|
269
|
+
children: n
|
|
270
|
+
})
|
|
271
|
+
]
|
|
272
|
+
}),
|
|
273
|
+
/* @__PURE__ */ f("div", {
|
|
274
|
+
...$,
|
|
275
|
+
ref: Ne,
|
|
276
|
+
role: "region",
|
|
277
|
+
tabIndex: $?.tabIndex ?? 0,
|
|
278
|
+
"data-ui": "stretch-refresh-feed",
|
|
279
|
+
"aria-labelledby": x($?.["aria-labelledby"], ze),
|
|
280
|
+
"aria-describedby": x($?.["aria-describedby"], Le ? Q : void 0),
|
|
281
|
+
css: [ve, $?.css],
|
|
282
|
+
onPointerDown: (e) => {
|
|
283
|
+
$?.onPointerDown?.(e), Pe(e);
|
|
284
|
+
},
|
|
285
|
+
onPointerMove: (e) => {
|
|
286
|
+
$?.onPointerMove?.(e), !e.defaultPrevented && R.current?.pointer === e.pointerId && Z(e.clientX, e.clientY, () => e.preventDefault());
|
|
287
|
+
},
|
|
288
|
+
onPointerUp: (e) => {
|
|
289
|
+
$?.onPointerUp?.(e), R.current?.pointer === e.pointerId && X(!e.defaultPrevented);
|
|
290
|
+
},
|
|
291
|
+
onPointerCancel: (e) => {
|
|
292
|
+
$?.onPointerCancel?.(e), R.current?.pointer === e.pointerId && X(!1);
|
|
293
|
+
},
|
|
294
|
+
onLostPointerCapture: (e) => {
|
|
295
|
+
$?.onLostPointerCapture?.(e), R.current?.pointer === e.pointerId && X(!1);
|
|
296
|
+
},
|
|
297
|
+
children: [/* @__PURE__ */ f("div", {
|
|
298
|
+
...D?.indicator,
|
|
299
|
+
"aria-hidden": "true",
|
|
300
|
+
"data-ui": "stretch-refresh-indicator",
|
|
301
|
+
css: [ye, D?.indicator?.css],
|
|
302
|
+
children: [Ie, /* @__PURE__ */ d(h.span, {
|
|
303
|
+
"data-ui": "stretch-refresh-line",
|
|
304
|
+
css: be,
|
|
305
|
+
style: { scaleX: j ? 1 : W }
|
|
306
|
+
})]
|
|
307
|
+
}), /* @__PURE__ */ f(h.div, {
|
|
308
|
+
style: { y: U },
|
|
309
|
+
children: [/* @__PURE__ */ d("ul", {
|
|
310
|
+
...D?.list,
|
|
311
|
+
"aria-busy": j,
|
|
312
|
+
"data-ui": "stretch-refresh-list",
|
|
313
|
+
css: [xe, D?.list?.css],
|
|
314
|
+
children: u.map((e, t) => {
|
|
315
|
+
let n = typeof D?.item == "function" ? D.item(e, t) : D?.item;
|
|
316
|
+
return /* @__PURE__ */ ne("li", {
|
|
317
|
+
...n,
|
|
318
|
+
key: m(e),
|
|
319
|
+
css: [Se, n?.css]
|
|
320
|
+
}, _(e, t));
|
|
321
|
+
})
|
|
322
|
+
}), u.length === 0 && a(E) && E !== "" && /* @__PURE__ */ d("div", {
|
|
323
|
+
...D?.empty,
|
|
324
|
+
"data-ui": "stretch-refresh-empty",
|
|
325
|
+
css: [we, D?.empty?.css],
|
|
326
|
+
children: E
|
|
327
|
+
})]
|
|
328
|
+
})]
|
|
329
|
+
}),
|
|
330
|
+
/* @__PURE__ */ d("div", {
|
|
331
|
+
...D?.status,
|
|
332
|
+
id: D?.status?.id ?? `${O}-status`,
|
|
333
|
+
role: "status",
|
|
334
|
+
"aria-atomic": "true",
|
|
335
|
+
"data-ui": "stretch-refresh-status",
|
|
336
|
+
css: [Ce, D?.status?.css],
|
|
337
|
+
children: /* @__PURE__ */ d(h.span, {
|
|
338
|
+
style: { opacity: G },
|
|
339
|
+
children: Be
|
|
340
|
+
})
|
|
341
|
+
})
|
|
342
|
+
]
|
|
343
|
+
})
|
|
344
|
+
})
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
S.displayName = "StretchRefresh";
|
|
348
|
+
//#endregion
|
|
349
|
+
export { S as t };
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { vars as e } from "@jfrader/tokens/vars";
|
|
3
3
|
//#region src/styling/surface.ts
|
|
4
|
-
|
|
4
|
+
function t(e) {
|
|
5
|
+
return e === "contrast" ? "dark" : null;
|
|
6
|
+
}
|
|
7
|
+
function n(e) {
|
|
8
|
+
let n = t(e);
|
|
9
|
+
return n ? {
|
|
10
|
+
"data-theme": n,
|
|
11
|
+
"data-appearance": e
|
|
12
|
+
} : null;
|
|
13
|
+
}
|
|
14
|
+
var r = {
|
|
5
15
|
boxSizing: "border-box",
|
|
6
16
|
backgroundColor: e.color.surfaceRaised,
|
|
7
17
|
border: `1px solid ${e.color.border}`,
|
|
8
18
|
color: e.color.text,
|
|
9
19
|
fontFamily: e.font.sans,
|
|
10
20
|
lineHeight: e.lineHeight.base
|
|
11
|
-
},
|
|
21
|
+
}, i = {
|
|
12
22
|
border: 0,
|
|
13
23
|
padding: 0,
|
|
14
24
|
background: "transparent",
|
|
@@ -16,4 +26,4 @@ var t = {
|
|
|
16
26
|
"&::backdrop": { backgroundColor: e.color.scrim }
|
|
17
27
|
};
|
|
18
28
|
//#endregion
|
|
19
|
-
export { t as n, n as t };
|
|
29
|
+
export { t as i, r as n, n as r, i as t };
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { t
|
|
4
|
-
import { n
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { t } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as r } from "./sx-BJXJ2xJK.js";
|
|
5
6
|
import { t as i } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
7
|
import { t as a } from "./renderable-DzcIj1Lo.js";
|
|
7
|
-
import { t as o } from "./menu-
|
|
8
|
+
import { t as o } from "./menu-CVzpsyXn.js";
|
|
8
9
|
import { Children as s, createContext as c, isValidElement as l, useContext as u, useEffect as d, useLayoutEffect as f, useMemo as p, useRef as m, useState as h } from "react";
|
|
9
10
|
import { vars as g } from "@jfrader/tokens/vars";
|
|
10
11
|
import { Fragment as _, jsx as v, jsxs as y } from "@emotion/react/jsx-runtime";
|
|
11
|
-
import {
|
|
12
|
-
import { AnimatePresence as te, MotionConfig as ne, animate as b, motion as x, useIsPresent as S, useMotionValue as C, useReducedMotion as re } from "motion/react";
|
|
12
|
+
import { AnimatePresence as ee, MotionConfig as te, animate as b, motion as x, useIsPresent as S, useMotionValue as C, useReducedMotion as ne } from "motion/react";
|
|
13
13
|
import { base as w } from "@jfrader/tokens";
|
|
14
|
+
import { useMergeRefs as re } from "@floating-ui/react";
|
|
14
15
|
//#region src/components/swipe-actions/swipe-actions.tsx
|
|
15
16
|
var ie = 8, ae = 48, oe = .56, se = 900, ce = .1, le = .2, ue = {
|
|
16
17
|
type: "spring",
|
|
@@ -26,7 +27,7 @@ var ie = 8, ae = 48, oe = .56, se = 900, ce = .1, le = .2, ue = {
|
|
|
26
27
|
gap: g.space[2],
|
|
27
28
|
fontFamily: g.font.sans,
|
|
28
29
|
color: g.color.text,
|
|
29
|
-
"&:focus":
|
|
30
|
+
"&:focus": t
|
|
30
31
|
}), he = e({
|
|
31
32
|
label: "swipe-actions-row",
|
|
32
33
|
display: "grid",
|
|
@@ -75,7 +76,7 @@ var ie = 8, ae = 48, oe = .56, se = 900, ce = .1, le = .2, ue = {
|
|
|
75
76
|
overflowWrap: "anywhere",
|
|
76
77
|
cursor: "pointer",
|
|
77
78
|
"&:disabled": { cursor: "not-allowed" },
|
|
78
|
-
[
|
|
79
|
+
[n]: { borderColor: "ButtonText" }
|
|
79
80
|
}), be = {
|
|
80
81
|
neutral: e({
|
|
81
82
|
background: g.color.surfaceHover,
|
|
@@ -109,8 +110,8 @@ function Ce({ nativeProps: e, ...t }) {
|
|
|
109
110
|
});
|
|
110
111
|
}
|
|
111
112
|
var we = x.create(Ce), Te = c(null);
|
|
112
|
-
function E({ ref: e, className:
|
|
113
|
-
let [g = null, _] = i(a, o, c), y = m(null), b = m(/* @__PURE__ */ new Map()).current, x =
|
|
113
|
+
function E({ ref: e, className: t, sx: n, value: a, defaultValue: o = null, onValueChange: c, children: u, onKeyDown: f, ...h }) {
|
|
114
|
+
let [g = null, _] = i(a, o, c), y = m(null), b = m(/* @__PURE__ */ new Map()).current, x = re([y, e]), S = s.toArray(u).flatMap((e) => l(e) ? [e.props.id] : []), C = p(() => ({
|
|
114
115
|
value: g,
|
|
115
116
|
rows: b,
|
|
116
117
|
list: y,
|
|
@@ -140,14 +141,14 @@ function E({ ref: e, className: n, sx: r, value: a, defaultValue: o = null, onVa
|
|
|
140
141
|
g,
|
|
141
142
|
b,
|
|
142
143
|
C
|
|
143
|
-
]), /* @__PURE__ */ v(
|
|
144
|
+
]), /* @__PURE__ */ v(te, {
|
|
144
145
|
reducedMotion: "user",
|
|
145
146
|
children: /* @__PURE__ */ v(Te.Provider, {
|
|
146
147
|
value: C,
|
|
147
|
-
children: /* @__PURE__ */ v(
|
|
148
|
-
className:
|
|
148
|
+
children: /* @__PURE__ */ v(r, {
|
|
149
|
+
className: t,
|
|
149
150
|
styles: T,
|
|
150
|
-
sx:
|
|
151
|
+
sx: n,
|
|
151
152
|
children: (e) => /* @__PURE__ */ v("ul", {
|
|
152
153
|
...h,
|
|
153
154
|
ref: x,
|
|
@@ -157,7 +158,7 @@ function E({ ref: e, className: n, sx: r, value: a, defaultValue: o = null, onVa
|
|
|
157
158
|
onKeyDown: (e) => {
|
|
158
159
|
f?.(e), !e.defaultPrevented && g !== null && e.key === "Escape" && !e.nativeEvent.isComposing && !e.target.closest("[role=\"menu\"]") && !D(y.current) && (e.stopPropagation(), e.preventDefault(), C.request(null));
|
|
159
160
|
},
|
|
160
|
-
children: /* @__PURE__ */ v(
|
|
161
|
+
children: /* @__PURE__ */ v(ee, {
|
|
161
162
|
initial: !1,
|
|
162
163
|
children: u
|
|
163
164
|
})
|
|
@@ -170,10 +171,10 @@ function D(e) {
|
|
|
170
171
|
return !!e?.querySelector("[aria-expanded=\"true\"]");
|
|
171
172
|
}
|
|
172
173
|
E.displayName = "SwipeActions";
|
|
173
|
-
function O({ id: e, label:
|
|
174
|
+
function O({ id: e, label: t, actionsLabel: n, leading: i = pe, trailing: s = pe, fullSwipe: c = !0, disabled: l = !1, ref: p, className: g, sx: ee, children: te, slotProps: w, onPointerDown: T, onPointerMove: Ce, onPointerUp: E, onPointerCancel: D, onLostPointerCapture: O, onClickCapture: k, ...Ee }) {
|
|
174
175
|
let A = u(Te);
|
|
175
176
|
if (!A) throw Error("SwipeActions.Row must be rendered inside SwipeActions.");
|
|
176
|
-
let { value: j, request: M, rows: N, list: P } = A, F = m(null), De = m(null), I = m(null), Oe = m(!1), ke = m(A.ids), L = m(null), R = m(null), z = m(null), B = m(0), V = m(!1), H = m(void 0), U = C(0), W =
|
|
177
|
+
let { value: j, request: M, rows: N, list: P } = A, F = m(null), De = m(null), I = m(null), Oe = m(!1), ke = m(A.ids), L = m(null), R = m(null), z = m(null), B = m(0), V = m(!1), H = m(void 0), U = C(0), W = ne(), G = S(), [Ae, K] = h(!1), [je, Me] = h(0), Ne = re([F, p]), q = {
|
|
177
178
|
leading: i,
|
|
178
179
|
trailing: s
|
|
179
180
|
}, J = (e) => !l && q[e].some((e) => !e.disabled), Y = (e) => Math.min(F.current?.getBoundingClientRect().width ?? 0, (e === "leading" ? L : R).current?.getBoundingClientRect().width ?? 0), Pe = () => F.current?.matches(":dir(rtl)") ? -1 : 1, Fe = () => j?.id === e && J(j.side) ? Y(j.side) * (j.side === "leading" ? 1 : -1) * Pe() : 0, X = () => {
|
|
@@ -266,15 +267,15 @@ function O({ id: e, label: n, actionsLabel: r, leading: i = pe, trailing: s = pe
|
|
|
266
267
|
css: w?.actionLabel?.css,
|
|
267
268
|
children: e.label
|
|
268
269
|
})] });
|
|
269
|
-
return /* @__PURE__ */ v(
|
|
270
|
+
return /* @__PURE__ */ v(r, {
|
|
270
271
|
className: g,
|
|
271
272
|
styles: he,
|
|
272
|
-
sx:
|
|
273
|
-
children: (
|
|
273
|
+
sx: ee,
|
|
274
|
+
children: (r) => /* @__PURE__ */ y(we, {
|
|
274
275
|
nativeProps: Ee,
|
|
275
276
|
id: e,
|
|
276
277
|
ref: Ne,
|
|
277
|
-
className:
|
|
278
|
+
className: r,
|
|
278
279
|
"data-ui": "swipe-actions-row",
|
|
279
280
|
"data-state": Le ?? "closed",
|
|
280
281
|
inert: !G || Ee.inert || void 0,
|
|
@@ -297,7 +298,9 @@ function O({ id: e, label: n, actionsLabel: r, leading: i = pe, trailing: s = pe
|
|
|
297
298
|
},
|
|
298
299
|
onPointerDown: (e) => {
|
|
299
300
|
if (T?.(e), e.defaultPrevented || l || !G || z.current || !e.isPrimary || e.button !== 0 || e.target.closest(me)) return;
|
|
300
|
-
let t = e.currentTarget, n = t.ownerDocument
|
|
301
|
+
let t = e.currentTarget, n = t.ownerDocument;
|
|
302
|
+
e.pointerType === "mouse" && e.preventDefault();
|
|
303
|
+
let r = (e) => {
|
|
301
304
|
t.contains(e.target) || Q(e.pointerId, !0);
|
|
302
305
|
};
|
|
303
306
|
n.addEventListener("pointerup", r, !0), n.addEventListener("pointercancel", r, !0), z.current = {
|
|
@@ -342,7 +345,7 @@ function O({ id: e, label: n, actionsLabel: r, leading: i = pe, trailing: s = pe
|
|
|
342
345
|
D?.(e), Q(e.pointerId, !0);
|
|
343
346
|
},
|
|
344
347
|
onLostPointerCapture: (e) => {
|
|
345
|
-
O?.(e), Q(e.pointerId, !0);
|
|
348
|
+
O?.(e), e.target === e.currentTarget && Q(e.pointerId, !0);
|
|
346
349
|
},
|
|
347
350
|
onClickCapture: (e) => {
|
|
348
351
|
k?.(e), V.current && (V.current = !1, e.preventDefault(), e.stopPropagation());
|
|
@@ -377,7 +380,7 @@ function O({ id: e, label: n, actionsLabel: r, leading: i = pe, trailing: s = pe
|
|
|
377
380
|
"data-ui": "swipe-actions-body",
|
|
378
381
|
className: w?.body?.className,
|
|
379
382
|
css: [_e, w?.body?.css],
|
|
380
|
-
children:
|
|
383
|
+
children: te
|
|
381
384
|
}), /* @__PURE__ */ y(o, {
|
|
382
385
|
open: Ae && G,
|
|
383
386
|
onOpenChange: (e) => {
|
|
@@ -386,8 +389,8 @@ function O({ id: e, label: n, actionsLabel: r, leading: i = pe, trailing: s = pe
|
|
|
386
389
|
children: [/* @__PURE__ */ v(o.Trigger, {
|
|
387
390
|
ref: De,
|
|
388
391
|
disabled: l || !i.length && !s.length,
|
|
389
|
-
"aria-label":
|
|
390
|
-
title:
|
|
392
|
+
"aria-label": n,
|
|
393
|
+
title: t,
|
|
391
394
|
className: w?.trigger?.className,
|
|
392
395
|
css: [Se, w?.trigger?.css],
|
|
393
396
|
children: "⋯"
|
package/dist/swipe-actions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as SwipeActions } from "./swipe-actions-
|
|
2
|
+
export { t as SwipeActions } from "./swipe-actions-1H5UOZKE.js";
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { n as t, r as n } from "./media-8yrN85VT.js";
|
|
4
|
+
import { t as r } from "./sx-BJXJ2xJK.js";
|
|
5
|
+
import { t as i } from "./renderable-DzcIj1Lo.js";
|
|
6
|
+
import { i as a, n as o, r as s, t as c } from "./choice-control-BsWOZPc9.js";
|
|
7
|
+
import { useId as l } from "react";
|
|
8
|
+
import { vars as u } from "@jfrader/tokens/vars";
|
|
9
|
+
import { jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
|
|
10
|
+
//#region src/components/switch/switch.tsx
|
|
11
|
+
var p = {
|
|
12
|
+
sm: "36px",
|
|
13
|
+
md: "44px"
|
|
14
|
+
}, m = e({
|
|
15
|
+
position: "relative",
|
|
16
|
+
display: "inline-block",
|
|
17
|
+
flexShrink: 0,
|
|
18
|
+
boxSizing: "border-box",
|
|
19
|
+
border: `1px solid ${u.color.borderControl}`,
|
|
20
|
+
borderRadius: u.radius.full,
|
|
21
|
+
backgroundColor: u.color.surfaceHover,
|
|
22
|
+
transitionProperty: "background-color, border-color",
|
|
23
|
+
transitionDuration: u.motion.duration.fast,
|
|
24
|
+
transitionTimingFunction: u.motion.easeStandard,
|
|
25
|
+
"&::after": {
|
|
26
|
+
content: "\"\"",
|
|
27
|
+
position: "absolute",
|
|
28
|
+
insetBlockStart: "2px",
|
|
29
|
+
insetInlineStart: "2px",
|
|
30
|
+
borderRadius: u.radius.full,
|
|
31
|
+
backgroundColor: u.color.text,
|
|
32
|
+
transitionProperty: "transform, background-color",
|
|
33
|
+
transitionDuration: u.motion.duration.fast,
|
|
34
|
+
transitionTimingFunction: u.motion.easeStandard
|
|
35
|
+
},
|
|
36
|
+
[n]: {
|
|
37
|
+
transitionDuration: "0s",
|
|
38
|
+
"&::after": { transitionDuration: "0s" }
|
|
39
|
+
},
|
|
40
|
+
[t]: { "&::after": { backgroundColor: "CanvasText" } }
|
|
41
|
+
}), h = {
|
|
42
|
+
sm: e({
|
|
43
|
+
inlineSize: p.sm,
|
|
44
|
+
blockSize: "20px",
|
|
45
|
+
"&::after": {
|
|
46
|
+
inlineSize: "14px",
|
|
47
|
+
blockSize: "14px"
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
md: e({
|
|
51
|
+
inlineSize: p.md,
|
|
52
|
+
blockSize: "24px",
|
|
53
|
+
"&::after": {
|
|
54
|
+
inlineSize: "18px",
|
|
55
|
+
blockSize: "18px"
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
}, g = {
|
|
59
|
+
sm: e({
|
|
60
|
+
"input:checked + span::after": {
|
|
61
|
+
transform: "translateX(16px)",
|
|
62
|
+
backgroundColor: u.color.accentContrast
|
|
63
|
+
},
|
|
64
|
+
"&:dir(rtl) input:checked + span::after": { transform: "translateX(-16px)" },
|
|
65
|
+
[t]: { "input:checked + span::after": { backgroundColor: "CanvasText" } }
|
|
66
|
+
}),
|
|
67
|
+
md: e({
|
|
68
|
+
"input:checked + span::after": {
|
|
69
|
+
transform: "translateX(20px)",
|
|
70
|
+
backgroundColor: u.color.accentContrast
|
|
71
|
+
},
|
|
72
|
+
"&:dir(rtl) input:checked + span::after": { transform: "translateX(-20px)" },
|
|
73
|
+
[t]: { "input:checked + span::after": { backgroundColor: "CanvasText" } }
|
|
74
|
+
})
|
|
75
|
+
}, _ = {
|
|
76
|
+
sm: e({ fontSize: u.textSize.sm }),
|
|
77
|
+
md: e({ fontSize: u.textSize.md })
|
|
78
|
+
}, v = e({
|
|
79
|
+
fontSize: u.textSize.sm,
|
|
80
|
+
color: u.color.textMuted
|
|
81
|
+
}), y = {
|
|
82
|
+
sm: e({ marginInlineStart: `calc(${p.sm} + ${u.space[2]})` }),
|
|
83
|
+
md: e({ marginInlineStart: `calc(${p.md} + ${u.space[2]})` })
|
|
84
|
+
};
|
|
85
|
+
function b({ ref: e, label: t, description: n, size: u = "md", onChange: p, onCheckedChange: b, slotProps: x, className: S, sx: C, dir: w, "aria-labelledby": T, "aria-describedby": E, ...D }) {
|
|
86
|
+
let O = l(), k = `${O}-label`, A = `${O}-description`, j = i(t), M = i(n), N = [T, j && k].filter(Boolean).join(" ") || void 0, P = [E, M && A].filter(Boolean).join(" ") || void 0, F = [S, x?.root?.className].filter(Boolean).join(" ") || void 0, I = (e) => {
|
|
87
|
+
p?.(e), b?.(e.currentTarget.checked);
|
|
88
|
+
};
|
|
89
|
+
return /* @__PURE__ */ d(r, {
|
|
90
|
+
className: F,
|
|
91
|
+
styles: [
|
|
92
|
+
s,
|
|
93
|
+
o,
|
|
94
|
+
g[u],
|
|
95
|
+
x?.root?.css
|
|
96
|
+
],
|
|
97
|
+
sx: C,
|
|
98
|
+
children: (r) => /* @__PURE__ */ f("label", {
|
|
99
|
+
"data-ui": "switch",
|
|
100
|
+
dir: w,
|
|
101
|
+
className: r,
|
|
102
|
+
children: [/* @__PURE__ */ f("span", {
|
|
103
|
+
css: a,
|
|
104
|
+
children: [
|
|
105
|
+
/* @__PURE__ */ d("input", {
|
|
106
|
+
...D,
|
|
107
|
+
ref: e,
|
|
108
|
+
type: "checkbox",
|
|
109
|
+
role: "switch",
|
|
110
|
+
"aria-labelledby": N,
|
|
111
|
+
"aria-describedby": P,
|
|
112
|
+
onChange: I,
|
|
113
|
+
css: c
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ d("span", {
|
|
116
|
+
"aria-hidden": "true",
|
|
117
|
+
className: x?.control?.className,
|
|
118
|
+
css: [
|
|
119
|
+
m,
|
|
120
|
+
h[u],
|
|
121
|
+
x?.control?.css
|
|
122
|
+
]
|
|
123
|
+
}),
|
|
124
|
+
j && /* @__PURE__ */ d("span", {
|
|
125
|
+
id: k,
|
|
126
|
+
className: x?.label?.className,
|
|
127
|
+
css: [_[u], x?.label?.css],
|
|
128
|
+
children: t
|
|
129
|
+
})
|
|
130
|
+
]
|
|
131
|
+
}), M && /* @__PURE__ */ d("span", {
|
|
132
|
+
id: A,
|
|
133
|
+
className: x?.description?.className,
|
|
134
|
+
css: [
|
|
135
|
+
v,
|
|
136
|
+
y[u],
|
|
137
|
+
x?.description?.css
|
|
138
|
+
],
|
|
139
|
+
children: n
|
|
140
|
+
})]
|
|
141
|
+
})
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
b.displayName = "Switch";
|
|
145
|
+
//#endregion
|
|
146
|
+
export { b as t };
|