@g4rcez/components 3.0.0 → 3.0.2
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/dist/MotionConfigContext-C7MqlSdv.js +2713 -0
- package/dist/MotionConfigContext-C7MqlSdv.js.map +1 -0
- package/dist/ai/SKILL.md +266 -0
- package/dist/ai/docs/Alert.md +167 -0
- package/dist/ai/docs/AnimatedList.md +205 -0
- package/dist/ai/docs/Autocomplete.md +225 -0
- package/dist/ai/docs/Button.md +182 -0
- package/dist/ai/docs/Calendar.md +219 -0
- package/dist/ai/docs/Card.md +174 -0
- package/dist/ai/docs/Checkbox.md +199 -0
- package/dist/ai/docs/CommandPalette.md +293 -0
- package/dist/ai/docs/DatePicker.md +171 -0
- package/dist/ai/docs/Dropdown.md +223 -0
- package/dist/ai/docs/Empty.md +163 -0
- package/dist/ai/docs/Expand.md +143 -0
- package/dist/ai/docs/FileUpload.md +225 -0
- package/dist/ai/docs/Form.md +107 -0
- package/dist/ai/docs/FormReset.md +117 -0
- package/dist/ai/docs/Heading.md +88 -0
- package/dist/ai/docs/Input.md +237 -0
- package/dist/ai/docs/InputField.md +170 -0
- package/dist/ai/docs/List.md +205 -0
- package/dist/ai/docs/Menu.md +166 -0
- package/dist/ai/docs/Modal.md +280 -0
- package/dist/ai/docs/MultiSelect.md +196 -0
- package/dist/ai/docs/Notifications.md +231 -0
- package/dist/ai/docs/PageCalendar.md +271 -0
- package/dist/ai/docs/Polymorph.md +159 -0
- package/dist/ai/docs/Progress.md +145 -0
- package/dist/ai/docs/Radiobox.md +128 -0
- package/dist/ai/docs/RenderOnView.md +138 -0
- package/dist/ai/docs/Resizable.md +159 -0
- package/dist/ai/docs/Select.md +284 -0
- package/dist/ai/docs/Shortcut.md +105 -0
- package/dist/ai/docs/Skeleton.md +166 -0
- package/dist/ai/docs/Slider.md +144 -0
- package/dist/ai/docs/Slot.md +173 -0
- package/dist/ai/docs/Spinner.md +118 -0
- package/dist/ai/docs/Stats.md +137 -0
- package/dist/ai/docs/Step.md +159 -0
- package/dist/ai/docs/Switch.md +167 -0
- package/dist/ai/docs/Table.md +298 -0
- package/dist/ai/docs/Tabs.md +191 -0
- package/dist/ai/docs/Tag.md +224 -0
- package/dist/ai/docs/TaskList.md +144 -0
- package/dist/ai/docs/Textarea.md +167 -0
- package/dist/ai/docs/Timeline.md +210 -0
- package/dist/ai/docs/Toolbar.md +132 -0
- package/dist/ai/docs/Tooltip.md +231 -0
- package/dist/ai/docs/TransferList.md +142 -0
- package/dist/ai/docs/Typography.md +187 -0
- package/dist/ai/docs/Wizard.md +213 -0
- package/dist/ai/docs/index.md +183 -0
- package/dist/autocomplete-Boida9R7.js +375 -0
- package/dist/autocomplete-Boida9R7.js.map +1 -0
- package/dist/calendar-BswV66Nx.js +1719 -0
- package/dist/calendar-BswV66Nx.js.map +1 -0
- package/dist/chevron-down-BBFYYzZq.js +6 -0
- package/dist/chevron-down-BBFYYzZq.js.map +1 -0
- package/dist/chevron-right-DvXGOiS_.js +6 -0
- package/dist/chevron-right-DvXGOiS_.js.map +1 -0
- package/dist/circle-check-big-3M5lhTxx.js +9 -0
- package/dist/circle-check-big-3M5lhTxx.js.map +1 -0
- package/dist/components/core/button.js +76 -0
- package/dist/components/core/button.js.map +1 -0
- package/dist/components/core/tag.d.ts +1 -1
- package/dist/components/core/tag.d.ts.map +1 -1
- package/dist/components/core/tag.js +67 -0
- package/dist/components/core/tag.js.map +1 -0
- package/dist/components/display/alert.js +94 -0
- package/dist/components/display/alert.js.map +1 -0
- package/dist/components/display/calendar.js +15 -0
- package/dist/components/display/calendar.js.map +1 -0
- package/dist/components/display/card.js +84 -0
- package/dist/components/display/card.js.map +1 -0
- package/dist/components/display/list.d.ts.map +1 -1
- package/dist/components/display/list.js +93 -0
- package/dist/components/display/list.js.map +1 -0
- package/dist/components/display/notifications.js +15 -0
- package/dist/components/display/notifications.js.map +1 -0
- package/dist/components/display/stats.js +16 -0
- package/dist/components/display/stats.js.map +1 -0
- package/dist/components/display/tabs.js +12 -0
- package/dist/components/display/tabs.js.map +1 -0
- package/dist/components/display/timeline.js +29 -0
- package/dist/components/display/timeline.js.map +1 -0
- package/dist/components/floating/dropdown.d.ts +1 -0
- package/dist/components/floating/dropdown.d.ts.map +1 -1
- package/dist/components/floating/dropdown.js +58 -0
- package/dist/components/floating/dropdown.js.map +1 -0
- package/dist/components/floating/expand.js +41 -0
- package/dist/components/floating/expand.js.map +1 -0
- package/dist/components/floating/menu.d.ts.map +1 -1
- package/dist/components/floating/menu.js +177 -0
- package/dist/components/floating/menu.js.map +1 -0
- package/dist/components/floating/modal.js +297 -0
- package/dist/components/floating/modal.js.map +1 -0
- package/dist/components/floating/tooltip.js +73 -0
- package/dist/components/floating/tooltip.js.map +1 -0
- package/dist/components/form/autocomplete.js +16 -0
- package/dist/components/form/autocomplete.js.map +1 -0
- package/dist/components/form/checkbox.js +44 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/date-picker.js +12 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/file-upload.js +11 -0
- package/dist/components/form/file-upload.js.map +1 -0
- package/dist/components/form/form.js +8 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/input.js +5 -0
- package/dist/components/form/input.js.map +1 -0
- package/dist/components/form/radiobox.js +30 -0
- package/dist/components/form/radiobox.js.map +1 -0
- package/dist/components/form/select.js +106 -0
- package/dist/components/form/select.js.map +1 -0
- package/dist/components/form/switch.js +65 -0
- package/dist/components/form/switch.js.map +1 -0
- package/dist/components/form/task-list.js +68 -0
- package/dist/components/form/task-list.js.map +1 -0
- package/dist/components/form/transfer-list.js +55 -0
- package/dist/components/form/transfer-list.js.map +1 -0
- package/dist/components/table/table.js +10 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/config/default-translations.d.ts +4 -4
- package/dist/constants-r-AHn273.js +6 -0
- package/dist/constants-r-AHn273.js.map +1 -0
- package/dist/context-BFXNJVn2.js +161 -0
- package/dist/context-BFXNJVn2.js.map +1 -0
- package/dist/createLucideIcon-CP-mMPfa.js +76 -0
- package/dist/createLucideIcon-CP-mMPfa.js.map +1 -0
- package/dist/date-picker-BxPTdZPy.js +1598 -0
- package/dist/date-picker-BxPTdZPy.js.map +1 -0
- package/dist/dom-Dl8XH0CK.js +2833 -0
- package/dist/dom-Dl8XH0CK.js.map +1 -0
- package/dist/file-CBCP85VI.js +15 -0
- package/dist/file-CBCP85VI.js.map +1 -0
- package/dist/file-upload-BB6BdGcE.js +3118 -0
- package/dist/file-upload-BB6BdGcE.js.map +1 -0
- package/dist/floating-ui.react-DycKASR0.js +3706 -0
- package/dist/floating-ui.react-DycKASR0.js.map +1 -0
- package/dist/fns-D2eyJKd5.js +33 -0
- package/dist/fns-D2eyJKd5.js.map +1 -0
- package/dist/hooks/use-translations.d.ts +4 -4
- package/dist/hooks/use-translations.d.ts.map +1 -1
- package/dist/index-0YMC-_Lt.js +20 -0
- package/dist/index-0YMC-_Lt.js.map +1 -0
- package/dist/index-BJ1ayTam.js +126 -0
- package/dist/index-BJ1ayTam.js.map +1 -0
- package/dist/index-BtlhELJ3.js +3416 -0
- package/dist/index-BtlhELJ3.js.map +1 -0
- package/dist/index-ChfR6F8d.js +1590 -0
- package/dist/index-ChfR6F8d.js.map +1 -0
- package/dist/index-DE4shK8D.js +215 -0
- package/dist/index-DE4shK8D.js.map +1 -0
- package/dist/index-DJSMaZR4.js +35 -0
- package/dist/index-DJSMaZR4.js.map +1 -0
- package/dist/index-t1qLJTt5.js +351 -0
- package/dist/index-t1qLJTt5.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.esm-BaIwleSE.js +343 -0
- package/dist/index.esm-BaIwleSE.js.map +1 -0
- package/dist/index.js +8050 -20
- package/dist/index.js.map +1 -1
- package/dist/info-N5jWZg2A.js +10 -0
- package/dist/info-N5jWZg2A.js.map +1 -0
- package/dist/input-CoJoHIhd.js +441 -0
- package/dist/input-CoJoHIhd.js.map +1 -0
- package/dist/input-field-DTeIrwpK.js +146 -0
- package/dist/input-field-DTeIrwpK.js.map +1 -0
- package/dist/notifications-NPuFDsBp.js +2550 -0
- package/dist/notifications-NPuFDsBp.js.map +1 -0
- package/dist/polymorph-B5n9fs_K.js +10 -0
- package/dist/polymorph-B5n9fs_K.js.map +1 -0
- package/dist/proxy-BZcQiBrp.js +2495 -0
- package/dist/proxy-BZcQiBrp.js.map +1 -0
- package/dist/skeleton-D75GFBV6.js +10 -0
- package/dist/skeleton-D75GFBV6.js.map +1 -0
- package/dist/slot-CQW8ZzBb.js +79 -0
- package/dist/slot-CQW8ZzBb.js.map +1 -0
- package/dist/styles/common.js +3 -3
- package/dist/styles/dark.js +4 -4
- package/dist/styles/design-tokens.js +89 -60
- package/dist/styles/light.js +4 -4
- package/dist/styles/theme.js +2 -2
- package/dist/tabs-ccIA7vMo.js +106 -0
- package/dist/tabs-ccIA7vMo.js.map +1 -0
- package/dist/triangle-alert-CHMhQ6yd.js +16 -0
- package/dist/triangle-alert-CHMhQ6yd.js.map +1 -0
- package/dist/use-motion-value-eGwNuWuw.js +14 -0
- package/dist/use-motion-value-eGwNuWuw.js.map +1 -0
- package/dist/use-stable-ref-CYh-YkID.js +11 -0
- package/dist/use-stable-ref-CYh-YkID.js.map +1 -0
- package/dist/use-translations-BwLKTrZv.js +10 -0
- package/dist/use-translations-BwLKTrZv.js.map +1 -0
- package/dist/x-B9bYxG31.js +9 -0
- package/dist/x-B9bYxG31.js.map +1 -0
- package/package.json +6 -7
- package/dist/components/core/button.jsx +0 -79
- package/dist/components/core/heading.jsx +0 -4
- package/dist/components/core/polymorph.jsx +0 -5
- package/dist/components/core/render-on-view.jsx +0 -31
- package/dist/components/core/resizable.jsx +0 -51
- package/dist/components/core/slot.jsx +0 -156
- package/dist/components/core/tag.jsx +0 -51
- package/dist/components/core/typography.jsx +0 -22
- package/dist/components/display/alert.jsx +0 -58
- package/dist/components/display/calendar.jsx +0 -299
- package/dist/components/display/card.jsx +0 -43
- package/dist/components/display/empty.jsx +0 -11
- package/dist/components/display/list.jsx +0 -81
- package/dist/components/display/notifications.jsx +0 -126
- package/dist/components/display/progress.jsx +0 -11
- package/dist/components/display/shortcut.jsx +0 -23
- package/dist/components/display/skeleton.jsx +0 -12
- package/dist/components/display/spinner.jsx +0 -7
- package/dist/components/display/stats.jsx +0 -20
- package/dist/components/display/step.jsx +0 -131
- package/dist/components/display/tabs.jsx +0 -98
- package/dist/components/display/timeline.jsx +0 -25
- package/dist/components/floating/command-palette.jsx +0 -194
- package/dist/components/floating/dropdown.jsx +0 -53
- package/dist/components/floating/expand.jsx +0 -44
- package/dist/components/floating/menu.jsx +0 -147
- package/dist/components/floating/modal.jsx +0 -299
- package/dist/components/floating/toolbar.jsx +0 -5
- package/dist/components/floating/tooltip.jsx +0 -58
- package/dist/components/floating/wizard.jsx +0 -161
- package/dist/components/form/autocomplete.jsx +0 -279
- package/dist/components/form/checkbox.jsx +0 -12
- package/dist/components/form/date-picker.jsx +0 -115
- package/dist/components/form/file-upload.jsx +0 -133
- package/dist/components/form/form.jsx +0 -10
- package/dist/components/form/formReset.jsx +0 -17
- package/dist/components/form/free-text.jsx +0 -41
- package/dist/components/form/input-field.jsx +0 -56
- package/dist/components/form/input.jsx +0 -36
- package/dist/components/form/multi-select.jsx +0 -328
- package/dist/components/form/radiobox.jsx +0 -6
- package/dist/components/form/select.jsx +0 -42
- package/dist/components/form/slider.jsx +0 -45
- package/dist/components/form/switch.jsx +0 -46
- package/dist/components/form/task-list.jsx +0 -26
- package/dist/components/form/textarea.jsx +0 -12
- package/dist/components/form/transfer-list.jsx +0 -39
- package/dist/components/index.js +0 -45
- package/dist/components/page-calendar/calendar-header.jsx +0 -81
- package/dist/components/page-calendar/day-view.jsx +0 -87
- package/dist/components/page-calendar/event-pill.jsx +0 -25
- package/dist/components/page-calendar/index.js +0 -2
- package/dist/components/page-calendar/month-view.jsx +0 -47
- package/dist/components/page-calendar/page-calendar.jsx +0 -41
- package/dist/components/page-calendar/page-calendar.types.js +0 -1
- package/dist/components/page-calendar/page-calendar.utils.js +0 -71
- package/dist/components/page-calendar/week-view.jsx +0 -64
- package/dist/components/table/filter.jsx +0 -141
- package/dist/components/table/group.jsx +0 -68
- package/dist/components/table/index.jsx +0 -60
- package/dist/components/table/inner-table.jsx +0 -104
- package/dist/components/table/metadata.jsx +0 -36
- package/dist/components/table/pagination.jsx +0 -73
- package/dist/components/table/row.jsx +0 -58
- package/dist/components/table/sort.jsx +0 -105
- package/dist/components/table/table-lib.js +0 -83
- package/dist/components/table/table.context.jsx +0 -4
- package/dist/components/table/thead.jsx +0 -103
- package/dist/config/context.js +0 -12
- package/dist/config/default-translations.jsx +0 -83
- package/dist/config/default-tweaks.js +0 -4
- package/dist/constants.js +0 -2
- package/dist/hooks/use-click-outside.js +0 -17
- package/dist/hooks/use-color-parser.js +0 -9
- package/dist/hooks/use-components-provider.jsx +0 -19
- package/dist/hooks/use-debounce.js +0 -12
- package/dist/hooks/use-floating-ref.js +0 -6
- package/dist/hooks/use-form.js +0 -550
- package/dist/hooks/use-hover.js +0 -18
- package/dist/hooks/use-input-id.js +0 -5
- package/dist/hooks/use-is-coarse-device.js +0 -12
- package/dist/hooks/use-locale.js +0 -10
- package/dist/hooks/use-media-query.js +0 -25
- package/dist/hooks/use-on-event.js +0 -7
- package/dist/hooks/use-parent.js +0 -21
- package/dist/hooks/use-preferences.js +0 -23
- package/dist/hooks/use-previous.js +0 -9
- package/dist/hooks/use-reactive.js +0 -9
- package/dist/hooks/use-remove-scroll.js +0 -61
- package/dist/hooks/use-resize-observer.js +0 -17
- package/dist/hooks/use-stable-ref.js +0 -9
- package/dist/hooks/use-swipe.js +0 -17
- package/dist/hooks/use-translations.js +0 -9
- package/dist/hooks/use-tweaks.js +0 -9
- package/dist/hooks/use-window-size.js +0 -14
- package/dist/index.mjs +0 -37103
- package/dist/index.mjs.map +0 -1
- package/dist/index.umd.js +0 -28
- package/dist/index.umd.js.map +0 -1
- package/dist/lib/combi-keys.js +0 -60
- package/dist/lib/dict.js +0 -39
- package/dist/lib/dom.js +0 -62
- package/dist/lib/fns.js +0 -46
- package/dist/lib/fzf.js +0 -117
- package/dist/lib/keyboard-area.js +0 -14
- package/dist/types.js +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { c as e } from "./dom-Dl8XH0CK.js";
|
|
4
|
+
import { P as m } from "./polymorph-B5n9fs_K.js";
|
|
5
|
+
const r = /* @__PURE__ */ s("div", { className: "h-6 w-10/12 animate-pulse rounded bg-muted" }), c = (a) => /* @__PURE__ */ s(m, { ...a, as: a.as || "span", className: e("block h-8 w-32 animate-pulse rounded bg-muted", a.className) });
|
|
6
|
+
export {
|
|
7
|
+
r as S,
|
|
8
|
+
c as a
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=skeleton-D75GFBV6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-D75GFBV6.js","sources":["../src/components/display/skeleton.tsx"],"sourcesContent":["import React, { CSSProperties, useRef, type ElementType } from \"react\";\nimport { css } from \"../../lib/dom\";\nimport { Polymorph } from \"../core/polymorph\";\n\nexport const SkeletonCell = <div className=\"h-6 w-10/12 animate-pulse rounded bg-muted\" />;\n\nexport const Skeleton = (props: { className?: string; as?: ElementType; style?: CSSProperties }) => (\n <Polymorph {...props} as={props.as || \"span\"} className={css(\"block h-8 w-32 animate-pulse rounded bg-muted\", props.className)} />\n);\n\nexport const SkeletonList = (props: { className?: string; rows: number }) => {\n const items = useRef(\n Array.from({ length: props.rows }).map((_, i) => {\n const rand = Math.max(100, Math.random() * 99);\n return <Skeleton key={`skeleton-${rand}-${i}`} style={{ width: `${rand}%` }} as=\"li\" />;\n })\n );\n return <ul className={css(\"flex flex-col gap-6\", props.className)}>{items.current}</ul>;\n};\n"],"names":["SkeletonCell","jsx","Skeleton","props","Polymorph","css"],"mappings":";;;;AAIO,MAAMA,IAAe,gBAAAC,EAAC,OAAA,EAAI,WAAU,6CAAA,CAA6C,GAE3EC,IAAW,CAACC,MACrB,gBAAAF,EAACG,GAAA,EAAW,GAAGD,GAAO,IAAIA,EAAM,MAAM,QAAQ,WAAWE,EAAI,iDAAiDF,EAAM,SAAS,EAAA,CAAG;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
const g = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
4
|
+
function d(n, e) {
|
|
5
|
+
if (typeof n == "function")
|
|
6
|
+
return n(e);
|
|
7
|
+
n != null && (n.current = e);
|
|
8
|
+
}
|
|
9
|
+
function C(...n) {
|
|
10
|
+
return (e) => {
|
|
11
|
+
let o = !1;
|
|
12
|
+
const i = n.map((t) => {
|
|
13
|
+
const r = d(t, e);
|
|
14
|
+
return !o && typeof r == "function" && (o = !0), r;
|
|
15
|
+
});
|
|
16
|
+
if (o)
|
|
17
|
+
return () => {
|
|
18
|
+
for (let t = 0; t < i.length; t++) {
|
|
19
|
+
const r = i[t];
|
|
20
|
+
typeof r == "function" ? r() : d(n[t], null);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const a = l[" use ".trim().toString()];
|
|
26
|
+
function E(n) {
|
|
27
|
+
return typeof n == "object" && n !== null && "then" in n;
|
|
28
|
+
}
|
|
29
|
+
function m(n) {
|
|
30
|
+
return n != null && typeof n == "object" && "$$typeof" in n && n.$$typeof === g && "_payload" in n && E(n._payload);
|
|
31
|
+
}
|
|
32
|
+
function h(n) {
|
|
33
|
+
const e = R(n), o = l.forwardRef((i, t) => {
|
|
34
|
+
let { children: r, ...c } = i;
|
|
35
|
+
m(r) && typeof a == "function" && (r = a(r._payload));
|
|
36
|
+
const s = l.Children.toArray(r), f = s.find(b);
|
|
37
|
+
if (f) {
|
|
38
|
+
const u = f.props.children, S = s.map((p) => p === f ? l.Children.count(u) > 1 ? l.Children.only(null) : l.isValidElement(u) ? u.props.children : null : p);
|
|
39
|
+
return /* @__PURE__ */ y(e, { ...c, ref: t, children: l.isValidElement(u) ? l.cloneElement(u, void 0, S) : null });
|
|
40
|
+
}
|
|
41
|
+
return /* @__PURE__ */ y(e, { ...c, ref: t, children: r });
|
|
42
|
+
});
|
|
43
|
+
return o.displayName = `${n}.Slot`, o;
|
|
44
|
+
}
|
|
45
|
+
const V = h("Slot");
|
|
46
|
+
function R(n) {
|
|
47
|
+
const e = l.forwardRef((o, i) => {
|
|
48
|
+
let { children: t, ...r } = o;
|
|
49
|
+
if (m(t) && typeof a == "function" && (t = a(t._payload)), l.isValidElement(t)) {
|
|
50
|
+
const c = j(t), s = P(r, t.props);
|
|
51
|
+
return t.type !== l.Fragment && (s.ref = i ? C(i, c) : c), l.cloneElement(t, s);
|
|
52
|
+
}
|
|
53
|
+
return l.Children.count(t) > 1 ? l.Children.only(null) : null;
|
|
54
|
+
});
|
|
55
|
+
return e.displayName = `${n}.SlotClone`, e;
|
|
56
|
+
}
|
|
57
|
+
const _ = /* @__PURE__ */ Symbol("radix.slottable");
|
|
58
|
+
function b(n) {
|
|
59
|
+
return l.isValidElement(n) && typeof n.type == "function" && "__radixId" in n.type && n.type.__radixId === _;
|
|
60
|
+
}
|
|
61
|
+
function P(n, e) {
|
|
62
|
+
const o = { ...e };
|
|
63
|
+
for (const i in e) {
|
|
64
|
+
const t = n[i], r = e[i];
|
|
65
|
+
/^on[A-Z]/.test(i) ? t && r ? o[i] = (...s) => {
|
|
66
|
+
const f = r(...s);
|
|
67
|
+
return t(...s), f;
|
|
68
|
+
} : t && (o[i] = t) : i === "style" ? o[i] = { ...t, ...r } : i === "className" && (o[i] = [t, r].filter(Boolean).join(" "));
|
|
69
|
+
}
|
|
70
|
+
return { ...n, ...o };
|
|
71
|
+
}
|
|
72
|
+
function j(n) {
|
|
73
|
+
let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, o = e && "isReactWarning" in e && e.isReactWarning;
|
|
74
|
+
return o ? n.ref : (e = Object.getOwnPropertyDescriptor(n, "ref")?.get, o = e && "isReactWarning" in e && e.isReactWarning, o ? n.props.ref : n.props.ref || n.ref);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
V as S
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=slot-CQW8ZzBb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-CQW8ZzBb.js","sources":["../src/components/core/slot.tsx"],"sourcesContent":["import * as React from \"react\";\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\nconst REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\n\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\ninterface LazyReactElement extends React.ReactElement {\n $$typeof: typeof REACT_LAZY_TYPE;\n _payload: PromiseLike<Exclude<React.ReactNode, PromiseLike<any>>>;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type Usable<T> = PromiseLike<T> | React.Context<T>;\n\nconst use: typeof React.use | undefined = (React as any)[\" use \".trim().toString()];\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\n\nfunction isLazyComponent(element: React.ReactNode): element is LazyReactElement {\n return (\n element != null &&\n typeof element === \"object\" &&\n \"$$typeof\" in element &&\n element.$$typeof === REACT_LAZY_TYPE &&\n \"_payload\" in element &&\n isPromiseLike(element._payload)\n );\n}\n\nexport function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? (newElement.props as { children: React.ReactNode }).children : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement) ? React.cloneElement(newElement, undefined, newChildren) : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nexport const Slot = createSlot(\"Slot\");\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\nfunction createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\nconst SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\nexport function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable(\"Slottable\");\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\nfunction getElementRef(element: React.ReactElement) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n"],"names":["REACT_LAZY_TYPE","setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","use","React","isPromiseLike","isLazyComponent","element","createSlot","ownerName","SlotClone","createSlotClone","Slot","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","childrenRef","getElementRef","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","getter","mayWarn"],"mappings":";;AAIA,MAAMA,IAAkB,uBAAO,IAAI,YAAY;AAE/C,SAASC,EAAUC,GAAqBC,GAAU;AAC9C,MAAI,OAAOD,KAAQ;AACf,WAAOA,EAAIC,CAAK;AACpB,EAAWD,KAAQ,SACfA,EAAI,UAAUC;AAEtB;AAEA,SAASC,KAAkBC,GAA8C;AACrE,SAAO,CAACC,MAAS;AACb,QAAIC,IAAa;AACjB,UAAMC,IAAWH,EAAK,IAAI,CAACH,MAAQ;AAC/B,YAAMO,IAAUR,EAAOC,GAAKI,CAAI;AAChC,aAAI,CAACC,KAAc,OAAOE,KAAW,eACjCF,IAAa,KAEVE;AAAA,IAAA,CACV;AACD,QAAIF;AACA,aAAO,MAAM;AACT,iBAASG,IAAI,GAAGA,IAAIF,EAAS,QAAQE,KAAK;AACtC,gBAAMD,IAAUD,EAASE,CAAC;AAC1B,UAAI,OAAOD,KAAW,aAClBA,EAAA,IAEAR,EAAOI,EAAKK,CAAC,GAAG,IAAI;AAAA,QACxB;AAAA,MACJ;AAAA,EAER;AAER;AAaA,MAAMC,IAAqCC,EAAc,QAAQ,KAAA,EAAO,UAAU;AAMlF,SAASC,EAAcV,GAA+C;AAClE,SAAO,OAAOA,KAAU,YAAYA,MAAU,QAAQ,UAAUA;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B;AAEA,SAASJ,EAAcjB,GAA6B;AAChD,MAAI2B,IAAS,OAAO,yBAAyB3B,EAAQ,OAAO,KAAK,GAAG,KAChE4B,IAAUD,KAAU,oBAAoBA,KAAUA,EAAO;AAC7D,SAAIC,IACQ5B,EAAgB,OAE5B2B,IAAS,OAAO,yBAAyB3B,GAAS,KAAK,GAAG,KAC1D4B,IAAUD,KAAU,oBAAoBA,KAAUA,EAAO,gBACrDC,IACQ5B,EAAQ,MAAuC,MAEnDA,EAAQ,MAAuC,OAAQA,EAAgB;AACnF;"}
|
package/dist/styles/common.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var rounded = {
|
|
2
2
|
button: "0.55rem",
|
|
3
3
|
pill: "2rem",
|
|
4
4
|
card: "0.75rem",
|
|
5
5
|
full: "9999px",
|
|
6
6
|
};
|
|
7
|
-
export
|
|
7
|
+
export var spacing = {
|
|
8
8
|
base: "1rem",
|
|
9
9
|
hairline: "0.0625rem",
|
|
10
10
|
lg: "1.125rem",
|
|
@@ -18,7 +18,7 @@ export const spacing = {
|
|
|
18
18
|
"input-inline": "0.25rem",
|
|
19
19
|
"input-gap": "0.3rem",
|
|
20
20
|
};
|
|
21
|
-
export
|
|
21
|
+
export var zIndex = {
|
|
22
22
|
wizard: "50",
|
|
23
23
|
normal: "1",
|
|
24
24
|
navbar: "22",
|
package/dist/styles/dark.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { rounded, spacing, zIndex } from "./common";
|
|
2
|
-
export
|
|
2
|
+
export var DARK_THEME = {
|
|
3
3
|
name: "dark",
|
|
4
|
-
zIndex,
|
|
5
|
-
rounded,
|
|
6
|
-
spacing,
|
|
4
|
+
zIndex: zIndex,
|
|
5
|
+
rounded: rounded,
|
|
6
|
+
spacing: spacing,
|
|
7
7
|
shadow: {
|
|
8
8
|
"shadow-notification": "1px 2px 2px 2px hsla(210, 15%, 20%, 0.15)",
|
|
9
9
|
"shadow-floating": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
@@ -1,69 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
cssVariable: (_, __, k) => `var(--${k})`,
|
|
10
|
-
formatWithVar: (format) => (_, __, v) => `${format}(var(--${v}), <alpha-value>)`,
|
|
11
|
-
};
|
|
12
|
-
export const reduceTokens = (colors, parse, prefix = "", append = "") => Object.entries(colors).reduce((acc, [key, value]) => {
|
|
13
|
-
const combine = append === "" ? `${prefix}${key}` : `${append}-${key}`;
|
|
14
|
-
if (typeof value === "string") {
|
|
15
|
-
const k = append === "" ? `${prefix}${key}` : key;
|
|
16
|
-
return acc.concat(parse(value, k, combine));
|
|
17
|
-
}
|
|
18
|
-
return acc.concat(reduceTokens(value, parse, prefix, combine));
|
|
19
|
-
}, []);
|
|
20
|
-
export const createDesignTokens = (colors, parse, prefix = "", append = "") => Object.entries(colors).reduce((acc, [key, value]) => {
|
|
21
|
-
const combine = append === "" ? `${prefix}${key}` : `${append}-${key}`;
|
|
22
|
-
if (typeof value === "string") {
|
|
23
|
-
const k = append === "" ? `${prefix}${key}` : key;
|
|
24
|
-
return { ...acc, [k]: parse(value, key, combine) };
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
...acc,
|
|
28
|
-
[key]: createDesignTokens(value, parse, prefix, combine),
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
29
9
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
export var parsers = {
|
|
13
|
+
hex: function (v) { return v; },
|
|
14
|
+
raw: function (v) { return v; },
|
|
15
|
+
hsl: function (v) { return "hsl(".concat(v, ")"); },
|
|
16
|
+
rgb: function (v) { return "rgb(".concat(v, ")"); },
|
|
17
|
+
z: function (_, __, k) { return "var(--z-".concat(k, ")"); },
|
|
18
|
+
hsla: function (v) { return "hsla(".concat(v, ")"); },
|
|
19
|
+
rgba: function (v) { return "rgba(".concat(v, ")"); },
|
|
20
|
+
cssVariable: function (_, __, k) { return "var(--".concat(k, ")"); },
|
|
21
|
+
formatWithVar: function (format) { return function (_, __, v) { return "".concat(format, "(var(--").concat(v, "), <alpha-value>)"); }; },
|
|
22
|
+
};
|
|
23
|
+
export var reduceTokens = function (colors, parse, prefix, append) {
|
|
24
|
+
if (prefix === void 0) { prefix = ""; }
|
|
25
|
+
if (append === void 0) { append = ""; }
|
|
26
|
+
return Object.entries(colors).reduce(function (acc, _a) {
|
|
27
|
+
var key = _a[0], value = _a[1];
|
|
28
|
+
var combine = append === "" ? "".concat(prefix).concat(key) : "".concat(append, "-").concat(key);
|
|
29
|
+
if (typeof value === "string") {
|
|
30
|
+
var k = append === "" ? "".concat(prefix).concat(key) : key;
|
|
31
|
+
return acc.concat(parse(value, k, combine));
|
|
32
|
+
}
|
|
33
|
+
return acc.concat(reduceTokens(value, parse, prefix, combine));
|
|
34
|
+
}, []);
|
|
35
|
+
};
|
|
36
|
+
export var createDesignTokens = function (colors, parse, prefix, append) {
|
|
37
|
+
if (prefix === void 0) { prefix = ""; }
|
|
38
|
+
if (append === void 0) { append = ""; }
|
|
39
|
+
return Object.entries(colors).reduce(function (acc, _a) {
|
|
40
|
+
var _b, _c;
|
|
41
|
+
var key = _a[0], value = _a[1];
|
|
42
|
+
var combine = append === "" ? "".concat(prefix).concat(key) : "".concat(append, "-").concat(key);
|
|
43
|
+
if (typeof value === "string") {
|
|
44
|
+
var k = append === "" ? "".concat(prefix).concat(key) : key;
|
|
45
|
+
return __assign(__assign({}, acc), (_b = {}, _b[k] = parse(value, key, combine), _b));
|
|
46
|
+
}
|
|
47
|
+
return __assign(__assign({}, acc), (_c = {}, _c[key] = createDesignTokens(value, parse, prefix, combine), _c));
|
|
48
|
+
}, {});
|
|
34
49
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
var modifiers = {
|
|
51
|
+
default: function (variables) { return ":root { ".concat(variables, " }"); },
|
|
52
|
+
dark: function (variables) { return "html.dark {".concat(variables, "}"); },
|
|
53
|
+
};
|
|
54
|
+
var createStyleContent = function (tokens, modifiers) {
|
|
55
|
+
var v = modifiers.value || (function (_, s) { return s; });
|
|
56
|
+
var content = tokens.map(function (token) { return "".concat(token.key, ": ").concat(v(token.key, token.value)); }).join(";");
|
|
38
57
|
return modifiers.result(content);
|
|
39
58
|
};
|
|
40
|
-
export
|
|
41
|
-
default: (tokens)
|
|
42
|
-
dark: (tokens)
|
|
59
|
+
export var createStyles = {
|
|
60
|
+
default: function (tokens) { return createStyleContent(tokens, { result: modifiers.default }); },
|
|
61
|
+
dark: function (tokens) { return createStyleContent(tokens, { result: modifiers.dark }); },
|
|
43
62
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
63
|
+
var fn = function (p) {
|
|
64
|
+
return function (value, _, key) {
|
|
65
|
+
var r = { key: "--".concat(key), value: "".concat(value) };
|
|
66
|
+
return p ? p(r) : r;
|
|
67
|
+
};
|
|
47
68
|
};
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
69
|
+
var zIndexParser = function (t) { return ({ key: t.key.replace(/^--/, "--z-"), value: t.value }); };
|
|
70
|
+
var createTokens = function (theme, map) {
|
|
71
|
+
var _a;
|
|
72
|
+
var colors = reduceTokens(theme.colors, fn(map === null || map === void 0 ? void 0 : map.colors));
|
|
73
|
+
var spacing = reduceTokens(theme.spacing, fn(map === null || map === void 0 ? void 0 : map.spacing));
|
|
74
|
+
var rounded = reduceTokens(theme.rounded, fn(map === null || map === void 0 ? void 0 : map.rounded));
|
|
75
|
+
var shadow = reduceTokens(theme.shadow, fn(map === null || map === void 0 ? void 0 : map.rounded));
|
|
76
|
+
var zIndex = reduceTokens(theme.zIndex, fn((_a = map === null || map === void 0 ? void 0 : map.zIndex) !== null && _a !== void 0 ? _a : zIndexParser));
|
|
77
|
+
var customTokens = theme.custom ? reduceTokens(theme.custom, fn(map === null || map === void 0 ? void 0 : map.customTokens)) : [];
|
|
56
78
|
return colors.concat(spacing, rounded, customTokens, zIndex, shadow);
|
|
57
79
|
};
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
80
|
+
export var createTheme = function (theme, name) {
|
|
81
|
+
return createStyleContent(createTokens(theme), {
|
|
82
|
+
result: function (variables) { return "html".concat(name ? ".".concat(name) : "", " {").concat(variables, "}"); },
|
|
83
|
+
value: function (_, v) { return v.replace("hsla(", "").replace(")", ""); },
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
export var createCssProperties = function (theme, map) {
|
|
87
|
+
var tokens = createTokens(theme, map);
|
|
88
|
+
return tokens.reduce(function (acc, el) {
|
|
89
|
+
var _a;
|
|
90
|
+
return (__assign(__assign({}, acc), (_a = {}, _a[el.key] = el.value, _a)));
|
|
91
|
+
}, {});
|
|
92
|
+
};
|
|
93
|
+
export var createTokenStyles = function (theme, map) {
|
|
94
|
+
return createStyleContent(createTokens(theme, map), {
|
|
95
|
+
result: function (variables) { return "html".concat((map === null || map === void 0 ? void 0 : map.name) ? ".".concat(map.name) : "", " {").concat(variables, "}"); },
|
|
96
|
+
value: function (_, v) { return v; },
|
|
97
|
+
});
|
|
65
98
|
};
|
|
66
|
-
export const createTokenStyles = (theme, map) => createStyleContent(createTokens(theme, map), {
|
|
67
|
-
result: (variables) => `html${map?.name ? `.${map.name}` : ""} {${variables}}`,
|
|
68
|
-
value: (_, v) => v,
|
|
69
|
-
});
|
package/dist/styles/light.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { rounded, spacing, zIndex } from "./common";
|
|
2
|
-
export
|
|
3
|
-
rounded,
|
|
4
|
-
spacing,
|
|
2
|
+
export var LIGHT_THEME = {
|
|
3
|
+
rounded: rounded,
|
|
4
|
+
spacing: spacing,
|
|
5
5
|
name: "light",
|
|
6
6
|
shadow: {
|
|
7
7
|
"shadow-notification": "1px 2px 2px 2px hsla(210, 25%, 40%, 0.15)",
|
|
@@ -9,7 +9,7 @@ export const LIGHT_THEME = {
|
|
|
9
9
|
"shadow-card": "0px 1px 2px 1px hsla(210, 25%, 20%, 0.1)",
|
|
10
10
|
"shadow-table": "0px 1px 1px 1px hsla(210, 0%, 0%, 0.1)",
|
|
11
11
|
},
|
|
12
|
-
zIndex,
|
|
12
|
+
zIndex: zIndex,
|
|
13
13
|
colors: {
|
|
14
14
|
foreground: "hsla(221, 15%, 23%)",
|
|
15
15
|
background: "hsla(0, 0%, 100%)",
|
package/dist/styles/theme.js
CHANGED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { jsx as l, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import A, { useState as k, useEffect as u, createContext as p, useRef as C, useContext as N, Fragment as R } from "react";
|
|
3
|
+
import { c as m, I as S } from "./dom-Dl8XH0CK.js";
|
|
4
|
+
import { u as T } from "./use-stable-ref-CYh-YkID.js";
|
|
5
|
+
import { P as q } from "./polymorph-B5n9fs_K.js";
|
|
6
|
+
import { Card as I } from "./components/display/card.js";
|
|
7
|
+
const _ = (t, r) => {
|
|
8
|
+
const [n, a] = k(() => r || t);
|
|
9
|
+
return u(() => {
|
|
10
|
+
a(t);
|
|
11
|
+
}, [t]), [n, a];
|
|
12
|
+
}, h = {
|
|
13
|
+
ArrowLeft: "ArrowLeft",
|
|
14
|
+
ArrowRight: "ArrowRight"
|
|
15
|
+
}, y = p(""), j = (t) => t.hasAttribute("disabled") || t.getAttribute("aria-disabled") === "true", f = (t, r, n) => {
|
|
16
|
+
const a = n === "forward" ? 1 : -1, o = r + a;
|
|
17
|
+
for (let s = o; s >= 0 && s < t.length; s += a) {
|
|
18
|
+
const d = t[s];
|
|
19
|
+
if (!j(d)) return d;
|
|
20
|
+
}
|
|
21
|
+
return n === "backward" ? f(t, t.length - 1, "backward") : f(t, -1, "forward");
|
|
22
|
+
}, w = (t, r) => {
|
|
23
|
+
const n = Array.from(t.querySelectorAll("li")), a = n.findIndex((s) => s.dataset.active === "true");
|
|
24
|
+
if (a === -1) return null;
|
|
25
|
+
const o = f(n, a, r);
|
|
26
|
+
return o === null ? null : (o.querySelector("button")?.focus({ preventScroll: !1 }), o.getAttribute("data-id") || "");
|
|
27
|
+
}, v = {
|
|
28
|
+
[h.ArrowLeft]: (t, r) => w(r, "backward"),
|
|
29
|
+
[h.ArrowRight]: (t, r) => w(r, "forward")
|
|
30
|
+
}, $ = (t) => {
|
|
31
|
+
const [r, n] = _(t.active), a = C(null), o = T(t.onChange);
|
|
32
|
+
u(() => {
|
|
33
|
+
const i = a.current;
|
|
34
|
+
if (i === null) return;
|
|
35
|
+
let e = i.querySelector("li[data-active=true]");
|
|
36
|
+
if (e === null) {
|
|
37
|
+
e = i.querySelector("li[data-id]");
|
|
38
|
+
const c = e.getAttribute("data-id") || "";
|
|
39
|
+
n(c);
|
|
40
|
+
}
|
|
41
|
+
}, [t.active, n]), u(() => {
|
|
42
|
+
o.current && o.current(r);
|
|
43
|
+
}, [o, r]);
|
|
44
|
+
const s = A.Children.toArray(t.children), d = (i) => {
|
|
45
|
+
const e = i.currentTarget;
|
|
46
|
+
n(e.dataset.id || "");
|
|
47
|
+
}, x = (i) => {
|
|
48
|
+
if (a.current === null) return;
|
|
49
|
+
const e = i.key;
|
|
50
|
+
if (S.keyof(v, e)) {
|
|
51
|
+
const c = v[e], b = c(i, a.current);
|
|
52
|
+
if (b === null) return;
|
|
53
|
+
n(b);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ l(y.Provider, { value: r, children: /* @__PURE__ */ l(
|
|
57
|
+
I,
|
|
58
|
+
{
|
|
59
|
+
className: t.className,
|
|
60
|
+
container: m("pt-0 max-w-full w-full min-w-0", t.container),
|
|
61
|
+
header: /* @__PURE__ */ g("header", { className: "relative mb-2 overflow-x-auto", children: [
|
|
62
|
+
/* @__PURE__ */ l("div", { className: "absolute bottom-0 h-[1px] w-full bg-card-border" }),
|
|
63
|
+
/* @__PURE__ */ l("nav", { className: "min-w-0", children: /* @__PURE__ */ l("ul", { onKeyDown: x, ref: a, className: "flex w-0 min-w-full flex-1 justify-start overflow-x-auto", children: s.map((i) => {
|
|
64
|
+
const e = i.props, c = r === e.id;
|
|
65
|
+
return /* @__PURE__ */ l(
|
|
66
|
+
"li",
|
|
67
|
+
{
|
|
68
|
+
"data-id": e.id,
|
|
69
|
+
"data-active": c,
|
|
70
|
+
"aria-disabled": e.disabled,
|
|
71
|
+
className: m(
|
|
72
|
+
"relative w-fit border-b border-transparent transition-all",
|
|
73
|
+
c ? "border-primary font-medium text-primary" : "",
|
|
74
|
+
e.disabled ? "aria-disabled:text-disabled" : ""
|
|
75
|
+
),
|
|
76
|
+
children: /* @__PURE__ */ l(
|
|
77
|
+
q,
|
|
78
|
+
{
|
|
79
|
+
as: "button",
|
|
80
|
+
type: "button",
|
|
81
|
+
"data-id": e.id,
|
|
82
|
+
"aria-current": "page",
|
|
83
|
+
disabled: e.disabled,
|
|
84
|
+
onClick: e.disabled ? void 0 : d,
|
|
85
|
+
className: "block w-full whitespace-nowrap px-10 py-4 disabled:cursor-not-allowed",
|
|
86
|
+
children: e.title
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
},
|
|
90
|
+
`tab-header-${e.id}`
|
|
91
|
+
);
|
|
92
|
+
}) }) })
|
|
93
|
+
] }),
|
|
94
|
+
children: t.children
|
|
95
|
+
}
|
|
96
|
+
) });
|
|
97
|
+
}, E = () => N(y), z = (t) => {
|
|
98
|
+
const r = E();
|
|
99
|
+
return /* @__PURE__ */ l(R, { children: t.id === r ? t.children : null });
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
$ as T,
|
|
103
|
+
z as a,
|
|
104
|
+
_ as u
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=tabs-ccIA7vMo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs-ccIA7vMo.js","sources":["../src/hooks/use-reactive.ts","../src/lib/keyboard-area.ts","../src/components/display/tabs.tsx"],"sourcesContent":["\"use client\";\nimport { useEffect, useState } from \"react\";\n\nexport const useReactive = <T>(t: T, initial?: T) => {\n const [state, setState] = useState(() => (initial ? initial : t));\n useEffect(() => {\n setState(t);\n }, [t]);\n return [state, setState] as const;\n};\n","import React from \"react\";\n\ntype EventKey =\n | \"Backspace\"\n | \"Tab\"\n | \"Enter\"\n | \"Shift\"\n | \"Control\"\n | \"Alt\"\n | \"Pause\"\n | \"CapsLock\"\n | \"Escape\"\n | \"Space\"\n | \"PageUp\"\n | \"PageDown\"\n | \"End\"\n | \"Home\"\n | \"ArrowLeft\"\n | \"ArrowUp\"\n | \"ArrowRight\"\n | \"ArrowDown\"\n | \"PrintScreen\"\n | \"Insert\"\n | \"Delete\"\n | \"0\"\n | \"1\"\n | \"2\"\n | \"3\"\n | \"4\"\n | \"5\"\n | \"6\"\n | \"7\"\n | \"8\"\n | \"9\"\n | \"a\"\n | \"b\"\n | \"c\"\n | \"d\"\n | \"e\"\n | \"f\"\n | \"g\"\n | \"h\"\n | \"i\"\n | \"j\"\n | \"k\"\n | \"l\"\n | \"m\"\n | \"n\"\n | \"o\"\n | \"p\"\n | \"q\"\n | \"r\"\n | \"s\"\n | \"t\"\n | \"u\"\n | \"v\"\n | \"w\"\n | \"x\"\n | \"y\"\n | \"z\"\n | \"Meta\"\n | \"ContextMenu\"\n | \"F1\"\n | \"F2\"\n | \"F3\"\n | \"F4\"\n | \"F5\"\n | \"F6\"\n | \"F7\"\n | \"F8\"\n | \"F9\"\n | \"F10\"\n | \"F11\"\n | \"F12\"\n | \"NumLock\"\n | \"ScrollLock\"\n | \"AudioVolumeMute\"\n | \"AudioVolumeUp\"\n | \"AudioVolumeDown\"\n | \"MediaTrackNext\"\n | \"MediaTrackPrevious\"\n | \"MediaStop\"\n | \"MediaPlayPause\"\n | \"LaunchMail\"\n | \"LaunchMediaPlayer\"\n | \"LaunchApplication1\"\n | \"LaunchApplication2\"\n | \"Semicolon\"\n | \"Equal\"\n | \"Comma\"\n | \"Minus\"\n | \"Period\"\n | \"Slash\"\n | \"Backquote\"\n | \"BracketLeft\"\n | \"Backslash\"\n | \"BracketRight\"\n | \"Quote\";\n\nexport const keyboardKeys = {\n ArrowUp: \"ArrowUp\",\n ArrowDown: \"ArrowDown\",\n ArrowLeft: \"ArrowLeft\",\n ArrowRight: \"ArrowRight\",\n} as const;\n\ntype Callback<T extends HTMLElement = HTMLElement> = (e: KeyboardEvent | React.KeyboardEvent<T>) => void;\n\nexport class KeyboardArea<T extends HTMLElement> {\n private set = new Set();\n\n public key(key: EventKey, callback: Callback<T>) {\n const fn: Callback<T> = (e) => (e.key === key ? callback(e) : undefined);\n return () => this.set.delete(fn);\n }\n\n public onKeyDown(_: Callback<T>) {}\n}\n","\"use client\";\nimport React, { createContext, Fragment, PropsWithChildren, useContext, useEffect, useRef } from \"react\";\nimport { Is, Nullable } from \"sidekicker\";\nimport { useReactive } from \"../../hooks/use-reactive\";\nimport { useStableRef } from \"../../hooks/use-stable-ref\";\nimport { css } from \"../../lib/dom\";\nimport { keyboardKeys } from \"../../lib/keyboard-area\";\nimport { Label } from \"../../types\";\nimport { Polymorph } from \"../core/polymorph\";\nimport { Card, CardProps } from \"./card\";\n\nexport type TabsProps = Omit<CardProps<\"div\">, \"onChange\"> & {\n active: string;\n container?: string;\n className?: string;\n onChange?: (id: string) => void;\n};\n\nconst Context = createContext<string>(\"\");\n\nconst isElementDisabled = (element: HTMLElement): boolean => element.hasAttribute(\"disabled\") || element.getAttribute(\"aria-disabled\") === \"true\";\n\nconst getNElement = (elements: HTMLElement[], currentIndex: number, direction: \"backward\" | \"forward\"): HTMLElement | null => {\n const step = direction === \"forward\" ? 1 : -1;\n const startIndex = currentIndex + step;\n for (let i = startIndex; i >= 0 && i < elements.length; i += step) {\n const element = elements[i];\n if (!isElementDisabled(element)) return element;\n }\n return direction === \"backward\" ? getNElement(elements, elements.length - 1, \"backward\") : getNElement(elements, -1, \"forward\");\n};\n\nconst moveOn = (ul: HTMLUListElement, direction: \"backward\" | \"forward\") => {\n const items = Array.from(ul.querySelectorAll(\"li\"));\n const find = items.findIndex((x) => x.dataset.active === \"true\");\n if (find === -1) return null;\n const item = getNElement(items, find, direction);\n if (item === null) return null;\n item.querySelector(\"button\")?.focus({ preventScroll: false });\n return item.getAttribute(\"data-id\") || \"\";\n};\n\nconst actionKeys = {\n [keyboardKeys.ArrowLeft]: (_: unknown, ul: HTMLUListElement): Nullable<string> => moveOn(ul, \"backward\"),\n [keyboardKeys.ArrowRight]: (_: unknown, ul: HTMLUListElement): Nullable<string> => moveOn(ul, \"forward\"),\n};\n\nexport const Tabs = (props: PropsWithChildren<TabsProps>) => {\n const [active, setActive] = useReactive(props.active);\n const ref = useRef<HTMLUListElement | null>(null);\n const onChangeRef = useStableRef(props.onChange);\n\n useEffect(() => {\n const header = ref.current;\n if (header === null) return;\n let first = header.querySelector<HTMLElement>(`li[data-active=true]`);\n if (first === null) {\n first = header.querySelector<HTMLElement>(`li[data-id]`)!;\n const id = first.getAttribute(\"data-id\") || \"\";\n setActive(id);\n }\n }, [props.active, setActive]);\n\n useEffect(() => {\n if (onChangeRef.current) onChangeRef.current(active);\n }, [onChangeRef, active]);\n\n const items = React.Children.toArray(props.children as React.ReactElement<TabProps>);\n\n const onClick = (e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n const anchor = e.currentTarget;\n setActive(anchor.dataset.id || \"\");\n };\n\n const onKeyDown = (e: React.KeyboardEvent<HTMLUListElement>) => {\n if (ref.current === null) return;\n const k = e.key;\n if (Is.keyof(actionKeys, k)) {\n const fn = actionKeys[k];\n const result = fn(e, ref.current);\n if (result === null) return;\n setActive(result);\n }\n };\n\n return (\n <Context.Provider value={active}>\n <Card\n className={props.className}\n container={css(\"pt-0 max-w-full w-full min-w-0\", props.container)}\n header={\n <header className=\"relative mb-2 overflow-x-auto\">\n <div className=\"absolute bottom-0 h-[1px] w-full bg-card-border\" />\n <nav className=\"min-w-0\">\n <ul onKeyDown={onKeyDown} ref={ref} className=\"flex w-0 min-w-full flex-1 justify-start overflow-x-auto\">\n {items.map((x: any) => {\n const inner = x.props as TabProps;\n const current = active === inner.id;\n return (\n <li\n data-id={inner.id}\n data-active={current}\n key={`tab-header-${inner.id}`}\n aria-disabled={inner.disabled}\n className={css(\n \"relative w-fit border-b border-transparent transition-all\",\n current ? \"border-primary font-medium text-primary\" : \"\",\n inner.disabled ? \"aria-disabled:text-disabled\" : \"\"\n )}\n >\n <Polymorph\n as=\"button\"\n type=\"button\"\n data-id={inner.id}\n aria-current=\"page\"\n disabled={inner.disabled}\n onClick={inner.disabled ? undefined : onClick}\n className=\"block w-full whitespace-nowrap px-10 py-4 disabled:cursor-not-allowed\"\n >\n {inner.title as any}\n </Polymorph>\n </li>\n );\n })}\n </ul>\n </nav>\n </header>\n }\n >\n {props.children}\n </Card>\n </Context.Provider>\n );\n};\n\nconst useTabs = () => useContext(Context);\n\ntype CommonTabProps = { id: string; disabled?: boolean };\n\nexport type TabProps = CommonTabProps &\n (\n | { title: string; label?: undefined }\n | {\n label: string;\n title: Omit<Label, string>;\n }\n );\n\nexport const Tab = (props: PropsWithChildren<TabProps>) => {\n const active = useTabs();\n return <Fragment>{props.id === active ? props.children : null}</Fragment>;\n};\n"],"names":["useReactive","initial","state","setState","useState","useEffect","keyboardKeys","Context","createContext","isElementDisabled","element","getNElement","elements","currentIndex","direction","step","startIndex","i","moveOn","ul","items","find","x","item","actionKeys","_","Tabs","props","active","setActive","ref","useRef","onChangeRef","useStableRef","header","first","id","React","onClick","e","anchor","onKeyDown","k","Is","fn","result","jsx","Card","css","jsxs","inner","current","Polymorph","useTabs","useContext","Tab","Fragment"],"mappings":";;;;;;AAGO,MAAMA,IAAc,CAAI,GAAMC,MAAgB;AACjD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAS,MAAOH,KAAoB,CAAE;AAChE,SAAAI,EAAU,MAAM;AACZ,IAAAF,EAAS,CAAC;AAAA,EAAA,GACX,CAAC,CAAC,CAAC,GACC,CAACD,GAAOC,CAAQ;AAC3B,GC0FaG,IAAe;AAAA,EAGxB,WAAW;AAAA,EACX,YAAY;AAChB,GCtFMC,IAAUC,EAAsB,EAAE,GAElCC,IAAoB,CAACC,MAAkCA,EAAQ,aAAa,UAAU,KAAKA,EAAQ,aAAa,eAAe,MAAM,QAErIC,IAAc,CAACC,GAAyBC,GAAsBC,MAA0D;AAC1H,QAAMC,IAAOD,MAAc,YAAY,IAAI,IACrCE,IAAaH,IAAeE;AAClC,WAASE,IAAID,GAAYC,KAAK,KAAKA,IAAIL,EAAS,QAAQK,KAAKF,GAAM;AAC/D,UAAML,IAAUE,EAASK,CAAC;AAC1B,QAAI,CAACR,EAAkBC,CAAO,EAAG,QAAOA;AAAA,EAAA;AAE5C,SAAOI,MAAc,aAAaH,EAAYC,GAAUA,EAAS,SAAS,GAAG,UAAU,IAAID,EAAYC,GAAU,IAAI,SAAS;AAClI,GAEMM,IAAS,CAACC,GAAsBL,MAAsC;AACxE,QAAMM,IAAQ,MAAM,KAAKD,EAAG,iBAAiB,IAAI,CAAC,GAC5CE,IAAOD,EAAM,UAAU,CAACE,MAAMA,EAAE,QAAQ,WAAW,MAAM;AAC/D,MAAID,MAAS,GAAI,QAAO;AACxB,QAAME,IAAOZ,EAAYS,GAAOC,GAAMP,CAAS;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AvB,EAAM;AAAA,IAAA;AAAA,EAAA,GAEf;AAER,GAEM0B,IAAU,MAAMC,EAAW/C,CAAO,GAa3BgD,IAAM,CAAC5B,MAAuC;AACvD,QAAMC,IAASyB,EAAA;AACf,2BAAQG,GAAA,EAAU,UAAA7B,EAAM,OAAOC,IAASD,EAAM,WAAW,MAAK;AAClE;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { c as e } from "./createLucideIcon-CP-mMPfa.js";
|
|
2
|
+
const a = [
|
|
3
|
+
[
|
|
4
|
+
"path",
|
|
5
|
+
{
|
|
6
|
+
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
7
|
+
key: "wmoenq"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
11
|
+
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
12
|
+
], o = e("triangle-alert", a);
|
|
13
|
+
export {
|
|
14
|
+
o as T
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=triangle-alert-CHMhQ6yd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"triangle-alert-CHMhQ6yd.js","sources":["../../../node_modules/.pnpm/lucide-react@0.575.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/triangle-alert.js"],"sourcesContent":["/**\n * @license lucide-react v0.575.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n];\nconst TriangleAlert = createLucideIcon(\"triangle-alert\", __iconNode);\n\nexport { __iconNode, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.js.map\n"],"names":["__iconNode","TriangleAlert","createLucideIcon"],"mappings":";AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,IAAgBC,EAAiB,kBAAkBF,CAAU;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useContext as n, useState as u, useEffect as a } from "react";
|
|
2
|
+
import { u as c, y as f, M as i } from "./MotionConfigContext-C7MqlSdv.js";
|
|
3
|
+
function C(t) {
|
|
4
|
+
const o = c(() => f(t)), { isStatic: e } = n(i);
|
|
5
|
+
if (e) {
|
|
6
|
+
const [, s] = u(t);
|
|
7
|
+
a(() => o.on("change", s), []);
|
|
8
|
+
}
|
|
9
|
+
return o;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
C as u
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=use-motion-value-eGwNuWuw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-motion-value-eGwNuWuw.js","sources":["../../../node_modules/.pnpm/framer-motion@12.34.3_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/framer-motion/dist/es/value/use-motion-value.mjs"],"sourcesContent":["\"use client\";\nimport { motionValue } from 'motion-dom';\nimport { useContext, useState, useEffect } from 'react';\nimport { MotionConfigContext } from '../context/MotionConfigContext.mjs';\nimport { useConstant } from '../utils/use-constant.mjs';\n\n/**\n * Creates a `MotionValue` to track the state and velocity of a value.\n *\n * Usually, these are created automatically. For advanced use-cases, like use with `useTransform`, you can create `MotionValue`s externally and pass them into the animated component via the `style` prop.\n *\n * ```jsx\n * export const MyComponent = () => {\n * const scale = useMotionValue(1)\n *\n * return <motion.div style={{ scale }} />\n * }\n * ```\n *\n * @param initial - The initial state.\n *\n * @public\n */\nfunction useMotionValue(initial) {\n const value = useConstant(() => motionValue(initial));\n /**\n * If this motion value is being used in static mode, like on\n * the Framer canvas, force components to rerender when the motion\n * value is updated.\n */\n const { isStatic } = useContext(MotionConfigContext);\n if (isStatic) {\n const [, setLatest] = useState(initial);\n useEffect(() => value.on(\"change\", setLatest), []);\n }\n return value;\n}\n\nexport { useMotionValue };\n//# sourceMappingURL=use-motion-value.mjs.map\n"],"names":["useMotionValue","initial","value","useConstant","motionValue","isStatic","useContext","MotionConfigContext","setLatest","useState","useEffect"],"mappings":";;AAuBA,SAASA,EAAeC,GAAS;AAC7B,QAAMC,IAAQC,EAAY,MAAMC,EAAYH,CAAO,CAAC,GAM9C,EAAE,UAAAI,EAAQ,IAAKC,EAAWC,CAAmB;AACnD,MAAIF,GAAU;AACV,UAAM,GAAGG,CAAS,IAAIC,EAASR,CAAO;AACtC,IAAAS,EAAU,MAAMR,EAAM,GAAG,UAAUM,CAAS,GAAG,EAAE;AAAA,EACzD;AACI,SAAON;AACX;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-stable-ref-CYh-YkID.js","sources":["../src/hooks/use-stable-ref.ts"],"sourcesContent":["\"use client\";\nimport { useEffect, useRef } from \"react\";\n\nexport const useStableRef = <T>(value: T) => {\n const ref = useRef<T>(value);\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref;\n};\n"],"names":["useStableRef","value","ref","useRef","useEffect"],"mappings":";AAGO,MAAMA,IAAe,CAAIC,MAAa;AACzC,QAAMC,IAAMC,EAAUF,CAAK;AAE3B,SAAAG,EAAU,MAAM;AACZ,IAAAF,EAAI,UAAUD;AAAA,EAAA,GACf,CAACA,CAAK,CAAC,GAEHC;AACX;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-translations-BwLKTrZv.js","sources":["../src/hooks/use-translations.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { Context } from \"../config/context\";\nimport { defaultTranslations } from \"../config/default-translations\";\n\nexport const useTranslations = () => {\n const ctx = useContext(Context);\n if (!ctx) return defaultTranslations;\n return ctx.map!;\n};\n"],"names":["useTranslations","ctx","useContext","Context","defaultTranslations"],"mappings":";;AAIO,MAAMA,IAAkB,MAAM;AACjC,QAAMC,IAAMC,EAAWC,CAAO;AAC9B,SAAKF,IACEA,EAAI,MADMG;AAErB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"x-B9bYxG31.js","sources":["../../../node_modules/.pnpm/lucide-react@0.575.0_react@19.2.3/node_modules/lucide-react/dist/esm/icons/x.js"],"sourcesContent":["/**\n * @license lucide-react v0.575.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n];\nconst X = createLucideIcon(\"x\", __iconNode);\n\nexport { __iconNode, X as default };\n//# sourceMappingURL=x.js.map\n"],"names":["__iconNode","X","createLucideIcon"],"mappings":";AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAAA,EAC3C,CAAC,QAAQ,EAAE,GAAG,cAAc,KAAK,SAAQ,CAAE;AAC7C,GACMC,IAAIC,EAAiB,KAAKF,CAAU;","x_google_ignoreList":[0]}
|