pentatrion-design 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/AccordionItem.d.ts +7 -0
- package/dist/components/accordion/AccordionItem.d.ts.map +1 -0
- package/dist/components/accordion/AccordionItem.js +7 -0
- package/dist/components/button/Button.js +1 -1
- package/dist/components/button/LinkButton.d.ts +7 -4
- package/dist/components/button/LinkButton.d.ts.map +1 -0
- package/dist/components/button/LinkButton.js +5 -5
- package/dist/components/dropdown-menu/useDropdownMenu.d.ts.map +1 -1
- package/dist/components/dropdown-menu/useDropdownMenuContext.d.ts.map +1 -1
- package/dist/components/form/InputField.d.ts.map +1 -1
- package/dist/components/form/InputField.js +2 -1
- package/dist/components/input/Color.d.ts.map +1 -1
- package/dist/components/input/Color.js +1 -1
- package/dist/components/input/TotpInput.d.ts +2 -1
- package/dist/components/input/TotpInput.d.ts.map +1 -1
- package/dist/components/input/TotpInput.js +2 -2
- package/dist/components/modal/ModalContent.d.ts +2 -1
- package/dist/components/modal/ModalContent.d.ts.map +1 -1
- package/dist/components/modal/ModalContent.js +2 -2
- package/dist/components/modal/useModal.d.ts.map +1 -1
- package/dist/components/modal/useModalContext.d.ts.map +1 -1
- package/dist/components/popover/usePopover.d.ts.map +1 -1
- package/dist/components/popover/usePopoverContext.d.ts.map +1 -1
- package/dist/components/slot/Slot.d.ts +9 -4
- package/dist/components/slot/Slot.d.ts.map +1 -1
- package/dist/components/slot/Slot.js +69 -49
- package/dist/components/tooltip/useTooltip.d.ts.map +1 -1
- package/dist/components/tooltip/useTooltipContext.d.ts.map +1 -1
- package/dist/lib/compose-refs.d.ts +4 -3
- package/dist/lib/compose-refs.d.ts.map +1 -1
- package/dist/lib/compose-refs.js +33 -4
- package/package.json +16 -16
- package/src/components/button/Button.tsx +1 -1
- package/src/components/form/InputField.tsx +3 -1
- package/src/components/input/Color.tsx +9 -2
- package/src/components/input/TotpInput.tsx +4 -1
- package/src/components/modal/ModalContent.tsx +6 -2
- package/src/components/slot/Slot.tsx +88 -57
- package/src/lib/compose-refs.ts +35 -9
- package/src/tailwind/components-input-outline.css +1 -1
- package/.local/package copy 2.json +0 -142
- package/.local/package copy.json +0 -247
- package/.local/tailwind copy/base-prose.css +0 -110
- package/.local/tailwind copy/base.css +0 -131
- package/.local/tailwind copy/components-input-outline.css +0 -95
- package/.local/tailwind copy/components-range.css +0 -33
- package/.local/tailwind copy/components-resize-area.css +0 -110
- package/.local/tailwind copy/components-step.css +0 -168
- package/.local/tailwind copy/components.css +0 -10
- package/.local/tailwind copy/components.utilities.css +0 -63
- package/.local/tailwind copy/index.css +0 -14
- package/.local/tailwind copy/plugin.ts +0 -274
- package/.local/tailwind copy/utilities-dialog.css +0 -47
- package/.local/tailwind copy/utilities-dialog.utilities.css +0 -35
- package/.local/tailwind copy/utilities.css +0 -3
- package/.local/tailwind copy/vars.css +0 -121
- package/.local/vite-plugin-watch-and-restart.ts +0 -53
- package/dist/README.md +0 -192
- package/dist/components/draggable-advanced/people/images/processed/Alexander.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Alexander.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Aliza.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Aliza.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Alvin.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Alvin.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Angie.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Angie.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Arjun.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Arjun.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Blair.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Blair.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Claudia.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Claudia.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Colin.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Colin.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Ed.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Ed.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Effie.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Effie.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Eliot.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Eliot.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Fabian.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Fabian.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Gael.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Gael.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Gerard.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Gerard.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Hasan.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Hasan.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Helena.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Helena.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Ivan.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Ivan.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Katina.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Katina.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Lara.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Lara.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Leo.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Leo.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Lydia.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Lydia.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Maribel.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Maribel.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Milo.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Milo.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Myra.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Myra.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Narul.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Narul.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Norah.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Norah.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Oliver.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Oliver.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Rahul.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Rahul.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Renato.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Renato.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Steve.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Steve.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Tanya.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Tanya.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Tori.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Tori.js +0 -9
- package/dist/components/draggable-advanced/people/images/processed/Vania.d.ts +0 -10
- package/dist/components/draggable-advanced/people/images/processed/Vania.js +0 -9
- package/dist/components/draggable-advanced/people/index.d.ts +0 -12
- package/dist/components/draggable-advanced/people/index.js +0 -126
- package/dist/components/dropdown-menu/DropdownMenuContent.d.ts +0 -1
- package/dist/components/dropdown-menu/DropdownMenuContent.js +0 -15
- package/dist/components/dropdown-menu/DropdownMenuTrigger.d.ts +0 -2
- package/dist/components/dropdown-menu/DropdownMenuTrigger.js +0 -11
- package/dist/components/dropdown-menu-legacy/DropdownMenu.d.ts +0 -7
- package/dist/components/dropdown-menu-legacy/DropdownMenu.js +0 -7
- package/dist/components/dropdown-menu-legacy/DropdownMenuContent.d.ts +0 -1
- package/dist/components/dropdown-menu-legacy/DropdownMenuContent.js +0 -15
- package/dist/components/dropdown-menu-legacy/DropdownMenuItem.d.ts +0 -7
- package/dist/components/dropdown-menu-legacy/DropdownMenuItem.js +0 -20
- package/dist/components/dropdown-menu-legacy/DropdownMenuTrigger.d.ts +0 -2
- package/dist/components/dropdown-menu-legacy/DropdownMenuTrigger.js +0 -11
- package/dist/components/dropdown-menu-legacy/index.d.ts +0 -7
- package/dist/components/dropdown-menu-legacy/index.js +0 -6
- package/dist/components/dropdown-menu-legacy/interface.d.ts +0 -10
- package/dist/components/dropdown-menu-legacy/interface.js +0 -1
- package/dist/components/dropdown-menu-legacy/useDropdownMenu.d.ts +0 -53
- package/dist/components/dropdown-menu-legacy/useDropdownMenu.js +0 -79
- package/dist/components/dropdown-menu-legacy/useDropdownMenuContext.d.ts +0 -56
- package/dist/components/dropdown-menu-legacy/useDropdownMenuContext.js +0 -9
- package/dist/components/href/Href.d.ts +0 -6
- package/dist/components/href/Href.js +0 -6
- package/dist/components/input/RadioGroup.d.ts +0 -21
- package/dist/components/input/RadioGroup.js +0 -20
- package/dist/components/input-field/InputField.d.ts +0 -13
- package/dist/components/input-field/InputField.js +0 -16
- package/dist/components/input-field/index.d.ts +0 -1
- package/dist/components/input-field/index.js +0 -1
- package/dist/components/sortable/Sortable.d.ts +0 -2
- package/dist/components/sortable/Sortable.js +0 -15
- package/dist/components/sortable/index.d.ts +0 -2
- package/dist/components/sortable/index.js +0 -1
- package/dist/components/sortable/interface.d.ts +0 -11
- package/dist/components/sortable/interface.js +0 -1
- package/dist/hooks/useCombinedRefs.d.ts +0 -2
- package/dist/hooks/useCombinedRefs.js +0 -13
- package/dist/hooks/useEventCallback.d.ts +0 -1
- package/dist/hooks/useEventCallback.js +0 -8
- package/dist/lib/fetch.test.d.ts +0 -1
- package/dist/lib/fetch.test.js +0 -100
- package/dist/package.json +0 -178
- package/dist/redux/notification/NotificationConsumer.d.ts +0 -6
- package/dist/redux/notification/NotificationConsumer.js +0 -28
- package/dist/redux/notification/errorCatcherMiddleware.d.ts +0 -1
- package/dist/redux/notification/errorCatcherMiddleware.js +0 -31
- package/dist/redux/notification/index.d.ts +0 -5
- package/dist/redux/notification/index.js +0 -5
- package/dist/redux/notification/notificationSlice.d.ts +0 -22
- package/dist/redux/notification/notificationSlice.js +0 -49
- package/dist/redux/notification/useReduxNotifications.d.ts +0 -5
- package/dist/redux/notification/useReduxNotifications.js +0 -22
- package/dist/tailwind/base.d.ts +0 -3
- package/dist/tailwind/base.js +0 -105
- package/dist/tailwind/components.d.ts +0 -5
- package/dist/tailwind/components.js +0 -258
- package/dist/tailwind/index.d.ts +0 -2
- package/dist/tailwind/index.js +0 -2
- package/dist/tailwind/keyframes.d.ts +0 -2
- package/dist/tailwind/keyframes.js +0 -67
- package/dist/tailwind/pentatrionTw.d.ts +0 -50
- package/dist/tailwind/pentatrionTw.js +0 -187
- package/dist/tailwind/plugin.d.ts +0 -8
- package/dist/tailwind/plugin.js +0 -256
- package/dist/tailwind/utilities.d.ts +0 -3
- package/dist/tailwind/utilities.js +0 -61
- package/dist/tailwind/vars.d.ts +0 -2
- package/dist/tailwind/vars.js +0 -104
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
interface Props extends ComponentProps<"div"> {
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function AccordionItem({ name, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=AccordionItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccordionItem.d.ts","sourceRoot":"","sources":["../../../src/components/accordion/AccordionItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC,UAAU,KAAM,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,KAAK,2CAQ/D"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useAccordion } from "./useAccordion";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
export function AccordionItem({ name, children, ...rest }) {
|
|
5
|
+
const { value } = useAccordion();
|
|
6
|
+
return (_jsx("div", { ...rest, className: clsx(value !== name && "hidden"), children: children }));
|
|
7
|
+
}
|
|
@@ -29,7 +29,7 @@ export const buttonVariants = cva("relative box-border inline-flex items-center
|
|
|
29
29
|
custom: "",
|
|
30
30
|
},
|
|
31
31
|
icon: {
|
|
32
|
-
true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg)]:pr-4",
|
|
32
|
+
true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg,strong)]:pr-4",
|
|
33
33
|
false: "rounded-2xl px-4",
|
|
34
34
|
custom: "",
|
|
35
35
|
},
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ButtonProps } from "./Button
|
|
3
|
-
export type
|
|
4
|
-
|
|
1
|
+
import { ComponentProps, RefObject } from "react";
|
|
2
|
+
import { ButtonProps } from "./Button";
|
|
3
|
+
export type HrefButtonProps = ComponentProps<"a"> & Pick<ButtonProps, "withRipple" | "variant" | "size" | "color" | "selected" | "icon" | "disabled" | "width"> & {
|
|
4
|
+
ref?: RefObject<HTMLAnchorElement>;
|
|
5
|
+
};
|
|
6
|
+
export declare function HrefButton({ withRipple, variant, color, size, width, className, disabled, children, selected, icon, href, ref, ...props }: HrefButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=LinkButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkButton.d.ts","sourceRoot":"","sources":["../../../src/components/button/LinkButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAG/E,OAAO,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,cAAc,CAAC,GAAG,CAAC,GAC/C,IAAI,CACF,WAAW,EACX,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CACzF,GAAG;IAAE,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAA;CAAE,CAAC;AAE7C,wBAAgB,UAAU,CAAC,EACzB,UAAiB,EACjB,OAAqB,EACrB,KAAgB,EAChB,IAAe,EACf,KAAa,EACb,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAgB,EAChB,IAAY,EACZ,IAAI,EACJ,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,2CA8BjB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useImperativeHandle, useRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { useRipple } from "../../hooks/useRipple
|
|
5
|
-
import { buttonVariants } from "./Button
|
|
6
|
-
export
|
|
4
|
+
import { useRipple } from "../../hooks/useRipple";
|
|
5
|
+
import { buttonVariants } from "./Button";
|
|
6
|
+
export function HrefButton({ withRipple = true, variant = "contained", color = "yellow", size = "medium", width = "fit", className, disabled, children, selected = false, icon = false, href, ref, ...props }) {
|
|
7
7
|
const anchorRef = useRef(null);
|
|
8
8
|
useImperativeHandle(ref, () => anchorRef.current);
|
|
9
9
|
const ripples = useRipple(anchorRef);
|
|
10
10
|
return (_jsxs("a", { role: "button", href: href, ref: anchorRef, className: clsx(buttonVariants({ variant, size, width, icon: size === "custom" ? "custom" : icon }), className, selected && "active"), "data-color": color, "data-variant": variant, "aria-checked": selected, "aria-disabled": disabled, ...props, children: [!disabled && withRipple && ripples, children] }));
|
|
11
|
-
}
|
|
11
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/useDropdownMenu.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAiB1D,wBAAgB,eAAe,CAAC,EAC9B,WAAmB,EACnB,SAAoB,EACpB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EACL,KAAa,GACd,EAAE,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDropdownMenu.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/useDropdownMenu.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAiB1D,wBAAgB,eAAe,CAAC,EAC9B,WAAmB,EACnB,SAAoB,EACpB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EACL,KAAa,GACd,EAAE,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA0F81jC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EAD3ikC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDropdownMenuContext.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/useDropdownMenuContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,CAAC;AAE7D,eAAO,MAAM,mBAAmB,sCAAmC,CAAC;AAEpE,wBAAgB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDropdownMenuContext.d.ts","sourceRoot":"","sources":["../../../src/components/dropdown-menu/useDropdownMenuContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,GAAG,IAAI,CAAC;AAE7D,eAAO,MAAM,mBAAmB,sCAAmC,CAAC;AAEpE,wBAAgB,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCASo3nC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EAD9koC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputField.d.ts","sourceRoot":"","sources":["../../../src/components/form/InputField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAS,MAAM,OAAO,CAAC;AAIzD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,WAAW,EACX,MAAM,EACN,OAAO,EACP,EAAE,EAAE,UAAU,EACd,QAAQ,EACR,iBAAwB,EACxB,aAAa,EAAE,UAAU,EACzB,SAAS,GACV,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"InputField.d.ts","sourceRoot":"","sources":["../../../src/components/form/InputField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAS,MAAM,OAAO,CAAC;AAIzD,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,WAAW,EACX,MAAM,EACN,OAAO,EACP,EAAE,EAAE,UAAU,EACd,QAAQ,EACR,iBAAwB,EACxB,aAAa,EAAE,UAAU,EACzB,SAAS,GACV,EAAE,eAAe,2CAyDjB"}
|
|
@@ -13,6 +13,7 @@ export function InputField({ label, hint, description, errors, warning, id: prov
|
|
|
13
13
|
const color = errors ? "red" : warning ? "orange" : "yellow";
|
|
14
14
|
const showLabel = preventLayerShift || label || hint;
|
|
15
15
|
const showFooter = preventLayerShift || errorsElement || warningElement;
|
|
16
|
-
|
|
16
|
+
const testIdProp = dataTestId ? { "data-testid": `input-field-${dataTestId}` } : {};
|
|
17
|
+
return (_jsxs("div", { role: "group", className: className, ...testIdProp, children: [showLabel &&
|
|
17
18
|
(label || hint ? (_jsxs("label", { className: "mb-1 flex flex-wrap items-center justify-between", htmlFor: id, children: [labelElement, hintElement] })) : (_jsx("label", { htmlFor: id, className: "invisible" }))), description && _jsx("div", { className: "text-body-sm text-gray-6 mb-2", children: description }), _jsx(Slot, { id: id, color: color, children: children }), showFooter && (_jsx("div", { className: "text-body-sm text-gray-6 mt-1 min-h-5", children: errorsElement || warningElement }))] }));
|
|
18
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../src/components/input/Color.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,UAAiB,EACjB,KAAgB,EAChB,KAAK,EACL,SAAiB,EACjB,SAAS,EACT,GAAG,EACH,GAAG,IAAI,EACR,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../src/components/input/Color.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAA+B,MAAM,OAAO,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,QAAQ,CAAC;IAC1D,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;CACpC;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,UAAiB,EACjB,KAAgB,EAChB,KAAK,EACL,SAAiB,EACjB,SAAS,EACT,GAAG,EACH,GAAG,IAAI,EACR,EAAE,UAAU,2CAuCZ"}
|
|
@@ -7,5 +7,5 @@ export function Color({ value, withRipple = true, color = "yellow", label, showV
|
|
|
7
7
|
const buttonRef = useRef(null);
|
|
8
8
|
useImperativeHandle(ref, () => buttonRef.current);
|
|
9
9
|
const ripples = useRipple(buttonRef);
|
|
10
|
-
return (_jsxs("button", { ref: buttonRef, "data-color": color, className: "p8n-input-text relative flex h-8 overflow-clip rounded-2xl p-1 outline-offset-[-1px]", ...rest, children: [withRipple && ripples, _jsx("span", { className: clsx("
|
|
10
|
+
return (_jsxs("button", { ref: buttonRef, "data-color": color, className: "p8n-input-text group relative flex h-8 cursor-pointer overflow-clip rounded-2xl p-1 outline-offset-[-1px] active:translate-y-[1px]", ...rest, children: [withRipple && ripples, _jsx("span", { className: clsx("absolute inset-1 flex items-center justify-center rounded-2xl transition-transform group-hover:scale-150", valueToShow === null && "min-w-12", className), style: { backgroundColor: value } }), _jsx("span", { className: clsx("relative flex h-full items-center justify-center px-2", valueToShow === null && "min-w-12", className), children: valueToShow })] }));
|
|
11
11
|
}
|
|
@@ -5,7 +5,8 @@ interface TotpInputProps {
|
|
|
5
5
|
type?: "number" | "alphabet";
|
|
6
6
|
autoFocus?: boolean;
|
|
7
7
|
autoComplete?: "one-time-code";
|
|
8
|
+
name?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare function TotpInput({ value, length, onValue, type, autoFocus, }: TotpInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function TotpInput({ value, length, onValue, type, autoFocus, name, }: TotpInputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=TotpInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TotpInput.d.ts","sourceRoot":"","sources":["../../../src/components/input/TotpInput.tsx"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"TotpInput.d.ts","sourceRoot":"","sources":["../../../src/components/input/TotpInput.tsx"],"names":[],"mappings":"AAIA,UAAU,cAAc;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,IAAI,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAWD,wBAAgB,SAAS,CAAC,EACxB,KAAU,EACV,MAAM,EACN,OAAO,EACP,IAAiB,EACjB,SAAS,EACT,IAAI,GACL,EAAE,cAAc,2CAuIhB"}
|
|
@@ -9,7 +9,7 @@ const getIsValidValue = (value, type) => {
|
|
|
9
9
|
}
|
|
10
10
|
return /[0-9A-Za-z]/.test(value);
|
|
11
11
|
};
|
|
12
|
-
export function TotpInput({ value = "", length, onValue, type = "alphabet", autoFocus, }) {
|
|
12
|
+
export function TotpInput({ value = "", length, onValue, type = "alphabet", autoFocus, name, }) {
|
|
13
13
|
const list = useMemo(() => Array.from({ length }), [length]);
|
|
14
14
|
const splitValues = value.split("");
|
|
15
15
|
const values = list.map((_, i) => {
|
|
@@ -51,7 +51,7 @@ export function TotpInput({ value = "", length, onValue, type = "alphabet", auto
|
|
|
51
51
|
// trim only for replacing ' ' with ''
|
|
52
52
|
const value = values[i].trim();
|
|
53
53
|
const isValidValue = getIsValidValue(value, type);
|
|
54
|
-
return (_jsx(Fragment, { children: _jsx(Input, { size: "custom", autoFocus: i === focusIndex ? autoFocus : undefined, type: type === "number" ? "tel" : "text", inputMode: type === "number" ? "numeric" : undefined, className: clsx("2sm:w-16 h-(--h-input) w-12 shrink-0 p-0 [--h-input:72px]"), inputClassName: "text-center text-body-3xl", autoCapitalize: "
|
|
54
|
+
return (_jsx(Fragment, { children: _jsx(Input, { name: name ? `${name}-chars[${i}]` : undefined, size: "custom", autoFocus: i === focusIndex ? autoFocus : undefined, type: type === "number" ? "tel" : "text", inputMode: type === "number" ? "numeric" : undefined, className: clsx("2sm:w-16 h-(--h-input) w-12 shrink-0 p-0 [--h-input:72px]"), inputClassName: "text-center text-body-3xl", autoCapitalize: "none", autoCorrect: "off", spellCheck: "false", ref: (ref) => {
|
|
55
55
|
refArray.current[i] = ref;
|
|
56
56
|
}, value: value, onFocus: (event) => {
|
|
57
57
|
event.currentTarget.select();
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ComponentProps, RefObject } from "react";
|
|
2
2
|
interface Props extends ComponentProps<"div"> {
|
|
3
3
|
ref?: RefObject<HTMLInputElement>;
|
|
4
|
+
zClassName?: string;
|
|
4
5
|
}
|
|
5
|
-
export declare function ModalContent({ style, className, children, ref, ...props }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
export declare function ModalContent({ zClassName, style, className, children, ref, ...props }: Props): import("react/jsx-runtime").JSX.Element | null;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=ModalContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalContent.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalContent.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlD,UAAU,KAAM,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3C,GAAG,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ModalContent.d.ts","sourceRoot":"","sources":["../../../src/components/modal/ModalContent.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlD,UAAU,KAAM,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3C,GAAG,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,kDAiC5F"}
|
|
@@ -3,12 +3,12 @@ import { FloatingFocusManager, FloatingOverlay, FloatingPortal, useMergeRefs, }
|
|
|
3
3
|
import { useModalContext } from "./useModalContext";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { Dialog } from "../dialog/Dialog";
|
|
6
|
-
export function ModalContent({ style, className, children, ref, ...props }) {
|
|
6
|
+
export function ModalContent({ zClassName, style, className, children, ref, ...props }) {
|
|
7
7
|
const context = useModalContext();
|
|
8
8
|
const floatingContext = context.context;
|
|
9
9
|
const mergedRef = useMergeRefs([context.refs.setFloating, ref]);
|
|
10
10
|
if (!context.open) {
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
|
-
return (_jsx(FloatingPortal, { children: _jsx(FloatingOverlay, { className: "flex-center
|
|
13
|
+
return (_jsx(FloatingPortal, { children: _jsx(FloatingOverlay, { className: clsx("flex-center bg-gray-7/40 motion-safe:animate-fade-in-opacity", zClassName ?? "z-overlay"), lockScroll: true, children: _jsx(FloatingFocusManager, { context: floatingContext, children: _jsx(Dialog, { color: context.color, className: clsx("motion-safe:animate-fade-in mx-4", className), style: style, "aria-labelledby": context.labelId, "aria-describedby": context.descriptionId, ...context.getFloatingProps(props), children: _jsx("div", { ref: mergedRef, children: children }) }) }) }) }));
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,wBAAgB,QAAQ,CAAC,EACvB,WAAmB,EACnB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,GACN,GAAE,YAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useModal.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useModal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAqB,MAAM,OAAO,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,wBAAgB,QAAQ,CAAC,EACvB,WAAmB,EACnB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,GACN,GAAE,YAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAuCk/lC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EAD1rmC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModalContext.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useModalContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC;AAEtD,eAAO,MAAM,YAAY,sCAAmC,CAAC;AAE7D,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useModalContext.d.ts","sourceRoot":"","sources":["../../../src/components/modal/useModalContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,QAAQ,CAAC,GAAG,IAAI,CAAC;AAEtD,eAAO,MAAM,YAAY,sCAAmC,CAAC;AAE7D,wBAAgB,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCASm7nC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADtooC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/usePopover.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgB7C,wBAAgB,UAAU,CAAC,EACzB,WAAmB,EACnB,SAAoB,EACpB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EACL,KAAa,GACd,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"usePopover.d.ts","sourceRoot":"","sources":["../../../src/components/popover/usePopover.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAgB7C,wBAAgB,UAAU,CAAC,EACzB,WAAmB,EACnB,SAAoB,EACpB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,KAAK,EACL,KAAa,GACd,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAwD8glC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADntlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopoverContext.d.ts","sourceRoot":"","sources":["../../../src/components/popover/usePopoverContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;AAExD,eAAO,MAAM,cAAc,sCAAmC,CAAC;AAE/D,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"usePopoverContext.d.ts","sourceRoot":"","sources":["../../../src/components/popover/usePopoverContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;AAExD,eAAO,MAAM,cAAc,sCAAmC,CAAC;AAE/D,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCASi6nC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADtnoC"}
|
|
@@ -2,11 +2,16 @@ import * as React from "react";
|
|
|
2
2
|
interface SlotProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
}
|
|
5
|
+
export declare function createSlot(ownerName: string): React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
|
5
6
|
declare const Slot: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
|
|
6
|
-
|
|
7
|
+
interface SlottableProps {
|
|
7
8
|
children: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
}
|
|
10
|
+
interface SlottableComponent extends React.FC<SlottableProps> {
|
|
11
|
+
__radixId: symbol;
|
|
12
|
+
}
|
|
13
|
+
export declare function createSlottable(ownerName: string): SlottableComponent;
|
|
14
|
+
declare const Slottable: SlottableComponent;
|
|
15
|
+
export { Slot, Slottable, Slot as Root, };
|
|
11
16
|
export type { SlotProps };
|
|
12
17
|
//# sourceMappingURL=Slot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slot.d.ts","sourceRoot":"","sources":["../../../src/components/slot/Slot.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Slot.d.ts","sourceRoot":"","sources":["../../../src/components/slot/Slot.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B,UAAU,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;IAC3D,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAE0B,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,iFA0CtE;AAED,QAAA,MAAM,IAAI,+EAAqB,CAAC;AAqChC,UAAU,cAAc;IACtB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,UAAU,kBAAmB,SAAQ,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAE0B,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,sBAO3E;AAED,QAAA,MAAM,SAAS,oBAA+B,CAAC;AA2E/C,OAAO,EACL,IAAI,EACJ,SAAS,EAET,IAAI,IAAI,IAAI,GACb,CAAC;AACF,YAAY,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1,58 +1,78 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/* -------------------------------------------------------------------------------------------------
|
|
3
|
+
* Slot
|
|
4
|
+
* https://github.com/radix-ui/primitives/blob/main/packages/react/slot/src/slot.tsx
|
|
5
|
+
* -----------------------------------------------------------------------------------------------*/
|
|
2
6
|
import * as React from "react";
|
|
3
7
|
import { composeRefs } from "../../lib";
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName) {
|
|
9
|
+
const SlotClone = createSlotClone(ownerName);
|
|
10
|
+
const Slot = React.forwardRef((props, forwardedRef) => {
|
|
11
|
+
const { children, ...slotProps } = props;
|
|
12
|
+
const childrenArray = React.Children.toArray(children);
|
|
13
|
+
const slottable = childrenArray.find(isSlottable);
|
|
14
|
+
if (slottable) {
|
|
15
|
+
// the new element to render is the one passed as a child of `Slottable`
|
|
16
|
+
const newElement = slottable.props.children;
|
|
17
|
+
const newChildren = childrenArray.map((child) => {
|
|
18
|
+
if (child === slottable) {
|
|
19
|
+
// because the new element will be the one rendered, we are only interested
|
|
20
|
+
// in grabbing its children (`newElement.props.children`)
|
|
21
|
+
if (React.Children.count(newElement) > 1)
|
|
22
|
+
return React.Children.only(null);
|
|
23
|
+
return React.isValidElement(newElement)
|
|
24
|
+
? newElement.props.children
|
|
25
|
+
: null;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return child;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return (_jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement)
|
|
32
|
+
? React.cloneElement(newElement, undefined, newChildren)
|
|
33
|
+
: null }));
|
|
34
|
+
}
|
|
35
|
+
return (_jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: children }));
|
|
36
|
+
});
|
|
37
|
+
Slot.displayName = `${ownerName}.Slot`;
|
|
38
|
+
return Slot;
|
|
39
|
+
}
|
|
40
|
+
const Slot = createSlot("Slot");
|
|
41
|
+
/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName) {
|
|
42
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
43
|
+
const { children, ...slotProps } = props;
|
|
44
|
+
if (React.isValidElement(children)) {
|
|
45
|
+
const childrenRef = getElementRef(children);
|
|
46
|
+
const props = mergeProps(slotProps, children.props);
|
|
47
|
+
// do not pass ref to React.Fragment for React 19 compatibility
|
|
48
|
+
if (children.type !== React.Fragment) {
|
|
49
|
+
props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
23
50
|
}
|
|
24
|
-
|
|
25
|
-
return (_jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement)
|
|
26
|
-
? React.cloneElement(newElement, undefined, newChildren)
|
|
27
|
-
: null }));
|
|
28
|
-
}
|
|
29
|
-
return (_jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: children }));
|
|
30
|
-
});
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
Slot.displayName = "Slot";
|
|
33
|
-
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
34
|
-
const { children, ...slotProps } = props;
|
|
35
|
-
if (React.isValidElement(children)) {
|
|
36
|
-
const childrenRef = getElementRef(children);
|
|
37
|
-
const props = mergeProps(slotProps, children.props);
|
|
38
|
-
// do not pass ref to React.Fragment for React 19 compatibility
|
|
39
|
-
if (children.type !== React.Fragment) {
|
|
40
|
-
props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
51
|
+
return React.cloneElement(children, props);
|
|
41
52
|
}
|
|
42
|
-
return React.
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
SlotClone.displayName = "SlotClone";
|
|
53
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
54
|
+
});
|
|
55
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
56
|
+
return SlotClone;
|
|
57
|
+
}
|
|
48
58
|
/* -------------------------------------------------------------------------------------------------
|
|
49
59
|
* Slottable
|
|
50
60
|
* -----------------------------------------------------------------------------------------------*/
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
}
|
|
61
|
+
const SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
62
|
+
/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName) {
|
|
63
|
+
const Slottable = ({ children }) => {
|
|
64
|
+
return _jsx(_Fragment, { children: children });
|
|
65
|
+
};
|
|
66
|
+
Slottable.displayName = `${ownerName}.Slottable`;
|
|
67
|
+
Slottable.__radixId = SLOTTABLE_IDENTIFIER;
|
|
68
|
+
return Slottable;
|
|
69
|
+
}
|
|
70
|
+
const Slottable = createSlottable("Slottable");
|
|
54
71
|
function isSlottable(child) {
|
|
55
|
-
return React.isValidElement(child) &&
|
|
72
|
+
return (React.isValidElement(child) &&
|
|
73
|
+
typeof child.type === "function" &&
|
|
74
|
+
"__radixId" in child.type &&
|
|
75
|
+
child.type.__radixId === SLOTTABLE_IDENTIFIER);
|
|
56
76
|
}
|
|
57
77
|
function mergeProps(slotProps, childProps) {
|
|
58
78
|
// all child props should override
|
|
@@ -65,8 +85,9 @@ function mergeProps(slotProps, childProps) {
|
|
|
65
85
|
// if the handler exists on both, we compose them
|
|
66
86
|
if (slotPropValue && childPropValue) {
|
|
67
87
|
overrideProps[propName] = (...args) => {
|
|
68
|
-
childPropValue(...args);
|
|
88
|
+
const result = childPropValue(...args);
|
|
69
89
|
slotPropValue(...args);
|
|
90
|
+
return result;
|
|
70
91
|
};
|
|
71
92
|
}
|
|
72
93
|
// but if it exists only on the slot, we use only this one
|
|
@@ -105,7 +126,6 @@ function getElementRef(element) {
|
|
|
105
126
|
// Not DEV
|
|
106
127
|
return element.props.ref || element.ref;
|
|
107
128
|
}
|
|
108
|
-
const Root = Slot;
|
|
109
129
|
export { Slot, Slottable,
|
|
110
130
|
//
|
|
111
|
-
Root, };
|
|
131
|
+
Slot as Root, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/useTooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkB7C,wBAAgB,UAAU,CAAC,EACzB,WAAmB,EACnB,SAAiB,EACjB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,SAAe,EACf,UAAgB,EAChB,KAAgB,GACjB,GAAE,cAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/useTooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAkB7C,wBAAgB,UAAU,CAAC,EACzB,WAAmB,EACnB,SAAiB,EACjB,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,iBAAiB,EACzB,SAAe,EACf,UAAgB,EAChB,KAAgB,GACjB,GAAE,cAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA4D+hlC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADzulC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltipContext.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/useTooltipContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;AAExD,eAAO,MAAM,cAAc,sCAAmC,CAAC;AAE/D,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useTooltipContext.d.ts","sourceRoot":"","sources":["../../../src/components/tooltip/useTooltipContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,UAAU,CAAC,GAAG,IAAI,CAAC;AAExD,eAAO,MAAM,cAAc,sCAAmC,CAAC;AAE/D,wBAAgB,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCASi6nC,CAAC;gCAAyF,CAAC;4BAAyF,CAAC;;;;;;EADtnoC"}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/
|
|
2
|
+
* https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx
|
|
3
3
|
*/
|
|
4
|
+
import * as React from "react";
|
|
4
5
|
type PossibleRef<T> = React.Ref<T> | undefined;
|
|
5
6
|
/**
|
|
6
7
|
* A utility to compose multiple refs together
|
|
7
8
|
* Accepts callback refs and RefObject(s)
|
|
8
9
|
*/
|
|
9
|
-
declare function composeRefs<T>(...refs: PossibleRef<T>[]):
|
|
10
|
+
declare function composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
|
|
10
11
|
/**
|
|
11
12
|
* A custom hook that composes multiple refs
|
|
12
13
|
* Accepts callback refs and RefObject(s)
|
|
13
14
|
*/
|
|
14
|
-
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]):
|
|
15
|
+
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T>;
|
|
15
16
|
export { composeRefs, useComposedRefs };
|
|
16
17
|
//# sourceMappingURL=compose-refs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose-refs.d.ts","sourceRoot":"","sources":["../../src/lib/compose-refs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compose-refs.d.ts","sourceRoot":"","sources":["../../src/lib/compose-refs.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAc/C;;;GAGG;AACH,iBAAS,WAAW,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CA4BvE;AAED;;;GAGG;AACH,iBAAS,eAAe,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAG3E;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
|
package/dist/lib/compose-refs.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* https://github.com/radix-ui/primitives/blob/main/packages/react/compose-refs/src/compose-refs.tsx
|
|
3
|
+
*/
|
|
4
|
+
import * as React from "react";
|
|
2
5
|
/**
|
|
3
6
|
* Set a given ref to a given value
|
|
4
7
|
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
5
8
|
*/
|
|
6
9
|
function setRef(ref, value) {
|
|
7
10
|
if (typeof ref === "function") {
|
|
8
|
-
ref(value);
|
|
11
|
+
return ref(value);
|
|
9
12
|
}
|
|
10
13
|
else if (ref !== null && ref !== undefined) {
|
|
11
14
|
ref.current = value;
|
|
@@ -16,7 +19,33 @@ function setRef(ref, value) {
|
|
|
16
19
|
* Accepts callback refs and RefObject(s)
|
|
17
20
|
*/
|
|
18
21
|
function composeRefs(...refs) {
|
|
19
|
-
return (node) =>
|
|
22
|
+
return (node) => {
|
|
23
|
+
let hasCleanup = false;
|
|
24
|
+
const cleanups = refs.map((ref) => {
|
|
25
|
+
const cleanup = setRef(ref, node);
|
|
26
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
27
|
+
hasCleanup = true;
|
|
28
|
+
}
|
|
29
|
+
return cleanup;
|
|
30
|
+
});
|
|
31
|
+
// React <19 will log an error to the console if a callback ref returns a
|
|
32
|
+
// value. We don't use ref cleanups internally so this will only happen if a
|
|
33
|
+
// user's ref callback returns a value, which we only expect if they are
|
|
34
|
+
// using the cleanup functionality added in React 19.
|
|
35
|
+
if (hasCleanup) {
|
|
36
|
+
return () => {
|
|
37
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
38
|
+
const cleanup = cleanups[i];
|
|
39
|
+
if (typeof cleanup == "function") {
|
|
40
|
+
cleanup();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
setRef(refs[i], null);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
20
49
|
}
|
|
21
50
|
/**
|
|
22
51
|
* A custom hook that composes multiple refs
|
|
@@ -24,6 +53,6 @@ function composeRefs(...refs) {
|
|
|
24
53
|
*/
|
|
25
54
|
function useComposedRefs(...refs) {
|
|
26
55
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
27
|
-
return useCallback(composeRefs(...refs), refs);
|
|
56
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
28
57
|
}
|
|
29
58
|
export { composeRefs, useComposedRefs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pentatrion-design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Hugues Tavernier",
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@atlaskit/pragmatic-drag-and-drop": "^1.
|
|
12
|
+
"@atlaskit/pragmatic-drag-and-drop": "^1.6.0",
|
|
13
13
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
14
14
|
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3",
|
|
15
|
-
"@conform-to/react": "
|
|
16
|
-
"@conform-to/zod": "
|
|
17
|
-
"@eslint/js": "^9.
|
|
18
|
-
"@floating-ui/react": "^0.27.
|
|
15
|
+
"@conform-to/react": "1.3.0",
|
|
16
|
+
"@conform-to/zod": "1.3.0",
|
|
17
|
+
"@eslint/js": "^9.27.0",
|
|
18
|
+
"@floating-ui/react": "^0.27.8",
|
|
19
19
|
"@floating-ui/react-dom": "^2.1.2",
|
|
20
20
|
"@storybook/addon-actions": "^8.6.12",
|
|
21
21
|
"@storybook/addon-docs": "^8.6.12",
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"@testing-library/react": "^16.3.0",
|
|
35
35
|
"@testing-library/user-event": "^14.6.1",
|
|
36
36
|
"@types/geojson": "^7946.0.16",
|
|
37
|
-
"@types/react": "19.1.
|
|
38
|
-
"@types/react-dom": "^19.1.
|
|
37
|
+
"@types/react": "^19.1.4",
|
|
38
|
+
"@types/react-dom": "^19.1.3",
|
|
39
39
|
"@use-gesture/react": "^10.3.1",
|
|
40
40
|
"@vitejs/plugin-react-swc": "^3.8.1",
|
|
41
41
|
"chokidar": "^4.0.3",
|
|
42
42
|
"class-variance-authority": "^0.7.1",
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
|
-
"eslint": "^9.
|
|
44
|
+
"eslint": "^9.27.0",
|
|
45
45
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
46
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
46
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
47
47
|
"fuse.js": "^7.1.0",
|
|
48
48
|
"globals": "^16.0.0",
|
|
49
49
|
"jsdom": "^26.0.0",
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"react": "^19.1.0",
|
|
55
55
|
"react-dom": "^19.1.0",
|
|
56
56
|
"storybook": "^8.6.12",
|
|
57
|
-
"tailwindcss": "^4.1.
|
|
58
|
-
"tsx": "^4.19.
|
|
59
|
-
"typescript": "^5.8.
|
|
60
|
-
"typescript-eslint": "^8.32.
|
|
57
|
+
"tailwindcss": "^4.1.5",
|
|
58
|
+
"tsx": "^4.19.4",
|
|
59
|
+
"typescript": "^5.8.3",
|
|
60
|
+
"typescript-eslint": "^8.32.1",
|
|
61
61
|
"vite": "^6.3.5",
|
|
62
|
-
"vitest": "^3.1.
|
|
63
|
-
"zod": "^3.
|
|
62
|
+
"vitest": "^3.1.4",
|
|
63
|
+
"zod": "^3.25.7"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"@atlaskit/pragmatic-drag-and-drop": "*",
|
|
@@ -61,7 +61,7 @@ export const buttonVariants = cva(
|
|
|
61
61
|
custom: "",
|
|
62
62
|
},
|
|
63
63
|
icon: {
|
|
64
|
-
true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg)]:pr-4",
|
|
64
|
+
true: "rounded-[calc(var(--h-button)/2)] min-w-(--h-button) [&_i,&_img,&_svg]:w-(--h-button) justify-center [&_:last-child:not(i,img,svg,strong)]:pr-4",
|
|
65
65
|
false: "rounded-2xl px-4",
|
|
66
66
|
custom: "",
|
|
67
67
|
},
|
|
@@ -59,8 +59,10 @@ export function InputField({
|
|
|
59
59
|
const showLabel = preventLayerShift || label || hint;
|
|
60
60
|
const showFooter = preventLayerShift || errorsElement || warningElement;
|
|
61
61
|
|
|
62
|
+
const testIdProp = dataTestId ? { "data-testid": `input-field-${dataTestId}` } : {};
|
|
63
|
+
|
|
62
64
|
return (
|
|
63
|
-
<div role="group" className={className}>
|
|
65
|
+
<div role="group" className={className} {...testIdProp}>
|
|
64
66
|
{showLabel &&
|
|
65
67
|
(label || hint ? (
|
|
66
68
|
<label className="mb-1 flex flex-wrap items-center justify-between" htmlFor={id}>
|
|
@@ -39,17 +39,24 @@ export function Color({
|
|
|
39
39
|
<button
|
|
40
40
|
ref={buttonRef}
|
|
41
41
|
data-color={color}
|
|
42
|
-
className="p8n-input-text relative flex h-8 overflow-clip rounded-2xl p-1 outline-offset-[-1px]"
|
|
42
|
+
className="p8n-input-text group relative flex h-8 cursor-pointer overflow-clip rounded-2xl p-1 outline-offset-[-1px] active:translate-y-[1px]"
|
|
43
43
|
{...rest}
|
|
44
44
|
>
|
|
45
45
|
{withRipple && ripples}
|
|
46
46
|
<span
|
|
47
47
|
className={clsx(
|
|
48
|
-
"
|
|
48
|
+
"absolute inset-1 flex items-center justify-center rounded-2xl transition-transform group-hover:scale-150",
|
|
49
49
|
valueToShow === null && "min-w-12",
|
|
50
50
|
className,
|
|
51
51
|
)}
|
|
52
52
|
style={{ backgroundColor: value }}
|
|
53
|
+
></span>
|
|
54
|
+
<span
|
|
55
|
+
className={clsx(
|
|
56
|
+
"relative flex h-full items-center justify-center px-2",
|
|
57
|
+
valueToShow === null && "min-w-12",
|
|
58
|
+
className,
|
|
59
|
+
)}
|
|
53
60
|
>
|
|
54
61
|
{valueToShow}
|
|
55
62
|
</span>
|