@slotted/react 0.1.0-beta.3 → 0.1.0-beta.5
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 +16 -1
- package/dist/{accordion-D-YuMJzk.js → accordion-lCqrmQ3w.js} +43 -43
- package/dist/accordion.js +1 -1
- package/dist/{action-bar-OACchRZw.js → action-bar-ti3e6FK1.js} +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/{app-shell-CmYvnu_7.js → app-shell-nnSP44OO.js} +271 -267
- package/dist/app-shell.js +1 -1
- package/dist/bin/slotted-agent-docs.mjs +297 -0
- package/dist/calendar-BZ6PP7Ke.js +436 -0
- package/dist/calendar.js +1 -1
- package/dist/{cascader-D1AhTyBL.js → cascader-Cn2Acpcv.js} +227 -210
- package/dist/cascader.js +1 -1
- package/dist/chart-04i6NZQA.js +968 -0
- package/dist/chart.js +1 -1
- package/dist/{checkbox-DfxFHZaU.js → checkbox-B4Sb1eXj.js} +3 -3
- package/dist/{checkbox-group-9sDgrV5Z.js → checkbox-group-LpGMuq9w.js} +2 -2
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{code-block-CFHf8uTm.js → code-block-CTNiyt0U.js} +1 -1
- package/dist/code-block.js +1 -1
- package/dist/{collapsible-CGo49NNW.js → collapsible-F-K36XbF.js} +17 -17
- package/dist/collapsible.js +1 -1
- package/dist/{color-picker-CwbWzCKg.js → color-picker-BcRCeISx.js} +4 -4
- package/dist/color-picker.js +1 -1
- package/dist/{column-manager-CTtizVhm.js → column-manager-BtkYLs5G.js} +4 -4
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-BVMI9lg8.js → combobox-C1D5doWM.js} +227 -198
- package/dist/combobox.js +1 -1
- package/dist/{context-menu-BuST6W94.js → context-menu-B00UIBVC.js} +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/{currency-field-DD9A5U3D.js → currency-field-Dti9JFu0.js} +1 -1
- package/dist/currency-field.js +1 -1
- package/dist/{dashboard-grid-CBMP_-JV.js → dashboard-grid-CoLKLvYL.js} +1 -1
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-BKaGMqIm.js → data-grid-DX95Y7mY.js} +18 -18
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-oICmxGkA.js → data-list-CWYTPNm-.js} +2 -2
- package/dist/data-list.js +1 -1
- package/dist/date-field-BxEpqAPg.js +290 -0
- package/dist/date-field.js +1 -1
- package/dist/date-picker-DRk9SZp1.js +308 -0
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-6Yz7avTS.js +483 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-field-B8TrmsDK.js → datetime-field-D2f9u6im.js} +1 -1
- package/dist/datetime-field.js +1 -1
- package/dist/datetime-picker-STqSWMkH.js +645 -0
- package/dist/datetime-picker.js +1 -1
- package/dist/datetime-range-picker-DQNQwr3K.js +1000 -0
- package/dist/datetime-range-picker.js +1 -1
- package/dist/{detail-panel-qOJiNuzr.js → detail-panel-z6WGleP4.js} +3 -3
- package/dist/detail-panel.js +1 -1
- package/dist/docs/AGENTS.snippet.md +2 -0
- package/dist/docs/app-shell.examples.md +1 -1
- package/dist/docs/app-shell.json +4 -4
- package/dist/docs/app-shell.md +2 -2
- package/dist/docs/calendar.json +7 -0
- package/dist/docs/calendar.md +1 -0
- package/dist/docs/collapsible.json +1 -1
- package/dist/docs/collapsible.md +1 -1
- package/dist/docs/date-field.json +8 -1
- package/dist/docs/date-field.md +2 -1
- package/dist/docs/date-picker.examples.md +29 -0
- package/dist/docs/date-picker.json +16 -1
- package/dist/docs/date-picker.md +2 -1
- package/dist/docs/guidelines/README.md +2 -2
- package/dist/docs/guidelines/composition.md +10 -0
- package/dist/docs/guidelines/index.md +3 -1
- package/dist/docs/guidelines/list-pages.md +12 -1
- package/dist/docs/guidelines/own-elements.md +1 -1
- package/dist/docs/page-header.json +1 -0
- package/dist/docs/page-header.md +1 -1
- package/dist/docs/page.json +1 -0
- package/dist/docs/page.md +1 -0
- package/dist/docs/select.json +1 -1
- package/dist/docs/select.md +1 -1
- package/dist/docs/skills/build-own-element/SKILL.md +6 -6
- package/dist/docs/skills/compose-screen/SKILL.md +13 -6
- package/dist/docs/skills/review-screen/SKILL.md +6 -6
- package/dist/docs/skills/theme-app/SKILL.md +1 -1
- package/dist/docs/skills/waiting-states/SKILL.md +2 -2
- package/dist/docs/table.json +13 -0
- package/dist/docs/table.md +3 -1
- package/dist/docs/tabs.json +22 -4
- package/dist/docs/tabs.md +6 -3
- package/dist/docs/text-field.json +1 -1
- package/dist/docs/text-field.md +1 -1
- package/dist/{entity-picker-CPDd73JR.js → entity-picker-BdySwW8F.js} +274 -256
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-CnF3iIZD.js → event-calendar-CiphPXdV.js} +4 -4
- package/dist/event-calendar.js +1 -1
- package/dist/{field-NJaCxl2h.js → field-BxQFpOXS.js} +1 -1
- package/dist/{field-group-hAzVa2O9.js → field-group-DcN_hiZN.js} +1 -1
- package/dist/field-group.js +1 -1
- package/dist/field.js +1 -1
- package/dist/{filter-bar-D_xDcAp2.js → filter-bar-C_dXljI_.js} +10 -10
- package/dist/filter-bar.js +1 -1
- package/dist/{hover-card-BJE5dtaQ.js → hover-card-DpVzwvDJ.js} +1 -1
- package/dist/hover-card.js +1 -1
- package/dist/{import-export-center-DpY2DGBZ.js → import-export-center-BQnMJz4g.js} +3 -3
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +68 -68
- package/dist/{listbox-Dv856z9I.js → listbox-D0MJcAMm.js} +1 -1
- package/dist/listbox.js +1 -1
- package/dist/{markdown-CeG8mUbI.js → markdown-IiVoh6yi.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/menu-parts-D6v_mz6O.js +809 -0
- package/dist/menu.js +1 -1
- package/dist/{menubar-b2CruimJ.js → menubar-DApIg1eR.js} +1 -1
- package/dist/menubar.js +1 -1
- package/dist/{multi-select-DQ5ds0fX.js → multi-select-B8z6ApgW.js} +286 -257
- package/dist/multi-select.js +1 -1
- package/dist/{notification-center-Sz54IziY.js → notification-center-CGEEHcRA.js} +2 -2
- package/dist/notification-center.js +1 -1
- package/dist/{number-field-BFIAmv-z.js → number-field-DXk1TAXA.js} +1 -1
- package/dist/number-field.js +1 -1
- package/dist/{otp-input-BNQhuKaT.js → otp-input-CI-kdNgx.js} +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/{page-kQgLctsA.js → page-IiYXk1sz.js} +32 -32
- package/dist/{page-header-CWEBfMGq.js → page-header-Bn4nIGfF.js} +1 -1
- package/dist/page-header.js +1 -1
- package/dist/page.js +1 -1
- package/dist/{popover-Be7JWbGJ.js → popover-DEp8Bf3e.js} +186 -166
- package/dist/popover.js +1 -1
- package/dist/{prompt-composer-BxpdkTpZ.js → prompt-composer-DdcU3S3L.js} +1 -1
- package/dist/prompt-composer.js +1 -1
- package/dist/{radio-group-BaVIP9UH.js → radio-group-D8csBZ8Z.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{rating-DYBQBzwB.js → rating-rI3b5zII.js} +1 -1
- package/dist/rating.js +1 -1
- package/dist/{saved-views-DlE_--Z9.js → saved-views-B3brBTD9.js} +4 -4
- package/dist/saved-views.js +1 -1
- package/dist/scroll-area-DQ_ansLu.js +112 -0
- package/dist/scroll-area.js +1 -1
- package/dist/{segmented-control-DmuOGiu6.js → segmented-control-C-PzkTtg.js} +2 -2
- package/dist/segmented-control.js +1 -1
- package/dist/{select-DOFqPy26.js → select-BUylPwpb.js} +309 -258
- package/dist/select.js +1 -1
- package/dist/{side-navigation-CBLtCzuJ.js → side-navigation-Bm-BZma1.js} +156 -140
- package/dist/side-navigation.js +1 -1
- package/dist/{slider-DTes4HLF.js → slider-fp7kyg-6.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{split-button-CPgHiy9G.js → split-button-DKRm0j5c.js} +1 -1
- package/dist/split-button.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/{switch-DQzuIhPX.js → switch-aVoc4C2F.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-Cipi2c5X.js → table-BYEvFr4P.js} +206 -203
- package/dist/table.js +1 -1
- package/dist/tabs-HWmvOKM4.js +355 -0
- package/dist/tabs.js +1 -1
- package/dist/{tags-input-CcOkm0AW.js → tags-input-pbv6x1Pi.js} +1 -1
- package/dist/tags-input.js +1 -1
- package/dist/{text-field-DLfIZ0fk.js → text-field-CbQ6UCAP.js} +1 -1
- package/dist/text-field.js +1 -1
- package/dist/{textarea-CBJBJBi6.js → textarea-DJSfhrXH.js} +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-field-DrhiCtUl.js → time-field-BI9n607q.js} +1 -1
- package/dist/time-field.js +1 -1
- package/dist/time-picker-D6SlQWNF.js +402 -0
- package/dist/time-picker.js +1 -1
- package/dist/time-range-picker-CcV3_45h.js +751 -0
- package/dist/time-range-picker.js +1 -1
- package/dist/{toggle-group-7iBR9Rn1.js → toggle-group-i7JPO8BM.js} +1 -1
- package/dist/toggle-group.js +1 -1
- package/dist/{toolbar-DDZpEftQ.js → toolbar-B9knmgHA.js} +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/tooltip-CgjIROUy.js +410 -0
- package/dist/tooltip.js +1 -1
- package/dist/{top-navigation-e-tWMGNr.js → top-navigation-DiG2PF5W.js} +2 -2
- package/dist/top-navigation.js +1 -1
- package/dist/{transfer-CqZOTLMP.js → transfer--UOQVeKE.js} +5 -5
- package/dist/transfer.js +1 -1
- package/dist/types/accordion/accordion.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell-parts.d.ts +6 -4
- package/dist/types/app-shell/app-shell-parts.d.ts.map +1 -1
- package/dist/types/app-shell/app-shell.d.ts.map +1 -1
- package/dist/types/calendar/calendar.d.ts +1 -1
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/calendar/calendar.types.d.ts +9 -0
- package/dist/types/calendar/calendar.types.d.ts.map +1 -1
- package/dist/types/calendar/index.d.ts +1 -1
- package/dist/types/calendar/index.d.ts.map +1 -1
- package/dist/types/cascader/cascader.d.ts.map +1 -1
- package/dist/types/chart/chart.d.ts.map +1 -1
- package/dist/types/collapsible/collapsible-parts.d.ts.map +1 -1
- package/dist/types/combobox/combobox-parts.d.ts.map +1 -1
- package/dist/types/date-field/date-field.d.ts +1 -1
- package/dist/types/date-field/date-field.d.ts.map +1 -1
- package/dist/types/date-field/date-field.types.d.ts +7 -0
- package/dist/types/date-field/date-field.types.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.d.ts +5 -1
- package/dist/types/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.types.d.ts +20 -2
- package/dist/types/date-picker/date-picker.types.d.ts.map +1 -1
- package/dist/types/date-picker/index.d.ts +1 -1
- package/dist/types/date-picker/index.d.ts.map +1 -1
- package/dist/types/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/types/datetime-picker/datetime-picker.d.ts.map +1 -1
- package/dist/types/datetime-range-picker/datetime-range-picker.d.ts.map +1 -1
- package/dist/types/entity-picker/entity-picker-popup.d.ts.map +1 -1
- package/dist/types/menu/menu-parts.d.ts.map +1 -1
- package/dist/types/multi-select/multi-select-parts.d.ts.map +1 -1
- package/dist/types/page/page.d.ts.map +1 -1
- package/dist/types/popover/popover-parts.d.ts.map +1 -1
- package/dist/types/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/types/select/select-items.d.ts.map +1 -1
- package/dist/types/select/select-parts.d.ts.map +1 -1
- package/dist/types/select/select.d.ts.map +1 -1
- package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card.types.d.ts +2 -2
- package/dist/types/stat-card/stat-card.types.d.ts.map +1 -1
- package/dist/types/table/index.d.ts +1 -1
- package/dist/types/table/index.d.ts.map +1 -1
- package/dist/types/table/table-content.d.ts.map +1 -1
- package/dist/types/table/table-defaults.d.ts.map +1 -1
- package/dist/types/table/table.d.ts +1 -1
- package/dist/types/table/table.d.ts.map +1 -1
- package/dist/types/table/table.types.d.ts +15 -0
- package/dist/types/table/table.types.d.ts.map +1 -1
- package/dist/types/tabs/tabs-parts.d.ts +2 -4
- package/dist/types/tabs/tabs-parts.d.ts.map +1 -1
- package/dist/types/tabs/tabs.d.ts +1 -1
- package/dist/types/tabs/tabs.d.ts.map +1 -1
- package/dist/types/tabs/tabs.types.d.ts +18 -0
- package/dist/types/tabs/tabs.types.d.ts.map +1 -1
- package/dist/types/time-picker/time-picker.d.ts.map +1 -1
- package/dist/types/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/types/tooltip/tooltip-parts.d.ts.map +1 -1
- package/dist/{upload-DjnlVR8y.js → upload-CLX5cURk.js} +1 -1
- package/dist/upload.js +1 -1
- package/package.json +10 -7
- package/dist/calendar-B3mio8iQ.js +0 -387
- package/dist/chart-O0ZhkzJe.js +0 -966
- package/dist/date-field-CYcN6diW.js +0 -279
- package/dist/date-picker-4X-_2ltN.js +0 -264
- package/dist/date-range-picker-CNOAtHwU.js +0 -471
- package/dist/datetime-picker-HDVlUhzy.js +0 -629
- package/dist/datetime-range-picker-IqOFJtdW.js +0 -994
- package/dist/menu-parts-W58pVNUt.js +0 -786
- package/dist/scroll-area-BriwmvYY.js +0 -111
- package/dist/tabs-DQ36APY-.js +0 -343
- package/dist/time-picker-CRQsMJbQ.js +0 -396
- package/dist/time-range-picker-DlZJsj1e.js +0 -745
- package/dist/tooltip-DbKTPe_i.js +0 -392
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { r as e } from "./i18n-DpW8lqJ1.js";
|
|
2
|
-
import { createContext as t, useCallback as n, useContext as r, useImperativeHandle as i, useRef as a, useState as o } from "react";
|
|
3
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
-
import { NO_SCROLL_EDGES as c, createScrollEdges as l, scrollEdgeAttributes as u } from "@slotted/core/overflow";
|
|
5
|
-
import { scrollAreaMessages as d } from "@slotted/core/i18n";
|
|
6
|
-
//#region src/scroll-area/scroll-area-defaults.tsx
|
|
7
|
-
var f = t({
|
|
8
|
-
axis: "block",
|
|
9
|
-
fade: "both",
|
|
10
|
-
gutter: "stable",
|
|
11
|
-
overscroll: "contain",
|
|
12
|
-
scrollbars: "auto"
|
|
13
|
-
});
|
|
14
|
-
function p() {
|
|
15
|
-
return r(f);
|
|
16
|
-
}
|
|
17
|
-
function m({ children: e, ...t }) {
|
|
18
|
-
let n = p();
|
|
19
|
-
return /* @__PURE__ */ s(f.Provider, {
|
|
20
|
-
value: {
|
|
21
|
-
axis: t.axis ?? n.axis,
|
|
22
|
-
fade: t.fade ?? n.fade,
|
|
23
|
-
gutter: t.gutter ?? n.gutter,
|
|
24
|
-
overscroll: t.overscroll ?? n.overscroll,
|
|
25
|
-
scrollbars: t.scrollbars ?? n.scrollbars
|
|
26
|
-
},
|
|
27
|
-
children: e
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/scroll-area/scroll-area.tsx
|
|
32
|
-
function h(e, t) {
|
|
33
|
-
typeof e == "function" ? e(t) : e != null && (e.current = t);
|
|
34
|
-
}
|
|
35
|
-
function g({ axis: t, children: r, className: f, fade: m, gutter: g, labelledBy: _, maxBlockSize: v, maxInlineSize: y, messages: b, onOverflowChange: x, onScrollChange: S, overscroll: C, ref: w, render: T, scrollbars: E, style: D, tabbable: O = !0, viewportProps: k, ...A }) {
|
|
36
|
-
let j = p(), M = e(d, b), N = t ?? j.axis, P = E ?? j.scrollbars, F = g ?? j.gutter, I = m ?? j.fade, L = C ?? j.overscroll, R = a(null), [z, B] = o(null), V = a(null), [H, U] = o(c), [W, G] = o(!1), K = a(x);
|
|
37
|
-
K.current = x;
|
|
38
|
-
let q = n((e) => {
|
|
39
|
-
if (B(e), h(k?.ref, e), e === null) return;
|
|
40
|
-
let t = l(e, { onChange: (e) => {
|
|
41
|
-
U(e), V.current !== null && G(V.current.sideways()), K.current?.(e);
|
|
42
|
-
} });
|
|
43
|
-
return V.current = t, U(t.state()), G(t.sideways()), () => {
|
|
44
|
-
t.destroy(), V.current = null;
|
|
45
|
-
};
|
|
46
|
-
}, [k?.ref]);
|
|
47
|
-
i(w, () => ({
|
|
48
|
-
get root() {
|
|
49
|
-
return R.current;
|
|
50
|
-
},
|
|
51
|
-
get viewport() {
|
|
52
|
-
return z;
|
|
53
|
-
},
|
|
54
|
-
state: () => V.current?.state() ?? c,
|
|
55
|
-
position: () => V.current?.position() ?? {
|
|
56
|
-
block: 0,
|
|
57
|
-
inline: 0
|
|
58
|
-
},
|
|
59
|
-
scrollTo: (e) => V.current?.scrollTo(e),
|
|
60
|
-
scrollToEdge: (e) => V.current?.scrollToEdge(e),
|
|
61
|
-
reveal: (e) => V.current?.reveal(e),
|
|
62
|
-
refresh: () => V.current?.refresh(),
|
|
63
|
-
focus: () => z?.focus()
|
|
64
|
-
}), [z]);
|
|
65
|
-
let J = (e) => {
|
|
66
|
-
k?.onScroll?.(e), S !== void 0 && V.current !== null && S(V.current.position(), e);
|
|
67
|
-
}, Y = (H.block.overflowing || H.inline.overflowing) && O, X = { ...k };
|
|
68
|
-
delete X.onScroll, delete X.ref;
|
|
69
|
-
let Z = /* @__PURE__ */ s("div", {
|
|
70
|
-
...X,
|
|
71
|
-
"data-part": "viewport",
|
|
72
|
-
onScroll: J,
|
|
73
|
-
ref: q,
|
|
74
|
-
...Y ? {
|
|
75
|
-
role: "region",
|
|
76
|
-
tabIndex: 0,
|
|
77
|
-
..._ === void 0 ? { "aria-label": M("label") } : { "aria-labelledby": _ }
|
|
78
|
-
} : {},
|
|
79
|
-
children: r
|
|
80
|
-
}), Q = {
|
|
81
|
-
...A,
|
|
82
|
-
className: f,
|
|
83
|
-
"data-axis": N,
|
|
84
|
-
"data-fade": I,
|
|
85
|
-
"data-gutter": F,
|
|
86
|
-
"data-overscroll": L,
|
|
87
|
-
"data-part": "root",
|
|
88
|
-
"data-scrollbars": P,
|
|
89
|
-
"data-ui": "scroll-area",
|
|
90
|
-
...W ? { "data-sideways": "" } : {},
|
|
91
|
-
...u(H),
|
|
92
|
-
ref: R,
|
|
93
|
-
style: v === void 0 && y === void 0 ? D : {
|
|
94
|
-
...v === void 0 ? {} : { maxBlockSize: v },
|
|
95
|
-
...y === void 0 ? {} : { maxInlineSize: y },
|
|
96
|
-
...D
|
|
97
|
-
},
|
|
98
|
-
children: Z
|
|
99
|
-
};
|
|
100
|
-
return T === void 0 ? /* @__PURE__ */ s("div", { ...Q }) : T(Q);
|
|
101
|
-
}
|
|
102
|
-
function _({ render: e, ...t }) {
|
|
103
|
-
let n = {
|
|
104
|
-
...t,
|
|
105
|
-
"data-part": "content"
|
|
106
|
-
};
|
|
107
|
-
return e === void 0 ? /* @__PURE__ */ s("div", { ...n }) : e(n);
|
|
108
|
-
}
|
|
109
|
-
g.Content = _;
|
|
110
|
-
//#endregion
|
|
111
|
-
export { m as n, p as r, g as t };
|
package/dist/tabs-DQ36APY-.js
DELETED
|
@@ -1,343 +0,0 @@
|
|
|
1
|
-
import { n as e, t } from "./icon-T9Yt4tnm.js";
|
|
2
|
-
import { createRemovalFocus as n, createRovingTabindex as r } from "@slotted/core/focus";
|
|
3
|
-
import { createControllable as i } from "@slotted/core/state";
|
|
4
|
-
import { createContext as a, useCallback as o, useContext as s, useEffect as c, useId as l, useRef as u, useState as d } from "react";
|
|
5
|
-
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
6
|
-
import { NOT_OVERFLOWING as h, createScrollAffordance as g } from "@slotted/core/overflow";
|
|
7
|
-
//#region src/tabs/tabs-defaults.tsx
|
|
8
|
-
var _ = a({
|
|
9
|
-
activation: "automatic",
|
|
10
|
-
fit: "auto",
|
|
11
|
-
loop: !0,
|
|
12
|
-
mount: "active",
|
|
13
|
-
orientation: "horizontal",
|
|
14
|
-
size: "md",
|
|
15
|
-
track: "line",
|
|
16
|
-
variant: "line"
|
|
17
|
-
});
|
|
18
|
-
function v() {
|
|
19
|
-
return s(_);
|
|
20
|
-
}
|
|
21
|
-
function y({ children: e, ...t }) {
|
|
22
|
-
let n = v();
|
|
23
|
-
return /* @__PURE__ */ p(_.Provider, {
|
|
24
|
-
value: {
|
|
25
|
-
activation: t.activation ?? n.activation,
|
|
26
|
-
fit: t.fit ?? n.fit,
|
|
27
|
-
loop: t.loop ?? n.loop,
|
|
28
|
-
mount: t.mount ?? n.mount,
|
|
29
|
-
orientation: t.orientation ?? n.orientation,
|
|
30
|
-
size: t.size ?? n.size,
|
|
31
|
-
track: t.track ?? n.track,
|
|
32
|
-
variant: t.variant ?? n.variant
|
|
33
|
-
},
|
|
34
|
-
children: e
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/tabs/tabs.tsx
|
|
39
|
-
var b = "[data-part=\"tab\"]", x = a(void 0);
|
|
40
|
-
function S() {
|
|
41
|
-
let e = s(x);
|
|
42
|
-
if (e === void 0) throw Error("Tab, TabPanel and TabActions must be rendered inside Tabs.");
|
|
43
|
-
return e;
|
|
44
|
-
}
|
|
45
|
-
function C(e) {
|
|
46
|
-
return e.replace(/[^\w-]/g, (e) => `-${e.charCodeAt(0).toString(16)}-`);
|
|
47
|
-
}
|
|
48
|
-
function w(e, t) {
|
|
49
|
-
let n = !1;
|
|
50
|
-
return {
|
|
51
|
-
reason: e,
|
|
52
|
-
source: t,
|
|
53
|
-
get cancelled() {
|
|
54
|
-
return n;
|
|
55
|
-
},
|
|
56
|
-
cancel() {
|
|
57
|
-
n = !0;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function T({ activation: a, children: o, className: s, defaultValue: _, disabled: y, fit: S, loop: T, mount: E, onTabDismiss: D, onValueChange: O, orientation: k, ref: A, render: j, size: M, style: N, track: ee, value: P, variant: te, ...ne }) {
|
|
62
|
-
let F = v(), I = l(), [re, ie] = d(_), L = P ?? re, [R, ae] = d(null), [z, B] = d(h), [oe, se] = d("none"), V = a ?? F.activation, ce = S ?? F.fit, H = T ?? F.loop, le = E ?? F.mount, U = k ?? F.orientation, ue = M ?? F.size, de = ee ?? F.track, fe = te ?? F.variant, W = y === !0, G = u(new Set(L === void 0 ? [] : [L]));
|
|
63
|
-
L !== void 0 && G.current.add(L);
|
|
64
|
-
let K = u(null), q = u(null);
|
|
65
|
-
function J() {
|
|
66
|
-
return R === null ? [] : [...R.querySelectorAll(b)];
|
|
67
|
-
}
|
|
68
|
-
function Y(e) {
|
|
69
|
-
return e === void 0 ? -1 : J().findIndex((t) => t.getAttribute("data-value") === e);
|
|
70
|
-
}
|
|
71
|
-
function X(e, t, n) {
|
|
72
|
-
if (e === L) return;
|
|
73
|
-
let r = !1, a = i({
|
|
74
|
-
controlled: P,
|
|
75
|
-
initial: L,
|
|
76
|
-
onRequest: (e) => {
|
|
77
|
-
r = e.cancelled, e.value !== void 0 && O?.(e.value, e);
|
|
78
|
-
}
|
|
79
|
-
}).request(e, t, n);
|
|
80
|
-
if (r) return;
|
|
81
|
-
let o = Y(L), s = Y(e);
|
|
82
|
-
o !== -1 && s !== -1 && se(s > o ? "forward" : "backward"), G.current.add(e), a && ie(e);
|
|
83
|
-
}
|
|
84
|
-
function pe(e) {
|
|
85
|
-
let t = J().map((e) => e.getAttribute("data-value")).filter((e) => e !== null), n = t.indexOf(e);
|
|
86
|
-
if (n !== -1) return t[n + 1] ?? t[n - 1];
|
|
87
|
-
}
|
|
88
|
-
function me(e, t, n) {
|
|
89
|
-
let r = w(t, n);
|
|
90
|
-
if (D?.(e, r), r.cancelled || e !== L) return;
|
|
91
|
-
let i = pe(e);
|
|
92
|
-
i !== void 0 && X(i, "remove", n);
|
|
93
|
-
}
|
|
94
|
-
let Z = u({
|
|
95
|
-
activation: V,
|
|
96
|
-
select: X,
|
|
97
|
-
value: L
|
|
98
|
-
});
|
|
99
|
-
c(() => {
|
|
100
|
-
Z.current = {
|
|
101
|
-
activation: V,
|
|
102
|
-
select: X,
|
|
103
|
-
value: L
|
|
104
|
-
};
|
|
105
|
-
}), c(() => {
|
|
106
|
-
if (R === null) return;
|
|
107
|
-
let e = r(R, {
|
|
108
|
-
crossAxis: !1,
|
|
109
|
-
itemSelector: b,
|
|
110
|
-
loop: H,
|
|
111
|
-
onMove: (e, t) => {
|
|
112
|
-
if (q.current?.reveal(t), Z.current.activation !== "automatic") return;
|
|
113
|
-
let n = t.getAttribute("data-value");
|
|
114
|
-
n !== null && Z.current.select(n, "keyboard", void 0);
|
|
115
|
-
},
|
|
116
|
-
orientation: () => U
|
|
117
|
-
});
|
|
118
|
-
K.current = e;
|
|
119
|
-
let t = n(R, { itemSelector: b }), i = new MutationObserver(() => {
|
|
120
|
-
e.refresh(), q.current?.refresh();
|
|
121
|
-
});
|
|
122
|
-
return i.observe(R, {
|
|
123
|
-
childList: !0,
|
|
124
|
-
subtree: !0
|
|
125
|
-
}), () => {
|
|
126
|
-
i.disconnect(), t.destroy(), e.destroy(), K.current = null;
|
|
127
|
-
};
|
|
128
|
-
}, [
|
|
129
|
-
R,
|
|
130
|
-
H,
|
|
131
|
-
U
|
|
132
|
-
]), c(() => {
|
|
133
|
-
if (R === null || U === "vertical") {
|
|
134
|
-
B(h);
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
let e = g(R, { onChange: B });
|
|
138
|
-
return q.current = e, B(e.state()), () => {
|
|
139
|
-
e.destroy(), q.current = null;
|
|
140
|
-
};
|
|
141
|
-
}, [R, U]), c(() => {
|
|
142
|
-
let e = Y(L);
|
|
143
|
-
if (e === -1) return;
|
|
144
|
-
K.current?.setActive(e);
|
|
145
|
-
let t = J()[e];
|
|
146
|
-
t !== void 0 && q.current?.reveal(t);
|
|
147
|
-
}, [L, R]);
|
|
148
|
-
let Q = z.overflowing && U === "horizontal";
|
|
149
|
-
c(() => {
|
|
150
|
-
if (!Q) return;
|
|
151
|
-
let e = J()[Y(Z.current.value)];
|
|
152
|
-
e !== void 0 && q.current?.reveal(e);
|
|
153
|
-
}, [Q]);
|
|
154
|
-
let he = {
|
|
155
|
-
activation: V,
|
|
156
|
-
attachList: ae,
|
|
157
|
-
disabled: W,
|
|
158
|
-
dismiss: me,
|
|
159
|
-
identify: (e) => ({
|
|
160
|
-
panelId: `${I}panel-${C(e)}`,
|
|
161
|
-
tabId: `${I}tab-${C(e)}`
|
|
162
|
-
}),
|
|
163
|
-
mount: le,
|
|
164
|
-
orientation: U,
|
|
165
|
-
seen: (e) => G.current.has(e),
|
|
166
|
-
select: X,
|
|
167
|
-
value: L
|
|
168
|
-
}, $ = {
|
|
169
|
-
...ne,
|
|
170
|
-
children: /* @__PURE__ */ m(f, { children: [o, Q ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("button", {
|
|
171
|
-
"aria-hidden": "true",
|
|
172
|
-
"data-direction": "start",
|
|
173
|
-
"data-part": "scroll",
|
|
174
|
-
disabled: z.atStart,
|
|
175
|
-
onClick: () => q.current?.page(-1),
|
|
176
|
-
tabIndex: -1,
|
|
177
|
-
type: "button",
|
|
178
|
-
children: /* @__PURE__ */ p(t, {
|
|
179
|
-
directional: !0,
|
|
180
|
-
children: /* @__PURE__ */ p(e, { name: "chevron-right" })
|
|
181
|
-
})
|
|
182
|
-
}), /* @__PURE__ */ p("button", {
|
|
183
|
-
"aria-hidden": "true",
|
|
184
|
-
"data-direction": "end",
|
|
185
|
-
"data-part": "scroll",
|
|
186
|
-
disabled: z.atEnd,
|
|
187
|
-
onClick: () => q.current?.page(1),
|
|
188
|
-
tabIndex: -1,
|
|
189
|
-
type: "button",
|
|
190
|
-
children: /* @__PURE__ */ p(t, {
|
|
191
|
-
directional: !0,
|
|
192
|
-
children: /* @__PURE__ */ p(e, { name: "chevron-right" })
|
|
193
|
-
})
|
|
194
|
-
})] }) : null] }),
|
|
195
|
-
className: s,
|
|
196
|
-
"data-activation-direction": oe,
|
|
197
|
-
...W ? { "data-disabled": "" } : {},
|
|
198
|
-
"data-fit": ce,
|
|
199
|
-
"data-orientation": U,
|
|
200
|
-
...z.overflowing ? { "data-overflowing": "" } : {},
|
|
201
|
-
"data-part": "root",
|
|
202
|
-
"data-size": ue,
|
|
203
|
-
"data-track": de,
|
|
204
|
-
"data-ui": "tabs",
|
|
205
|
-
"data-variant": fe,
|
|
206
|
-
style: N
|
|
207
|
-
};
|
|
208
|
-
return /* @__PURE__ */ p(x.Provider, {
|
|
209
|
-
value: he,
|
|
210
|
-
children: j === void 0 ? /* @__PURE__ */ p("div", {
|
|
211
|
-
...$,
|
|
212
|
-
ref: A
|
|
213
|
-
}) : j($)
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
//#endregion
|
|
217
|
-
//#region src/tabs/tabs-parts.tsx
|
|
218
|
-
function E(e) {
|
|
219
|
-
return e.detail === 0 ? "keyboard" : "pointer";
|
|
220
|
-
}
|
|
221
|
-
function D({ children: e, ref: t, render: n, ...r }) {
|
|
222
|
-
let i = S(), a = o((e) => {
|
|
223
|
-
if (i.attachList(e), typeof t == "function") return t(e);
|
|
224
|
-
t && (t.current = e);
|
|
225
|
-
}, [t, i.attachList]), s = {
|
|
226
|
-
tabIndex: -1,
|
|
227
|
-
...r,
|
|
228
|
-
...i.orientation === "vertical" ? { "aria-orientation": "vertical" } : {},
|
|
229
|
-
children: e,
|
|
230
|
-
"data-part": "list",
|
|
231
|
-
role: "tablist"
|
|
232
|
-
};
|
|
233
|
-
return n === void 0 ? /* @__PURE__ */ p("div", {
|
|
234
|
-
...s,
|
|
235
|
-
ref: a
|
|
236
|
-
}) : n({
|
|
237
|
-
...s,
|
|
238
|
-
ref: a
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
function O({ children: n, className: r, controls: i, disabled: a, dismissLabel: o, dismissible: s = !1, end: c, href: l, onClick: u, onKeyDown: d, ref: h, render: g, start: _, style: v, value: y, ...b }) {
|
|
242
|
-
let x = S(), { panelId: C, tabId: w } = x.identify(y), T = i ?? C, D = x.value === y, O = x.disabled === !0 || a === !0;
|
|
243
|
-
function k(e) {
|
|
244
|
-
u?.(e), !e.defaultPrevented && (O || l !== void 0 && (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) || (l !== void 0 && e.preventDefault(), x.select(y, E(e), e)));
|
|
245
|
-
}
|
|
246
|
-
function A(e) {
|
|
247
|
-
d?.(e), !(e.defaultPrevented || e.repeat) && s && !O && e.key === "Delete" && (e.preventDefault(), x.dismiss(y, "keyboard", e));
|
|
248
|
-
}
|
|
249
|
-
let j = /* @__PURE__ */ m(f, { children: [
|
|
250
|
-
_ === void 0 ? null : /* @__PURE__ */ p("span", {
|
|
251
|
-
"data-part": "start",
|
|
252
|
-
children: _
|
|
253
|
-
}),
|
|
254
|
-
/* @__PURE__ */ p("span", {
|
|
255
|
-
"data-part": "label",
|
|
256
|
-
children: n
|
|
257
|
-
}),
|
|
258
|
-
c === void 0 ? null : /* @__PURE__ */ p("span", {
|
|
259
|
-
"data-part": "end",
|
|
260
|
-
children: c
|
|
261
|
-
})
|
|
262
|
-
] }), M = l === void 0 ? /* @__PURE__ */ p("button", {
|
|
263
|
-
...b,
|
|
264
|
-
"aria-controls": T,
|
|
265
|
-
"aria-keyshortcuts": s ? "Delete" : void 0,
|
|
266
|
-
"aria-selected": D,
|
|
267
|
-
"data-part": "tab",
|
|
268
|
-
"data-value": y,
|
|
269
|
-
disabled: O,
|
|
270
|
-
id: w,
|
|
271
|
-
onClick: k,
|
|
272
|
-
onKeyDown: A,
|
|
273
|
-
ref: h,
|
|
274
|
-
role: "tab",
|
|
275
|
-
tabIndex: D ? 0 : -1,
|
|
276
|
-
type: "button",
|
|
277
|
-
children: j
|
|
278
|
-
}) : /* @__PURE__ */ p("a", {
|
|
279
|
-
...b,
|
|
280
|
-
"aria-controls": T,
|
|
281
|
-
"aria-disabled": O === !0 || void 0,
|
|
282
|
-
"aria-keyshortcuts": s ? "Delete" : void 0,
|
|
283
|
-
"aria-selected": D,
|
|
284
|
-
"data-part": "tab",
|
|
285
|
-
"data-value": y,
|
|
286
|
-
href: l,
|
|
287
|
-
id: w,
|
|
288
|
-
onClick: k,
|
|
289
|
-
onKeyDown: A,
|
|
290
|
-
ref: h,
|
|
291
|
-
role: "tab",
|
|
292
|
-
tabIndex: D ? 0 : -1,
|
|
293
|
-
children: j
|
|
294
|
-
}), N = {
|
|
295
|
-
children: /* @__PURE__ */ m(f, { children: [M, s ? /* @__PURE__ */ p("button", {
|
|
296
|
-
"aria-label": o,
|
|
297
|
-
"data-part": "dismiss",
|
|
298
|
-
disabled: O,
|
|
299
|
-
onClick: (e) => {
|
|
300
|
-
e.stopPropagation(), x.dismiss(y, "pointer", e);
|
|
301
|
-
},
|
|
302
|
-
tabIndex: -1,
|
|
303
|
-
type: "button",
|
|
304
|
-
children: /* @__PURE__ */ p(t, { children: /* @__PURE__ */ p(e, { name: "x" }) })
|
|
305
|
-
}) : null] }),
|
|
306
|
-
className: r,
|
|
307
|
-
"data-part": "item",
|
|
308
|
-
...D ? { "data-selected": "" } : {},
|
|
309
|
-
role: "presentation",
|
|
310
|
-
style: v
|
|
311
|
-
};
|
|
312
|
-
return g === void 0 ? /* @__PURE__ */ p("div", { ...N }) : g(N);
|
|
313
|
-
}
|
|
314
|
-
function k({ children: e, ref: t, render: n, value: r, ...i }) {
|
|
315
|
-
let a = S(), { panelId: o, tabId: s } = a.identify(r), c = a.value === r, l = c || a.mount === "eager" || a.mount === "lazy" && a.seen(r), u = {
|
|
316
|
-
...i,
|
|
317
|
-
"aria-labelledby": s,
|
|
318
|
-
children: l ? e : null,
|
|
319
|
-
"data-part": "panel",
|
|
320
|
-
hidden: !c,
|
|
321
|
-
id: o,
|
|
322
|
-
role: "tabpanel",
|
|
323
|
-
tabIndex: 0
|
|
324
|
-
};
|
|
325
|
-
return n === void 0 ? /* @__PURE__ */ p("div", {
|
|
326
|
-
...u,
|
|
327
|
-
ref: t
|
|
328
|
-
}) : n(u);
|
|
329
|
-
}
|
|
330
|
-
function A({ children: e, ref: t, render: n, ...r }) {
|
|
331
|
-
S();
|
|
332
|
-
let i = {
|
|
333
|
-
...r,
|
|
334
|
-
children: e,
|
|
335
|
-
"data-part": "actions"
|
|
336
|
-
};
|
|
337
|
-
return n === void 0 ? /* @__PURE__ */ p("div", {
|
|
338
|
-
...i,
|
|
339
|
-
ref: t
|
|
340
|
-
}) : n(i);
|
|
341
|
-
}
|
|
342
|
-
//#endregion
|
|
343
|
-
export { T as a, v as c, k as i, A as n, S as o, D as r, y as s, O as t };
|