@jfrader/ui 0.5.1 → 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-DLul6vIl.js → accordion-D6myONB9.js} +36 -35
- 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-Dlbq5-9D.js → announcement-bar-B5J33QUh.js} +132 -131
- package/dist/announcement-bar.js +1 -1
- package/dist/{avatar-CaGJHy1N.js → avatar-B6idYC59.js} +11 -10
- package/dist/{avatar-group-M1opAQEG.js → avatar-group-DvP8mAE-.js} +10 -9
- package/dist/avatar-group.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/{badge-CjM5Agqk.js → badge-CfhTcA-Z.js} +10 -9
- 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-DjZOPq4k.js → bottom-sheet-BFQKO0Wo.js} +282 -264
- package/dist/bottom-sheet.js +1 -1
- package/dist/{breadcrumbs-BDK_LiwH.js → breadcrumbs-CG3akw-b.js} +19 -18
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-NLY0h6EJ.js → button-C6OV0C7J.js} +14 -13
- 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-B7OrvD6J.js → carousel-lTH4Foke.js} +13 -12
- package/dist/carousel.js +1 -1
- package/dist/chat-thread-DVa17BRC.js +864 -0
- package/dist/chat-thread.js +2 -0
- package/dist/{checkbox-DKSzExj2.js → checkbox-CClE61GV.js} +9 -8
- package/dist/checkbox.js +1 -1
- package/dist/{chip-group-DjQ0_6Y9.js → chip-group-BZUX9KPF.js} +17 -16
- package/dist/chip-group.js +1 -1
- package/dist/{choice-control-5kJkLXgv.js → choice-control-BsWOZPc9.js} +1 -1
- package/dist/{code-block-B5we2lZa.js → code-block-CYP89_6h.js} +35 -34
- package/dist/code-block.js +1 -1
- package/dist/{combobox-DFFqOBCi.js → combobox-D2Oc-co7.js} +21 -20
- 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 +1 -1
- package/dist/{container-BOaSptJa.js → container-BxtwJSSD.js} +3 -2
- package/dist/container.js +1 -1
- package/dist/{context-menu-__1c2Dk9.js → context-menu-I4i0LRpm.js} +52 -51
- package/dist/context-menu.js +1 -1
- package/dist/{copy-button-DCSLcYS-.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-BiPN7yeK.js → date-picker-D-bn-iHs.js} +14 -13
- 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-Cp7aNbhM.js → divider-zOJzkcHh.js} +7 -6
- 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-rUATve0o.js → expandable-card-W97vjix9.js} +52 -51
- package/dist/expandable-card.js +1 -1
- package/dist/{expanding-search-BxOwtdwt.js → expanding-search-Bb2_YfNx.js} +16 -15
- package/dist/expanding-search.js +1 -1
- package/dist/{field-anatomy-COVdNpf5.js → field-anatomy-BDIP42MI.js} +2 -1
- package/dist/{file-dropzone-BuXm3Tea.js → file-dropzone-Bi5ikRIz.js} +14 -13
- package/dist/file-dropzone.js +1 -1
- package/dist/{filter-toolbar-Cy5Hqur-.js → filter-toolbar-QRnC4S_H.js} +33 -32
- 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-CoMJKg1g.js → hover-card-DN1EAlQA.js} +20 -19
- package/dist/hover-card.js +1 -1
- package/dist/{icon-wrapper-stN8sD7R.js → icon-wrapper-C-zMD0uL.js} +1 -1
- package/dist/{image-compare-BxY8Ykzt.js → image-compare-Ln2UUqTU.js} +20 -19
- package/dist/image-compare.js +1 -1
- package/dist/index.js +98 -83
- 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-DgWqyU75.js → json-viewer-Dro3WrjS.js} +31 -30
- 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-sq61si9L.js → mention-input-BjjAbJCf.js} +6 -6
- package/dist/mention-input.js +1 -1
- package/dist/{menu-DDKgmK2F.js → menu-CVzpsyXn.js} +113 -96
- package/dist/menu.js +1 -1
- package/dist/{metric-card--lVTz5Wn.js → metric-card-BnFssTXj.js} +12 -11
- package/dist/metric-card.js +1 -1
- package/dist/{multi-select-DG1BCFX7.js → multi-select-B3puEVo0.js} +67 -66
- package/dist/multi-select.js +1 -1
- package/dist/{navigation-CC26JDr-.js → navigation-C_JD43gA.js} +41 -40
- 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-motion-Cr77ihn2.js +90 -0
- package/dist/{overlay-portal-C4JZFq2M.js → overlay-portal-C9igMHnC.js} +1 -1
- package/dist/{pagination-BfkeWbmP.js → pagination-Dkh4bJQh.js} +10 -9
- 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-BaS-uIbn.js → pill-Dd7pog19.js} +10 -9
- package/dist/pill.js +1 -1
- package/dist/{popover-CErIw2q3.js → popover-CUMOcMtj.js} +5 -4
- package/dist/popover.js +1 -1
- package/dist/presence-spring-4zwtUDQN.js +12 -0
- package/dist/{progress-DAQkfhPd.js → progress-Bcuz3Ob4.js} +11 -10
- package/dist/progress.js +1 -1
- package/dist/{radio-cards-Cu9cBssN.js → radio-cards-FkAhESb5.js} +35 -34
- package/dist/radio-cards.js +1 -1
- package/dist/{radio-group-TIK0-iPX.js → radio-group-DItMf2YM.js} +18 -17
- package/dist/radio-group.js +1 -1
- package/dist/{resizable-panels-DUpQEpwG.js → resizable-panels-61h9hA3B.js} +13 -12
- 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-DMvho0KQ.js → search-field-CbsajaZb.js} +93 -92
- package/dist/search-field.js +1 -1
- package/dist/{segmented-control-8ZUGnsZm.js → segmented-control-DCh-4ca-.js} +26 -25
- package/dist/segmented-control.js +1 -1
- package/dist/{select-D5rhJ8gi.js → select-SrcQqZjo.js} +27 -26
- 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-_bTeguN9.js → signature-pad-khL2yhQI.js} +15 -14
- 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-CYKT_Ng7.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-BCw4zZom.js → split-button-Bu41f2AY.js} +20 -19
- 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-CBuJREU1.js → swipe-actions-1H5UOZKE.js} +26 -25
- package/dist/swipe-actions.js +1 -1
- package/dist/{switch-C1WrKrf-.js → switch-79-hkQqg.js} +15 -14
- package/dist/switch.js +1 -1
- package/dist/sx-BJXJ2xJK.js +23 -0
- package/dist/{tabs-XluwRjgg.js → tabs-Bb5-noYE.js} +43 -42
- 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-hU72iSVS.js → text-field-D0VP7b4P.js} +3 -3
- package/dist/text-field.js +1 -1
- package/dist/{textarea-3k4Y0QQ3.js → textarea-D1YwEPmn.js} +3 -3
- 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-C505TtU8.js → theme-switch-CP42mVDb.js} +12 -11
- package/dist/theme-switch.js +1 -1
- package/dist/thread-parts-DfZNz70v.js +683 -0
- package/dist/{time-picker-CPlhW0tr.js → time-picker-Tnd-JBLC.js} +16 -15
- package/dist/time-picker.js +1 -1
- package/dist/{timeline-B0uAAVfT.js → timeline-DaldDMX7.js} +22 -21
- package/dist/timeline.js +1 -1
- package/dist/{toast-B7wo3sX1.js → toast-CSAbl5yK.js} +12 -11
- package/dist/{toast-stack-B40VpS4M.js → toast-stack-BCR4Cu7V.js} +10 -9
- package/dist/toast-stack.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-B2fpFZwV.js → toggle-group-C7ye1v4s.js} +23 -22
- package/dist/toggle-group.js +1 -1
- package/dist/{tooltip-BvgVTCTN.js → tooltip-IajLwdUb.js} +48 -39
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-j8qLqkb_.js → tree-view-CoW4oJIZ.js} +15 -14
- 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/comment-thread/comment-thread.d.ts +3 -3
- package/dist/types/components/drawer/drawer.d.ts +7 -1
- 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 +29 -5
- 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/photo-grid/index.d.ts +2 -0
- package/dist/types/components/photo-grid/photo-grid.d.ts +82 -0
- 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/stretch-refresh/index.d.ts +1 -0
- package/dist/types/components/stretch-refresh/stretch-refresh.d.ts +49 -0
- 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/{comment-thread → thread}/thread-parts.d.ts +7 -2
- package/dist/types/components/tooltip/tooltip.d.ts +8 -1
- 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 +14 -1
- package/dist/types/overlay/exit-motion.d.ts +24 -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/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-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 +72 -6
- package/dist/calendar-BzJdv_SZ.js +0 -449
- package/dist/card-Ca4KQKYQ.js +0 -154
- package/dist/command-palette-BmQu2w4H.js +0 -391
- package/dist/comment-thread-ASaXDcGo.js +0 -1410
- package/dist/date-range-picker-DQpUeKqV.js +0 -570
- package/dist/dialog-BX1zYMs-.js +0 -219
- package/dist/drawer-DsASTiP-.js +0 -553
- package/dist/elastic-slider-BG6K019r.js +0 -395
- package/dist/elastic-slider.js +0 -2
- package/dist/slider-DVG6-Awh.js +0 -308
- package/dist/sx-Dx9JUKp5.js +0 -23
- package/dist/theme-root-Bs1U3uPA.js +0 -46
- package/dist/theme-scope-t7nAKc2c.js +0 -27
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +0 -53
- package/dist/types/components/elastic-slider/index.d.ts +0 -1
- package/dist/use-native-dialog-DWpIUVO1.js +0 -84
- package/dist/use-slider-interaction-ChL-208h.js +0 -234
- /package/dist/types/components/{comment-thread → thread}/thread-core.d.ts +0 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { n as t } from "./focus-ring-BK5W5_NY.js";
|
|
4
|
+
import { n, r } from "./media-8yrN85VT.js";
|
|
5
|
+
import { t as i } from "./sx-BJXJ2xJK.js";
|
|
6
|
+
import { t as a } from "./use-latest-callback-cj1OOQL6.js";
|
|
7
|
+
import { t as o } from "./use-controlled-state-DpeVQZNR.js";
|
|
8
|
+
import { _ as s, a as c, c as l, d as u, f as d, g as f, h as p, i as m, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C, v as w, y as ee } from "./calendar.utils-azmB4Ej7.js";
|
|
9
|
+
import { createContext as T, useContext as E, useEffect as te, useId as ne, useImperativeHandle as D, useLayoutEffect as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
10
|
+
import { vars as M } from "@jfrader/tokens/vars";
|
|
11
|
+
import { Fragment as N, jsx as P, jsxs as F } from "@emotion/react/jsx-runtime";
|
|
12
|
+
//#region src/components/calendar/calendar.styles.ts
|
|
13
|
+
var I = e({
|
|
14
|
+
display: "inline-flex",
|
|
15
|
+
flexDirection: "column",
|
|
16
|
+
gap: M.space[2],
|
|
17
|
+
fontFamily: M.font.sans,
|
|
18
|
+
color: M.color.text
|
|
19
|
+
}), L = e({
|
|
20
|
+
display: "flex",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
gap: M.space[2]
|
|
23
|
+
}), R = e({
|
|
24
|
+
flex: 1,
|
|
25
|
+
textAlign: "center",
|
|
26
|
+
fontSize: M.textSize.sm,
|
|
27
|
+
fontWeight: M.fontWeight.semibold
|
|
28
|
+
}), z = {
|
|
29
|
+
transitionDuration: M.motion.duration.fast,
|
|
30
|
+
transitionTimingFunction: M.motion.easeStandard,
|
|
31
|
+
[r]: { transitionDuration: "0s" }
|
|
32
|
+
}, B = e({
|
|
33
|
+
appearance: "none",
|
|
34
|
+
display: "inline-flex",
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
justifyContent: "center",
|
|
37
|
+
inlineSize: "32px",
|
|
38
|
+
blockSize: "32px",
|
|
39
|
+
padding: 0,
|
|
40
|
+
border: `1px solid ${M.color.borderControl}`,
|
|
41
|
+
borderRadius: M.radius.sm,
|
|
42
|
+
backgroundColor: "transparent",
|
|
43
|
+
font: "inherit",
|
|
44
|
+
fontSize: M.textSize.lg,
|
|
45
|
+
lineHeight: 1,
|
|
46
|
+
color: M.color.text,
|
|
47
|
+
cursor: "pointer",
|
|
48
|
+
transitionProperty: "background-color",
|
|
49
|
+
...z,
|
|
50
|
+
"&:hover:not([aria-disabled=\"true\"])": { backgroundColor: M.color.surfaceHover },
|
|
51
|
+
"&[aria-disabled=\"true\"]": {
|
|
52
|
+
opacity: .55,
|
|
53
|
+
cursor: "not-allowed"
|
|
54
|
+
},
|
|
55
|
+
"&:focus-visible": { ...t }
|
|
56
|
+
}), V = e({
|
|
57
|
+
display: "inline-block",
|
|
58
|
+
"&:dir(rtl)": { transform: "scaleX(-1)" }
|
|
59
|
+
}), H = e({
|
|
60
|
+
borderCollapse: "separate",
|
|
61
|
+
borderSpacing: M.space[1],
|
|
62
|
+
marginInline: `calc(-1 * ${M.space[1]})`
|
|
63
|
+
}), U = e({
|
|
64
|
+
paddingBlock: M.space[1],
|
|
65
|
+
fontSize: M.textSize.xs,
|
|
66
|
+
fontWeight: M.fontWeight.medium,
|
|
67
|
+
color: M.color.textMuted,
|
|
68
|
+
textAlign: "center"
|
|
69
|
+
}), W = e({ padding: 0 }), G = e({
|
|
70
|
+
appearance: "none",
|
|
71
|
+
display: "inline-flex",
|
|
72
|
+
alignItems: "center",
|
|
73
|
+
justifyContent: "center",
|
|
74
|
+
inlineSize: "36px",
|
|
75
|
+
blockSize: "36px",
|
|
76
|
+
padding: 0,
|
|
77
|
+
border: "1px solid transparent",
|
|
78
|
+
borderRadius: M.radius.sm,
|
|
79
|
+
backgroundColor: "transparent",
|
|
80
|
+
font: "inherit",
|
|
81
|
+
fontSize: M.textSize.sm,
|
|
82
|
+
fontVariantNumeric: "tabular-nums",
|
|
83
|
+
color: M.color.text,
|
|
84
|
+
cursor: "pointer",
|
|
85
|
+
transitionProperty: "background-color, border-color, color",
|
|
86
|
+
...z,
|
|
87
|
+
"&:hover:not(:disabled):not([data-selected]):not([data-in-range])": { backgroundColor: M.color.surfaceHover },
|
|
88
|
+
"&[data-today]": {
|
|
89
|
+
borderColor: M.color.borderControl,
|
|
90
|
+
fontWeight: M.fontWeight.semibold,
|
|
91
|
+
textDecoration: "underline"
|
|
92
|
+
},
|
|
93
|
+
"&[data-selected]": {
|
|
94
|
+
backgroundColor: M.color.accent,
|
|
95
|
+
borderColor: M.color.accent,
|
|
96
|
+
color: M.color.accentContrast,
|
|
97
|
+
fontWeight: M.fontWeight.semibold
|
|
98
|
+
},
|
|
99
|
+
"&[data-selected]:hover": { backgroundColor: M.color.accentHover },
|
|
100
|
+
"&[data-in-range]": {
|
|
101
|
+
backgroundColor: M.color.accentSoft,
|
|
102
|
+
borderColor: M.color.accentBorder
|
|
103
|
+
},
|
|
104
|
+
"&[data-preview]:not([data-in-range])": {
|
|
105
|
+
borderStyle: "dashed",
|
|
106
|
+
borderColor: M.color.accentText
|
|
107
|
+
},
|
|
108
|
+
"&[data-range-start], &[data-range-end]": {
|
|
109
|
+
backgroundColor: M.color.accent,
|
|
110
|
+
borderColor: M.color.accent,
|
|
111
|
+
color: M.color.accentContrast,
|
|
112
|
+
fontWeight: M.fontWeight.semibold
|
|
113
|
+
},
|
|
114
|
+
"&[data-range-start]:hover, &[data-range-end]:hover": { backgroundColor: M.color.accentHover },
|
|
115
|
+
"&:disabled": {
|
|
116
|
+
opacity: .55,
|
|
117
|
+
cursor: "not-allowed",
|
|
118
|
+
textDecoration: "line-through"
|
|
119
|
+
},
|
|
120
|
+
"&[data-today]:disabled": { textDecoration: "underline line-through" },
|
|
121
|
+
"&:focus-visible": { ...t },
|
|
122
|
+
[n]: {
|
|
123
|
+
"&[data-in-range], &[data-preview]": { borderColor: "CanvasText" },
|
|
124
|
+
"&[data-selected], &[data-range-start], &[data-range-end]": {
|
|
125
|
+
forcedColorAdjust: "none",
|
|
126
|
+
backgroundColor: "Highlight",
|
|
127
|
+
borderColor: "Highlight",
|
|
128
|
+
color: "HighlightText"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}), K = T(null);
|
|
132
|
+
function q(e) {
|
|
133
|
+
let t = E(K);
|
|
134
|
+
if (!t) throw Error(`Calendar.${e} must be rendered inside <Calendar>.`);
|
|
135
|
+
return t;
|
|
136
|
+
}
|
|
137
|
+
var J = (e, t) => t != null && e >= t.start && e <= t.end, Y = "‹", X = "›";
|
|
138
|
+
function Z({ ref: e, value: t, defaultValue: n, onValueChange: r, visibleMonth: s, defaultVisibleMonth: d, onVisibleMonthChange: m, min: h, max: g, locale: _, firstDayOfWeek: v, today: b, selectionRange: w, previewRange: ee, tabStopDate: T, onDayActivate: E, onFocusedDateChange: te, rangeLabels: D, className: O, sx: A, children: M, ...L }) {
|
|
139
|
+
let R = ne(), z = `${R}-label`, B = D !== void 0, V = k(() => B ? {
|
|
140
|
+
start: `${R}-range-start`,
|
|
141
|
+
end: `${R}-range-end`
|
|
142
|
+
} : void 0, [R, B]), H = a(E), U = a(te), W = /* @__PURE__ */ new Date(), G = C(b) ? b : y(x(W.getFullYear(), W.getMonth(), W.getDate())), q = k(() => new Intl.DateTimeFormat(_ ?? l(), S).resolvedOptions().locale, [_]), J = k(() => c(q), [q]), Y = k(() => p(q), [q]), X = v ?? Y, [Z, Q] = o(t, n, r), re = t ?? n, [$, ie] = o(s, d ?? f(C(re) ? re : G), m), ae = u($) ? $ : f(G), oe = C(h) ? h : void 0, se = C(g) ? g : void 0, [ce, le] = j(null), [ue, de] = j(!1), fe = k(() => ({
|
|
143
|
+
value: Z,
|
|
144
|
+
selectionRange: w,
|
|
145
|
+
previewRange: ee,
|
|
146
|
+
tabStopDate: T,
|
|
147
|
+
onDayActivate: H,
|
|
148
|
+
onFocusedDateChange: U,
|
|
149
|
+
rangeLabelIds: V,
|
|
150
|
+
visibleMonth: ae,
|
|
151
|
+
today: G,
|
|
152
|
+
min: oe,
|
|
153
|
+
max: se,
|
|
154
|
+
firstDayOfWeek: X,
|
|
155
|
+
formatters: J,
|
|
156
|
+
focus: ce,
|
|
157
|
+
setFocus: le,
|
|
158
|
+
requestValue: Q,
|
|
159
|
+
requestVisibleMonth: ie,
|
|
160
|
+
labelId: z,
|
|
161
|
+
hasHeader: ue,
|
|
162
|
+
setHasHeader: de
|
|
163
|
+
}), [
|
|
164
|
+
Z,
|
|
165
|
+
w,
|
|
166
|
+
ee,
|
|
167
|
+
T,
|
|
168
|
+
H,
|
|
169
|
+
U,
|
|
170
|
+
V,
|
|
171
|
+
ae,
|
|
172
|
+
G,
|
|
173
|
+
oe,
|
|
174
|
+
se,
|
|
175
|
+
X,
|
|
176
|
+
J,
|
|
177
|
+
ce,
|
|
178
|
+
Q,
|
|
179
|
+
ie,
|
|
180
|
+
z,
|
|
181
|
+
ue
|
|
182
|
+
]);
|
|
183
|
+
return /* @__PURE__ */ P(K.Provider, {
|
|
184
|
+
value: fe,
|
|
185
|
+
children: /* @__PURE__ */ P(i, {
|
|
186
|
+
className: O,
|
|
187
|
+
styles: I,
|
|
188
|
+
sx: A,
|
|
189
|
+
children: (t) => /* @__PURE__ */ F("div", {
|
|
190
|
+
...L,
|
|
191
|
+
ref: e,
|
|
192
|
+
"data-ui": "calendar",
|
|
193
|
+
className: t,
|
|
194
|
+
children: [M, D && V && /* @__PURE__ */ F(N, { children: [/* @__PURE__ */ P("span", {
|
|
195
|
+
id: V.start,
|
|
196
|
+
hidden: !0,
|
|
197
|
+
children: D.start
|
|
198
|
+
}), /* @__PURE__ */ P("span", {
|
|
199
|
+
id: V.end,
|
|
200
|
+
hidden: !0,
|
|
201
|
+
children: D.end
|
|
202
|
+
})] })]
|
|
203
|
+
})
|
|
204
|
+
})
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
Z.displayName = "Calendar";
|
|
208
|
+
function Q({ ref: e, className: t, sx: n, ...r }) {
|
|
209
|
+
let { visibleMonth: a, min: o, max: s, formatters: c, requestVisibleMonth: l, labelId: u, setHasHeader: d } = q("Header");
|
|
210
|
+
O(() => (d(!0), () => d(!1)), [d]);
|
|
211
|
+
let f = w(a, -1), p = w(a, 1), m = o !== void 0 && g(f) < o, _ = s !== void 0 && h(p) > s, y = (e) => c.month.format(v(h(e)));
|
|
212
|
+
return /* @__PURE__ */ P(i, {
|
|
213
|
+
className: t,
|
|
214
|
+
styles: L,
|
|
215
|
+
sx: n,
|
|
216
|
+
children: (t) => /* @__PURE__ */ F("div", {
|
|
217
|
+
...r,
|
|
218
|
+
ref: e,
|
|
219
|
+
"data-ui": "calendar-header",
|
|
220
|
+
className: t,
|
|
221
|
+
children: [
|
|
222
|
+
/* @__PURE__ */ P("button", {
|
|
223
|
+
type: "button",
|
|
224
|
+
"data-ui": "calendar-previous",
|
|
225
|
+
"aria-label": y(f),
|
|
226
|
+
"aria-disabled": m || void 0,
|
|
227
|
+
onClick: () => {
|
|
228
|
+
m || l(f);
|
|
229
|
+
},
|
|
230
|
+
css: B,
|
|
231
|
+
children: /* @__PURE__ */ P("span", {
|
|
232
|
+
"aria-hidden": "true",
|
|
233
|
+
css: V,
|
|
234
|
+
children: Y
|
|
235
|
+
})
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ P("span", {
|
|
238
|
+
id: u,
|
|
239
|
+
"aria-live": "polite",
|
|
240
|
+
"aria-atomic": "true",
|
|
241
|
+
"data-ui": "calendar-label",
|
|
242
|
+
css: R,
|
|
243
|
+
children: y(a)
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ P("button", {
|
|
246
|
+
type: "button",
|
|
247
|
+
"data-ui": "calendar-next",
|
|
248
|
+
"aria-label": y(p),
|
|
249
|
+
"aria-disabled": _ || void 0,
|
|
250
|
+
onClick: () => {
|
|
251
|
+
_ || l(p);
|
|
252
|
+
},
|
|
253
|
+
css: B,
|
|
254
|
+
children: /* @__PURE__ */ P("span", {
|
|
255
|
+
"aria-hidden": "true",
|
|
256
|
+
css: V,
|
|
257
|
+
children: X
|
|
258
|
+
})
|
|
259
|
+
})
|
|
260
|
+
]
|
|
261
|
+
})
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
Q.displayName = "Calendar.Header";
|
|
265
|
+
function re({ date: e, isTabStop: t }) {
|
|
266
|
+
let { value: n, selectionRange: r, previewRange: i, rangeLabelIds: a, today: o, min: s, max: c, formatters: l, setFocus: u, requestValue: f, onDayActivate: p, onFocusedDateChange: m } = q("Grid"), h = r !== void 0, g = d(e, s, c), _ = h ? J(e, r) : n === e, y = r?.start === e, b = r?.end === e, x = o === e, S = v(e), C = [y ? a?.start : void 0, b ? a?.end : void 0].filter(Boolean).join(" ") || void 0;
|
|
267
|
+
return /* @__PURE__ */ P("td", {
|
|
268
|
+
role: "gridcell",
|
|
269
|
+
"aria-selected": _ ? !0 : h && g ? !1 : void 0,
|
|
270
|
+
css: W,
|
|
271
|
+
children: /* @__PURE__ */ P("button", {
|
|
272
|
+
type: "button",
|
|
273
|
+
"data-ui": "calendar-day",
|
|
274
|
+
"data-date": e,
|
|
275
|
+
"data-today": x || void 0,
|
|
276
|
+
"data-selected": !h && _ || void 0,
|
|
277
|
+
"data-in-range": h && _ || void 0,
|
|
278
|
+
"data-range-start": y || void 0,
|
|
279
|
+
"data-range-end": b || void 0,
|
|
280
|
+
"data-preview": J(e, i) || void 0,
|
|
281
|
+
"data-preview-start": i?.start === e || void 0,
|
|
282
|
+
"data-preview-end": i?.end === e || void 0,
|
|
283
|
+
"aria-current": x ? "date" : void 0,
|
|
284
|
+
"aria-label": l.date.format(S),
|
|
285
|
+
"aria-describedby": C,
|
|
286
|
+
tabIndex: t ? 0 : -1,
|
|
287
|
+
disabled: !g,
|
|
288
|
+
onFocus: () => {
|
|
289
|
+
u({
|
|
290
|
+
date: e,
|
|
291
|
+
fallback: e
|
|
292
|
+
}), m(e);
|
|
293
|
+
},
|
|
294
|
+
onClick: () => {
|
|
295
|
+
u({
|
|
296
|
+
date: e,
|
|
297
|
+
fallback: e
|
|
298
|
+
}), h || f(e), p(e);
|
|
299
|
+
},
|
|
300
|
+
css: G,
|
|
301
|
+
children: l.day.format(S)
|
|
302
|
+
})
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
function $({ ref: e, onKeyDown: t, "aria-labelledby": n, "aria-label": r, className: a, sx: o, ...c }) {
|
|
306
|
+
let { value: l, selectionRange: u, tabStopDate: p, visibleMonth: y, today: x, min: S, max: C, firstDayOfWeek: w, formatters: T, focus: E, setFocus: ne, requestVisibleMonth: O, onFocusedDateChange: k, labelId: j, hasHeader: M } = q("Grid"), N = A(null);
|
|
307
|
+
D(e, () => N.current, []);
|
|
308
|
+
let I = A(!1), L = h(y), R = v(g(y)).getUTCDate(), z = Array.from({ length: R }, (e, t) => s(L, t)), B = (e) => e != null && z.includes(e) && d(e, S, C), V = p !== void 0, G = V ? B(p) ? p : void 0 : [
|
|
309
|
+
E?.date,
|
|
310
|
+
E?.fallback,
|
|
311
|
+
u === void 0 ? l : u?.start,
|
|
312
|
+
x
|
|
313
|
+
].find(B) ?? z.find((e) => d(e, S, C)), K = [...Array(ee(L, w)).fill(null), ...z], J = Array.from({ length: Math.ceil(K.length / 7) }, (e, t) => Array.from({ length: 7 }, (e, n) => K[t * 7 + n] ?? null)), Y = Array.from({ length: 7 }, (e, t) => v(s(b, (w + t) % 7)));
|
|
314
|
+
te(() => {
|
|
315
|
+
I.current && (I.current = !1, N.current?.querySelector(`[data-date="${G}"]`)?.focus());
|
|
316
|
+
});
|
|
317
|
+
let X = (e) => {
|
|
318
|
+
t?.(e);
|
|
319
|
+
let n = N.current;
|
|
320
|
+
if (e.defaultPrevented || !n) return;
|
|
321
|
+
let r = e.target.dataset.date;
|
|
322
|
+
if (!B(r)) return;
|
|
323
|
+
let i = _[getComputedStyle(n).direction === "rtl" ? "rtl" : "ltr"][e.key];
|
|
324
|
+
if (!i) return;
|
|
325
|
+
e.preventDefault();
|
|
326
|
+
let a = m(i(r, {
|
|
327
|
+
firstDayOfWeek: w,
|
|
328
|
+
shiftKey: e.shiftKey
|
|
329
|
+
}), S, C);
|
|
330
|
+
V ? k(a) : a !== r && (ne({
|
|
331
|
+
date: a,
|
|
332
|
+
fallback: r
|
|
333
|
+
}), I.current = !0, f(a) !== y && O(f(a)));
|
|
334
|
+
}, Z = [n, M ? j : void 0].filter(Boolean).join(" ") || void 0, Q = T.month.format(v(L));
|
|
335
|
+
return /* @__PURE__ */ P(i, {
|
|
336
|
+
className: a,
|
|
337
|
+
styles: H,
|
|
338
|
+
sx: o,
|
|
339
|
+
children: (e) => /* @__PURE__ */ F("table", {
|
|
340
|
+
...c,
|
|
341
|
+
ref: N,
|
|
342
|
+
role: "grid",
|
|
343
|
+
"aria-multiselectable": u !== void 0 || void 0,
|
|
344
|
+
"aria-labelledby": Z,
|
|
345
|
+
"aria-label": Z === void 0 ? r ?? Q : r,
|
|
346
|
+
"data-ui": "calendar-grid",
|
|
347
|
+
onKeyDown: X,
|
|
348
|
+
className: e,
|
|
349
|
+
children: [/* @__PURE__ */ P("thead", { children: /* @__PURE__ */ P("tr", {
|
|
350
|
+
role: "row",
|
|
351
|
+
children: Y.map((e) => /* @__PURE__ */ P("th", {
|
|
352
|
+
role: "columnheader",
|
|
353
|
+
scope: "col",
|
|
354
|
+
abbr: T.weekdayLong.format(e),
|
|
355
|
+
css: U,
|
|
356
|
+
children: T.weekdayShort.format(e)
|
|
357
|
+
}, e.getUTCDay()))
|
|
358
|
+
}) }), /* @__PURE__ */ P("tbody", { children: J.map((e, t) => /* @__PURE__ */ P("tr", {
|
|
359
|
+
role: "row",
|
|
360
|
+
children: e.map((e, t) => e === null ? /* @__PURE__ */ P("td", {
|
|
361
|
+
role: "gridcell",
|
|
362
|
+
css: W
|
|
363
|
+
}, `empty-${t}`) : /* @__PURE__ */ P(re, {
|
|
364
|
+
date: e,
|
|
365
|
+
isTabStop: e === G
|
|
366
|
+
}, e))
|
|
367
|
+
}, t)) })]
|
|
368
|
+
})
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
$.displayName = "Calendar.Grid";
|
|
372
|
+
var ie = Object.assign(Z, {
|
|
373
|
+
Header: Q,
|
|
374
|
+
Grid: $
|
|
375
|
+
});
|
|
376
|
+
//#endregion
|
|
377
|
+
export { ie as t };
|
package/dist/calendar.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Calendar } from "./calendar-
|
|
2
|
+
export { t as Calendar } from "./calendar-Bg6D2sul.js";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
//#region src/components/calendar/calendar.utils.ts
|
|
3
|
+
var e = /^\d{4}-\d{2}-\d{2}$/, t = /^\d{4}-\d{2}$/, n = "2026-01-04", r = (e, t) => String(e).padStart(t, "0");
|
|
4
|
+
function i(e, t, n) {
|
|
5
|
+
let r = new Date(Date.UTC(0, 0, 1));
|
|
6
|
+
return r.setUTCFullYear(e, t, n), r;
|
|
7
|
+
}
|
|
8
|
+
function a(e) {
|
|
9
|
+
let [t = NaN, n = NaN, r = 1] = e.split("-").map(Number);
|
|
10
|
+
return i(t, n - 1, r);
|
|
11
|
+
}
|
|
12
|
+
var o = (e) => `${r(e.getUTCFullYear(), 4)}-${r(e.getUTCMonth() + 1, 2)}-${r(e.getUTCDate(), 2)}`, s = (t) => t !== void 0 && e.test(t) && o(a(t)) === t, c = (e) => e !== void 0 && t.test(e) && s(`${e}-01`), l = (e) => e.slice(0, 7), u = (e) => `${e}-01`;
|
|
13
|
+
function d(e, t) {
|
|
14
|
+
let n = a(e);
|
|
15
|
+
return o(i(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + t));
|
|
16
|
+
}
|
|
17
|
+
function f(e, t) {
|
|
18
|
+
let n = a(e), r = i(n.getUTCFullYear(), n.getUTCMonth() + t, 1), s = i(r.getUTCFullYear(), r.getUTCMonth() + 1, 0).getUTCDate();
|
|
19
|
+
return o(i(r.getUTCFullYear(), r.getUTCMonth(), Math.min(n.getUTCDate(), s)));
|
|
20
|
+
}
|
|
21
|
+
var p = (e, t) => l(f(u(e), t)), m = (e) => d(u(p(e, 1)), -1), h = (e, t, n) => (t === void 0 || e >= t) && (n === void 0 || e <= n);
|
|
22
|
+
function g(e, t, n) {
|
|
23
|
+
return t !== void 0 && e < t ? t : n !== void 0 && e > n ? n : e;
|
|
24
|
+
}
|
|
25
|
+
var _ = (e, t) => (a(e).getUTCDay() - t + 7) % 7;
|
|
26
|
+
function v(e) {
|
|
27
|
+
let t = new Intl.Locale(e), n = t.getWeekInfo?.() ?? t.weekInfo;
|
|
28
|
+
return n ? n.firstDay % 7 : 0;
|
|
29
|
+
}
|
|
30
|
+
var y = {
|
|
31
|
+
calendar: "gregory",
|
|
32
|
+
timeZone: "UTC"
|
|
33
|
+
};
|
|
34
|
+
function b(e) {
|
|
35
|
+
return {
|
|
36
|
+
month: new Intl.DateTimeFormat(e, {
|
|
37
|
+
...y,
|
|
38
|
+
month: "long",
|
|
39
|
+
year: "numeric"
|
|
40
|
+
}),
|
|
41
|
+
day: new Intl.DateTimeFormat(e, {
|
|
42
|
+
...y,
|
|
43
|
+
day: "numeric"
|
|
44
|
+
}),
|
|
45
|
+
date: new Intl.DateTimeFormat(e, {
|
|
46
|
+
...y,
|
|
47
|
+
dateStyle: "long"
|
|
48
|
+
}),
|
|
49
|
+
weekdayShort: new Intl.DateTimeFormat(e, {
|
|
50
|
+
...y,
|
|
51
|
+
weekday: "short"
|
|
52
|
+
}),
|
|
53
|
+
weekdayLong: new Intl.DateTimeFormat(e, {
|
|
54
|
+
...y,
|
|
55
|
+
weekday: "long"
|
|
56
|
+
})
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
var x = () => typeof navigator > "u" ? void 0 : navigator.language, S = (e) => (t) => d(t, e), C = (e) => (t, { shiftKey: n }) => f(t, n ? e * 12 : e), w = {
|
|
60
|
+
ArrowDown: S(7),
|
|
61
|
+
ArrowUp: S(-7),
|
|
62
|
+
Home: (e, { firstDayOfWeek: t }) => d(e, -_(e, t)),
|
|
63
|
+
End: (e, { firstDayOfWeek: t }) => d(e, 6 - _(e, t)),
|
|
64
|
+
PageUp: C(-1),
|
|
65
|
+
PageDown: C(1)
|
|
66
|
+
}, T = {
|
|
67
|
+
ltr: {
|
|
68
|
+
...w,
|
|
69
|
+
ArrowRight: S(1),
|
|
70
|
+
ArrowLeft: S(-1)
|
|
71
|
+
},
|
|
72
|
+
rtl: {
|
|
73
|
+
...w,
|
|
74
|
+
ArrowRight: S(-1),
|
|
75
|
+
ArrowLeft: S(1)
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { d as _, b as a, x as c, c as d, h as f, l as g, v as h, g as i, u as l, m, T as n, a as o, o as p, n as r, i as s, y as t, s as u, p as v, _ as y };
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { t } from "./sx-BJXJ2xJK.js";
|
|
4
|
+
import { i as n, n as r, r as i } from "./surface-C69kwSuk.js";
|
|
5
|
+
import { c as a, o, s, t as c } from "./theme-scope-DGWy4H0C.js";
|
|
6
|
+
import { createContext as l, useContext as u } from "react";
|
|
7
|
+
import { vars as d } from "@jfrader/tokens/vars";
|
|
8
|
+
import { jsx as f } from "@emotion/react/jsx-runtime";
|
|
9
|
+
//#region src/components/card/card.tsx
|
|
10
|
+
var p = l(void 0);
|
|
11
|
+
function m(...e) {
|
|
12
|
+
return e.filter(Boolean).join(" ") || void 0;
|
|
13
|
+
}
|
|
14
|
+
var h = e({
|
|
15
|
+
...r,
|
|
16
|
+
minInlineSize: 0,
|
|
17
|
+
borderRadius: d.radius.lg,
|
|
18
|
+
paddingBlock: d.space[4],
|
|
19
|
+
paddingInline: d.space[5]
|
|
20
|
+
}), g = {
|
|
21
|
+
flat: e({ boxShadow: "none" }),
|
|
22
|
+
raised: e({ boxShadow: d.shadow.raised })
|
|
23
|
+
}, _ = e({
|
|
24
|
+
display: "grid",
|
|
25
|
+
gap: d.space[1],
|
|
26
|
+
marginBlockEnd: d.space[4]
|
|
27
|
+
}), v = e({
|
|
28
|
+
margin: 0,
|
|
29
|
+
fontSize: d.textSize.md,
|
|
30
|
+
fontWeight: d.fontWeight.semibold,
|
|
31
|
+
lineHeight: d.lineHeight.tight,
|
|
32
|
+
color: d.color.text
|
|
33
|
+
}), y = e({
|
|
34
|
+
margin: 0,
|
|
35
|
+
fontSize: d.textSize.sm,
|
|
36
|
+
color: d.color.textMuted
|
|
37
|
+
}), b = e({
|
|
38
|
+
fontSize: d.textSize.sm,
|
|
39
|
+
color: d.color.text
|
|
40
|
+
}), x = e({
|
|
41
|
+
display: "flex",
|
|
42
|
+
flexWrap: "wrap",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "space-between",
|
|
45
|
+
gap: d.space[2],
|
|
46
|
+
marginBlockStart: d.space[4],
|
|
47
|
+
paddingBlockStart: d.space[4],
|
|
48
|
+
borderBlockStart: `1px solid ${d.color.borderSubtle}`,
|
|
49
|
+
"& > :only-child": { marginInlineStart: "auto" }
|
|
50
|
+
});
|
|
51
|
+
function S({ ref: e, variant: r = "raised", appearance: l, slotProps: u, className: d, style: _, sx: v, ...y }) {
|
|
52
|
+
let b = s(l), x = n(l ?? "default"), S = a(x, _);
|
|
53
|
+
return /* @__PURE__ */ f(p.Provider, {
|
|
54
|
+
value: u,
|
|
55
|
+
children: /* @__PURE__ */ f(c, {
|
|
56
|
+
theme: x,
|
|
57
|
+
appearance: b,
|
|
58
|
+
children: /* @__PURE__ */ f(t, {
|
|
59
|
+
className: m(u?.root?.className, d),
|
|
60
|
+
styles: [
|
|
61
|
+
h,
|
|
62
|
+
g[r],
|
|
63
|
+
x && o,
|
|
64
|
+
u?.root?.css
|
|
65
|
+
],
|
|
66
|
+
sx: v,
|
|
67
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
68
|
+
...y,
|
|
69
|
+
ref: e,
|
|
70
|
+
"data-ui": "card",
|
|
71
|
+
"data-variant": r,
|
|
72
|
+
...i(l ?? "default"),
|
|
73
|
+
className: t,
|
|
74
|
+
style: S
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
S.displayName = "Card";
|
|
81
|
+
function C({ ref: e, className: n, sx: r, ...i }) {
|
|
82
|
+
let a = u(p)?.header;
|
|
83
|
+
return /* @__PURE__ */ f(t, {
|
|
84
|
+
className: m(a?.className, n),
|
|
85
|
+
styles: [_, a?.css],
|
|
86
|
+
sx: r,
|
|
87
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
88
|
+
...i,
|
|
89
|
+
ref: e,
|
|
90
|
+
"data-ui": "card-header",
|
|
91
|
+
className: t
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
C.displayName = "Card.Header";
|
|
96
|
+
function w({ ref: e, level: n = 3, className: r, sx: i, ...a }) {
|
|
97
|
+
let o = u(p)?.title, s = `h${n}`;
|
|
98
|
+
return /* @__PURE__ */ f(t, {
|
|
99
|
+
className: m(o?.className, r),
|
|
100
|
+
styles: [v, o?.css],
|
|
101
|
+
sx: i,
|
|
102
|
+
children: (t) => /* @__PURE__ */ f(s, {
|
|
103
|
+
...a,
|
|
104
|
+
ref: e,
|
|
105
|
+
"data-ui": "card-title",
|
|
106
|
+
className: t
|
|
107
|
+
})
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
w.displayName = "Card.Title";
|
|
111
|
+
function T({ ref: e, className: n, sx: r, ...i }) {
|
|
112
|
+
let a = u(p)?.description;
|
|
113
|
+
return /* @__PURE__ */ f(t, {
|
|
114
|
+
className: m(a?.className, n),
|
|
115
|
+
styles: [y, a?.css],
|
|
116
|
+
sx: r,
|
|
117
|
+
children: (t) => /* @__PURE__ */ f("p", {
|
|
118
|
+
...i,
|
|
119
|
+
ref: e,
|
|
120
|
+
"data-ui": "card-description",
|
|
121
|
+
className: t
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
T.displayName = "Card.Description";
|
|
126
|
+
function E({ ref: e, className: n, sx: r, ...i }) {
|
|
127
|
+
let a = u(p)?.content;
|
|
128
|
+
return /* @__PURE__ */ f(t, {
|
|
129
|
+
className: m(a?.className, n),
|
|
130
|
+
styles: [b, a?.css],
|
|
131
|
+
sx: r,
|
|
132
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
133
|
+
...i,
|
|
134
|
+
ref: e,
|
|
135
|
+
"data-ui": "card-content",
|
|
136
|
+
className: t
|
|
137
|
+
})
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
E.displayName = "Card.Content";
|
|
141
|
+
function D({ ref: e, className: n, sx: r, ...i }) {
|
|
142
|
+
let a = u(p)?.footer;
|
|
143
|
+
return /* @__PURE__ */ f(t, {
|
|
144
|
+
className: m(a?.className, n),
|
|
145
|
+
styles: [x, a?.css],
|
|
146
|
+
sx: r,
|
|
147
|
+
children: (t) => /* @__PURE__ */ f("div", {
|
|
148
|
+
...i,
|
|
149
|
+
ref: e,
|
|
150
|
+
"data-ui": "card-footer",
|
|
151
|
+
className: t
|
|
152
|
+
})
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
D.displayName = "Card.Footer";
|
|
156
|
+
var O = Object.assign(S, {
|
|
157
|
+
Header: C,
|
|
158
|
+
Title: w,
|
|
159
|
+
Description: T,
|
|
160
|
+
Content: E,
|
|
161
|
+
Footer: D
|
|
162
|
+
});
|
|
163
|
+
//#endregion
|
|
164
|
+
export { O as t };
|
package/dist/card.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Card } from "./card-
|
|
2
|
+
export { t as Card } from "./card-C008OQCp.js";
|