ixia-ui-react 1.8.0 → 2.1.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 +24 -1
- package/dist/accordion/index.d.ts +41 -0
- package/dist/accordion/index.js +142 -0
- package/dist/accordion/index.js.map +1 -0
- package/dist/alert/index.d.ts +22 -0
- package/dist/alert/index.js +1 -0
- package/dist/alert-Dcu9R8CY.js +73 -0
- package/dist/alert-Dcu9R8CY.js.map +1 -0
- package/dist/alert-dialog/index.d.ts +39 -0
- package/dist/alert-dialog/index.js +134 -0
- package/dist/alert-dialog/index.js.map +1 -0
- package/dist/autocomplete/index.d.ts +2 -0
- package/dist/autocomplete/index.js +1 -0
- package/dist/autocomplete-BfpWVO1l.js +169 -0
- package/dist/autocomplete-BfpWVO1l.js.map +1 -0
- package/dist/avatar/index.d.ts +2 -0
- package/dist/avatar/index.js +1 -0
- package/dist/avatar-Bp4gZh21.js +93 -0
- package/dist/avatar-Bp4gZh21.js.map +1 -0
- package/dist/badge/index.d.ts +2 -0
- package/dist/badge/index.js +1 -0
- package/dist/badge-Cl-9WTW-.js +160 -0
- package/dist/badge-Cl-9WTW-.js.map +1 -0
- package/dist/bento-box/index.d.ts +30 -0
- package/dist/bento-box/index.js +103 -0
- package/dist/bento-box/index.js.map +1 -0
- package/dist/breadcrumb/index.d.ts +18 -0
- package/dist/breadcrumb/index.js +58 -0
- package/dist/breadcrumb/index.js.map +1 -0
- package/dist/button/index.d.ts +3 -0
- package/dist/button/index.js +1 -0
- package/dist/button-DXQvyQyj.js +309 -0
- package/dist/button-DXQvyQyj.js.map +1 -0
- package/dist/button-group/index.d.ts +2 -0
- package/dist/button-group/index.js +1 -0
- package/dist/button-group-BiSk3iIf.js +269 -0
- package/dist/button-group-BiSk3iIf.js.map +1 -0
- package/dist/button-group-context-CScS9Ntz.js +7 -0
- package/dist/button-group-context-CScS9Ntz.js.map +1 -0
- package/dist/button.types-BFKrBCGd.d.ts +10 -0
- package/dist/calendar/index.d.ts +63 -0
- package/dist/calendar/index.js +292 -0
- package/dist/calendar/index.js.map +1 -0
- package/dist/chart/index.d.ts +87 -0
- package/dist/chart/index.js +262 -0
- package/dist/chart/index.js.map +1 -0
- package/dist/checkbox/index.d.ts +2 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/checkbox-BuUZ1Lly.js +54 -0
- package/dist/checkbox-BuUZ1Lly.js.map +1 -0
- package/dist/checkbox-group/index.d.ts +6 -0
- package/dist/checkbox-group/index.js +17 -0
- package/dist/checkbox-group/index.js.map +1 -0
- package/dist/cn-BDi0DfT5.js +29 -0
- package/dist/cn-BDi0DfT5.js.map +1 -0
- package/dist/code-block/index.d.ts +53 -0
- package/dist/code-block/index.js +193 -0
- package/dist/code-block/index.js.map +1 -0
- package/dist/collapsible/index.d.ts +2 -0
- package/dist/collapsible/index.js +1 -0
- package/dist/collapsible-C3OPWY9l.js +44 -0
- package/dist/collapsible-C3OPWY9l.js.map +1 -0
- package/dist/color-channel-slider/index.d.ts +2 -0
- package/dist/color-channel-slider/index.js +1 -0
- package/dist/color-channel-slider-h8mUPJ35.js +70 -0
- package/dist/color-channel-slider-h8mUPJ35.js.map +1 -0
- package/dist/color-picker/index.d.ts +137 -0
- package/dist/color-picker/index.js +621 -0
- package/dist/color-picker/index.js.map +1 -0
- package/dist/combobox/index.d.ts +64 -0
- package/dist/combobox/index.js +289 -0
- package/dist/combobox/index.js.map +1 -0
- package/dist/context-menu/index.d.ts +49 -0
- package/dist/context-menu/index.js +166 -0
- package/dist/context-menu/index.js.map +1 -0
- package/dist/copy-button/index.d.ts +2 -0
- package/dist/copy-button/index.js +1 -0
- package/dist/copy-button-BAG-P44v.js +28 -0
- package/dist/copy-button-BAG-P44v.js.map +1 -0
- package/dist/dialog/index.d.ts +36 -0
- package/dist/dialog/index.js +119 -0
- package/dist/dialog/index.js.map +1 -0
- package/dist/drawer/index.d.ts +31 -0
- package/dist/drawer/index.js +95 -0
- package/dist/drawer/index.js.map +1 -0
- package/dist/dropzone/index.d.ts +70 -0
- package/dist/dropzone/index.js +479 -0
- package/dist/dropzone/index.js.map +1 -0
- package/dist/field/index.d.ts +2 -0
- package/dist/field/index.js +1 -0
- package/dist/field-DkMfrmdj.js +254 -0
- package/dist/field-DkMfrmdj.js.map +1 -0
- package/dist/form/index.d.ts +220 -0
- package/dist/form/index.js +3 -0
- package/dist/form-V2VqHn0D.js +192 -0
- package/dist/form-V2VqHn0D.js.map +1 -0
- package/dist/has-single-element-child-DLGI0Dh2.js +12 -0
- package/dist/has-single-element-child-DLGI0Dh2.js.map +1 -0
- package/dist/hooks/index.d.ts +26 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks-DUm-q_ig.js +68 -0
- package/dist/hooks-DUm-q_ig.js.map +1 -0
- package/dist/icon/index.d.ts +2 -0
- package/dist/icon/index.js +1 -0
- package/dist/icon-D3JWfCa2.js +85 -0
- package/dist/icon-D3JWfCa2.js.map +1 -0
- package/dist/icon-container/index.d.ts +10 -0
- package/dist/icon-container/index.js +64 -0
- package/dist/icon-container/index.js.map +1 -0
- package/dist/index-0ZQzIKoE.d.ts +11 -0
- package/dist/index-B0Qz4Egw.d.ts +33 -0
- package/dist/index-BJVMIPq4.d.ts +54 -0
- package/dist/index-BsV-u_jc.d.ts +4 -0
- package/dist/index-BygR7cUT.d.ts +22 -0
- package/dist/index-BzTOLSgZ.d.ts +9 -0
- package/dist/index-C15xiG9O.d.ts +14 -0
- package/dist/index-C2zco6-C.d.ts +15 -0
- package/dist/index-CIDOd4Z8.d.ts +56 -0
- package/dist/index-CQti9gFb.d.ts +49 -0
- package/dist/index-CiE-Rqit.d.ts +70 -0
- package/dist/index-CpNMNewO.d.ts +11 -0
- package/dist/index-D1kkOg9k.d.ts +14 -0
- package/dist/index-DLfdAked.d.ts +34 -0
- package/dist/index-DMaW_XF1.d.ts +24 -0
- package/dist/index-DVMheqs_.d.ts +9 -0
- package/dist/index-DXDObRKO.d.ts +14 -0
- package/dist/index-Db_QGr6S.d.ts +5 -0
- package/dist/index-DdFxZ3Xr.d.ts +22 -0
- package/dist/index-DyQYoAUf.d.ts +29 -0
- package/dist/index-PuhTRMce.d.ts +11 -0
- package/dist/index-Wb_tILYa.d.ts +24 -0
- package/dist/index-uaJUy56Z.d.ts +4 -0
- package/dist/index-x4f8gnaI.d.ts +15 -0
- package/dist/input/index.d.ts +3 -0
- package/dist/input/index.js +1 -0
- package/dist/input-Czt30vp7.js +179 -0
- package/dist/input-Czt30vp7.js.map +1 -0
- package/dist/input-group/index.d.ts +2 -0
- package/dist/input-group/index.js +1 -0
- package/dist/input-group-CgdazGrY.js +111 -0
- package/dist/input-group-CgdazGrY.js.map +1 -0
- package/dist/input-otp/index.d.ts +13 -0
- package/dist/input-otp/index.js +44 -0
- package/dist/input-otp/index.js.map +1 -0
- package/dist/input.types-816rEVWU.d.ts +20 -0
- package/dist/input.types-D0gyoaQv.js +48 -0
- package/dist/input.types-D0gyoaQv.js.map +1 -0
- package/dist/kbd/index.d.ts +9 -0
- package/dist/kbd/index.js +25 -0
- package/dist/kbd/index.js.map +1 -0
- package/dist/label/index.d.ts +8 -0
- package/dist/label/index.js +1 -0
- package/dist/label-BgpayDvN.js +27 -0
- package/dist/label-BgpayDvN.js.map +1 -0
- package/dist/layer-tree/index.d.ts +728 -0
- package/dist/layer-tree/index.js +685 -0
- package/dist/layer-tree/index.js.map +1 -0
- package/dist/map/google/index.d.ts +143 -0
- package/dist/map/google/index.js +445 -0
- package/dist/map/google/index.js.map +1 -0
- package/dist/map/index.d.ts +94 -0
- package/dist/map/index.js +208 -0
- package/dist/map/index.js.map +1 -0
- package/dist/map.context-Dw1D7E8m.js +11 -0
- package/dist/map.context-Dw1D7E8m.js.map +1 -0
- package/dist/menu/index.d.ts +2 -0
- package/dist/menu/index.js +1 -0
- package/dist/menu-sf13cnGp.js +173 -0
- package/dist/menu-sf13cnGp.js.map +1 -0
- package/dist/menu-tone-DWBEHoX2.js +22 -0
- package/dist/menu-tone-DWBEHoX2.js.map +1 -0
- package/dist/meter/index.d.ts +2 -0
- package/dist/meter/index.js +1 -0
- package/dist/meter-HD5taq57.js +116 -0
- package/dist/meter-HD5taq57.js.map +1 -0
- package/dist/nav-bar/index.d.ts +25 -0
- package/dist/nav-bar/index.js +133 -0
- package/dist/nav-bar/index.js.map +1 -0
- package/dist/navigation-menu/index.d.ts +43 -0
- package/dist/navigation-menu/index.js +176 -0
- package/dist/navigation-menu/index.js.map +1 -0
- package/dist/number-field/index.d.ts +14 -0
- package/dist/number-field/index.js +116 -0
- package/dist/number-field/index.js.map +1 -0
- package/dist/popover/index.d.ts +2 -0
- package/dist/popover/index.js +1 -0
- package/dist/popover-0WDxRi-s.js +114 -0
- package/dist/popover-0WDxRi-s.js.map +1 -0
- package/dist/preview-card/index.d.ts +13 -0
- package/dist/preview-card/index.js +35 -0
- package/dist/preview-card/index.js.map +1 -0
- package/dist/profile/index.d.ts +21 -0
- package/dist/profile/index.js +52 -0
- package/dist/profile/index.js.map +1 -0
- package/dist/progress/index.d.ts +23 -0
- package/dist/progress/index.js +97 -0
- package/dist/progress/index.js.map +1 -0
- package/dist/radar-ping/index.d.ts +11 -0
- package/dist/radar-ping/index.js +49 -0
- package/dist/radar-ping/index.js.map +1 -0
- package/dist/radio-group/index.d.ts +2 -0
- package/dist/radio-group/index.js +1 -0
- package/dist/radio-group-Dj43u35Z.js +47 -0
- package/dist/radio-group-Dj43u35Z.js.map +1 -0
- package/dist/resizeable/index.d.ts +11 -0
- package/dist/resizeable/index.js +31 -0
- package/dist/resizeable/index.js.map +1 -0
- package/dist/scroll-area/index.d.ts +11 -0
- package/dist/scroll-area/index.js +51 -0
- package/dist/scroll-area/index.js.map +1 -0
- package/dist/select/index.d.ts +2 -0
- package/dist/select/index.js +1 -0
- package/dist/select-DncJXYim.js +159 -0
- package/dist/select-DncJXYim.js.map +1 -0
- package/dist/separator/index.d.ts +2 -0
- package/dist/separator/index.js +1 -0
- package/dist/separator-DgIQp1cB.js +97 -0
- package/dist/separator-DgIQp1cB.js.map +1 -0
- package/dist/sidebar/index.d.ts +80 -0
- package/dist/sidebar/index.js +334 -0
- package/dist/sidebar/index.js.map +1 -0
- package/dist/site-header/index.d.ts +22 -0
- package/dist/site-header/index.js +55 -0
- package/dist/site-header/index.js.map +1 -0
- package/dist/skeleton/index.d.ts +4 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton-DSG3FWby.js +13 -0
- package/dist/skeleton-DSG3FWby.js.map +1 -0
- package/dist/slider/index.d.ts +2 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider-D_XlV4OW.js +114 -0
- package/dist/slider-D_XlV4OW.js.map +1 -0
- package/dist/slider-group/index.d.ts +46 -0
- package/dist/slider-group/index.js +198 -0
- package/dist/slider-group/index.js.map +1 -0
- package/dist/styles.css +4 -1
- package/dist/switch/index.d.ts +2 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch-DXHixGHe.js +23 -0
- package/dist/switch-DXHixGHe.js.map +1 -0
- package/dist/table/index.d.ts +920 -0
- package/dist/table/index.js +1544 -0
- package/dist/table/index.js.map +1 -0
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +1 -0
- package/dist/tabs-DTC7coap.js +270 -0
- package/dist/tabs-DTC7coap.js.map +1 -0
- package/dist/text-area/index.d.ts +2 -0
- package/dist/text-area/index.js +1 -0
- package/dist/text-area-H6HjKnv_.js +50 -0
- package/dist/text-area-H6HjKnv_.js.map +1 -0
- package/dist/toast/index.d.ts +65 -0
- package/dist/toast/index.js +216 -0
- package/dist/toast/index.js.map +1 -0
- package/dist/toggle/index.d.ts +2 -0
- package/dist/toggle/index.js +1 -0
- package/dist/toggle-ZT9thVmz.js +73 -0
- package/dist/toggle-ZT9thVmz.js.map +1 -0
- package/dist/toggle-group/index.d.ts +10 -0
- package/dist/toggle-group/index.js +63 -0
- package/dist/toggle-group/index.js.map +1 -0
- package/dist/toggle-group-context-CBNZEf1I.js +6 -0
- package/dist/toggle-group-context-CBNZEf1I.js.map +1 -0
- package/dist/tooltip/index.d.ts +18 -0
- package/dist/tooltip/index.js +1 -0
- package/dist/tooltip-B6z3tDbW.js +41 -0
- package/dist/tooltip-B6z3tDbW.js.map +1 -0
- package/dist/trim-text-children-CQRFg2fL.js +33 -0
- package/dist/trim-text-children-CQRFg2fL.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils-BI2x7nW5.js +5 -0
- package/dist/utils-BI2x7nW5.js.map +1 -0
- package/package.json +100 -31
- package/dist/index.d.ts +0 -8000
- package/dist/index.js +0 -17274
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { t as cn } from "../cn-BDi0DfT5.js";
|
|
2
|
+
import { n as Icon } from "../icon-D3JWfCa2.js";
|
|
3
|
+
import { t as Button } from "../button-DXQvyQyj.js";
|
|
4
|
+
import { t as Popover } from "../popover-0WDxRi-s.js";
|
|
5
|
+
import { n as useIxiaMap, t as MapContext } from "../map.context-Dw1D7E8m.js";
|
|
6
|
+
import { cva } from "class-variance-authority";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import React from "react";
|
|
9
|
+
// src/components/map/map.tsx
|
|
10
|
+
function Map$1({ layers, onVisibilityChange, children }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(MapContext.Provider, {
|
|
12
|
+
value: {
|
|
13
|
+
layers,
|
|
14
|
+
onVisibilityChange
|
|
15
|
+
},
|
|
16
|
+
children
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
// src/components/map/map.utils.ts
|
|
20
|
+
const mapControlGroupVariants = cva("absolute z-10 flex flex-col items-center justify-start gap-2xs", {
|
|
21
|
+
defaultVariants: { position: "bottom-right" },
|
|
22
|
+
variants: { position: {
|
|
23
|
+
"bottom-left": "bottom-lg left-sm",
|
|
24
|
+
"bottom-right": "right-sm bottom-lg",
|
|
25
|
+
"top-left": "top-lg left-sm",
|
|
26
|
+
"top-right": "top-lg right-sm"
|
|
27
|
+
} }
|
|
28
|
+
});
|
|
29
|
+
// src/components/map/map-control-group.tsx
|
|
30
|
+
function MapControlGroup({ position, className, children, ref, ...props }) {
|
|
31
|
+
return /* @__PURE__ */ jsx("div", {
|
|
32
|
+
className: cn(mapControlGroupVariants({ position }), className),
|
|
33
|
+
ref,
|
|
34
|
+
...props,
|
|
35
|
+
children
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
// src/components/map/map-layer-group.context.ts
|
|
39
|
+
const MapLayerGroupContext = React.createContext(void 0);
|
|
40
|
+
function useMapLayerGroup() {
|
|
41
|
+
const context = React.useContext(MapLayerGroupContext);
|
|
42
|
+
if (!context) throw new Error("useMapLayerGroup must be used within a MapLayerGroup");
|
|
43
|
+
return context;
|
|
44
|
+
}
|
|
45
|
+
// src/components/map/map-layer-group.tsx
|
|
46
|
+
function MapLayerGroup({ group, className, children, ref, ...props }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(MapLayerGroupContext.Provider, {
|
|
48
|
+
value: { group },
|
|
49
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: cn("flex flex-col gap-3xs", className),
|
|
51
|
+
ref,
|
|
52
|
+
...props,
|
|
53
|
+
children
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// src/components/map/map-layer-group-label.tsx
|
|
58
|
+
function MapLayerGroupLabel({ className, children, ref, ...props }) {
|
|
59
|
+
const { group } = useMapLayerGroup();
|
|
60
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
61
|
+
className: cn("font-body text-sm font-medium text-on-surface-variant", className),
|
|
62
|
+
ref,
|
|
63
|
+
...props,
|
|
64
|
+
children: [children, group.name]
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// src/components/map/map-layer-group-layer-list.tsx
|
|
68
|
+
function MapLayerGroupLayerList({ className, children, ...props }) {
|
|
69
|
+
const { group } = useMapLayerGroup(), { layers } = useIxiaMap(), groupLayers = group.layers.flatMap((config) => {
|
|
70
|
+
const layer = layers.find((candidate) => candidate.id === config.id);
|
|
71
|
+
if (!layer) return [];
|
|
72
|
+
return [layer];
|
|
73
|
+
});
|
|
74
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
75
|
+
className: cn("flex flex-col gap-2xs", className),
|
|
76
|
+
...props,
|
|
77
|
+
children: groupLayers.map((layer) => children(layer))
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
// src/components/map/map-layer-group-list.tsx
|
|
81
|
+
const GROUP_CHECK = 0;
|
|
82
|
+
function MapLayerGroupList({ groups, className, children, ref, ...props }) {
|
|
83
|
+
const { layers } = useIxiaMap();
|
|
84
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(Button, {
|
|
85
|
+
size: "medium",
|
|
86
|
+
tone: "neutral",
|
|
87
|
+
variant: "elevated",
|
|
88
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
89
|
+
name: "layers",
|
|
90
|
+
weight: "bold"
|
|
91
|
+
})
|
|
92
|
+
}) }), /* @__PURE__ */ jsx(Popover.Panel, {
|
|
93
|
+
className: cn("", className),
|
|
94
|
+
ref,
|
|
95
|
+
...props,
|
|
96
|
+
children: /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsx("ul", {
|
|
97
|
+
className: "flex flex-col gap-md",
|
|
98
|
+
children: groups.map((group) => {
|
|
99
|
+
if (group.layers.flatMap((config) => {
|
|
100
|
+
const layer = layers.find((candidate) => candidate.id === config.id);
|
|
101
|
+
if (!layer) return [];
|
|
102
|
+
return [{
|
|
103
|
+
...layer,
|
|
104
|
+
visible: config.visible ?? true
|
|
105
|
+
}];
|
|
106
|
+
}).length === GROUP_CHECK) return;
|
|
107
|
+
return children(group);
|
|
108
|
+
})
|
|
109
|
+
}) })
|
|
110
|
+
})] });
|
|
111
|
+
}
|
|
112
|
+
// src/components/map/map-layer-item.context.ts
|
|
113
|
+
const MapLayerItemContext = React.createContext(void 0);
|
|
114
|
+
function useMapLayerItem() {
|
|
115
|
+
const context = React.useContext(MapLayerItemContext);
|
|
116
|
+
if (!context) throw new Error("useMapLayerItem must be used within a MapLayerItem");
|
|
117
|
+
return context;
|
|
118
|
+
}
|
|
119
|
+
// src/components/map/map-layer-icon.tsx
|
|
120
|
+
function MapLayerIcon({ className, children, ref, ...props }) {
|
|
121
|
+
const { layer } = useMapLayerItem();
|
|
122
|
+
if (!layer.icon) return;
|
|
123
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
124
|
+
className: cn("shrink-0 [&>svg]:size-md", className),
|
|
125
|
+
ref,
|
|
126
|
+
...props,
|
|
127
|
+
children: [children, layer.icon]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// src/components/map/map-layer-item.tsx
|
|
131
|
+
function MapLayerItem({ fadeWhenInvisible = true, layer, className, children, ref, ...props }) {
|
|
132
|
+
return /* @__PURE__ */ jsx(MapLayerItemContext.Provider, {
|
|
133
|
+
value: { layer },
|
|
134
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
135
|
+
className: cn("flex items-center gap-2xs transition-opacity [&>:nth-last-child(2)]:mr-lg", fadeWhenInvisible && layer.visible === false && "opacity-50", className),
|
|
136
|
+
ref,
|
|
137
|
+
...props,
|
|
138
|
+
children
|
|
139
|
+
})
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// src/components/map/map-layer-list.tsx
|
|
143
|
+
function MapLayerList({ className, children, ref, ...props }) {
|
|
144
|
+
const { layers } = useIxiaMap();
|
|
145
|
+
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(Button, {
|
|
146
|
+
size: "medium",
|
|
147
|
+
tone: "neutral",
|
|
148
|
+
variant: "elevated",
|
|
149
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
150
|
+
name: "layers",
|
|
151
|
+
weight: "bold"
|
|
152
|
+
})
|
|
153
|
+
}) }), /* @__PURE__ */ jsx(Popover.Panel, {
|
|
154
|
+
className: cn("", className),
|
|
155
|
+
ref,
|
|
156
|
+
...props,
|
|
157
|
+
children: /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsx("ul", {
|
|
158
|
+
className: "flex flex-col gap-2xs",
|
|
159
|
+
children: layers.map((layer) => children(layer))
|
|
160
|
+
}) })
|
|
161
|
+
})] });
|
|
162
|
+
}
|
|
163
|
+
// src/components/map/map-layer-name.tsx
|
|
164
|
+
function MapLayerName({ className, children, ref, ...props }) {
|
|
165
|
+
const { layer } = useMapLayerItem();
|
|
166
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
167
|
+
className: cn("font-body text-sm font-medium whitespace-nowrap", className),
|
|
168
|
+
ref,
|
|
169
|
+
...props,
|
|
170
|
+
children: [children, layer.name]
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
// src/components/map/map-layer-visibility-toggle.tsx
|
|
174
|
+
function MapLayerVisibilityToggle({ className, children, ref, ...props }) {
|
|
175
|
+
const { layer } = useMapLayerItem(), layerId = layer.id, { onVisibilityChange } = useIxiaMap(), visible = layer.visible ?? true, handleClick = (event) => {
|
|
176
|
+
if (!event.defaultPrevented && onVisibilityChange) onVisibilityChange(layer, !visible);
|
|
177
|
+
};
|
|
178
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
179
|
+
type: "button",
|
|
180
|
+
size: "small",
|
|
181
|
+
tone: "neutral",
|
|
182
|
+
variant: "soft",
|
|
183
|
+
"aria-label": `Layer visibility: ${layerId}`,
|
|
184
|
+
"aria-pressed": visible,
|
|
185
|
+
title: "Toggle layer visibility",
|
|
186
|
+
className: cn("ml-auto shrink-0 grow-0", className),
|
|
187
|
+
ref,
|
|
188
|
+
onClick: handleClick,
|
|
189
|
+
...props,
|
|
190
|
+
children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [visible && /* @__PURE__ */ jsx(Icon, { name: "visible" }), !visible && /* @__PURE__ */ jsx(Icon, { name: "hidden" })] })
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
// src/components/map/index.ts
|
|
194
|
+
const Map = Object.assign(Map$1, {
|
|
195
|
+
ControlGroup: MapControlGroup,
|
|
196
|
+
LayerGroup: MapLayerGroup,
|
|
197
|
+
LayerGroupLabel: MapLayerGroupLabel,
|
|
198
|
+
LayerGroupLayerList: MapLayerGroupLayerList,
|
|
199
|
+
LayerGroupList: MapLayerGroupList,
|
|
200
|
+
LayerIcon: MapLayerIcon,
|
|
201
|
+
LayerItem: MapLayerItem,
|
|
202
|
+
LayerList: MapLayerList,
|
|
203
|
+
LayerName: MapLayerName,
|
|
204
|
+
LayerVisibilityToggle: MapLayerVisibilityToggle
|
|
205
|
+
});
|
|
206
|
+
export { Map, MapControlGroup, MapLayerGroup, MapLayerGroupLabel, MapLayerGroupLayerList, MapLayerGroupList, MapLayerIcon, MapLayerItem, MapLayerList, MapLayerName, MapLayerVisibilityToggle, useIxiaMap, useMapLayerGroup, useMapLayerItem };
|
|
207
|
+
|
|
208
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Map","MapRoot"],"sources":["../../src/components/map/map.tsx","../../src/components/map/map.utils.ts","../../src/components/map/map-control-group.tsx","../../src/components/map/map-layer-group.context.ts","../../src/components/map/map-layer-group.tsx","../../src/components/map/map-layer-group-label.tsx","../../src/components/map/map-layer-group-layer-list.tsx","../../src/components/map/map-layer-group-list.tsx","../../src/components/map/map-layer-item.context.ts","../../src/components/map/map-layer-icon.tsx","../../src/components/map/map-layer-item.tsx","../../src/components/map/map-layer-list.tsx","../../src/components/map/map-layer-name.tsx","../../src/components/map/map-layer-visibility-toggle.tsx","../../src/components/map/index.ts"],"sourcesContent":["import { MapContext } from './map.context'\nimport type { MapProps } from './map.types'\n\nexport function Map({ layers, onVisibilityChange, children }: MapProps) {\n return (\n <MapContext.Provider value={{ layers, onVisibilityChange }}>{children}</MapContext.Provider>\n )\n}\n","import { cva } from 'class-variance-authority'\n\nconst mapControlGroupVariants = cva(\n 'absolute z-10 flex flex-col items-center justify-start gap-2xs',\n {\n defaultVariants: {\n position: 'bottom-right',\n },\n variants: {\n position: {\n 'bottom-left': 'bottom-lg left-sm',\n 'bottom-right': 'right-sm bottom-lg',\n 'top-left': 'top-lg left-sm',\n 'top-right': 'top-lg right-sm',\n },\n },\n },\n)\n\nexport { mapControlGroupVariants }\n","import { cn } from '@/utils'\n\nimport type { MapControlGroupProps } from './map.types'\nimport { mapControlGroupVariants } from './map.utils'\n\nexport function MapControlGroup({\n position,\n className,\n children,\n ref,\n ...props\n}: MapControlGroupProps) {\n return (\n <div className={cn(mapControlGroupVariants({ position }), className)} ref={ref} {...props}>\n {children}\n </div>\n )\n}\n","import React from 'react'\n\nimport type { MapLayerGroupContextValue } from './map.types'\n\nconst MapLayerGroupContext = React.createContext<MapLayerGroupContextValue | undefined>(undefined)\n\nfunction useMapLayerGroup(): MapLayerGroupContextValue {\n const context = React.useContext(MapLayerGroupContext)\n\n if (!context) {\n throw new Error('useMapLayerGroup must be used within a MapLayerGroup')\n }\n\n return context\n}\n\nexport { MapLayerGroupContext, useMapLayerGroup }\n","import { cn } from '@/utils'\n\nimport { MapLayerGroupContext } from './map-layer-group.context'\nimport type { MapLayerGroupProps } from './map.types'\n\nexport function MapLayerGroup({ group, className, children, ref, ...props }: MapLayerGroupProps) {\n return (\n <MapLayerGroupContext.Provider value={{ group }}>\n <div className={cn('flex flex-col gap-3xs', className)} ref={ref} {...props}>\n {children}\n </div>\n </MapLayerGroupContext.Provider>\n )\n}\n","import { cn } from '@/utils'\n\nimport { useMapLayerGroup } from './map-layer-group.context'\nimport type { MapLayerGroupLabelProps } from './map.types'\n\nexport function MapLayerGroupLabel({\n className,\n children,\n ref,\n ...props\n}: MapLayerGroupLabelProps) {\n const { group } = useMapLayerGroup()\n\n return (\n <span\n className={cn('font-body text-sm font-medium text-on-surface-variant', className)}\n ref={ref}\n {...props}\n >\n {children}\n {group.name}\n </span>\n )\n}\n","import { cn } from '@/utils'\n\nimport { useMapLayerGroup } from './map-layer-group.context'\nimport { useIxiaMap } from './map.context'\nimport type { MapLayerGroupLayerListProps } from './map.types'\n\nexport function MapLayerGroupLayerList({\n className,\n children,\n ...props\n}: MapLayerGroupLayerListProps) {\n const { group } = useMapLayerGroup(),\n { layers } = useIxiaMap(),\n groupLayers = group.layers.flatMap((config) => {\n const layer = layers.find((candidate) => candidate.id === config.id)\n if (!layer) {\n return []\n }\n\n return [layer]\n })\n\n return (\n <ul className={cn('flex flex-col gap-2xs', className)} {...props}>\n {groupLayers.map((layer) => children(layer))}\n </ul>\n )\n}\n","import { cn } from '@/utils'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { Popover } from '../popover'\nimport { useIxiaMap } from './map.context'\nimport type { MapLayerGroupListProps } from './map.types'\n\nconst GROUP_CHECK = 0\n\nexport function MapLayerGroupList({\n groups,\n className,\n children,\n ref,\n ...props\n}: MapLayerGroupListProps) {\n const { layers } = useIxiaMap()\n\n return (\n <Popover>\n <Popover.Trigger>\n <Button size=\"medium\" tone=\"neutral\" variant=\"elevated\">\n <Icon name=\"layers\" weight=\"bold\" />\n </Button>\n </Popover.Trigger>\n <Popover.Panel className={cn('', className)} ref={ref} {...props}>\n <Popover.Content>\n <ul className=\"flex flex-col gap-md\">\n {groups.map((group) => {\n const groupLayers = group.layers.flatMap((config) => {\n const layer = layers.find((candidate) => candidate.id === config.id)\n if (!layer) {\n return []\n }\n\n return [\n {\n ...layer,\n visible: config.visible ?? true,\n },\n ]\n })\n\n if (groupLayers.length === GROUP_CHECK) {\n return undefined\n }\n\n return children(group)\n })}\n </ul>\n </Popover.Content>\n </Popover.Panel>\n </Popover>\n )\n}\n","import React from 'react'\n\nimport type { MapLayerItemContextValue } from './map.types'\n\nconst MapLayerItemContext = React.createContext<MapLayerItemContextValue | undefined>(undefined)\n\nfunction useMapLayerItem(): MapLayerItemContextValue {\n const context = React.useContext(MapLayerItemContext)\n\n if (!context) {\n throw new Error('useMapLayerItem must be used within a MapLayerItem')\n }\n\n return context\n}\n\nexport { MapLayerItemContext, useMapLayerItem }\n","import { cn } from '@/utils'\n\nimport { useMapLayerItem } from './map-layer-item.context'\nimport type { MapLayerIconProps } from './map.types'\n\nexport function MapLayerIcon({ className, children, ref, ...props }: MapLayerIconProps) {\n const { layer } = useMapLayerItem()\n\n if (!layer.icon) {\n return undefined\n }\n\n return (\n <div className={cn('shrink-0 [&>svg]:size-md', className)} ref={ref} {...props}>\n {children}\n {layer.icon}\n </div>\n )\n}\n","import { cn } from '@/utils'\n\nimport { MapLayerItemContext } from './map-layer-item.context'\nimport type { MapLayerItemProps } from './map.types'\n\nexport function MapLayerItem({\n fadeWhenInvisible = true,\n layer,\n className,\n children,\n ref,\n ...props\n}: MapLayerItemProps) {\n return (\n <MapLayerItemContext.Provider value={{ layer }}>\n <div\n className={cn(\n 'flex items-center gap-2xs transition-opacity [&>:nth-last-child(2)]:mr-lg',\n fadeWhenInvisible && layer.visible === false && 'opacity-50',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </div>\n </MapLayerItemContext.Provider>\n )\n}\n","import { cn } from '@/utils'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { Popover } from '../popover'\nimport { useIxiaMap } from './map.context'\nimport type { MapLayerListProps } from './map.types'\n\nexport function MapLayerList({ className, children, ref, ...props }: MapLayerListProps) {\n const { layers } = useIxiaMap()\n\n return (\n <Popover>\n <Popover.Trigger>\n <Button size=\"medium\" tone=\"neutral\" variant=\"elevated\">\n <Icon name=\"layers\" weight=\"bold\" />\n </Button>\n </Popover.Trigger>\n <Popover.Panel className={cn('', className)} ref={ref} {...props}>\n <Popover.Content>\n <ul className=\"flex flex-col gap-2xs\">{layers.map((layer) => children(layer))}</ul>\n </Popover.Content>\n </Popover.Panel>\n </Popover>\n )\n}\n","import { cn } from '@/utils'\n\nimport { useMapLayerItem } from './map-layer-item.context'\nimport type { MapLayerNameProps } from './map.types'\n\nexport function MapLayerName({ className, children, ref, ...props }: MapLayerNameProps) {\n const { layer } = useMapLayerItem()\n\n return (\n <span\n className={cn('font-body text-sm font-medium whitespace-nowrap', className)}\n ref={ref}\n {...props}\n >\n {children}\n {layer.name}\n </span>\n )\n}\n","import { cn } from '@/utils'\n\nimport { Button } from '../button'\nimport { Icon } from '../icon'\nimport { useMapLayerItem } from './map-layer-item.context'\nimport { useIxiaMap } from './map.context'\nimport type { MapLayerVisibilityToggleProps } from './map.types'\n\nexport function MapLayerVisibilityToggle({\n className,\n children,\n ref,\n ...props\n}: MapLayerVisibilityToggleProps) {\n const { layer } = useMapLayerItem(),\n layerId = layer.id,\n { onVisibilityChange } = useIxiaMap(),\n visible = layer.visible ?? true,\n handleClick: NonNullable<MapLayerVisibilityToggleProps['onClick']> = (event) => {\n if (!event.defaultPrevented && onVisibilityChange) {\n onVisibilityChange(layer, !visible)\n }\n }\n\n return (\n <Button\n type=\"button\"\n size=\"small\"\n tone=\"neutral\"\n variant=\"soft\"\n aria-label={`Layer visibility: ${layerId}`}\n aria-pressed={visible}\n title=\"Toggle layer visibility\"\n className={cn('ml-auto shrink-0 grow-0', className)}\n ref={ref}\n onClick={handleClick}\n {...props}\n >\n {children ?? (\n <>\n {visible && <Icon name=\"visible\" />}\n {!visible && <Icon name=\"hidden\" />}\n </>\n )}\n </Button>\n )\n}\n","import { Map as MapRoot } from './map'\nimport { MapControlGroup } from './map-control-group'\nimport { MapLayerGroup } from './map-layer-group'\nimport { MapLayerGroupLabel } from './map-layer-group-label'\nimport { MapLayerGroupLayerList } from './map-layer-group-layer-list'\nimport { MapLayerGroupList } from './map-layer-group-list'\nimport { MapLayerIcon } from './map-layer-icon'\nimport { MapLayerItem } from './map-layer-item'\nimport { MapLayerList } from './map-layer-list'\nimport { MapLayerName } from './map-layer-name'\nimport { MapLayerVisibilityToggle } from './map-layer-visibility-toggle'\n\nconst Map = Object.assign(MapRoot, {\n ControlGroup: MapControlGroup,\n LayerGroup: MapLayerGroup,\n LayerGroupLabel: MapLayerGroupLabel,\n LayerGroupLayerList: MapLayerGroupLayerList,\n LayerGroupList: MapLayerGroupList,\n LayerIcon: MapLayerIcon,\n LayerItem: MapLayerItem,\n LayerList: MapLayerList,\n LayerName: MapLayerName,\n LayerVisibilityToggle: MapLayerVisibilityToggle,\n})\n\nexport { MapControlGroup } from './map-control-group'\nexport { MapLayerList } from './map-layer-list'\nexport { MapLayerItem } from './map-layer-item'\nexport { MapLayerName } from './map-layer-name'\nexport { useMapLayerItem } from './map-layer-item.context'\nexport { useIxiaMap } from './map.context'\nexport { MapLayerVisibilityToggle } from './map-layer-visibility-toggle'\nexport { MapLayerIcon } from './map-layer-icon'\nexport { MapLayerGroup } from './map-layer-group'\nexport { MapLayerGroupLabel } from './map-layer-group-label'\nexport { MapLayerGroupLayerList } from './map-layer-group-layer-list'\nexport { MapLayerGroupList } from './map-layer-group-list'\nexport { useMapLayerGroup } from './map-layer-group.context'\nexport type {\n MapLayerIconProps,\n MapLayerListProps,\n MapLayerItemProps,\n MapLayerItemContextValue,\n MapLayerVisibilityToggleProps,\n GeometryLayerConfig,\n DeckGLLayerConfig,\n MarkerOverlayConfig,\n MapLayerConfig,\n MapLayerMetadata,\n MapControlGroupProps,\n MapLayerNameProps,\n MapLayerGroupConfig,\n MapContextValue,\n MapProps,\n MapLayerGroupProps,\n MapLayerGroupLabelProps,\n MapLayerGroupListProps,\n MapLayerGroupLayerListProps,\n MapLayerGroupContextValue,\n} from './map.types'\nexport { Map }\n"],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
// src/components/map/map.context.ts
|
|
3
|
+
const MapContext = React.createContext(void 0);
|
|
4
|
+
function useIxiaMap() {
|
|
5
|
+
const context = React.useContext(MapContext);
|
|
6
|
+
if (!context) throw new Error("useIxiaMap must be used within a Map");
|
|
7
|
+
return context;
|
|
8
|
+
}
|
|
9
|
+
export { useIxiaMap as n, MapContext as t };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=map.context-Dw1D7E8m.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map.context-Dw1D7E8m.js","names":[],"sources":["../src/components/map/map.context.ts"],"sourcesContent":["import React from 'react'\n\nimport type { MapContextValue } from './map.types'\n\nconst MapContext = React.createContext<MapContextValue | undefined>(undefined)\n\nfunction useIxiaMap(): MapContextValue {\n const context = React.useContext(MapContext)\n\n if (!context) {\n throw new Error('useIxiaMap must be used within a Map')\n }\n\n return context\n}\n\nexport { MapContext, useIxiaMap }\n"],"mappings":";;AAIA,MAAM,aAAa,MAAM,cAA2C,KAAA,CAAS;AAE7E,SAAS,aAA8B;CACrC,MAAM,UAAU,MAAM,WAAW,UAAU;CAE3C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,sCAAsC;CAGxD,OAAO;AACT"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as MenuShortcutProps, E as MenuTriggerProps, S as MenuSeparatorProps, T as MenuSubmenuTriggerProps, _ as MenuItemProps, a as MenuShortcut, b as MenuRadioGroupProps, c as MenuRadioGroup, d as MenuGroupLabel, f as MenuGroup, g as MenuGroupProps, h as MenuGroupLabelProps, i as MenuSubmenu, l as MenuPopup, m as MenuCheckboxItemProps, n as MenuTrigger, o as MenuSeparator, p as MenuCheckboxItem, r as MenuSubmenuTrigger, s as MenuRadioItem, t as Menu, u as MenuItem, v as MenuPopupProps, w as MenuSubmenuProps, x as MenuRadioItemProps, y as MenuProps } from "../index-CQti9gFb.js";
|
|
2
|
+
export { Menu, MenuCheckboxItem, type MenuCheckboxItemProps, MenuGroup, MenuGroupLabel, type MenuGroupLabelProps, type MenuGroupProps, MenuItem, type MenuItemProps, MenuPopup, type MenuPopupProps, type MenuProps, MenuRadioGroup, type MenuRadioGroupProps, MenuRadioItem, type MenuRadioItemProps, MenuSeparator, type MenuSeparatorProps, MenuShortcut, type MenuShortcutProps, MenuSubmenu, type MenuSubmenuProps, MenuSubmenuTrigger, type MenuSubmenuTriggerProps, MenuTrigger, type MenuTriggerProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Menu, p as MenuCheckboxItem, f as MenuGroup, d as MenuGroupLabel, u as MenuItem, l as MenuPopup, c as MenuRadioGroup, s as MenuRadioItem, o as MenuSeparator, a as MenuShortcut, i as MenuSubmenu, r as MenuSubmenuTrigger, n as MenuTrigger } from "../menu-sf13cnGp.js";
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { t as cn } from "./cn-BDi0DfT5.js";
|
|
2
|
+
import { n as Icon } from "./icon-D3JWfCa2.js";
|
|
3
|
+
import { t as trimTextChildren } from "./trim-text-children-CQRFg2fL.js";
|
|
4
|
+
import { n as menuSubmenuToneClasses, t as menuItemToneClasses } from "./menu-tone-DWBEHoX2.js";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { isValidElement } from "react";
|
|
8
|
+
import { Menu } from "@base-ui/react/menu";
|
|
9
|
+
// src/components/menu/menu.tsx
|
|
10
|
+
function Menu$2({ ...props }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Menu.Root, { ...props });
|
|
12
|
+
}
|
|
13
|
+
// src/components/menu/menu-checkbox-item.tsx
|
|
14
|
+
function MenuCheckboxItem({ className, children, ref, ...props }) {
|
|
15
|
+
return /* @__PURE__ */ jsxs(Menu.CheckboxItem, {
|
|
16
|
+
className: cn("relative z-0 grid h-lg cursor-default grid-cols-[1fr_2rem] items-center px-xs style-text-default-0 transition-colors outline-none select-none before:absolute before:inset-x-3xs before:inset-y-[0px] before:z-[-1] before:rounded-md before:bg-transparent before:transition-colors before:content-[\"\"] hover:cursor-pointer data-highlighted:text-neutral-on-container data-highlighted:before:bg-neutral-container-high", className),
|
|
17
|
+
ref,
|
|
18
|
+
...props,
|
|
19
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
20
|
+
className: "col-start-1 flex items-center gap-2xs",
|
|
21
|
+
children: trimTextChildren(children)
|
|
22
|
+
}), /* @__PURE__ */ jsx(Menu.CheckboxItemIndicator, {
|
|
23
|
+
className: "col-start-2 flex items-center justify-center place-self-end self-center",
|
|
24
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
25
|
+
name: "selected",
|
|
26
|
+
className: "size-sm"
|
|
27
|
+
})
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
// src/components/menu/menu-group.tsx
|
|
32
|
+
function MenuGroup({ className, ref, ...props }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(Menu.Group, {
|
|
34
|
+
className: cn("", className),
|
|
35
|
+
ref,
|
|
36
|
+
...props
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// src/components/menu/menu-group-label.tsx
|
|
40
|
+
function MenuGroupLabel({ className, ref, ...props }) {
|
|
41
|
+
return /* @__PURE__ */ jsx(Menu.GroupLabel, {
|
|
42
|
+
className: cn("cursor-default px-2xs py-3xs style-text-default--2 text-on-surface-variant select-none", className),
|
|
43
|
+
ref,
|
|
44
|
+
...props
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// src/components/menu/menu.types.ts
|
|
48
|
+
const menuItemVariants = cva("relative z-0 flex cursor-default items-center px-xs py-3xs style-text-default-0 transition-colors duration-100 outline-none select-none before:absolute before:inset-x-3xs before:inset-y-[0px] before:z-[-1] before:rounded-md before:bg-transparent before:transition-colors before:duration-100 before:content-[\"\"] hover:cursor-pointer", {
|
|
49
|
+
defaultVariants: { tone: "neutral" },
|
|
50
|
+
variants: { tone: menuItemToneClasses }
|
|
51
|
+
});
|
|
52
|
+
const menuSubmenuTriggerVariants = cva("relative z-0 grid cursor-default grid-cols-[1fr_2rem] items-center px-xs py-3xs style-text-default-0 transition-colors duration-100 outline-none select-none before:absolute before:inset-x-3xs before:inset-y-[0px] before:z-[-1] before:rounded-md before:transition-colors before:duration-100 before:content-[\"\"] hover:cursor-pointer", {
|
|
53
|
+
defaultVariants: { tone: "neutral" },
|
|
54
|
+
variants: { tone: menuSubmenuToneClasses }
|
|
55
|
+
});
|
|
56
|
+
// src/components/menu/menu-item.tsx
|
|
57
|
+
function MenuItem({ tone, className, children, ref, ...props }) {
|
|
58
|
+
return /* @__PURE__ */ jsx(Menu.Item, {
|
|
59
|
+
className: cn(menuItemVariants({ tone }), className),
|
|
60
|
+
nativeButton: true,
|
|
61
|
+
ref,
|
|
62
|
+
render: (renderProps) => /* @__PURE__ */ jsx("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
...renderProps,
|
|
65
|
+
className: cn("w-full gap-2xs [&>svg]:size-sm", renderProps.className),
|
|
66
|
+
children: trimTextChildren(children)
|
|
67
|
+
}),
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// src/components/menu/menu-popup.tsx
|
|
72
|
+
function MenuPopup({ className, children, ref, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
|
|
74
|
+
className: cn("z-99 outline-none", className),
|
|
75
|
+
ref,
|
|
76
|
+
sideOffset: 8,
|
|
77
|
+
...props,
|
|
78
|
+
children: /* @__PURE__ */ jsx(Menu.Popup, {
|
|
79
|
+
className: "flex min-w-[12rem] origin-(--transform-origin) translate-x-[-calc(var(--spacing-xl)/2)] flex-col gap-3xs rounded-lg bg-surface-2 px-3xs py-2xs shadow-md transition-[transform,scale,opacity] data-ending-style:scale-90 data-ending-style:opacity-0 data-starting-style:scale-90 data-starting-style:opacity-0",
|
|
80
|
+
children
|
|
81
|
+
})
|
|
82
|
+
}) });
|
|
83
|
+
}
|
|
84
|
+
// src/components/menu/menu-radio-group.tsx
|
|
85
|
+
function MenuRadioGroup({ className, ref, ...props }) {
|
|
86
|
+
return /* @__PURE__ */ jsx(Menu.RadioGroup, {
|
|
87
|
+
className: cn("", className),
|
|
88
|
+
ref,
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// src/components/menu/menu-radio-item.tsx
|
|
93
|
+
function MenuRadioItem({ className, children, ref, ...props }) {
|
|
94
|
+
return /* @__PURE__ */ jsxs(Menu.RadioItem, {
|
|
95
|
+
className: cn("relative z-0 grid h-lg cursor-default grid-cols-[1fr_2rem] items-center px-xs style-text-default-0 transition-colors outline-none select-none before:absolute before:inset-x-3xs before:inset-y-[0px] before:z-[-1] before:rounded-md before:bg-transparent before:transition-colors before:content-[\"\"] hover:cursor-pointer data-highlighted:text-neutral-on-container data-highlighted:before:bg-neutral-container-high", className),
|
|
96
|
+
ref,
|
|
97
|
+
...props,
|
|
98
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
99
|
+
className: "col-start-1 min-w-3xl text-box-trim",
|
|
100
|
+
children
|
|
101
|
+
}), /* @__PURE__ */ jsx(Menu.RadioItemIndicator, {
|
|
102
|
+
className: "col-start-2 flex items-center justify-center place-self-end self-center",
|
|
103
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
104
|
+
name: "selected",
|
|
105
|
+
className: "size-sm"
|
|
106
|
+
})
|
|
107
|
+
})]
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// src/components/menu/menu-separator.tsx
|
|
111
|
+
function MenuSeparator({ className, ref, ...props }) {
|
|
112
|
+
return /* @__PURE__ */ jsx(Menu.Separator, {
|
|
113
|
+
className: cn("mx-2xs my-3xs h-px bg-border-strong", className),
|
|
114
|
+
ref,
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// src/components/menu/menu-shortcut.tsx
|
|
119
|
+
function MenuShortcut({ className, ref, ...props }) {
|
|
120
|
+
return /* @__PURE__ */ jsx("div", {
|
|
121
|
+
className: cn("ml-auto inline-flex items-center gap-3xs", className),
|
|
122
|
+
ref,
|
|
123
|
+
...props
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
// src/components/menu/menu-submenu.tsx
|
|
127
|
+
function MenuSubmenu({ ...props }) {
|
|
128
|
+
return /* @__PURE__ */ jsx(Menu.SubmenuRoot, { ...props });
|
|
129
|
+
}
|
|
130
|
+
// src/components/menu/menu-submenu-trigger.tsx
|
|
131
|
+
function MenuSubmenuTrigger({ tone, className, children, ref, ...props }) {
|
|
132
|
+
return /* @__PURE__ */ jsxs(Menu.SubmenuTrigger, {
|
|
133
|
+
className: cn(menuSubmenuTriggerVariants({ tone }), className),
|
|
134
|
+
ref,
|
|
135
|
+
...props,
|
|
136
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
137
|
+
className: "col-start-1 flex min-w-3xl items-center gap-2xs pr-2xl [&>svg]:size-sm",
|
|
138
|
+
children
|
|
139
|
+
}), /* @__PURE__ */ jsx(Icon, {
|
|
140
|
+
name: "chevronRight",
|
|
141
|
+
className: "col-start-2 size-xs place-self-end self-center"
|
|
142
|
+
})]
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// src/components/menu/menu-trigger.tsx
|
|
146
|
+
function MenuTrigger({ className, children, ref, ...props }) {
|
|
147
|
+
let render = void 0;
|
|
148
|
+
if (isValidElement(children)) render = children;
|
|
149
|
+
return /* @__PURE__ */ jsx(Menu.Trigger, {
|
|
150
|
+
className: cn("data-popup-open:pointer-events-none", className),
|
|
151
|
+
ref,
|
|
152
|
+
render,
|
|
153
|
+
...props
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
// src/components/menu/index.ts
|
|
157
|
+
const Menu$1 = Object.assign(Menu$2, {
|
|
158
|
+
CheckboxItem: MenuCheckboxItem,
|
|
159
|
+
Group: MenuGroup,
|
|
160
|
+
GroupLabel: MenuGroupLabel,
|
|
161
|
+
Item: MenuItem,
|
|
162
|
+
Popup: MenuPopup,
|
|
163
|
+
RadioGroup: MenuRadioGroup,
|
|
164
|
+
RadioItem: MenuRadioItem,
|
|
165
|
+
Separator: MenuSeparator,
|
|
166
|
+
Shortcut: MenuShortcut,
|
|
167
|
+
Submenu: MenuSubmenu,
|
|
168
|
+
SubmenuTrigger: MenuSubmenuTrigger,
|
|
169
|
+
Trigger: MenuTrigger
|
|
170
|
+
});
|
|
171
|
+
export { MenuShortcut as a, MenuRadioGroup as c, MenuGroupLabel as d, MenuGroup as f, MenuSubmenu as i, MenuPopup as l, MenuTrigger as n, MenuSeparator as o, MenuCheckboxItem as p, MenuSubmenuTrigger as r, MenuRadioItem as s, Menu$1 as t, MenuItem as u };
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=menu-sf13cnGp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-sf13cnGp.js","names":["Menu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","BaseMenu","Menu","MenuRoot"],"sources":["../src/components/menu/menu.tsx","../src/components/menu/menu-checkbox-item.tsx","../src/components/menu/menu-group.tsx","../src/components/menu/menu-group-label.tsx","../src/components/menu/menu.types.ts","../src/components/menu/menu-item.tsx","../src/components/menu/menu-popup.tsx","../src/components/menu/menu-radio-group.tsx","../src/components/menu/menu-radio-item.tsx","../src/components/menu/menu-separator.tsx","../src/components/menu/menu-shortcut.tsx","../src/components/menu/menu-submenu.tsx","../src/components/menu/menu-submenu-trigger.tsx","../src/components/menu/menu-trigger.tsx","../src/components/menu/index.ts"],"sourcesContent":["import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport type { MenuProps } from './menu.types'\n\nexport function Menu({ ...props }: MenuProps) {\n return <BaseMenu.Root {...props} />\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\nimport { trimTextChildren } from '@/utils/trim-text-children'\n\nimport { Icon } from '../icon'\nimport type { MenuCheckboxItemProps } from './menu.types'\n\nexport function MenuCheckboxItem({ className, children, ref, ...props }: MenuCheckboxItemProps) {\n return (\n <BaseMenu.CheckboxItem\n className={cn(\n 'relative z-0 grid h-lg cursor-default grid-cols-[1fr_2rem] items-center px-xs style-text-default-0 transition-colors outline-none select-none before:absolute before:inset-x-3xs before:inset-y-[0px] before:z-[-1] before:rounded-md before:bg-transparent before:transition-colors before:content-[\"\"] hover:cursor-pointer data-highlighted:text-neutral-on-container data-highlighted:before:bg-neutral-container-high',\n className,\n )}\n ref={ref}\n {...props}\n >\n <span className=\"col-start-1 flex items-center gap-2xs\">{trimTextChildren(children)}</span>\n <BaseMenu.CheckboxItemIndicator className=\"col-start-2 flex items-center justify-center place-self-end self-center\">\n <Icon name=\"selected\" className=\"size-sm\" />\n </BaseMenu.CheckboxItemIndicator>\n </BaseMenu.CheckboxItem>\n )\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\n\nimport type { MenuGroupProps } from './menu.types'\n\nexport function MenuGroup({ className, ref, ...props }: MenuGroupProps) {\n return <BaseMenu.Group className={cn('', className)} ref={ref} {...props} />\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\n\nimport type { MenuGroupLabelProps } from './menu.types'\n\nexport function MenuGroupLabel({ className, ref, ...props }: MenuGroupLabelProps) {\n return (\n <BaseMenu.GroupLabel\n className={cn(\n 'cursor-default px-2xs py-3xs style-text-default--2 text-on-surface-variant select-none',\n className,\n )}\n ref={ref}\n {...props}\n />\n )\n}\n","import type { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { cva } from 'class-variance-authority'\nimport type { VariantProps } from 'class-variance-authority'\n\nimport { menuItemToneClasses, menuSubmenuToneClasses } from './menu-tone'\n\ntype MenuProps = React.ComponentProps<typeof BaseMenu.Root>\ntype MenuTriggerProps = React.ComponentProps<typeof BaseMenu.Trigger>\ntype MenuPopupProps = React.ComponentProps<typeof BaseMenu.Positioner>\ntype MenuSeparatorProps = React.ComponentProps<typeof BaseMenu.Separator>\ntype MenuCheckboxItemProps = React.ComponentProps<typeof BaseMenu.CheckboxItem>\ntype MenuRadioGroupProps = React.ComponentProps<typeof BaseMenu.RadioGroup>\ntype MenuRadioItemProps = React.ComponentProps<typeof BaseMenu.RadioItem>\ntype MenuGroupProps = React.ComponentProps<typeof BaseMenu.Group>\ntype MenuGroupLabelProps = React.ComponentProps<typeof BaseMenu.GroupLabel>\ntype MenuSubmenuProps = React.ComponentProps<typeof BaseMenu.SubmenuRoot>\ntype MenuShortcutProps = React.ComponentProps<'div'>\n\nconst menuItemVariants = cva(\n 'relative z-0 flex cursor-default items-center px-xs py-3xs style-text-default-0 transition-colors duration-100 outline-none select-none before:absolute before:inset-x-3xs before:inset-y-[0px] before:z-[-1] before:rounded-md before:bg-transparent before:transition-colors before:duration-100 before:content-[\"\"] hover:cursor-pointer',\n {\n defaultVariants: {\n tone: 'neutral',\n },\n variants: {\n tone: menuItemToneClasses,\n },\n },\n ),\n menuSubmenuTriggerVariants = cva(\n 'relative z-0 grid cursor-default grid-cols-[1fr_2rem] items-center px-xs py-3xs style-text-default-0 transition-colors duration-100 outline-none select-none before:absolute before:inset-x-3xs before:inset-y-[0px] before:z-[-1] before:rounded-md before:transition-colors before:duration-100 before:content-[\"\"] hover:cursor-pointer',\n {\n defaultVariants: {\n tone: 'neutral',\n },\n variants: {\n tone: menuSubmenuToneClasses,\n },\n },\n )\n\ntype MenuItemProps = React.ComponentProps<typeof BaseMenu.Item> &\n VariantProps<typeof menuItemVariants>\ntype MenuSubmenuTriggerProps = React.ComponentProps<typeof BaseMenu.SubmenuTrigger> &\n VariantProps<typeof menuSubmenuTriggerVariants>\n\nexport type {\n MenuProps,\n MenuTriggerProps,\n MenuPopupProps,\n MenuSeparatorProps,\n MenuCheckboxItemProps,\n MenuRadioGroupProps,\n MenuRadioItemProps,\n MenuGroupProps,\n MenuGroupLabelProps,\n MenuSubmenuProps,\n MenuShortcutProps,\n MenuItemProps,\n MenuSubmenuTriggerProps,\n}\nexport { menuItemVariants, menuSubmenuTriggerVariants }\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\nimport { trimTextChildren } from '@/utils/trim-text-children'\n\nimport { menuItemVariants } from './menu.types'\nimport type { MenuItemProps } from './menu.types'\n\nexport function MenuItem({ tone, className, children, ref, ...props }: MenuItemProps) {\n return (\n <BaseMenu.Item\n className={cn(menuItemVariants({ tone }), className)}\n nativeButton\n ref={ref}\n render={(renderProps) => (\n <button\n type=\"button\"\n {...renderProps}\n className={cn('w-full gap-2xs [&>svg]:size-sm', renderProps.className)}\n >\n {trimTextChildren(children)}\n </button>\n )}\n {...props}\n />\n )\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\n\nimport type { MenuPopupProps } from './menu.types'\n\nexport function MenuPopup({ className, children, ref, ...props }: MenuPopupProps) {\n return (\n <BaseMenu.Portal>\n <BaseMenu.Positioner\n className={cn('z-99 outline-none', className)}\n ref={ref}\n sideOffset={8}\n {...props}\n >\n <BaseMenu.Popup className=\"flex min-w-[12rem] origin-(--transform-origin) translate-x-[-calc(var(--spacing-xl)/2)] flex-col gap-3xs rounded-lg bg-surface-2 px-3xs py-2xs shadow-md transition-[transform,scale,opacity] data-ending-style:scale-90 data-ending-style:opacity-0 data-starting-style:scale-90 data-starting-style:opacity-0\">\n {children}\n </BaseMenu.Popup>\n </BaseMenu.Positioner>\n </BaseMenu.Portal>\n )\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\n\nimport type { MenuRadioGroupProps } from './menu.types'\n\nexport function MenuRadioGroup({ className, ref, ...props }: MenuRadioGroupProps) {\n return <BaseMenu.RadioGroup className={cn('', className)} ref={ref} {...props} />\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\n\nimport { Icon } from '../icon'\nimport type { MenuRadioItemProps } from './menu.types'\n\nexport function MenuRadioItem({ className, children, ref, ...props }: MenuRadioItemProps) {\n return (\n <BaseMenu.RadioItem\n className={cn(\n 'relative z-0 grid h-lg cursor-default grid-cols-[1fr_2rem] items-center px-xs style-text-default-0 transition-colors outline-none select-none before:absolute before:inset-x-3xs before:inset-y-[0px] before:z-[-1] before:rounded-md before:bg-transparent before:transition-colors before:content-[\"\"] hover:cursor-pointer data-highlighted:text-neutral-on-container data-highlighted:before:bg-neutral-container-high',\n className,\n )}\n ref={ref}\n {...props}\n >\n <span className=\"col-start-1 min-w-3xl text-box-trim\">{children}</span>\n <BaseMenu.RadioItemIndicator className=\"col-start-2 flex items-center justify-center place-self-end self-center\">\n <Icon name=\"selected\" className=\"size-sm\" />\n </BaseMenu.RadioItemIndicator>\n </BaseMenu.RadioItem>\n )\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\n\nimport type { MenuSeparatorProps } from './menu.types'\n\nexport function MenuSeparator({ className, ref, ...props }: MenuSeparatorProps) {\n return (\n <BaseMenu.Separator\n className={cn('mx-2xs my-3xs h-px bg-border-strong', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { cn } from '@/utils/cn'\n\nimport type { MenuShortcutProps } from './menu.types'\n\nexport function MenuShortcut({ className, ref, ...props }: MenuShortcutProps) {\n return (\n <div\n className={cn('ml-auto inline-flex items-center gap-3xs', className)}\n ref={ref}\n {...props}\n />\n )\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport type { MenuSubmenuProps } from './menu.types'\n\nexport function MenuSubmenu({ ...props }: MenuSubmenuProps) {\n return <BaseMenu.SubmenuRoot {...props} />\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\n\nimport { cn } from '@/utils/cn'\n\nimport { Icon } from '../icon'\nimport { menuSubmenuTriggerVariants } from './menu.types'\nimport type { MenuSubmenuTriggerProps } from './menu.types'\n\nexport function MenuSubmenuTrigger({\n tone,\n className,\n children,\n ref,\n ...props\n}: MenuSubmenuTriggerProps) {\n return (\n <BaseMenu.SubmenuTrigger\n className={cn(menuSubmenuTriggerVariants({ tone }), className)}\n ref={ref}\n {...props}\n >\n <div className=\"col-start-1 flex min-w-3xl items-center gap-2xs pr-2xl [&>svg]:size-sm\">\n {children}\n </div>\n <Icon name=\"chevronRight\" className=\"col-start-2 size-xs place-self-end self-center\" />\n </BaseMenu.SubmenuTrigger>\n )\n}\n","import { Menu as BaseMenu } from '@base-ui/react/menu'\nimport { isValidElement } from 'react'\nimport type { ReactElement } from 'react'\n\nimport { cn } from '@/utils/cn'\n\nimport type { MenuTriggerProps } from './menu.types'\n\nexport function MenuTrigger({ className, children, ref, ...props }: MenuTriggerProps) {\n let render: ReactElement | undefined = undefined\n if (isValidElement(children)) {\n render = children\n }\n\n return (\n <BaseMenu.Trigger\n className={cn('data-popup-open:pointer-events-none', className)}\n ref={ref}\n render={render}\n {...props}\n />\n )\n}\n","import { Menu as MenuRoot } from './menu'\nimport { MenuCheckboxItem } from './menu-checkbox-item'\nimport { MenuGroup } from './menu-group'\nimport { MenuGroupLabel } from './menu-group-label'\nimport { MenuItem } from './menu-item'\nimport { MenuPopup } from './menu-popup'\nimport { MenuRadioGroup } from './menu-radio-group'\nimport { MenuRadioItem } from './menu-radio-item'\nimport { MenuSeparator } from './menu-separator'\nimport { MenuShortcut } from './menu-shortcut'\nimport { MenuSubmenu } from './menu-submenu'\nimport { MenuSubmenuTrigger } from './menu-submenu-trigger'\nimport { MenuTrigger } from './menu-trigger'\n\nconst Menu = Object.assign(MenuRoot, {\n CheckboxItem: MenuCheckboxItem,\n Group: MenuGroup,\n GroupLabel: MenuGroupLabel,\n Item: MenuItem,\n Popup: MenuPopup,\n RadioGroup: MenuRadioGroup,\n RadioItem: MenuRadioItem,\n Separator: MenuSeparator,\n Shortcut: MenuShortcut,\n Submenu: MenuSubmenu,\n SubmenuTrigger: MenuSubmenuTrigger,\n Trigger: MenuTrigger,\n})\n\nexport type {\n MenuCheckboxItemProps,\n MenuGroupLabelProps,\n MenuGroupProps,\n MenuItemProps,\n MenuPopupProps,\n MenuProps,\n MenuRadioGroupProps,\n MenuRadioItemProps,\n MenuSeparatorProps,\n MenuShortcutProps,\n MenuSubmenuProps,\n MenuSubmenuTriggerProps,\n MenuTriggerProps,\n} from './menu.types'\nexport { MenuCheckboxItem } from './menu-checkbox-item'\nexport { MenuGroup } from './menu-group'\nexport { MenuGroupLabel } from './menu-group-label'\nexport { MenuItem } from './menu-item'\nexport { MenuPopup } from './menu-popup'\nexport { MenuRadioGroup } from './menu-radio-group'\nexport { MenuRadioItem } from './menu-radio-item'\nexport { MenuSeparator } from './menu-separator'\nexport { MenuShortcut } from './menu-shortcut'\nexport { MenuSubmenu } from './menu-submenu'\nexport { MenuSubmenuTrigger } from './menu-submenu-trigger'\nexport { MenuTrigger } from './menu-trigger'\n\nexport { Menu }\n"],"mappings":";;;;;;;;;AAIA,SAAgBA,OAAK,EAAE,GAAG,SAAoB;CAC5C,OAAO,oBAACC,KAAS,MAAV,EAAe,GAAI,MAAQ,CAAA;AACpC;;ACEA,SAAgB,iBAAiB,EAAE,WAAW,UAAU,KAAK,GAAG,SAAgC;CAC9F,OACE,qBAACC,KAAS,cAAV;EACE,WAAW,GACT,gaACA,SACF;EACK;EACL,GAAI;EANN,UAAA,CAQE,oBAAC,QAAD;GAAM,WAAU;GAAyC,UAAA,iBAAiB,QAAQ;EAAQ,CAAA,GAC1F,oBAACA,KAAS,uBAAV;GAAgC,WAAU;GACxC,UAAA,oBAAC,MAAD;IAAM,MAAK;IAAW,WAAU;GAAW,CAAA;EACb,CAAA,CACX;;AAE3B;;AClBA,SAAgB,UAAU,EAAE,WAAW,KAAK,GAAG,SAAyB;CACtE,OAAO,oBAACC,KAAS,OAAV;EAAgB,WAAW,GAAG,IAAI,SAAS;EAAQ;EAAK,GAAI;CAAQ,CAAA;AAC7E;;ACFA,SAAgB,eAAe,EAAE,WAAW,KAAK,GAAG,SAA8B;CAChF,OACE,oBAACC,KAAS,YAAV;EACE,WAAW,GACT,0FACA,SACF;EACK;EACL,GAAI;CACL,CAAA;AAEL;;ACCA,MAAM,mBAAmB,IACrB,iVACA;CACE,iBAAiB,EACf,MAAM,UACR;CACA,UAAU,EACR,MAAM,oBACR;AACF,CACF;AACA,MAAA,6BAA6B,IAC3B,gVACA;CACE,iBAAiB,EACf,MAAM,UACR;CACA,UAAU,EACR,MAAM,uBACR;AACF,CACF;;AC/BF,SAAgB,SAAS,EAAE,MAAM,WAAW,UAAU,KAAK,GAAG,SAAwB;CACpF,OACE,oBAACC,KAAS,MAAV;EACE,WAAW,GAAG,iBAAiB,EAAE,KAAK,CAAC,GAAG,SAAS;EACnD,cAAA;EACK;EACL,SAAS,gBACP,oBAAC,UAAD;GACE,MAAK;GACL,GAAI;GACJ,WAAW,GAAG,kCAAkC,YAAY,SAAS;GAEpE,UAAA,iBAAiB,QAAQ;EACpB,CAAA;EAEV,GAAI;CACL,CAAA;AAEL;;ACpBA,SAAgB,UAAU,EAAE,WAAW,UAAU,KAAK,GAAG,SAAyB;CAChF,OACE,oBAACC,KAAS,QAAV,EAAA,UACE,oBAACA,KAAS,YAAV;EACE,WAAW,GAAG,qBAAqB,SAAS;EACvC;EACL,YAAY;EACZ,GAAI;EAEJ,UAAA,oBAACA,KAAS,OAAV;GAAgB,WAAU;GACvB;EACa,CAAA;CACG,CAAA,EACN,CAAA;AAErB;;ACfA,SAAgB,eAAe,EAAE,WAAW,KAAK,GAAG,SAA8B;CAChF,OAAO,oBAACC,KAAS,YAAV;EAAqB,WAAW,GAAG,IAAI,SAAS;EAAQ;EAAK,GAAI;CAAQ,CAAA;AAClF;;ACDA,SAAgB,cAAc,EAAE,WAAW,UAAU,KAAK,GAAG,SAA6B;CACxF,OACE,qBAACC,KAAS,WAAV;EACE,WAAW,GACT,gaACA,SACF;EACK;EACL,GAAI;EANN,UAAA,CAQE,oBAAC,QAAD;GAAM,WAAU;GAAuC;EAAe,CAAA,GACtE,oBAACA,KAAS,oBAAV;GAA6B,WAAU;GACrC,UAAA,oBAAC,MAAD;IAAM,MAAK;IAAW,WAAU;GAAW,CAAA;EAChB,CAAA,CACX;;AAExB;;ACjBA,SAAgB,cAAc,EAAE,WAAW,KAAK,GAAG,SAA6B;CAC9E,OACE,oBAACC,KAAS,WAAV;EACE,WAAW,GAAG,uCAAuC,SAAS;EACzD;EACL,GAAI;CACL,CAAA;AAEL;;ACVA,SAAgB,aAAa,EAAE,WAAW,KAAK,GAAG,SAA4B;CAC5E,OACE,oBAAC,OAAD;EACE,WAAW,GAAG,4CAA4C,SAAS;EAC9D;EACL,GAAI;CACL,CAAA;AAEL;;ACRA,SAAgB,YAAY,EAAE,GAAG,SAA2B;CAC1D,OAAO,oBAACC,KAAS,aAAV,EAAsB,GAAI,MAAQ,CAAA;AAC3C;;ACEA,SAAgB,mBAAmB,EACjC,MACA,WACA,UACA,KACA,GAAG,SACuB;CAC1B,OACE,qBAACC,KAAS,gBAAV;EACE,WAAW,GAAG,2BAA2B,EAAE,KAAK,CAAC,GAAG,SAAS;EACxD;EACL,GAAI;EAHN,UAAA,CAKE,oBAAC,OAAD;GAAK,WAAU;GACZ;EACE,CAAA,GACL,oBAAC,MAAD;GAAM,MAAK;GAAe,WAAU;EAAkD,CAAA,CAC/D;;AAE7B;;ACnBA,SAAgB,YAAY,EAAE,WAAW,UAAU,KAAK,GAAG,SAA2B;CACpF,IAAI,SAAmC,KAAA;CACvC,IAAI,eAAe,QAAQ,GACzB,SAAS;CAGX,OACE,oBAACC,KAAS,SAAV;EACE,WAAW,GAAG,uCAAuC,SAAS;EACzD;EACG;EACR,GAAI;CACL,CAAA;AAEL;;ACRA,MAAMC,SAAO,OAAO,OAAOC,QAAU;CACnC,cAAc;CACd,OAAO;CACP,YAAY;CACZ,MAAM;CACN,OAAO;CACP,YAAY;CACZ,WAAW;CACX,WAAW;CACX,UAAU;CACV,SAAS;CACT,gBAAgB;CAChB,SAAS;AACX,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/components/menu/menu-tone.ts
|
|
2
|
+
const menuItemToneClasses = {
|
|
3
|
+
accent: "text-accent-default data-highlighted:text-accent-on-container data-highlighted:before:bg-accent-container-high",
|
|
4
|
+
brand: "text-brand-default data-highlighted:text-brand-on-container data-highlighted:before:bg-brand-container-high",
|
|
5
|
+
error: "text-error-default data-highlighted:text-error-on-container data-highlighted:before:bg-error-container-high",
|
|
6
|
+
info: "text-info-default data-highlighted:text-info-on-container data-highlighted:before:bg-info-container-high",
|
|
7
|
+
neutral: "text-on-surface data-highlighted:text-neutral-on-container data-highlighted:before:bg-neutral-container-high",
|
|
8
|
+
success: "text-success-default data-highlighted:text-success-on-container data-highlighted:before:bg-success-container-high",
|
|
9
|
+
warning: "text-warning-default data-highlighted:text-warning-on-container data-highlighted:before:bg-warning-container-high"
|
|
10
|
+
};
|
|
11
|
+
const menuSubmenuToneClasses = {
|
|
12
|
+
accent: "text-accent-default data-highlighted:text-accent-on-container data-highlighted:before:bg-accent-container-high data-popup-open:text-accent-on-container data-popup-open:before:bg-accent-container-high data-highlighted:data-popup-open:before:bg-accent-container-high",
|
|
13
|
+
brand: "text-brand-default data-highlighted:text-brand-on-container data-highlighted:before:bg-brand-container-high data-popup-open:text-brand-on-container data-popup-open:before:bg-brand-container-high data-highlighted:data-popup-open:before:bg-brand-container-high",
|
|
14
|
+
error: "text-error-default data-highlighted:text-error-on-container data-highlighted:before:bg-error-container-high data-popup-open:text-error-on-container data-popup-open:before:bg-error-container-high data-highlighted:data-popup-open:before:bg-error-container-high",
|
|
15
|
+
info: "text-info-default data-highlighted:text-info-on-container data-highlighted:before:bg-info-container-high data-popup-open:text-info-on-container data-popup-open:before:bg-info-container-high data-highlighted:data-popup-open:before:bg-info-container-high",
|
|
16
|
+
neutral: "text-on-surface data-highlighted:text-neutral-on-container data-highlighted:before:bg-neutral-container-high data-popup-open:text-neutral-on-container data-popup-open:before:bg-neutral-container-high data-highlighted:data-popup-open:before:bg-neutral-container-high",
|
|
17
|
+
success: "text-success-default data-highlighted:text-success-on-container data-highlighted:before:bg-success-container-high data-popup-open:text-success-on-container data-popup-open:before:bg-success-container-high data-highlighted:data-popup-open:before:bg-success-container-high",
|
|
18
|
+
warning: "text-warning-default data-highlighted:text-warning-on-container data-highlighted:before:bg-warning-container-high data-popup-open:text-warning-on-container data-popup-open:before:bg-warning-container-high data-highlighted:data-popup-open:before:bg-warning-container-high"
|
|
19
|
+
};
|
|
20
|
+
export { menuSubmenuToneClasses as n, menuItemToneClasses as t };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=menu-tone-DWBEHoX2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu-tone-DWBEHoX2.js","names":[],"sources":["../src/components/menu/menu-tone.ts"],"sourcesContent":["const menuItemToneClasses = {\n accent:\n 'text-accent-default data-highlighted:text-accent-on-container data-highlighted:before:bg-accent-container-high',\n brand:\n 'text-brand-default data-highlighted:text-brand-on-container data-highlighted:before:bg-brand-container-high',\n error:\n 'text-error-default data-highlighted:text-error-on-container data-highlighted:before:bg-error-container-high',\n info: 'text-info-default data-highlighted:text-info-on-container data-highlighted:before:bg-info-container-high',\n neutral:\n 'text-on-surface data-highlighted:text-neutral-on-container data-highlighted:before:bg-neutral-container-high',\n success:\n 'text-success-default data-highlighted:text-success-on-container data-highlighted:before:bg-success-container-high',\n warning:\n 'text-warning-default data-highlighted:text-warning-on-container data-highlighted:before:bg-warning-container-high',\n },\n menuSubmenuToneClasses = {\n accent:\n 'text-accent-default data-highlighted:text-accent-on-container data-highlighted:before:bg-accent-container-high data-popup-open:text-accent-on-container data-popup-open:before:bg-accent-container-high data-highlighted:data-popup-open:before:bg-accent-container-high',\n brand:\n 'text-brand-default data-highlighted:text-brand-on-container data-highlighted:before:bg-brand-container-high data-popup-open:text-brand-on-container data-popup-open:before:bg-brand-container-high data-highlighted:data-popup-open:before:bg-brand-container-high',\n error:\n 'text-error-default data-highlighted:text-error-on-container data-highlighted:before:bg-error-container-high data-popup-open:text-error-on-container data-popup-open:before:bg-error-container-high data-highlighted:data-popup-open:before:bg-error-container-high',\n info: 'text-info-default data-highlighted:text-info-on-container data-highlighted:before:bg-info-container-high data-popup-open:text-info-on-container data-popup-open:before:bg-info-container-high data-highlighted:data-popup-open:before:bg-info-container-high',\n neutral:\n 'text-on-surface data-highlighted:text-neutral-on-container data-highlighted:before:bg-neutral-container-high data-popup-open:text-neutral-on-container data-popup-open:before:bg-neutral-container-high data-highlighted:data-popup-open:before:bg-neutral-container-high',\n success:\n 'text-success-default data-highlighted:text-success-on-container data-highlighted:before:bg-success-container-high data-popup-open:text-success-on-container data-popup-open:before:bg-success-container-high data-highlighted:data-popup-open:before:bg-success-container-high',\n warning:\n 'text-warning-default data-highlighted:text-warning-on-container data-highlighted:before:bg-warning-container-high data-popup-open:text-warning-on-container data-popup-open:before:bg-warning-container-high data-highlighted:data-popup-open:before:bg-warning-container-high',\n }\n\nexport { menuItemToneClasses, menuSubmenuToneClasses }\n"],"mappings":";AAAA,MAAM,sBAAsB;CACxB,QACE;CACF,OACE;CACF,OACE;CACF,MAAM;CACN,SACE;CACF,SACE;CACF,SACE;AACJ;AACA,MAAA,yBAAyB;CACvB,QACE;CACF,OACE;CACF,OACE;CACF,MAAM;CACN,SACE;CACF,SACE;CACF,SACE;AACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as MeterLabel, c as MeterFooter, d as MeterIndicatorProps, f as MeterLabelProps, g as MeterValueProps, h as MeterTrackProps, i as MeterSubtitle, l as MeterFooterProps, m as MeterSubtitleProps, n as MeterValue, o as MeterIndicator, p as MeterProps, r as MeterTrack, s as MeterHeader, t as Meter, u as MeterHeaderProps } from "../index-DLfdAked.js";
|
|
2
|
+
export { Meter, MeterFooter, type MeterFooterProps, MeterHeader, type MeterHeaderProps, MeterIndicator, type MeterIndicatorProps, MeterLabel, type MeterLabelProps, type MeterProps, MeterSubtitle, type MeterSubtitleProps, MeterTrack, type MeterTrackProps, MeterValue, type MeterValueProps };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as Meter, c as MeterFooter, s as MeterHeader, o as MeterIndicator, a as MeterLabel, i as MeterSubtitle, r as MeterTrack, n as MeterValue } from "../meter-HD5taq57.js";
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { t as cn } from "./cn-BDi0DfT5.js";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { Meter } from "@base-ui/react";
|
|
5
|
+
// src/components/meter/meter.types.ts
|
|
6
|
+
const meterVariants = cva("", {
|
|
7
|
+
defaultVariants: {
|
|
8
|
+
orientation: "vertical",
|
|
9
|
+
size: "medium",
|
|
10
|
+
tone: "brand"
|
|
11
|
+
},
|
|
12
|
+
variants: {
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: "flex items-center justify-between gap-xs [&_[data-track]]:w-full [&_button]:shrink-0",
|
|
15
|
+
vertical: "flex flex-col space-y-3xs"
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
large: "[&_[data-track]]:h-xs",
|
|
19
|
+
medium: "[&_[data-track]]:h-2xs",
|
|
20
|
+
small: "[&_[data-track]]:h-3xs"
|
|
21
|
+
},
|
|
22
|
+
tone: {
|
|
23
|
+
accent: "[&_[data-indicator]]:bg-accent-default",
|
|
24
|
+
brand: "[&_[data-indicator]]:bg-brand-default",
|
|
25
|
+
error: "[&_[data-indicator]]:bg-error-default",
|
|
26
|
+
info: "[&_[data-indicator]]:bg-info-default",
|
|
27
|
+
neutral: "[&_[data-indicator]]:bg-neutral-default",
|
|
28
|
+
success: "[&_[data-indicator]]:bg-success-default",
|
|
29
|
+
warning: "[&_[data-indicator]]:bg-warning-default"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
// src/components/meter/meter.tsx
|
|
34
|
+
function Meter$2({ orientation, size, tone, className, ref, ...props }) {
|
|
35
|
+
return /* @__PURE__ */ jsx(Meter.Root, {
|
|
36
|
+
className: cn(meterVariants({
|
|
37
|
+
className,
|
|
38
|
+
orientation,
|
|
39
|
+
size,
|
|
40
|
+
tone
|
|
41
|
+
})),
|
|
42
|
+
ref,
|
|
43
|
+
...props
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
// src/components/meter/meter-footer.tsx
|
|
47
|
+
function MeterFooter({ className, ref, ...props }) {
|
|
48
|
+
return /* @__PURE__ */ jsx("div", {
|
|
49
|
+
className: cn("flex items-center justify-between", className),
|
|
50
|
+
ref,
|
|
51
|
+
...props
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
// src/components/meter/meter-header.tsx
|
|
55
|
+
function MeterHeader({ className, ref, ...props }) {
|
|
56
|
+
return /* @__PURE__ */ jsx("div", {
|
|
57
|
+
className: cn("flex items-center justify-between", className),
|
|
58
|
+
ref,
|
|
59
|
+
...props
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
// src/components/meter/meter-indicator.tsx
|
|
63
|
+
function MeterIndicator({ className, ref, ...props }) {
|
|
64
|
+
return /* @__PURE__ */ jsx(Meter.Indicator, {
|
|
65
|
+
"data-indicator": true,
|
|
66
|
+
className: cn("rounded-full", className),
|
|
67
|
+
ref,
|
|
68
|
+
...props
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// src/components/meter/meter-label.tsx
|
|
72
|
+
function MeterLabel({ className, ref, ...props }) {
|
|
73
|
+
return /* @__PURE__ */ jsx(Meter.Label, {
|
|
74
|
+
className: cn("flex items-center gap-2xs style-text-strong--1 text-on-surface [&>svg]:size-xs", className),
|
|
75
|
+
ref,
|
|
76
|
+
...props
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// src/components/meter/meter-subtitle.tsx
|
|
80
|
+
function MeterSubtitle({ className, ref, ...props }) {
|
|
81
|
+
return /* @__PURE__ */ jsx("span", {
|
|
82
|
+
className: cn("text-left style-text-prose--2 whitespace-nowrap text-on-surface-variant", className),
|
|
83
|
+
ref,
|
|
84
|
+
...props
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// src/components/meter/meter-track.tsx
|
|
88
|
+
function MeterTrack({ className, ref, ...props }) {
|
|
89
|
+
return /* @__PURE__ */ jsx(Meter.Track, {
|
|
90
|
+
className: cn("w-full self-center rounded-full bg-neutral-container", className),
|
|
91
|
+
"data-track": true,
|
|
92
|
+
ref,
|
|
93
|
+
...props
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// src/components/meter/meter-value.tsx
|
|
97
|
+
function MeterValue({ className, ref, ...props }) {
|
|
98
|
+
return /* @__PURE__ */ jsx(Meter.Value, {
|
|
99
|
+
className: cn("ml-auto text-right style-text-prose--2 text-on-surface-variant", className),
|
|
100
|
+
ref,
|
|
101
|
+
...props
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
// src/components/meter/index.ts
|
|
105
|
+
const Meter$1 = Object.assign(Meter$2, {
|
|
106
|
+
Footer: MeterFooter,
|
|
107
|
+
Header: MeterHeader,
|
|
108
|
+
Indicator: MeterIndicator,
|
|
109
|
+
Label: MeterLabel,
|
|
110
|
+
Subtitle: MeterSubtitle,
|
|
111
|
+
Track: MeterTrack,
|
|
112
|
+
Value: MeterValue
|
|
113
|
+
});
|
|
114
|
+
export { MeterLabel as a, MeterFooter as c, MeterSubtitle as i, MeterValue as n, MeterIndicator as o, MeterTrack as r, MeterHeader as s, Meter$1 as t };
|
|
115
|
+
|
|
116
|
+
//# sourceMappingURL=meter-HD5taq57.js.map
|