@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
package/dist/switch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Switch } from "./switch-
|
|
2
|
+
export { t as Switch } from "./switch-79-hkQqg.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { n as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { jsx as t } from "@emotion/react/jsx-runtime";
|
|
4
|
+
//#region src/styling/sx.tsx
|
|
5
|
+
var n = (e) => Array.isArray(e);
|
|
6
|
+
function r(e, t) {
|
|
7
|
+
return typeof e == "function" ? r(e(t), t) : n(e) ? e.map((e) => r(e, t)) : e;
|
|
8
|
+
}
|
|
9
|
+
function i({ className: n, styles: i, children: a }) {
|
|
10
|
+
return /* @__PURE__ */ t(e, { children: ({ css: e, cx: t, theme: o }) => a(i === void 0 ? n : t(e(r(i, o)), n)) });
|
|
11
|
+
}
|
|
12
|
+
function a({ className: e, styles: n, sx: r, children: a }) {
|
|
13
|
+
return /* @__PURE__ */ t(i, {
|
|
14
|
+
styles: r,
|
|
15
|
+
children: (o) => /* @__PURE__ */ t(i, {
|
|
16
|
+
className: r === void 0 ? e : [e, o].filter(Boolean).join(" "),
|
|
17
|
+
styles: n,
|
|
18
|
+
children: a
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { a as t };
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { n as t, 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 "./sx-BJXJ2xJK.js";
|
|
6
|
+
import { n as o, r as s, t as c } from "./roving-focus-CYlo_Kf8.js";
|
|
7
|
+
import { t as l } from "./use-controlled-state-DpeVQZNR.js";
|
|
8
|
+
import { t as u } from "./part-id-D0zksy32.js";
|
|
9
|
+
import { createContext as d, useContext as f, useEffect as p, useId as m, useImperativeHandle as h, useMemo as g, useRef as _, useState as v } from "react";
|
|
10
|
+
import { vars as y } from "@jfrader/tokens/vars";
|
|
11
|
+
import { jsx as b } from "@emotion/react/jsx-runtime";
|
|
12
|
+
//#region src/components/tabs/tabs.tsx
|
|
13
|
+
var x = d(null);
|
|
14
|
+
function S(e) {
|
|
15
|
+
let t = f(x);
|
|
16
|
+
if (!t) throw Error(`Tabs.${e} must be rendered inside <Tabs>.`);
|
|
17
|
+
return t;
|
|
18
|
+
}
|
|
19
|
+
var C = {
|
|
20
|
+
itemSelector: "[role=\"tab\"]:not([disabled])",
|
|
21
|
+
ownerSelector: "[role=\"tablist\"]"
|
|
22
|
+
}, w = e({ "&[data-orientation=\"vertical\"]": {
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "flex-start",
|
|
25
|
+
gap: y.space[4]
|
|
26
|
+
} }), T = {
|
|
27
|
+
horizontal: e({
|
|
28
|
+
display: "inline-flex",
|
|
29
|
+
gap: y.space[1],
|
|
30
|
+
borderBlockEnd: `1px solid ${y.color.border}`
|
|
31
|
+
}),
|
|
32
|
+
vertical: e({
|
|
33
|
+
display: "inline-flex",
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
alignItems: "stretch",
|
|
36
|
+
borderInlineEnd: `1px solid ${y.color.border}`
|
|
37
|
+
})
|
|
38
|
+
}, E = e({
|
|
39
|
+
appearance: "none",
|
|
40
|
+
border: 0,
|
|
41
|
+
background: "transparent",
|
|
42
|
+
cursor: "pointer",
|
|
43
|
+
paddingBlock: y.space[2],
|
|
44
|
+
paddingInline: y.space[3],
|
|
45
|
+
font: "inherit",
|
|
46
|
+
fontSize: y.textSize.sm,
|
|
47
|
+
fontWeight: y.fontWeight.medium,
|
|
48
|
+
color: y.color.textMuted,
|
|
49
|
+
transitionProperty: "color, border-color",
|
|
50
|
+
transitionDuration: y.motion.duration.fast,
|
|
51
|
+
transitionTimingFunction: y.motion.easeStandard,
|
|
52
|
+
"&:hover:not(:disabled):not([aria-selected=\"true\"])": { color: y.color.text },
|
|
53
|
+
"&[aria-selected=\"true\"]": {
|
|
54
|
+
color: y.color.text,
|
|
55
|
+
borderColor: y.color.accent
|
|
56
|
+
},
|
|
57
|
+
"&:disabled": {
|
|
58
|
+
opacity: .55,
|
|
59
|
+
cursor: "not-allowed"
|
|
60
|
+
},
|
|
61
|
+
"&:focus-visible": { ...n },
|
|
62
|
+
[i]: { transitionDuration: "0s" },
|
|
63
|
+
[r]: {
|
|
64
|
+
borderColor: "Canvas",
|
|
65
|
+
"&[aria-selected=\"true\"]": { borderColor: "Highlight" }
|
|
66
|
+
}
|
|
67
|
+
}), D = {
|
|
68
|
+
horizontal: e({
|
|
69
|
+
borderBlockEnd: "2px solid transparent",
|
|
70
|
+
marginBlockEnd: "-1px"
|
|
71
|
+
}),
|
|
72
|
+
vertical: e({
|
|
73
|
+
borderInlineEnd: "2px solid transparent",
|
|
74
|
+
marginInlineEnd: "-1px",
|
|
75
|
+
textAlign: "start"
|
|
76
|
+
})
|
|
77
|
+
}, O = e({
|
|
78
|
+
color: y.color.text,
|
|
79
|
+
outline: "none",
|
|
80
|
+
"&:focus-visible": { ...t },
|
|
81
|
+
"&[hidden]": { display: "none" }
|
|
82
|
+
}), k = e({ paddingBlockStart: y.space[3] });
|
|
83
|
+
function A({ ref: e, value: t, defaultValue: n, onValueChange: r, orientation: i = "horizontal", activation: o = "auto", className: s, sx: c, ...u }) {
|
|
84
|
+
let d = m(), [f, p] = l(t, n, r), [h, _] = v(null), y = g(() => ({
|
|
85
|
+
value: f,
|
|
86
|
+
setValue: p,
|
|
87
|
+
focused: h,
|
|
88
|
+
setFocused: _,
|
|
89
|
+
orientation: i,
|
|
90
|
+
activation: o,
|
|
91
|
+
baseId: d
|
|
92
|
+
}), [
|
|
93
|
+
f,
|
|
94
|
+
p,
|
|
95
|
+
h,
|
|
96
|
+
i,
|
|
97
|
+
o,
|
|
98
|
+
d
|
|
99
|
+
]);
|
|
100
|
+
return /* @__PURE__ */ b(x.Provider, {
|
|
101
|
+
value: y,
|
|
102
|
+
children: /* @__PURE__ */ b(a, {
|
|
103
|
+
className: s,
|
|
104
|
+
styles: w,
|
|
105
|
+
sx: c,
|
|
106
|
+
children: (t) => /* @__PURE__ */ b("div", {
|
|
107
|
+
...u,
|
|
108
|
+
ref: e,
|
|
109
|
+
"data-ui": "tabs-root",
|
|
110
|
+
"data-orientation": i,
|
|
111
|
+
className: t
|
|
112
|
+
})
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
A.displayName = "Tabs";
|
|
117
|
+
function j({ ref: e, onKeyDown: t, className: n, sx: r, ...i }) {
|
|
118
|
+
let { orientation: l, value: u, focused: d, setFocused: f } = S("List"), m = _(null);
|
|
119
|
+
h(e, () => m.current, []), p(() => {
|
|
120
|
+
let e = m.current;
|
|
121
|
+
if (!e) return;
|
|
122
|
+
let t = s(e, C);
|
|
123
|
+
t.length !== 0 && (t.some((e) => e.tabIndex === 0) || f((c(t, u) ?? c(t, d) ?? t[0])?.dataset.value ?? null));
|
|
124
|
+
});
|
|
125
|
+
let g = (e) => {
|
|
126
|
+
t?.(e);
|
|
127
|
+
let n = m.current;
|
|
128
|
+
!e.defaultPrevented && n && o(e, n, l, C);
|
|
129
|
+
};
|
|
130
|
+
return /* @__PURE__ */ b(a, {
|
|
131
|
+
className: n,
|
|
132
|
+
styles: T[l],
|
|
133
|
+
sx: r,
|
|
134
|
+
children: (e) => /* @__PURE__ */ b("div", {
|
|
135
|
+
...i,
|
|
136
|
+
ref: m,
|
|
137
|
+
role: "tablist",
|
|
138
|
+
"aria-orientation": l,
|
|
139
|
+
"data-ui": "tabs-list",
|
|
140
|
+
"data-orientation": l,
|
|
141
|
+
"data-roving": d ?? "",
|
|
142
|
+
"data-selected": u ?? "",
|
|
143
|
+
onKeyDown: g,
|
|
144
|
+
className: e
|
|
145
|
+
})
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
j.displayName = "Tabs.List";
|
|
149
|
+
function M({ ref: e, value: t, disabled: n, onClick: r, onFocus: i, onPointerDown: o, className: s, sx: c, ...l }) {
|
|
150
|
+
let { value: d, setValue: f, focused: p, setFocused: m, activation: h, baseId: g, orientation: v } = S("Tab"), y = d === t, x = !n && (p === null ? y : p === t), C = _(!1), w = (e) => {
|
|
151
|
+
if (r?.(e), e.defaultPrevented) return;
|
|
152
|
+
let n = C.current;
|
|
153
|
+
C.current = !1, !(h === "auto" && n && e.detail !== 0) && f(t);
|
|
154
|
+
}, T = (e) => {
|
|
155
|
+
i?.(e), !e.defaultPrevented && (C.current = !0, m(t), h === "auto" && f(t));
|
|
156
|
+
};
|
|
157
|
+
return /* @__PURE__ */ b(a, {
|
|
158
|
+
className: s,
|
|
159
|
+
styles: [E, D[v]],
|
|
160
|
+
sx: c,
|
|
161
|
+
children: (r) => /* @__PURE__ */ b("button", {
|
|
162
|
+
...l,
|
|
163
|
+
ref: e,
|
|
164
|
+
type: "button",
|
|
165
|
+
role: "tab",
|
|
166
|
+
id: u(g, "tab", t),
|
|
167
|
+
"data-ui": "tabs-tab",
|
|
168
|
+
"data-value": t,
|
|
169
|
+
"data-state": y ? "active" : "inactive",
|
|
170
|
+
"aria-selected": y,
|
|
171
|
+
"aria-controls": u(g, "panel", t),
|
|
172
|
+
tabIndex: x ? 0 : -1,
|
|
173
|
+
disabled: n,
|
|
174
|
+
onClick: w,
|
|
175
|
+
onFocus: T,
|
|
176
|
+
onPointerDown: (e) => {
|
|
177
|
+
C.current = !1, o?.(e);
|
|
178
|
+
},
|
|
179
|
+
className: r
|
|
180
|
+
})
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
M.displayName = "Tabs.Tab";
|
|
184
|
+
function N({ ref: e, value: t, tabIndex: n = 0, "aria-labelledby": r, className: i, sx: o, ...s }) {
|
|
185
|
+
let { value: c, baseId: l, orientation: d } = S("Panel"), f = c === t, p = [r, u(l, "tab", t)].filter(Boolean).join(" ") || void 0;
|
|
186
|
+
return /* @__PURE__ */ b(a, {
|
|
187
|
+
className: i,
|
|
188
|
+
styles: [O, d === "horizontal" && k],
|
|
189
|
+
sx: o,
|
|
190
|
+
children: (r) => /* @__PURE__ */ b("div", {
|
|
191
|
+
...s,
|
|
192
|
+
ref: e,
|
|
193
|
+
role: "tabpanel",
|
|
194
|
+
id: u(l, "panel", t),
|
|
195
|
+
"aria-labelledby": p,
|
|
196
|
+
tabIndex: n,
|
|
197
|
+
hidden: !f,
|
|
198
|
+
"data-ui": "tabs-panel",
|
|
199
|
+
"data-state": f ? "active" : "inactive",
|
|
200
|
+
className: r
|
|
201
|
+
})
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
N.displayName = "Tabs.Panel";
|
|
205
|
+
var P = Object.assign(A, {
|
|
206
|
+
List: j,
|
|
207
|
+
Tab: M,
|
|
208
|
+
Panel: N
|
|
209
|
+
});
|
|
210
|
+
//#endregion
|
|
211
|
+
export { P as t };
|
package/dist/tabs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Tabs } from "./tabs-
|
|
2
|
+
export { t as Tabs } from "./tabs-Bb5-noYE.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
3
|
import { t } from "./focus-ring-BK5W5_NY.js";
|
|
4
4
|
import { n, r, t as i } from "./media-8yrN85VT.js";
|
|
5
5
|
import { t as a } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
-
import { t as ee } from "./visually-hidden-
|
|
6
|
+
import { t as ee } from "./visually-hidden-DgVO3NaB.js";
|
|
7
7
|
import { t as te } from "./renderable-DzcIj1Lo.js";
|
|
8
|
-
import { t as ne } from "./icon-wrapper-
|
|
9
|
-
import { t as re } from "./input-control-
|
|
10
|
-
import { a as ie, i as ae, n as oe, r as se, t as ce } from "./field-anatomy-
|
|
8
|
+
import { t as ne } from "./icon-wrapper-C-zMD0uL.js";
|
|
9
|
+
import { t as re } from "./input-control-B6HVBgwl.js";
|
|
10
|
+
import { a as ie, i as ae, n as oe, r as se, t as ce } from "./field-anatomy-BDIP42MI.js";
|
|
11
11
|
import { useEffect as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
12
12
|
import { vars as u } from "@jfrader/tokens/vars";
|
|
13
13
|
import { jsx as d, jsxs as f } from "@emotion/react/jsx-runtime";
|
package/dist/tag-input.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as TagInput } from "./tag-input-
|
|
2
|
+
export { t as TagInput } from "./tag-input-BQaueKEb.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { t } from "./input-control-
|
|
4
|
-
import { a as n, i as r, n as i, r as a, t as o } from "./field-anatomy-
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { t } from "./input-control-B6HVBgwl.js";
|
|
4
|
+
import { a as n, i as r, n as i, r as a, t as o } from "./field-anatomy-BDIP42MI.js";
|
|
5
5
|
import { vars as s } from "@jfrader/tokens/vars";
|
|
6
6
|
import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
|
|
7
7
|
//#region src/components/text-field/text-field.tsx
|
|
@@ -22,36 +22,38 @@ var u = {
|
|
|
22
22
|
fontSize: s.textSize.md
|
|
23
23
|
})
|
|
24
24
|
};
|
|
25
|
-
function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChange: m, onValueChange: h, slotProps: g, className: _, sx: v, required: y, id: b, "aria-describedby":
|
|
26
|
-
let
|
|
25
|
+
function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChange: m, onValueChange: h, slotProps: g, className: _, sx: v, required: y, id: b, dir: x, "aria-describedby": S, "aria-invalid": C, ...w }) {
|
|
26
|
+
let T = n({
|
|
27
27
|
id: b,
|
|
28
28
|
description: d,
|
|
29
29
|
error: f,
|
|
30
|
-
"aria-describedby":
|
|
31
|
-
"aria-invalid":
|
|
32
|
-
}),
|
|
30
|
+
"aria-describedby": S,
|
|
31
|
+
"aria-invalid": C
|
|
32
|
+
}), E = (e) => {
|
|
33
33
|
m?.(e), h?.(e.currentTarget.value);
|
|
34
34
|
};
|
|
35
35
|
return /* @__PURE__ */ l(r, {
|
|
36
36
|
"data-ui": "text-field",
|
|
37
|
+
dir: x,
|
|
37
38
|
className: _,
|
|
38
39
|
sx: v,
|
|
39
40
|
part: g?.root,
|
|
40
41
|
children: [
|
|
41
42
|
/* @__PURE__ */ c(a, {
|
|
42
|
-
htmlFor:
|
|
43
|
+
htmlFor: T.id,
|
|
43
44
|
required: y,
|
|
44
45
|
part: g?.label,
|
|
45
46
|
children: s
|
|
46
47
|
}),
|
|
47
48
|
/* @__PURE__ */ c("input", {
|
|
48
|
-
...
|
|
49
|
+
...w,
|
|
49
50
|
ref: e,
|
|
50
|
-
id:
|
|
51
|
+
id: T.id,
|
|
52
|
+
dir: x,
|
|
51
53
|
required: y,
|
|
52
|
-
"aria-describedby":
|
|
53
|
-
"aria-invalid":
|
|
54
|
-
onChange:
|
|
54
|
+
"aria-describedby": T.describedBy,
|
|
55
|
+
"aria-invalid": T.ariaInvalid,
|
|
56
|
+
onChange: E,
|
|
55
57
|
className: g?.control?.className,
|
|
56
58
|
css: [
|
|
57
59
|
t,
|
|
@@ -60,12 +62,12 @@ function d({ ref: e, label: s, description: d, error: f, size: p = "md", onChang
|
|
|
60
62
|
]
|
|
61
63
|
}),
|
|
62
64
|
/* @__PURE__ */ c(o, {
|
|
63
|
-
id:
|
|
65
|
+
id: T.descriptionId,
|
|
64
66
|
part: g?.description,
|
|
65
67
|
children: d
|
|
66
68
|
}),
|
|
67
69
|
/* @__PURE__ */ c(i, {
|
|
68
|
-
id:
|
|
70
|
+
id: T.errorId,
|
|
69
71
|
part: g?.error,
|
|
70
72
|
children: f
|
|
71
73
|
})
|
package/dist/text-field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as TextField } from "./text-field-
|
|
2
|
+
export { t as TextField } from "./text-field-D0VP7b4P.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { t } from "./input-control-
|
|
4
|
-
import { a as n, i as r, n as i, r as a, t as o } from "./field-anatomy-
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { t } from "./input-control-B6HVBgwl.js";
|
|
4
|
+
import { a as n, i as r, n as i, r as a, t as o } from "./field-anatomy-BDIP42MI.js";
|
|
5
5
|
import { vars as s } from "@jfrader/tokens/vars";
|
|
6
6
|
import { jsx as c, jsxs as l } from "@emotion/react/jsx-runtime";
|
|
7
7
|
//#region src/components/textarea/textarea.tsx
|
|
@@ -28,37 +28,39 @@ var u = e({
|
|
|
28
28
|
none: e({ resize: "none" }),
|
|
29
29
|
vertical: e({ resize: "vertical" })
|
|
30
30
|
}, p = e({ fieldSizing: "content" });
|
|
31
|
-
function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize: _ = "vertical", autoResize: v = !1, rows: y = 3, onChange: b, onValueChange: x, slotProps: S, className: C, sx: w,
|
|
32
|
-
let
|
|
33
|
-
id:
|
|
31
|
+
function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize: _ = "vertical", autoResize: v = !1, rows: y = 3, onChange: b, onValueChange: x, slotProps: S, className: C, sx: w, dir: T, required: E, id: D, "aria-describedby": O, "aria-invalid": k, ...A }) {
|
|
32
|
+
let j = n({
|
|
33
|
+
id: D,
|
|
34
34
|
description: m,
|
|
35
35
|
error: h,
|
|
36
|
-
"aria-describedby":
|
|
37
|
-
"aria-invalid":
|
|
38
|
-
}),
|
|
36
|
+
"aria-describedby": O,
|
|
37
|
+
"aria-invalid": k
|
|
38
|
+
}), M = (e) => {
|
|
39
39
|
b?.(e), x?.(e.currentTarget.value);
|
|
40
40
|
};
|
|
41
41
|
return /* @__PURE__ */ l(r, {
|
|
42
42
|
"data-ui": "textarea",
|
|
43
|
+
dir: T,
|
|
43
44
|
className: C,
|
|
44
45
|
sx: w,
|
|
45
46
|
part: S?.root,
|
|
46
47
|
children: [
|
|
47
48
|
/* @__PURE__ */ c(a, {
|
|
48
|
-
htmlFor:
|
|
49
|
-
required:
|
|
49
|
+
htmlFor: j.id,
|
|
50
|
+
required: E,
|
|
50
51
|
part: S?.label,
|
|
51
52
|
children: s
|
|
52
53
|
}),
|
|
53
54
|
/* @__PURE__ */ c("textarea", {
|
|
54
|
-
...
|
|
55
|
+
...A,
|
|
55
56
|
ref: e,
|
|
56
|
-
id:
|
|
57
|
+
id: j.id,
|
|
57
58
|
rows: y,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"aria-
|
|
61
|
-
|
|
59
|
+
dir: T,
|
|
60
|
+
required: E,
|
|
61
|
+
"aria-describedby": j.describedBy,
|
|
62
|
+
"aria-invalid": j.ariaInvalid,
|
|
63
|
+
onChange: M,
|
|
62
64
|
className: S?.control?.className,
|
|
63
65
|
css: [
|
|
64
66
|
t,
|
|
@@ -70,12 +72,12 @@ function m({ ref: e, label: s, description: m, error: h, size: g = "md", resize:
|
|
|
70
72
|
]
|
|
71
73
|
}),
|
|
72
74
|
/* @__PURE__ */ c(o, {
|
|
73
|
-
id:
|
|
75
|
+
id: j.descriptionId,
|
|
74
76
|
part: S?.description,
|
|
75
77
|
children: m
|
|
76
78
|
}),
|
|
77
79
|
/* @__PURE__ */ c(i, {
|
|
78
|
-
id:
|
|
80
|
+
id: j.errorId,
|
|
79
81
|
part: S?.error,
|
|
80
82
|
children: h
|
|
81
83
|
})
|
package/dist/textarea.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as Textarea } from "./textarea-
|
|
2
|
+
export { t as Textarea } from "./textarea-D1YwEPmn.js";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { o as e, r as t } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { vars as n } from "@jfrader/tokens/vars";
|
|
4
|
+
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
5
|
+
//#region src/styling/theme.ts
|
|
6
|
+
var i = n;
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region src/components/theme-provider/theme-provider.tsx
|
|
9
|
+
function a({ theme: e = i, children: n }) {
|
|
10
|
+
return /* @__PURE__ */ r(t, {
|
|
11
|
+
theme: e,
|
|
12
|
+
children: n
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
a.displayName = "ThemeProvider";
|
|
16
|
+
function o() {
|
|
17
|
+
return e();
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { o as n, i as r, a as t };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { t as e } from "./sx-BJXJ2xJK.js";
|
|
3
|
+
import { a as t, i as n, o as r, r as i } from "./theme-scope-DGWy4H0C.js";
|
|
4
|
+
import { r as a, t as o } from "./theme-provider-BvcY-iJu.js";
|
|
5
|
+
import { useContext as s, useMemo as c } from "react";
|
|
6
|
+
import { jsx as l } from "@emotion/react/jsx-runtime";
|
|
7
|
+
import { base as u, light as d } from "@jfrader/tokens";
|
|
8
|
+
//#region src/styling/create-theme.ts
|
|
9
|
+
var f = {
|
|
10
|
+
dark: {
|
|
11
|
+
hoverLightness: .08,
|
|
12
|
+
textMaxLightness: null
|
|
13
|
+
},
|
|
14
|
+
light: {
|
|
15
|
+
hoverLightness: -.06,
|
|
16
|
+
textMaxLightness: .5
|
|
17
|
+
}
|
|
18
|
+
}, p = {
|
|
19
|
+
accentSoft: 22,
|
|
20
|
+
accentSoftHover: 30,
|
|
21
|
+
accentBorder: 50
|
|
22
|
+
}, m = [u.color.accentContrast, d.color.accentContrast], h = 1e-4, g = [
|
|
23
|
+
[
|
|
24
|
+
.4122214708,
|
|
25
|
+
.5363325363,
|
|
26
|
+
.0514459929
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
.2119034982,
|
|
30
|
+
.6806995451,
|
|
31
|
+
.1073969566
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
.0883024619,
|
|
35
|
+
.2817188376,
|
|
36
|
+
.6299787005
|
|
37
|
+
]
|
|
38
|
+
], _ = [
|
|
39
|
+
[
|
|
40
|
+
.2104542553,
|
|
41
|
+
.793617785,
|
|
42
|
+
-.0040720468
|
|
43
|
+
],
|
|
44
|
+
[
|
|
45
|
+
1.9779984951,
|
|
46
|
+
-2.428592205,
|
|
47
|
+
.4505937099
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
.0259040371,
|
|
51
|
+
.7827717662,
|
|
52
|
+
-.808675766
|
|
53
|
+
]
|
|
54
|
+
], v = [
|
|
55
|
+
.2126,
|
|
56
|
+
.7152,
|
|
57
|
+
.0722
|
|
58
|
+
], y = /^#(?:[\da-f]{3}|[\da-f]{6})$/i, b = (e, t) => e[0] * t[0] + e[1] * t[1] + e[2] * t[2], x = (e) => Math.min(1, Math.max(0, e)), S = (e, t) => Number(e.toFixed(t));
|
|
59
|
+
function C(e) {
|
|
60
|
+
if (!y.test(e)) throw Error(`createTheme: accent must be a #rgb or #rrggbb color, got "${e}".`);
|
|
61
|
+
let [t, n, r] = (e.length === 4 ? [...e.slice(1)].map((e) => e + e) : e.slice(1).match(/../g)).map((e) => {
|
|
62
|
+
let t = Number.parseInt(e, 16) / 255;
|
|
63
|
+
return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
64
|
+
});
|
|
65
|
+
return [
|
|
66
|
+
t,
|
|
67
|
+
n,
|
|
68
|
+
r
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
function w(e) {
|
|
72
|
+
return b(v, e);
|
|
73
|
+
}
|
|
74
|
+
function T(e, t) {
|
|
75
|
+
return (Math.max(e, t) + .05) / (Math.min(e, t) + .05);
|
|
76
|
+
}
|
|
77
|
+
function E(e) {
|
|
78
|
+
let t = w(e), n = (e) => T(t, w(C(e)));
|
|
79
|
+
return m.reduce((e, t) => n(t) > n(e) ? t : e);
|
|
80
|
+
}
|
|
81
|
+
function D(e) {
|
|
82
|
+
let [t, n, r] = g.map((t) => Math.cbrt(b(t, e))), i = [
|
|
83
|
+
t,
|
|
84
|
+
n,
|
|
85
|
+
r
|
|
86
|
+
], [a, o, s] = _.map((e) => b(e, i)), c = Math.hypot(o, s);
|
|
87
|
+
return {
|
|
88
|
+
lightness: a,
|
|
89
|
+
chroma: c,
|
|
90
|
+
hue: c < h ? 0 : (Math.atan2(s, o) * 180 / Math.PI + 360) % 360
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function O(e, t, n) {
|
|
94
|
+
return `oklch(${S(x(e) * 100, 2)}% ${S(t, 4)} ${S(n, 2)})`;
|
|
95
|
+
}
|
|
96
|
+
function k(e, t) {
|
|
97
|
+
let n = C(e), { lightness: r, chroma: i, hue: a } = D(n), { hoverLightness: o, textMaxLightness: s } = f[t], c = (t) => `color-mix(in oklab, ${e} ${t}%, transparent)`;
|
|
98
|
+
return {
|
|
99
|
+
accent: e,
|
|
100
|
+
accentHover: O(r + o, i, a),
|
|
101
|
+
accentText: s === null ? e : O(Math.min(r, s), i, a),
|
|
102
|
+
accentSoft: c(p.accentSoft),
|
|
103
|
+
accentSoftHover: c(p.accentSoftHover),
|
|
104
|
+
accentBorder: c(p.accentBorder),
|
|
105
|
+
accentContrast: E(n),
|
|
106
|
+
focusRing: e
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
function A(e, t) {
|
|
110
|
+
return Object.fromEntries([.../* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])].map((n) => {
|
|
111
|
+
let [r, i] = [e[n], t[n]];
|
|
112
|
+
return [n, typeof r == "object" && typeof i == "object" ? A(r, i) : i ?? r];
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
function j({ base: e = "dark", accent: t, tokens: n = {} } = {}) {
|
|
116
|
+
return A(t === void 0 ? {} : { color: k(t, e) }, n);
|
|
117
|
+
}
|
|
118
|
+
var M = /^var\((--[\w-]+)\)$/;
|
|
119
|
+
function N(e, t) {
|
|
120
|
+
return Object.entries(e).flatMap(([e, n]) => {
|
|
121
|
+
let r = t[e];
|
|
122
|
+
if (typeof n == "object" && typeof r == "object") return N(n, r);
|
|
123
|
+
let i = typeof r == "string" ? M.exec(r)?.[1] : void 0;
|
|
124
|
+
return typeof n == "string" && i ? [[i, n]] : [];
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function P(e) {
|
|
128
|
+
return Object.fromEntries(N(e, a));
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region src/components/theme-root/theme-root.tsx
|
|
132
|
+
function F({ ref: a, theme: u = "dark", tokens: d, portalContainer: f, className: p, style: m, sx: h, ...g }) {
|
|
133
|
+
let _ = s(i), v = f === void 0 ? _?.portalContainer : f, y = _ && _.theme === u ? _.appearance : "default", b = c(() => d && P(d), [d]) ?? n(_, u), x = c(() => ({
|
|
134
|
+
theme: u,
|
|
135
|
+
appearance: y,
|
|
136
|
+
portalContainer: v,
|
|
137
|
+
tokenStyle: b
|
|
138
|
+
}), [
|
|
139
|
+
u,
|
|
140
|
+
y,
|
|
141
|
+
v,
|
|
142
|
+
b
|
|
143
|
+
]);
|
|
144
|
+
return /* @__PURE__ */ l(i.Provider, {
|
|
145
|
+
value: x,
|
|
146
|
+
children: /* @__PURE__ */ l(o, { children: /* @__PURE__ */ l(e, {
|
|
147
|
+
className: p,
|
|
148
|
+
styles: r,
|
|
149
|
+
sx: h,
|
|
150
|
+
children: (e) => /* @__PURE__ */ l("div", {
|
|
151
|
+
...g,
|
|
152
|
+
ref: a,
|
|
153
|
+
"data-ui": "theme-root",
|
|
154
|
+
"data-theme": u,
|
|
155
|
+
className: e,
|
|
156
|
+
style: t(b, m)
|
|
157
|
+
})
|
|
158
|
+
}) })
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
F.displayName = "ThemeRoot";
|
|
162
|
+
//#endregion
|
|
163
|
+
export { j as n, P as r, F as t };
|
package/dist/theme-root.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { t as ThemeRoot } from "./theme-root-
|
|
2
|
+
export { t as ThemeRoot, n as createTheme, r as themeTokenStyle } from "./theme-root-BrYVcTzt.js";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { i as e } from "./css-BYJhdGh-.js";
|
|
3
|
+
import { createContext as t, useContext as n, useMemo as r } from "react";
|
|
4
|
+
import { vars as i } from "@jfrader/tokens/vars";
|
|
5
|
+
import { jsx as a } from "@emotion/react/jsx-runtime";
|
|
6
|
+
//#region src/styling/theme-scope.tsx
|
|
7
|
+
var o = t(null);
|
|
8
|
+
function s() {
|
|
9
|
+
return n(o);
|
|
10
|
+
}
|
|
11
|
+
function c(e, t) {
|
|
12
|
+
return e && e.theme === t ? e.tokenStyle : void 0;
|
|
13
|
+
}
|
|
14
|
+
function l(e, t) {
|
|
15
|
+
return e ? {
|
|
16
|
+
...e,
|
|
17
|
+
...t
|
|
18
|
+
} : t;
|
|
19
|
+
}
|
|
20
|
+
function u(e, t) {
|
|
21
|
+
return l(c(n(o), e), t);
|
|
22
|
+
}
|
|
23
|
+
function d(e) {
|
|
24
|
+
let t = n(o);
|
|
25
|
+
return e ?? t?.appearance ?? "default";
|
|
26
|
+
}
|
|
27
|
+
var f = e({
|
|
28
|
+
color: i.color.text,
|
|
29
|
+
colorScheme: "dark",
|
|
30
|
+
"&[data-theme=\"light\"]": { colorScheme: "light" }
|
|
31
|
+
}), p = e({ display: "contents" });
|
|
32
|
+
function m({ theme: e, appearance: t, children: i }) {
|
|
33
|
+
let s = n(o), l = e ?? s?.theme ?? "dark", u = c(s, l), d = r(() => ({
|
|
34
|
+
theme: l,
|
|
35
|
+
appearance: t,
|
|
36
|
+
portalContainer: s?.portalContainer,
|
|
37
|
+
tokenStyle: u
|
|
38
|
+
}), [
|
|
39
|
+
l,
|
|
40
|
+
t,
|
|
41
|
+
s?.portalContainer,
|
|
42
|
+
u
|
|
43
|
+
]);
|
|
44
|
+
return (s ? s.theme === l && s.appearance === t : t === "default") ? i : /* @__PURE__ */ a(o.Provider, {
|
|
45
|
+
value: d,
|
|
46
|
+
children: i
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function h({ children: e }) {
|
|
50
|
+
let t = s();
|
|
51
|
+
return t ? /* @__PURE__ */ a("div", {
|
|
52
|
+
"data-ui": "theme-boundary",
|
|
53
|
+
"data-theme": t.theme,
|
|
54
|
+
"data-appearance": t.appearance,
|
|
55
|
+
style: t.tokenStyle,
|
|
56
|
+
css: [f, p],
|
|
57
|
+
children: e
|
|
58
|
+
}) : e;
|
|
59
|
+
}
|
|
60
|
+
h.displayName = "ThemeBoundary";
|
|
61
|
+
//#endregion
|
|
62
|
+
export { l as a, u as c, c as i, s as l, h as n, f as o, o as r, d as s, m as t };
|