@px-ui/core 2.1.0 → 3.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 +1 -1
- package/dist/index.d.ts +194 -170
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +431 -114
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { n as __reExport, t as __export } from "./chunk-CYeTv9WL.js";
|
|
2
2
|
import * as React$1 from "react";
|
|
3
|
-
import React, { useCallback, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
|
|
4
|
-
import { Dialog } from "@base-ui
|
|
3
|
+
import React, { createContext, useCallback, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { Collapsible, Dialog, Toast } from "@base-ui/react";
|
|
5
5
|
import classnames from "classnames";
|
|
6
6
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
7
7
|
import { cva } from "class-variance-authority";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
import { Popover } from "@base-ui
|
|
10
|
-
import { Combobox } from "@base-ui
|
|
9
|
+
import { Popover } from "@base-ui/react/popover";
|
|
10
|
+
import { Combobox } from "@base-ui/react/combobox";
|
|
11
11
|
import { useInfiniteQuery } from "@tanstack/react-query";
|
|
12
|
-
import { Select } from "@base-ui
|
|
13
|
-
import { Menu } from "@base-ui
|
|
14
|
-
import { Progress } from "@base-ui
|
|
15
|
-
import { Radio } from "@base-ui
|
|
16
|
-
import { RadioGroup } from "@base-ui
|
|
17
|
-
import { Tabs } from "@base-ui
|
|
18
|
-
import { Tooltip } from "@base-ui
|
|
19
|
-
import { CheckboxGroup } from "@base-ui
|
|
20
|
-
import { Checkbox as Checkbox$1 } from "@base-ui
|
|
21
|
-
import { useRender } from "@base-ui
|
|
22
|
-
import { mergeProps } from "@base-ui
|
|
12
|
+
import { Select } from "@base-ui/react/select";
|
|
13
|
+
import { Menu } from "@base-ui/react/menu";
|
|
14
|
+
import { Progress } from "@base-ui/react/progress";
|
|
15
|
+
import { Radio } from "@base-ui/react/radio";
|
|
16
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
17
|
+
import { Tabs } from "@base-ui/react/tabs";
|
|
18
|
+
import { Tooltip } from "@base-ui/react/tooltip";
|
|
19
|
+
import { CheckboxGroup } from "@base-ui/react/checkbox-group";
|
|
20
|
+
import { Checkbox as Checkbox$1 } from "@base-ui/react/checkbox";
|
|
21
|
+
import { useRender } from "@base-ui/react/use-render";
|
|
22
|
+
import { mergeProps } from "@base-ui/react/merge-props";
|
|
23
23
|
import { DayPicker, getDefaultClassNames } from "react-day-picker";
|
|
24
|
-
import { Avatar as Avatar$1 } from "@base-ui
|
|
25
|
-
import { Switch as Switch$1 } from "@base-ui
|
|
24
|
+
import { Avatar as Avatar$1 } from "@base-ui/react/avatar";
|
|
25
|
+
import { Switch as Switch$1 } from "@base-ui/react/switch";
|
|
26
26
|
import { format } from "date-fns";
|
|
27
27
|
|
|
28
28
|
export * from "class-variance-authority"
|
|
@@ -82,7 +82,7 @@ const buttonVariants = cva("inline-flex items-center justify-center gap-2 whites
|
|
|
82
82
|
default: "px-4 py-2 h-10 has-[>svg]:px-3 text-ppx-base",
|
|
83
83
|
sm: "gap-1.5 px-3 has-[>svg]:px-2.5 h-8 text-ppx-sm",
|
|
84
84
|
lg: "px-6 h-12 text-ppx-base font-sans-sb has-[>svg]:px-4",
|
|
85
|
-
"icon-sm": "
|
|
85
|
+
"icon-sm": "size-8",
|
|
86
86
|
icon: "size-10 px-2"
|
|
87
87
|
}
|
|
88
88
|
},
|
|
@@ -133,11 +133,11 @@ var dialog_exports = /* @__PURE__ */ __export({
|
|
|
133
133
|
HeaderIcon: () => HeaderIcon,
|
|
134
134
|
Overlay: () => Overlay,
|
|
135
135
|
Portal: () => Portal$1,
|
|
136
|
-
Root: () => Root$
|
|
136
|
+
Root: () => Root$11,
|
|
137
137
|
Title: () => Title$3,
|
|
138
|
-
Trigger: () => Trigger$
|
|
138
|
+
Trigger: () => Trigger$8
|
|
139
139
|
});
|
|
140
|
-
function Root$
|
|
140
|
+
function Root$11({ ...props }) {
|
|
141
141
|
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
142
142
|
"data-slot": "dialog",
|
|
143
143
|
...props
|
|
@@ -149,7 +149,7 @@ function Portal$1({ ...props }) {
|
|
|
149
149
|
...props
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function Trigger$
|
|
152
|
+
function Trigger$8({ ...props }) {
|
|
153
153
|
return /* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
154
154
|
"data-slot": "dialog-trigger",
|
|
155
155
|
...props
|
|
@@ -242,11 +242,11 @@ var popover_exports = /* @__PURE__ */ __export({
|
|
|
242
242
|
Description: () => Description$2,
|
|
243
243
|
Footer: () => Footer,
|
|
244
244
|
Header: () => Header$2,
|
|
245
|
-
Root: () => Root$
|
|
245
|
+
Root: () => Root$10,
|
|
246
246
|
Title: () => Title$2,
|
|
247
|
-
Trigger: () => Trigger$
|
|
247
|
+
Trigger: () => Trigger$7
|
|
248
248
|
});
|
|
249
|
-
function Root$
|
|
249
|
+
function Root$10(props) {
|
|
250
250
|
return /* @__PURE__ */ jsx(Popover.Root, {
|
|
251
251
|
"data-slot": "popover",
|
|
252
252
|
...props
|
|
@@ -258,7 +258,7 @@ function Portal(props) {
|
|
|
258
258
|
...props
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
|
-
function Trigger$
|
|
261
|
+
function Trigger$7(props) {
|
|
262
262
|
return /* @__PURE__ */ jsx(Popover.Trigger, {
|
|
263
263
|
"data-slot": "popover-trigger",
|
|
264
264
|
...props
|
|
@@ -531,7 +531,7 @@ var input_group_exports = /* @__PURE__ */ __export({
|
|
|
531
531
|
Addon: () => Addon,
|
|
532
532
|
Button: () => Button$1,
|
|
533
533
|
Input: () => Input$1,
|
|
534
|
-
Root: () => Root$
|
|
534
|
+
Root: () => Root$9,
|
|
535
535
|
Text: () => Text
|
|
536
536
|
});
|
|
537
537
|
const inputGroupVariants = cva("group/input-group relative flex items-center border border-ppx-neutral-5 bg-ppx-neutral-1 outline-transparent has-[[data-slot=input-group-control]:focus-visible]:outline-2 has-[[data-slot=input-group-control]:focus-visible]:-outline-offset-1 has-[[data-slot=input-group-control]:focus-visible]:bg-ppx-background has-[[data-slot=input-group-control]:focus-visible]:outline-ppx-primary-focus has-[[data-slot][aria-invalid=true]]:outline-ppx-red-4 has-[[data-slot][aria-invalid=true]]:outline has-[[data-slot][aria-invalid=true]]:-outline-offset-1 has-[[data-slot][aria-invalid=true]]:bg-ppx-red-1 has-[[data-slot=input-group-control]:disabled]:*:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:border-ppx-neutral-3 has-[[data-slot=input-group-control]:disabled]:bg-ppx-neutral-3 has-[[data-slot=input-group-control]:disabled]:text-ppx-neutral-11 has-[>[data-align=inline-start]]:[&>input]:pl-input has-[>[data-align=inline-end]]:[&>input]:pr-input", {
|
|
@@ -551,7 +551,7 @@ const inputGroupVariants = cva("group/input-group relative flex items-center bor
|
|
|
551
551
|
widthVariant: "full"
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
|
-
function Root$
|
|
554
|
+
function Root$9({ className, size, disabled, widthVariant, ...props }) {
|
|
555
555
|
return /* @__PURE__ */ jsx("div", {
|
|
556
556
|
"data-slot": "input-group",
|
|
557
557
|
role: "group",
|
|
@@ -692,18 +692,18 @@ var combobox_exports = /* @__PURE__ */ __export({
|
|
|
692
692
|
List: () => List$2,
|
|
693
693
|
LoadingIndicator: () => LoadingIndicator,
|
|
694
694
|
MultiItem: () => MultiItem$1,
|
|
695
|
-
Root: () => Root$
|
|
695
|
+
Root: () => Root$8,
|
|
696
696
|
Search: () => Search,
|
|
697
697
|
SearchableTrigger: () => SearchableTrigger,
|
|
698
698
|
SearchableTriggerDropdownAddon: () => SearchableTriggerDropdownAddon,
|
|
699
|
-
Trigger: () => Trigger$
|
|
699
|
+
Trigger: () => Trigger$6,
|
|
700
700
|
Value: () => Value$2,
|
|
701
701
|
useComboboxContext: () => useComboboxContext
|
|
702
702
|
});
|
|
703
703
|
const SINGLE_TEXT_CONTENT_CN = "px-4 py-2 text-ppx-sm min-h-11 flex items-center justify-center text-ppx-muted-foreground";
|
|
704
704
|
const List$2 = Combobox.List;
|
|
705
705
|
const ComboboxContext = React$1.createContext({});
|
|
706
|
-
function Root$
|
|
706
|
+
function Root$8({ children, ...props }) {
|
|
707
707
|
const chipsTriggerRef = React$1.useRef(null);
|
|
708
708
|
const searchableTriggerRef = React$1.useRef(null);
|
|
709
709
|
const [isOpen, setIsOpen] = React$1.useState(false);
|
|
@@ -821,7 +821,7 @@ function LoadingIndicator(props) {
|
|
|
821
821
|
}
|
|
822
822
|
function SearchableTrigger(props) {
|
|
823
823
|
const { invalid, disabled, searchableTriggerRef } = useComboboxContext();
|
|
824
|
-
return /* @__PURE__ */ jsxs(Root$
|
|
824
|
+
return /* @__PURE__ */ jsxs(Root$9, {
|
|
825
825
|
...props,
|
|
826
826
|
disabled,
|
|
827
827
|
ref: searchableTriggerRef,
|
|
@@ -860,7 +860,7 @@ function SearchableTriggerDropdownAddon() {
|
|
|
860
860
|
]
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
|
-
function Trigger$
|
|
863
|
+
function Trigger$6({ size, widthVariant, children, className, ...props }) {
|
|
864
864
|
const { isLoading, invalid } = useComboboxContext();
|
|
865
865
|
return /* @__PURE__ */ jsxs(Combobox.Trigger, {
|
|
866
866
|
"aria-label": "Open popup",
|
|
@@ -970,15 +970,15 @@ var select_exports = /* @__PURE__ */ __export({
|
|
|
970
970
|
List: () => List$1,
|
|
971
971
|
MultiItem: () => MultiItem,
|
|
972
972
|
MultiSelectedValue: () => MultiSelectedValue,
|
|
973
|
-
Root: () => Root$
|
|
974
|
-
Trigger: () => Trigger$
|
|
973
|
+
Root: () => Root$7,
|
|
974
|
+
Trigger: () => Trigger$5,
|
|
975
975
|
Value: () => Value$1
|
|
976
976
|
});
|
|
977
977
|
const SelectContext = React$1.createContext({});
|
|
978
978
|
function useSelectContext() {
|
|
979
979
|
return React$1.useContext(SelectContext);
|
|
980
980
|
}
|
|
981
|
-
function Root$
|
|
981
|
+
function Root$7({ children, invalid, ...props }) {
|
|
982
982
|
const value = React$1.useMemo(() => ({ invalid }), [invalid]);
|
|
983
983
|
return /* @__PURE__ */ jsx(SelectContext.Provider, {
|
|
984
984
|
value,
|
|
@@ -1028,7 +1028,7 @@ function ItemIndicator(props) {
|
|
|
1028
1028
|
children: /* @__PURE__ */ jsx(Select.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, {}) })
|
|
1029
1029
|
});
|
|
1030
1030
|
}
|
|
1031
|
-
function Trigger$
|
|
1031
|
+
function Trigger$5({ size, widthVariant, ...props }) {
|
|
1032
1032
|
const { invalid } = useSelectContext();
|
|
1033
1033
|
return /* @__PURE__ */ jsxs(Select.Trigger, {
|
|
1034
1034
|
"aria-label": "Open popup",
|
|
@@ -1086,12 +1086,12 @@ var menu_exports = /* @__PURE__ */ __export({
|
|
|
1086
1086
|
Item: () => Item$5,
|
|
1087
1087
|
RadioGroup: () => RadioGroup$1,
|
|
1088
1088
|
RadioItem: () => RadioItem,
|
|
1089
|
-
Root: () => Root$
|
|
1089
|
+
Root: () => Root$6,
|
|
1090
1090
|
Separator: () => Separator$1,
|
|
1091
|
-
Trigger: () => Trigger$
|
|
1091
|
+
Trigger: () => Trigger$4
|
|
1092
1092
|
});
|
|
1093
|
-
const Root$
|
|
1094
|
-
function Trigger$
|
|
1093
|
+
const Root$6 = Menu.Root;
|
|
1094
|
+
function Trigger$4({ className, children, size, widthVariant = "fit", ...props }) {
|
|
1095
1095
|
return /* @__PURE__ */ jsxs(Menu.Trigger, {
|
|
1096
1096
|
className: cn(triggerVariants({
|
|
1097
1097
|
size,
|
|
@@ -1157,7 +1157,7 @@ var progress_exports = /* @__PURE__ */ __export({
|
|
|
1157
1157
|
BaseProgress: () => BaseProgress,
|
|
1158
1158
|
Indicator: () => Indicator$1,
|
|
1159
1159
|
Label: () => Label$1,
|
|
1160
|
-
Root: () => Root$
|
|
1160
|
+
Root: () => Root$5,
|
|
1161
1161
|
Track: () => Track,
|
|
1162
1162
|
Value: () => Value
|
|
1163
1163
|
});
|
|
@@ -1169,7 +1169,7 @@ const progressTrackVariants = cva("relative h-2 w-full overflow-hidden rounded-f
|
|
|
1169
1169
|
} },
|
|
1170
1170
|
defaultVariants: { size: "default" }
|
|
1171
1171
|
});
|
|
1172
|
-
const Root$
|
|
1172
|
+
const Root$5 = Progress.Root;
|
|
1173
1173
|
function Track({ className, size, children, ...props }) {
|
|
1174
1174
|
return /* @__PURE__ */ jsx(Progress.Track, {
|
|
1175
1175
|
className: cn(progressTrackVariants({ size }), className),
|
|
@@ -1201,9 +1201,9 @@ const BaseProgress = Progress;
|
|
|
1201
1201
|
//#region src/components/segmented-control.tsx
|
|
1202
1202
|
var segmented_control_exports = /* @__PURE__ */ __export({
|
|
1203
1203
|
Item: () => Item$4,
|
|
1204
|
-
Root: () => Root$
|
|
1204
|
+
Root: () => Root$4
|
|
1205
1205
|
});
|
|
1206
|
-
const segmentedControlItemVariants = cva("relative flex items-center justify-center px-4 py-2 text-sm font-medium transition-all duration-200 ease-in-out cursor-pointer rounded-full whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ppx-primary-5 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", {
|
|
1206
|
+
const segmentedControlItemVariants = cva("relative flex items-center justify-center px-4 py-2 text-sm font-medium transition-all duration-200 ease-in-out cursor-pointer rounded-full whitespace-nowrap outline-none focus-visible:ring-2 focus-visible:ring-ppx-primary-5 focus-visible:ring-offset-2 data-disabled:cursor-not-allowed data-disabled:opacity-50", {
|
|
1207
1207
|
variants: {
|
|
1208
1208
|
variant: { default: "text-ppx-neutral-11 data-checked:bg-ppx-primary-5 data-checked:text-white data-checked:shadow-sm hover:text-ppx-neutral-12" },
|
|
1209
1209
|
size: {
|
|
@@ -1217,10 +1217,10 @@ const segmentedControlItemVariants = cva("relative flex items-center justify-cen
|
|
|
1217
1217
|
size: "default"
|
|
1218
1218
|
}
|
|
1219
1219
|
});
|
|
1220
|
-
function Root$
|
|
1220
|
+
function Root$4({ className, ...props }) {
|
|
1221
1221
|
return /* @__PURE__ */ jsx(RadioGroup, {
|
|
1222
1222
|
"data-slot": "segmented-control",
|
|
1223
|
-
className: cn("
|
|
1223
|
+
className: cn("bg-ppx-neutral-3 inline-flex items-center rounded-full p-1", className),
|
|
1224
1224
|
...props
|
|
1225
1225
|
});
|
|
1226
1226
|
}
|
|
@@ -1242,8 +1242,8 @@ function Item$4({ children, className, variant, size, ...props }) {
|
|
|
1242
1242
|
var tabs_exports = /* @__PURE__ */ __export({
|
|
1243
1243
|
Content: () => Content$1,
|
|
1244
1244
|
List: () => List,
|
|
1245
|
-
Root: () => Root$
|
|
1246
|
-
Trigger: () => Trigger$
|
|
1245
|
+
Root: () => Root$3,
|
|
1246
|
+
Trigger: () => Trigger$3
|
|
1247
1247
|
});
|
|
1248
1248
|
const TabsContext = React$1.createContext(null);
|
|
1249
1249
|
const useTabs = () => {
|
|
@@ -1251,7 +1251,7 @@ const useTabs = () => {
|
|
|
1251
1251
|
if (!context) throw new Error("useTabs must be used within a Tabs");
|
|
1252
1252
|
return context;
|
|
1253
1253
|
};
|
|
1254
|
-
function Root$
|
|
1254
|
+
function Root$3({ variant = "underline", className, ...props }) {
|
|
1255
1255
|
return /* @__PURE__ */ jsx(TabsContext.Provider, {
|
|
1256
1256
|
value: { variant },
|
|
1257
1257
|
children: /* @__PURE__ */ jsx(Tabs.Root, {
|
|
@@ -1273,7 +1273,7 @@ function List({ className, children, ...props }) {
|
|
|
1273
1273
|
]
|
|
1274
1274
|
});
|
|
1275
1275
|
}
|
|
1276
|
-
function Trigger$
|
|
1276
|
+
function Trigger$3({ className, ...props }) {
|
|
1277
1277
|
return /* @__PURE__ */ jsx(Tabs.Tab, {
|
|
1278
1278
|
"data-slot": "tabs-trigger",
|
|
1279
1279
|
className: cn("focus-visible:ring-ring/50 [&_svg:not([class*='size-'])] gap-1.5 px-2 py-1 text-sm font-medium z-[1] flex-1 items-center justify-center text-nowrap whitespace-nowrap text-ppx-neutral-18 not-data-selected:hover:text-ppx-neutral-12 focus-visible:ring-[3px] data-selected:text-ppx-primary-b-5 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0", className),
|
|
@@ -1302,8 +1302,8 @@ var tooltip_exports = /* @__PURE__ */ __export({
|
|
|
1302
1302
|
BaseProvider: () => BaseProvider,
|
|
1303
1303
|
BaseRoot: () => BaseRoot,
|
|
1304
1304
|
Content: () => Content,
|
|
1305
|
-
Root: () => Root$
|
|
1306
|
-
Trigger: () => Trigger$
|
|
1305
|
+
Root: () => Root$2,
|
|
1306
|
+
Trigger: () => Trigger$2
|
|
1307
1307
|
});
|
|
1308
1308
|
function TooltipProvider(props) {
|
|
1309
1309
|
return /* @__PURE__ */ jsx(Tooltip.Provider, {
|
|
@@ -1329,7 +1329,7 @@ function TooltipArrow({ ...props }) {
|
|
|
1329
1329
|
...props
|
|
1330
1330
|
});
|
|
1331
1331
|
}
|
|
1332
|
-
function Root$
|
|
1332
|
+
function Root$2({ ...props }) {
|
|
1333
1333
|
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(Tooltip.Root, {
|
|
1334
1334
|
"data-slot": "tooltip",
|
|
1335
1335
|
...props
|
|
@@ -1337,7 +1337,7 @@ function Root$1({ ...props }) {
|
|
|
1337
1337
|
}
|
|
1338
1338
|
const BaseRoot = Tooltip.Root;
|
|
1339
1339
|
const BaseProvider = Tooltip.Provider;
|
|
1340
|
-
function Trigger$
|
|
1340
|
+
function Trigger$2({ ...props }) {
|
|
1341
1341
|
return /* @__PURE__ */ jsx(Tooltip.Trigger, {
|
|
1342
1342
|
"data-slot": "tooltip-trigger",
|
|
1343
1343
|
...props
|
|
@@ -1374,7 +1374,7 @@ function Content({ className, align = "center", sideOffset = 8, side = "top", ch
|
|
|
1374
1374
|
|
|
1375
1375
|
//#endregion
|
|
1376
1376
|
//#region src/components/checkbox.tsx
|
|
1377
|
-
const checkboxVariants = cva("peer aria-invalid:border-ppx-red-5 aria-invalid:text-shadow-ppx-red-5 flex items-center justify-center rounded-sm border transition-colors duration-150 outline-none focus-visible:ring-2 disabled:cursor-not-allowed disabled:opacity-50", {
|
|
1377
|
+
const checkboxVariants = cva("peer aria-invalid:border-ppx-red-5 aria-invalid:text-shadow-ppx-red-5 flex items-center justify-center rounded-sm border transition-colors duration-150 outline-none focus-visible:ring-2 data-disabled:cursor-not-allowed data-disabled:opacity-50", {
|
|
1378
1378
|
variants: {
|
|
1379
1379
|
variant: { default: "bg-white data-checked:bg-ppx-primary-5 data-[indeterminate]:bg-ppx-primary-5 data-checked:text-white data-[indeterminate]:text-white border-ppx-neutral-10 data-checked:border-ppx-primary-5 data-[indeterminate]:border-ppx-primary-5" },
|
|
1380
1380
|
size: {
|
|
@@ -1439,13 +1439,13 @@ var block_checkbox_group_exports = /* @__PURE__ */ __export({
|
|
|
1439
1439
|
});
|
|
1440
1440
|
function Group$2({ className, ...props }) {
|
|
1441
1441
|
return /* @__PURE__ */ jsx(CheckboxGroup, {
|
|
1442
|
-
className: cn("gap-4
|
|
1442
|
+
className: cn("flex gap-4", className),
|
|
1443
1443
|
...props
|
|
1444
1444
|
});
|
|
1445
1445
|
}
|
|
1446
1446
|
function Item$3({ className, invalid, children, ...rest }) {
|
|
1447
1447
|
return /* @__PURE__ */ jsxs("label", {
|
|
1448
|
-
className: cn("
|
|
1448
|
+
className: cn("rounded-ppx-s border-ppx-neutral-3 has-not-data-disabled:hover:border-ppx-neutral-6 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-60 has-data-disabled:hover:border-ppx-neutral-3 has-aria-invalid:shadow-ppx-red-2 has-data-checked:border-ppx-primary-5! flex min-h-[155px] justify-between gap-2 border-2 p-5 shadow-[0px_0px_12px_#0000001F] transition-colors duration-300", className),
|
|
1449
1449
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1450
1450
|
className: "flex-1",
|
|
1451
1451
|
children
|
|
@@ -1459,7 +1459,7 @@ function Item$3({ className, invalid, children, ...rest }) {
|
|
|
1459
1459
|
}
|
|
1460
1460
|
function Header$1(props) {
|
|
1461
1461
|
return /* @__PURE__ */ jsx("div", {
|
|
1462
|
-
className: cn("mb-5
|
|
1462
|
+
className: cn("mb-5 flex items-center gap-2", props.className),
|
|
1463
1463
|
children: props.children
|
|
1464
1464
|
});
|
|
1465
1465
|
}
|
|
@@ -1471,7 +1471,7 @@ function Title$1(props) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
function Description$1(props) {
|
|
1473
1473
|
return /* @__PURE__ */ jsx("p", {
|
|
1474
|
-
className: cn("
|
|
1474
|
+
className: cn("text-ppx-sm text-ppx-muted-foreground mb-5", props.className),
|
|
1475
1475
|
children: props.children
|
|
1476
1476
|
});
|
|
1477
1477
|
}
|
|
@@ -1489,7 +1489,7 @@ function Group$1({ className, ...props }) {
|
|
|
1489
1489
|
...props
|
|
1490
1490
|
});
|
|
1491
1491
|
}
|
|
1492
|
-
const radioVariants = cva("bg-
|
|
1492
|
+
const radioVariants = cva("relative inline-flex bg-ppx-background aria-invalid:border-ppx-red-5 aspect-square shrink-0 rounded-full border border-ppx-neutral-10 shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] data-disabled:cursor-not-allowed data-disabled:opacity-50 items-center justify-center", {
|
|
1493
1493
|
variants: {
|
|
1494
1494
|
variant: { default: "data-checked:border-ppx-primary-5 text-ppx-primary-5" },
|
|
1495
1495
|
size: {
|
|
@@ -1525,7 +1525,7 @@ function Item$1({ className, variant, size, ...props }) {
|
|
|
1525
1525
|
strokeWidth: "2",
|
|
1526
1526
|
strokeLinecap: "round",
|
|
1527
1527
|
strokeLinejoin: "round",
|
|
1528
|
-
className: cn("absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", size === "sm" && "size-2", size === void 0
|
|
1528
|
+
className: cn("absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2", size === "sm" && "size-2", size === void 0 || size === "default" ? "size-3" : "", size === "lg" && "size-3.5"),
|
|
1529
1529
|
children: /* @__PURE__ */ jsx("circle", {
|
|
1530
1530
|
cx: "12",
|
|
1531
1531
|
cy: "12",
|
|
@@ -1554,7 +1554,7 @@ function Group({ className, ...props }) {
|
|
|
1554
1554
|
}
|
|
1555
1555
|
function Item$2({ className, invalid, children, ...rest }) {
|
|
1556
1556
|
return /* @__PURE__ */ jsxs("label", {
|
|
1557
|
-
className: cn("rounded-ppx-s border-ppx-neutral-3 has-not-disabled:hover:border-ppx-neutral-6 has-disabled:cursor-not-allowed has-disabled:opacity-60 has-disabled:hover:border-ppx-neutral-3 has-aria-invalid:shadow-ppx-red-2 has-data-checked:border-ppx-primary-5! flex min-h-[155px] justify-between gap-2 border-2 p-5 shadow-[0px_0px_12px_#0000001F] transition-colors duration-300", className),
|
|
1557
|
+
className: cn("rounded-ppx-s border-ppx-neutral-3 has-not-data-disabled:hover:border-ppx-neutral-6 has-data-disabled:cursor-not-allowed has-data-disabled:opacity-60 has-data-disabled:hover:border-ppx-neutral-3 has-aria-invalid:shadow-ppx-red-2 has-data-checked:border-ppx-primary-5! flex min-h-[155px] justify-between gap-2 border-2 p-5 shadow-[0px_0px_12px_#0000001F] transition-colors duration-300", className),
|
|
1558
1558
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1559
1559
|
className: "flex-1",
|
|
1560
1560
|
children
|
|
@@ -1644,6 +1644,39 @@ function BreadcrumbSeparator({ children, className, ...props }) {
|
|
|
1644
1644
|
});
|
|
1645
1645
|
}
|
|
1646
1646
|
|
|
1647
|
+
//#endregion
|
|
1648
|
+
//#region src/components/collapsible.tsx
|
|
1649
|
+
var collapsible_exports = /* @__PURE__ */ __export({
|
|
1650
|
+
Panel: () => Panel,
|
|
1651
|
+
Root: () => Root$1,
|
|
1652
|
+
ToggleIcon: () => ToggleIcon,
|
|
1653
|
+
Trigger: () => Trigger$1
|
|
1654
|
+
});
|
|
1655
|
+
function Root$1({ className, ...props }) {
|
|
1656
|
+
return /* @__PURE__ */ jsx(Collapsible.Root, {
|
|
1657
|
+
"data-slot": "collapsible",
|
|
1658
|
+
className: cn("flex flex-col", className),
|
|
1659
|
+
...props
|
|
1660
|
+
});
|
|
1661
|
+
}
|
|
1662
|
+
function Trigger$1(props) {
|
|
1663
|
+
return /* @__PURE__ */ jsx(Collapsible.Trigger, {
|
|
1664
|
+
"data-slot": "collapsible-trigger",
|
|
1665
|
+
...props,
|
|
1666
|
+
className: cn("group flex items-center gap-2", props.className)
|
|
1667
|
+
});
|
|
1668
|
+
}
|
|
1669
|
+
function Panel({ className, ...props }) {
|
|
1670
|
+
return /* @__PURE__ */ jsx(Collapsible.Panel, {
|
|
1671
|
+
"data-slot": "collapsible-content",
|
|
1672
|
+
className: cn("flex h-[var(--collapsible-panel-height)] w-full flex-col overflow-hidden transition-all duration-150 ease-out data-[ending-style]:h-0 data-[starting-style]:h-0 [&[hidden]:not([hidden='until-found'])]:hidden", className),
|
|
1673
|
+
...props
|
|
1674
|
+
});
|
|
1675
|
+
}
|
|
1676
|
+
function ToggleIcon() {
|
|
1677
|
+
return /* @__PURE__ */ jsx(ChevronDownIcon, { className: "rotate-270 group-data-[panel-open]:rotate-360 transition-all ease-out" });
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1647
1680
|
//#endregion
|
|
1648
1681
|
//#region src/components/calendar.tsx
|
|
1649
1682
|
function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", formatters, components, ...props }) {
|
|
@@ -1743,12 +1776,291 @@ function CalendarDayButton({ className, day, modifiers, ...props }) {
|
|
|
1743
1776
|
});
|
|
1744
1777
|
}
|
|
1745
1778
|
|
|
1779
|
+
//#endregion
|
|
1780
|
+
//#region src/icons/circle-alert-icon.tsx
|
|
1781
|
+
function CircleAlertIcon(props) {
|
|
1782
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
1783
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1784
|
+
width: "24",
|
|
1785
|
+
height: "24",
|
|
1786
|
+
viewBox: "0 0 24 24",
|
|
1787
|
+
fill: "none",
|
|
1788
|
+
stroke: "currentColor",
|
|
1789
|
+
strokeWidth: "2",
|
|
1790
|
+
strokeLinecap: "round",
|
|
1791
|
+
strokeLinejoin: "round",
|
|
1792
|
+
...props,
|
|
1793
|
+
className: cn("size-4 shrink-0", props.className),
|
|
1794
|
+
children: [
|
|
1795
|
+
/* @__PURE__ */ jsx("circle", {
|
|
1796
|
+
cx: "12",
|
|
1797
|
+
cy: "12",
|
|
1798
|
+
r: "10"
|
|
1799
|
+
}),
|
|
1800
|
+
/* @__PURE__ */ jsx("line", {
|
|
1801
|
+
x1: "12",
|
|
1802
|
+
x2: "12",
|
|
1803
|
+
y1: "8",
|
|
1804
|
+
y2: "12"
|
|
1805
|
+
}),
|
|
1806
|
+
/* @__PURE__ */ jsx("line", {
|
|
1807
|
+
x1: "12",
|
|
1808
|
+
x2: "12.01",
|
|
1809
|
+
y1: "16",
|
|
1810
|
+
y2: "16"
|
|
1811
|
+
})
|
|
1812
|
+
]
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
//#endregion
|
|
1817
|
+
//#region src/icons/circle-check-icon.tsx
|
|
1818
|
+
function CircleCheckIcon(props) {
|
|
1819
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
1820
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1821
|
+
width: "24",
|
|
1822
|
+
height: "24",
|
|
1823
|
+
viewBox: "0 0 24 24",
|
|
1824
|
+
fill: "none",
|
|
1825
|
+
stroke: "currentColor",
|
|
1826
|
+
strokeWidth: "2",
|
|
1827
|
+
strokeLinecap: "round",
|
|
1828
|
+
strokeLinejoin: "round",
|
|
1829
|
+
...props,
|
|
1830
|
+
className: cn("size-4 shrink-0", props.className),
|
|
1831
|
+
children: [/* @__PURE__ */ jsx("circle", {
|
|
1832
|
+
cx: "12",
|
|
1833
|
+
cy: "12",
|
|
1834
|
+
r: "10"
|
|
1835
|
+
}), /* @__PURE__ */ jsx("path", { d: "m9 12 2 2 4-4" })]
|
|
1836
|
+
});
|
|
1837
|
+
}
|
|
1838
|
+
|
|
1839
|
+
//#endregion
|
|
1840
|
+
//#region src/icons/info-icon.tsx
|
|
1841
|
+
function InfoIcon(props) {
|
|
1842
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
1843
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1844
|
+
width: "24",
|
|
1845
|
+
height: "24",
|
|
1846
|
+
viewBox: "0 0 24 24",
|
|
1847
|
+
fill: "none",
|
|
1848
|
+
stroke: "currentColor",
|
|
1849
|
+
"stroke-width": "2",
|
|
1850
|
+
strokeLinecap: "round",
|
|
1851
|
+
strokeLinejoin: "round",
|
|
1852
|
+
...props,
|
|
1853
|
+
className: cn("size-4 shrink-0", props.className),
|
|
1854
|
+
children: [
|
|
1855
|
+
/* @__PURE__ */ jsx("circle", {
|
|
1856
|
+
cx: "12",
|
|
1857
|
+
cy: "12",
|
|
1858
|
+
r: "10"
|
|
1859
|
+
}),
|
|
1860
|
+
/* @__PURE__ */ jsx("path", { d: "M12 16v-4" }),
|
|
1861
|
+
/* @__PURE__ */ jsx("path", { d: "M12 8h.01" })
|
|
1862
|
+
]
|
|
1863
|
+
});
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
//#endregion
|
|
1867
|
+
//#region src/icons/triangle-alert-icon.tsx
|
|
1868
|
+
function TriangleAlertIcon(props) {
|
|
1869
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
1870
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1871
|
+
width: "24",
|
|
1872
|
+
height: "24",
|
|
1873
|
+
viewBox: "0 0 24 24",
|
|
1874
|
+
fill: "none",
|
|
1875
|
+
stroke: "currentColor",
|
|
1876
|
+
strokeWidth: "2",
|
|
1877
|
+
strokeLinecap: "round",
|
|
1878
|
+
strokeLinejoin: "round",
|
|
1879
|
+
...props,
|
|
1880
|
+
className: cn("size-4 shrink-0", props.className),
|
|
1881
|
+
children: [
|
|
1882
|
+
/* @__PURE__ */ jsx("path", { 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" }),
|
|
1883
|
+
/* @__PURE__ */ jsx("path", { d: "M12 9v4" }),
|
|
1884
|
+
/* @__PURE__ */ jsx("path", { d: "M12 17h.01" })
|
|
1885
|
+
]
|
|
1886
|
+
});
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
//#endregion
|
|
1890
|
+
//#region src/icons/spinner-icon.tsx
|
|
1891
|
+
function SpinnerIcon(props) {
|
|
1892
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
1893
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1894
|
+
viewBox: "0 0 24 24",
|
|
1895
|
+
fill: "none",
|
|
1896
|
+
stroke: "currentColor",
|
|
1897
|
+
strokeWidth: 2,
|
|
1898
|
+
strokeLinecap: "round",
|
|
1899
|
+
strokeLinejoin: "round",
|
|
1900
|
+
...props,
|
|
1901
|
+
className: cn("shrink-0", props.className),
|
|
1902
|
+
children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
1903
|
+
});
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
//#endregion
|
|
1907
|
+
//#region src/components/toast.tsx
|
|
1908
|
+
const toast = Toast.createToastManager();
|
|
1909
|
+
const anchoredToast = Toast.createToastManager();
|
|
1910
|
+
const TOAST_ICONS = {
|
|
1911
|
+
error: CircleAlertIcon,
|
|
1912
|
+
info: InfoIcon,
|
|
1913
|
+
loading: SpinnerIcon,
|
|
1914
|
+
success: CircleCheckIcon,
|
|
1915
|
+
warning: TriangleAlertIcon
|
|
1916
|
+
};
|
|
1917
|
+
function ToastProvider({ children, position = "top-center", ...props }) {
|
|
1918
|
+
return /* @__PURE__ */ jsxs(Toast.Provider, {
|
|
1919
|
+
toastManager: toast,
|
|
1920
|
+
...props,
|
|
1921
|
+
children: [children, /* @__PURE__ */ jsx(Toasts, { position })]
|
|
1922
|
+
});
|
|
1923
|
+
}
|
|
1924
|
+
function Toasts(props) {
|
|
1925
|
+
const { position = "top-center" } = props;
|
|
1926
|
+
const { toasts } = Toast.useToastManager();
|
|
1927
|
+
const isTop = position.startsWith("top");
|
|
1928
|
+
const hasLoadingToast = toasts.some((t) => t.type === "loading");
|
|
1929
|
+
return /* @__PURE__ */ jsxs(Toast.Portal, {
|
|
1930
|
+
"data-slot": "toast-portal",
|
|
1931
|
+
children: [hasLoadingToast && /* @__PURE__ */ jsx("div", {
|
|
1932
|
+
className: "bg-ppx-foreground/20 fixed inset-0 z-40 transition-opacity",
|
|
1933
|
+
"data-slot": "toast-backdrop"
|
|
1934
|
+
}), /* @__PURE__ */ jsx(Toast.Viewport, {
|
|
1935
|
+
className: cn("max-w-90 fixed z-50 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]", "data-[position*=top]:top-(--toast-inset)", "data-[position*=bottom]:bottom-(--toast-inset)", "data-[position*=left]:left-(--toast-inset)", "data-[position*=right]:right-(--toast-inset)", "data-[position*=center]:left-1/2 data-[position*=center]:-translate-x-1/2"),
|
|
1936
|
+
"data-position": position,
|
|
1937
|
+
"data-slot": "toast-viewport",
|
|
1938
|
+
children: toasts.map((toast$1) => {
|
|
1939
|
+
const Icon = toast$1.type ? TOAST_ICONS[toast$1.type] : null;
|
|
1940
|
+
return /* @__PURE__ */ jsx(Toast.Root, {
|
|
1941
|
+
className: cn("h-(--toast-calc-height) bg-ppx-background text-ppx-foreground rounded-ppx-m absolute z-[calc(9999-var(--toast-index))] w-full select-none border bg-clip-padding shadow-lg [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-ppx-m)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)]", "data-[position*=right]:left-auto data-[position*=right]:right-0", "data-[position*=left]:left-0 data-[position*=left]:right-auto", "data-[position*=center]:left-0 data-[position*=center]:right-0", "data-[position*=top]:bottom-auto data-[position*=top]:top-0 data-[position*=top]:origin-top", "data-[position*=bottom]:bottom-0 data-[position*=bottom]:top-auto data-[position*=bottom]:origin-bottom", "after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full", "data-[position*=top]:after:top-full", "data-[position*=bottom]:after:bottom-full", "[--toast-calc-height:var(--toast-frontmost-height,var(--toast-height))] [--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]", "data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]", "data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]", "data-[position*=top]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]", "data-[position*=bottom]:transform-[translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]", "data-limited:opacity-0", "data-expanded:h-(--toast-height)", "data-position:data-expanded:transform-[translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]", "data-[position*=top]:data-starting-style:transform-[translateY(calc(-100%-var(--toast-inset)))]", "data-[position*=bottom]:data-starting-style:transform-[translateY(calc(100%+var(--toast-inset)))]", "data-ending-style:opacity-0", "data-[position*=top]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(-100%-var(--toast-inset)))]", "data-[position*=bottom]:data-ending-style:not-data-limited:not-data-swipe-direction:transform-[translateY(calc(100%+var(--toast-inset)))]", "data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]", "data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]", "data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]", "data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]", "data-expanded:data-ending-style:data-[swipe-direction=left]:transform-[translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]", "data-expanded:data-ending-style:data-[swipe-direction=right]:transform-[translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]", "data-expanded:data-ending-style:data-[swipe-direction=up]:transform-[translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]", "data-expanded:data-ending-style:data-[swipe-direction=down]:transform-[translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]", toast$1.type === "success" && "bg-ppx-green-1", toast$1.type === "info" && "bg-ppx-primary-b-1", toast$1.type === "warning" && "bg-ppx-yellow-1", toast$1.type === "error" && "bg-ppx-red-1"),
|
|
1942
|
+
"data-position": position,
|
|
1943
|
+
swipeDirection: position.includes("center") ? [isTop ? "up" : "down"] : position.includes("left") ? ["left", isTop ? "up" : "down"] : ["right", isTop ? "up" : "down"],
|
|
1944
|
+
toast: toast$1,
|
|
1945
|
+
children: /* @__PURE__ */ jsxs(Toast.Content, {
|
|
1946
|
+
className: "duration-250 data-behind:pointer-events-none data-behind:opacity-0 data-expanded:opacity-100 text-ppx-sm pointer-events-auto flex flex-col gap-2.5 overflow-hidden px-3.5 py-4 transition-opacity",
|
|
1947
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1948
|
+
className: "flex gap-2",
|
|
1949
|
+
children: [Icon && /* @__PURE__ */ jsx("div", {
|
|
1950
|
+
className: "[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
1951
|
+
"data-slot": "toast-icon",
|
|
1952
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "in-data-[type=loading]:animate-spin in-data-[type=error]:text-ppx-red-5 in-data-[type=info]:text-ppx-primary-b-5 in-data-[type=success]:text-ppx-green-5 in-data-[type=warning]:text-ppx-yellow-5 in-data-[type=loading]:opacity-80" })
|
|
1953
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1954
|
+
className: "flex flex-col gap-1.5",
|
|
1955
|
+
children: [
|
|
1956
|
+
/* @__PURE__ */ jsx(Toast.Title, {
|
|
1957
|
+
className: "text-ppx-base font-medium leading-none",
|
|
1958
|
+
"data-slot": "toast-title"
|
|
1959
|
+
}),
|
|
1960
|
+
/* @__PURE__ */ jsx(Toast.Description, {
|
|
1961
|
+
className: "text-ppx-muted-foreground",
|
|
1962
|
+
"data-slot": "toast-description"
|
|
1963
|
+
}),
|
|
1964
|
+
toast$1.type === "loading" ? null : /* @__PURE__ */ jsx(Toast.Close, {
|
|
1965
|
+
className: buttonVariants({
|
|
1966
|
+
size: "icon-sm",
|
|
1967
|
+
variant: "ghost",
|
|
1968
|
+
className: "absolute right-2 top-2 shrink-0"
|
|
1969
|
+
}),
|
|
1970
|
+
"aria-label": "Close",
|
|
1971
|
+
children: /* @__PURE__ */ jsx(CloseIcon, { className: "size-4" })
|
|
1972
|
+
})
|
|
1973
|
+
]
|
|
1974
|
+
})]
|
|
1975
|
+
}), toast$1.actionProps && /* @__PURE__ */ jsx(Toast.Action, {
|
|
1976
|
+
className: buttonVariants({ size: "sm" }),
|
|
1977
|
+
"data-slot": "toast-action",
|
|
1978
|
+
children: toast$1.actionProps.children
|
|
1979
|
+
})]
|
|
1980
|
+
})
|
|
1981
|
+
}, toast$1.id);
|
|
1982
|
+
})
|
|
1983
|
+
})]
|
|
1984
|
+
});
|
|
1985
|
+
}
|
|
1986
|
+
function AnchoredToastProvider({ children, ...props }) {
|
|
1987
|
+
return /* @__PURE__ */ jsxs(Toast.Provider, {
|
|
1988
|
+
toastManager: anchoredToast,
|
|
1989
|
+
...props,
|
|
1990
|
+
children: [children, /* @__PURE__ */ jsx(AnchoredToasts, {})]
|
|
1991
|
+
});
|
|
1992
|
+
}
|
|
1993
|
+
function AnchoredToasts() {
|
|
1994
|
+
const { toasts } = Toast.useToastManager();
|
|
1995
|
+
return /* @__PURE__ */ jsx(Toast.Portal, {
|
|
1996
|
+
"data-slot": "toast-portal-anchored",
|
|
1997
|
+
children: /* @__PURE__ */ jsx(Toast.Viewport, {
|
|
1998
|
+
className: "outline-none",
|
|
1999
|
+
"data-slot": "toast-viewport-anchored",
|
|
2000
|
+
children: toasts.map((toast$1) => {
|
|
2001
|
+
const Icon = toast$1.type ? TOAST_ICONS[toast$1.type] : null;
|
|
2002
|
+
const tooltipStyle = toast$1.data?.tooltipStyle ?? false;
|
|
2003
|
+
const positionerProps = toast$1.positionerProps;
|
|
2004
|
+
if (!positionerProps?.anchor) return null;
|
|
2005
|
+
return /* @__PURE__ */ jsx(Toast.Positioner, {
|
|
2006
|
+
className: "z-50 max-w-[min(--spacing(64),var(--available-width))]",
|
|
2007
|
+
"data-slot": "toast-positioner",
|
|
2008
|
+
sideOffset: positionerProps.sideOffset ?? 4,
|
|
2009
|
+
toast: toast$1,
|
|
2010
|
+
children: /* @__PURE__ */ jsx(Toast.Root, {
|
|
2011
|
+
className: cn("bg-ppx-background text-ppx-foreground data-ending-style:scale-98 data-starting-style:scale-98 data-ending-style:opacity-0 data-starting-style:opacity-0 text-ppx-sm relative text-balance border bg-clip-padding transition-[scale,opacity] before:pointer-events-none before:absolute before:inset-0 before:shadow-[0_1px_--theme(--color-black/4%)]", tooltipStyle ? "rounded-ppx-m shadow-md shadow-black/5 before:rounded-[calc(var(--radius-ppx-s)-1px)]" : "rounded-ppx-l shadow-lg before:rounded-[calc(var(--radius-ppx-m)-1px)]", toast$1.type === "success" && "bg-ppx-green-1", toast$1.type === "info" && "bg-ppx-primary-b-1", toast$1.type === "warning" && "bg-ppx-yellow-1", toast$1.type === "error" && "bg-ppx-red-1"),
|
|
2012
|
+
"data-slot": "toast-popup",
|
|
2013
|
+
toast: toast$1,
|
|
2014
|
+
children: tooltipStyle ? /* @__PURE__ */ jsx(Toast.Content, {
|
|
2015
|
+
className: "pointer-events-auto px-2 py-1",
|
|
2016
|
+
children: /* @__PURE__ */ jsx(Toast.Title, { "data-slot": "toast-title" })
|
|
2017
|
+
}) : /* @__PURE__ */ jsxs(Toast.Content, {
|
|
2018
|
+
className: "text-ppx-sm pointer-events-auto relative flex items-center justify-between gap-1.5 overflow-hidden px-3.5 py-3",
|
|
2019
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
2020
|
+
className: "flex gap-2",
|
|
2021
|
+
children: [Icon && /* @__PURE__ */ jsx("div", {
|
|
2022
|
+
className: "[&>svg]:h-lh [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
2023
|
+
"data-slot": "toast-icon",
|
|
2024
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "in-data-[type=loading]:animate-spin in-data-[type=error]:text-ppx-red-5 in-data-[type=info]:text-ppx-primary-b-5 in-data-[type=success]:text-ppx-green-5 in-data-[type=warning]:text-ppx-yellow-5 in-data-[type=loading]:opacity-80" })
|
|
2025
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
2026
|
+
className: "flex flex-col gap-0.5",
|
|
2027
|
+
children: [/* @__PURE__ */ jsx(Toast.Title, {
|
|
2028
|
+
className: "text-ppx-base font-medium leading-none",
|
|
2029
|
+
"data-slot": "toast-title"
|
|
2030
|
+
}), /* @__PURE__ */ jsx(Toast.Description, {
|
|
2031
|
+
className: "text-ppx-muted-foreground",
|
|
2032
|
+
"data-slot": "toast-description"
|
|
2033
|
+
})]
|
|
2034
|
+
})]
|
|
2035
|
+
}), toast$1.actionProps && /* @__PURE__ */ jsx(Toast.Action, {
|
|
2036
|
+
className: buttonVariants({ size: "sm" }),
|
|
2037
|
+
"data-slot": "toast-action",
|
|
2038
|
+
children: toast$1.actionProps.children
|
|
2039
|
+
})]
|
|
2040
|
+
})
|
|
2041
|
+
})
|
|
2042
|
+
}, toast$1.id);
|
|
2043
|
+
})
|
|
2044
|
+
})
|
|
2045
|
+
});
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
//#endregion
|
|
2049
|
+
//#region src/providers/px-ui-provider.tsx
|
|
2050
|
+
const PXUIContext = createContext(null);
|
|
2051
|
+
function PXUIProvider(props) {
|
|
2052
|
+
return /* @__PURE__ */ jsx(PXUIContext.Provider, {
|
|
2053
|
+
value: null,
|
|
2054
|
+
children: /* @__PURE__ */ jsx(ToastProvider, { children: /* @__PURE__ */ jsx(AnchoredToastProvider, { children: props.children }) })
|
|
2055
|
+
});
|
|
2056
|
+
}
|
|
2057
|
+
|
|
1746
2058
|
//#endregion
|
|
1747
2059
|
//#region src/components/label.tsx
|
|
1748
2060
|
function Label({ className, ...props }) {
|
|
1749
2061
|
return /* @__PURE__ */ jsx("label", {
|
|
1750
2062
|
"data-slot": "label",
|
|
1751
|
-
className: cn("
|
|
2063
|
+
className: cn("text-ppx-sm peer-data-disabled:cursor-not-allowed peer-data-disabled:opacity-50 group-data-disabled:pointer-events-none group-data-disabled:opacity-50 flex select-none items-center gap-2 font-medium leading-none", className),
|
|
1752
2064
|
...props
|
|
1753
2065
|
});
|
|
1754
2066
|
}
|
|
@@ -1869,9 +2181,9 @@ const replaceSizeInUrl = (url, size) => {
|
|
|
1869
2181
|
return url.replace("/SIZE/", `/${newSize}/`);
|
|
1870
2182
|
};
|
|
1871
2183
|
function Avatar(props) {
|
|
1872
|
-
return /* @__PURE__ */ jsxs(Root$
|
|
2184
|
+
return /* @__PURE__ */ jsxs(Root$2, {
|
|
1873
2185
|
disabled: props.hideTooltip,
|
|
1874
|
-
children: [/* @__PURE__ */ jsx(Trigger$
|
|
2186
|
+
children: [/* @__PURE__ */ jsx(Trigger$2, { render: (tooltipProps) => /* @__PURE__ */ jsx(AvatarImpl, {
|
|
1875
2187
|
...props,
|
|
1876
2188
|
avatarRootProps: tooltipProps
|
|
1877
2189
|
}) }), /* @__PURE__ */ jsx(Content, { children: props.name })]
|
|
@@ -1916,7 +2228,7 @@ function AvatarGroup({ max = 4, avatars, className }) {
|
|
|
1916
2228
|
return /* @__PURE__ */ jsx(BaseProvider, { children: /* @__PURE__ */ jsxs("div", {
|
|
1917
2229
|
className: cn("flex items-center", className),
|
|
1918
2230
|
"data-slot": "avatar-group",
|
|
1919
|
-
children: [avatars.map((avatar, index) => /* @__PURE__ */ jsx(React.Fragment, { children: /* @__PURE__ */ jsxs(BaseRoot, { children: [/* @__PURE__ */ jsx(Trigger$
|
|
2231
|
+
children: [avatars.map((avatar, index) => /* @__PURE__ */ jsx(React.Fragment, { children: /* @__PURE__ */ jsxs(BaseRoot, { children: [/* @__PURE__ */ jsx(Trigger$2, { render: (tooltipProps) => /* @__PURE__ */ jsx("div", {
|
|
1920
2232
|
className: "relative",
|
|
1921
2233
|
style: {
|
|
1922
2234
|
marginLeft: index > 0 ? `-${parseInt(avatar.size ?? "100px") * .25}px` : "0",
|
|
@@ -1933,9 +2245,9 @@ function AvatarGroup({ max = 4, avatars, className }) {
|
|
|
1933
2245
|
marginLeft: `-${parseInt(avatars[0].size ?? "100px") * .25}px`,
|
|
1934
2246
|
zIndex: 0
|
|
1935
2247
|
},
|
|
1936
|
-
children: /* @__PURE__ */ jsxs(Root$
|
|
2248
|
+
children: /* @__PURE__ */ jsxs(Root$10, { children: [/* @__PURE__ */ jsx(Trigger$7, {
|
|
1937
2249
|
openOnHover: true,
|
|
1938
|
-
children:
|
|
2250
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
1939
2251
|
className: cn("bg-ppx-neutral-3 text-ppx-neutral-18 hover:bg-ppx-neutral-4 flex cursor-pointer items-center justify-center font-medium transition-colors", avatars[0].variant === "rounded" ? "rounded-full" : "rounded-ppx-s"),
|
|
1940
2252
|
style: {
|
|
1941
2253
|
width: avatars[0].size ?? "100px",
|
|
@@ -1943,28 +2255,28 @@ function AvatarGroup({ max = 4, avatars, className }) {
|
|
|
1943
2255
|
fontSize: `${parseInt(avatars[0].size ?? "100px") * .3}px`
|
|
1944
2256
|
},
|
|
1945
2257
|
children: ["+", overflowAvatars.length]
|
|
1946
|
-
})
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
}
|
|
1965
|
-
})
|
|
1966
|
-
})
|
|
1967
|
-
})
|
|
2258
|
+
})
|
|
2259
|
+
}), /* @__PURE__ */ jsx(Content$5, {
|
|
2260
|
+
className: "w-80",
|
|
2261
|
+
positionerProps: {
|
|
2262
|
+
align: "start",
|
|
2263
|
+
side: "top"
|
|
2264
|
+
},
|
|
2265
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
2266
|
+
className: "max-h-64 space-y-2 overflow-y-auto",
|
|
2267
|
+
children: overflowAvatars.map((avatar) => /* @__PURE__ */ jsxs("div", {
|
|
2268
|
+
className: "flex items-center gap-3 rounded-md p-2",
|
|
2269
|
+
children: [/* @__PURE__ */ jsx(Avatar, {
|
|
2270
|
+
...avatar,
|
|
2271
|
+
size: "24px",
|
|
2272
|
+
hideTooltip: true
|
|
2273
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
2274
|
+
className: "text-ppx-neutral-18 text-sm font-medium",
|
|
2275
|
+
children: avatar.name
|
|
2276
|
+
})]
|
|
2277
|
+
}, avatar.name))
|
|
2278
|
+
})
|
|
2279
|
+
})] })
|
|
1968
2280
|
})]
|
|
1969
2281
|
}) });
|
|
1970
2282
|
}
|
|
@@ -1974,11 +2286,11 @@ function AvatarGroup({ max = 4, avatars, className }) {
|
|
|
1974
2286
|
function Switch({ className, size, ...props }) {
|
|
1975
2287
|
return /* @__PURE__ */ jsx(Switch$1.Root, {
|
|
1976
2288
|
"data-slot": "switch",
|
|
1977
|
-
className: cn("
|
|
2289
|
+
className: cn("shadow-xs focus-visible:ring-3 focus-visible:ring-ppx-neutral-17/30 data-checked:bg-ppx-primary-5 data-unchecked:bg-ppx-neutral-4 data-disabled:cursor-not-allowed data-disabled:opacity-50 peer inline-flex shrink-0 items-center rounded-full border border-transparent outline-none transition-all", size === "sm" && "h-4 w-8", size === void 0 || size === "default" ? "h-5 w-10" : "", size === "lg" && "h-6 w-12", className),
|
|
1978
2290
|
...props,
|
|
1979
2291
|
children: /* @__PURE__ */ jsx(Switch$1.Thumb, {
|
|
1980
2292
|
"data-slot": "switch-thumb",
|
|
1981
|
-
className: cn("
|
|
2293
|
+
className: cn("bg-ppx-neutral-1 pointer-events-none block rounded-full ring-0 transition-transform duration-300 ease-in-out", size === "sm" && "data-checked:translate-x-[calc(100%+2px)] size-3.5", size === void 0 || size === "default" ? "data-checked:translate-x-[calc(100%+5px)] data-unchecked:translate-x-px size-4" : "", size === "lg" && "data-checked:translate-x-[calc(100%+5px)] data-unchecked:translate-x-px size-5")
|
|
1982
2294
|
})
|
|
1983
2295
|
});
|
|
1984
2296
|
}
|
|
@@ -2023,11 +2335,11 @@ function DatePicker({ triggerProps, placeholder = "Pick a date", format: format$
|
|
|
2023
2335
|
calendarProps.onSelect(...args);
|
|
2024
2336
|
!calendarProps.mode || calendarProps.mode === "single" && setOpen(false);
|
|
2025
2337
|
};
|
|
2026
|
-
return /* @__PURE__ */ jsxs(Root$
|
|
2338
|
+
return /* @__PURE__ */ jsxs(Root$10, {
|
|
2027
2339
|
open,
|
|
2028
2340
|
onOpenChange: setOpen,
|
|
2029
2341
|
...popoverRootProps,
|
|
2030
|
-
children: [/* @__PURE__ */ jsxs(Trigger$
|
|
2342
|
+
children: [/* @__PURE__ */ jsxs(Trigger$7, {
|
|
2031
2343
|
disabled: triggerProps?.disabled,
|
|
2032
2344
|
className: cn(triggerVariants({
|
|
2033
2345
|
size: triggerProps?.size,
|
|
@@ -2093,23 +2405,6 @@ function RetryIcon(props) {
|
|
|
2093
2405
|
});
|
|
2094
2406
|
}
|
|
2095
2407
|
|
|
2096
|
-
//#endregion
|
|
2097
|
-
//#region src/icons/spinner-icon.tsx
|
|
2098
|
-
function SpinnerIcon(props) {
|
|
2099
|
-
return /* @__PURE__ */ jsx("svg", {
|
|
2100
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2101
|
-
viewBox: "0 0 24 24",
|
|
2102
|
-
fill: "none",
|
|
2103
|
-
stroke: "currentColor",
|
|
2104
|
-
strokeWidth: 2,
|
|
2105
|
-
strokeLinecap: "round",
|
|
2106
|
-
strokeLinejoin: "round",
|
|
2107
|
-
...props,
|
|
2108
|
-
className: cn("shrink-0", props.className),
|
|
2109
|
-
children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
|
|
2110
|
-
});
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
2408
|
//#endregion
|
|
2114
2409
|
//#region src/icons/upload-icon.tsx
|
|
2115
2410
|
function UploadIcon(props) {
|
|
@@ -2863,6 +3158,23 @@ const FileUpload = {
|
|
|
2863
3158
|
ImageGridItem
|
|
2864
3159
|
};
|
|
2865
3160
|
|
|
3161
|
+
//#endregion
|
|
3162
|
+
//#region src/hooks/use-mobile.ts
|
|
3163
|
+
const MOBILE_BREAKPOINT = 768;
|
|
3164
|
+
function useIsMobile() {
|
|
3165
|
+
const [isMobile, setIsMobile] = React$1.useState(void 0);
|
|
3166
|
+
React$1.useEffect(() => {
|
|
3167
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
3168
|
+
const onChange = () => {
|
|
3169
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
3170
|
+
};
|
|
3171
|
+
mql.addEventListener("change", onChange);
|
|
3172
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
3173
|
+
return () => mql.removeEventListener("change", onChange);
|
|
3174
|
+
}, []);
|
|
3175
|
+
return !!isMobile;
|
|
3176
|
+
}
|
|
3177
|
+
|
|
2866
3178
|
//#endregion
|
|
2867
3179
|
//#region src/index.ts
|
|
2868
3180
|
var src_exports = /* @__PURE__ */ __export({
|
|
@@ -2875,6 +3187,7 @@ var src_exports = /* @__PURE__ */ __export({
|
|
|
2875
3187
|
Button: () => Button,
|
|
2876
3188
|
Calendar: () => Calendar,
|
|
2877
3189
|
Checkbox: () => Checkbox,
|
|
3190
|
+
Collapsible: () => collapsible_exports,
|
|
2878
3191
|
Combobox: () => combobox_exports,
|
|
2879
3192
|
DatePicker: () => DatePicker,
|
|
2880
3193
|
Dialog: () => dialog_exports,
|
|
@@ -2884,6 +3197,7 @@ var src_exports = /* @__PURE__ */ __export({
|
|
|
2884
3197
|
InputGroup: () => input_group_exports,
|
|
2885
3198
|
Label: () => Label,
|
|
2886
3199
|
Menu: () => menu_exports,
|
|
3200
|
+
PXUIProvider: () => PXUIProvider,
|
|
2887
3201
|
Popover: () => popover_exports,
|
|
2888
3202
|
Progress: () => progress_exports,
|
|
2889
3203
|
RadioGroup: () => radio_group_exports,
|
|
@@ -2896,15 +3210,18 @@ var src_exports = /* @__PURE__ */ __export({
|
|
|
2896
3210
|
Textarea: () => Textarea,
|
|
2897
3211
|
Tooltip: () => tooltip_exports,
|
|
2898
3212
|
UploadIcon: () => UploadIcon,
|
|
3213
|
+
anchoredToast: () => anchoredToast,
|
|
2899
3214
|
buttonVariants: () => buttonVariants,
|
|
2900
3215
|
cn: () => cn,
|
|
2901
3216
|
defineLoadOptions: () => defineLoadOptions,
|
|
2902
3217
|
formatBytes: () => formatBytes,
|
|
3218
|
+
toast: () => toast,
|
|
2903
3219
|
useAsyncOptions: () => useAsyncOptions,
|
|
2904
3220
|
useFileUpload: () => useFileUpload,
|
|
2905
|
-
useIntersectionObserver: () => useIntersectionObserver
|
|
3221
|
+
useIntersectionObserver: () => useIntersectionObserver,
|
|
3222
|
+
useIsMobile: () => useIsMobile
|
|
2906
3223
|
});
|
|
2907
3224
|
|
|
2908
3225
|
//#endregion
|
|
2909
|
-
export { Avatar, AvatarGroup, AvatarImpl, block_checkbox_group_exports as BlockCheckboxGroup, block_radio_group_exports as BlockRadioGroup, breadcrumbs_exports as Breadcrumbs, Button, Calendar, Checkbox, combobox_exports as Combobox, DatePicker, dialog_exports as Dialog, FileIcon, FileUpload, Input, input_group_exports as InputGroup, Label, menu_exports as Menu, popover_exports as Popover, progress_exports as Progress, radio_group_exports as RadioGroup, segmented_control_exports as SegmentedControl, select_exports as Select, Separator, Spinner, Switch, tabs_exports as Tabs, Textarea, tooltip_exports as Tooltip, UploadIcon, buttonVariants, cn, defineLoadOptions, formatBytes, useAsyncOptions, useFileUpload, useIntersectionObserver };
|
|
3226
|
+
export { Avatar, AvatarGroup, AvatarImpl, block_checkbox_group_exports as BlockCheckboxGroup, block_radio_group_exports as BlockRadioGroup, breadcrumbs_exports as Breadcrumbs, Button, Calendar, Checkbox, collapsible_exports as Collapsible, combobox_exports as Combobox, DatePicker, dialog_exports as Dialog, FileIcon, FileUpload, Input, input_group_exports as InputGroup, Label, menu_exports as Menu, PXUIProvider, popover_exports as Popover, progress_exports as Progress, radio_group_exports as RadioGroup, segmented_control_exports as SegmentedControl, select_exports as Select, Separator, Spinner, Switch, tabs_exports as Tabs, Textarea, tooltip_exports as Tooltip, UploadIcon, anchoredToast, buttonVariants, cn, defineLoadOptions, formatBytes, toast, useAsyncOptions, useFileUpload, useIntersectionObserver, useIsMobile };
|
|
2910
3227
|
//# sourceMappingURL=index.js.map
|