periplo-ui 4.22.3 → 4.23.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/inputs/InputOTP/InputOTP.d.ts +13 -0
- package/dist/components/inputs/InputOTP/InputOTP.js +50 -0
- package/dist/components/inputs/InputOTP/InputOTP.js.map +1 -0
- package/dist/components/inputs/InputOTP/index.d.ts +1 -0
- package/dist/components/inputs/InputOTP/index.js +2 -0
- package/dist/components/navigation/Tabs/Tabs.d.ts +1 -1
- package/dist/components/navigation/Tabs/Tabs.js +9 -1
- package/dist/components/navigation/Tabs/Tabs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -1
- package/dist/theme.css +7 -1
- package/package.json +7 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OTPInputProps } from 'input-otp';
|
|
2
|
+
import { ControlSize } from '../Button';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
export type InputOTPProps = Pick<OTPInputProps, 'value' | 'onChange' | 'onComplete' | 'onBlur' | 'onPaste' | 'disabled' | 'name' | 'id' | 'autoFocus' | 'aria-invalid' | 'aria-describedby'> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Slot height, same as the other inputs: sm 32px, md 40px, lg 48px (the `--control-height-*` tokens).
|
|
8
|
+
* @default lg
|
|
9
|
+
*/
|
|
10
|
+
size?: ControlSize;
|
|
11
|
+
};
|
|
12
|
+
declare const InputOTP: React.ForwardRefExoticComponent<Readonly<InputOTPProps> & React.RefAttributes<HTMLInputElement>>;
|
|
13
|
+
export { InputOTP };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
import { cn } from "../../../lib/utils.js";
|
|
4
|
+
import { isFieldInvalid } from "../shared/fieldInvalid.js";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { OTPInput, REGEXP_ONLY_DIGITS } from "input-otp";
|
|
8
|
+
//#region src/components/inputs/InputOTP/InputOTP.tsx
|
|
9
|
+
var OTP_LENGTH = 6;
|
|
10
|
+
var keepDigits = (text) => text.replace(/\D/g, "");
|
|
11
|
+
var replaceWholeValueOnPaste = (event) => event.currentTarget.setSelectionRange(0, event.currentTarget.value.length);
|
|
12
|
+
function OTPSlot({ char, isActive, hasFakeCaret, size, invalid, disabled }) {
|
|
13
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
14
|
+
"data-slot": "input-otp-slot",
|
|
15
|
+
"data-size": size,
|
|
16
|
+
"data-active": isActive ? "" : void 0,
|
|
17
|
+
"data-invalid": invalid ? "" : void 0,
|
|
18
|
+
"data-disabled": disabled ? "" : void 0,
|
|
19
|
+
className: "\n relative flex h-(--control-height) min-w-0 flex-1 items-center justify-center rounded-lg border\n border-neutral-200 bg-white text-(length:--control-text) leading-(--control-leading) text-neutral-950\n transition-colors control\n data-active:border-neutral-950\n data-disabled:bg-neutral-50\n data-invalid:border-error-400\n data-invalid:data-active:border-error-700\n ",
|
|
20
|
+
children: [char, hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute h-1/2 w-px animate-pulse bg-neutral-950 motion-reduce:animate-none" })]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
var InputOTP = React$1.forwardRef(({ className, size = "lg", disabled, "aria-invalid": ariaInvalid, ...props }, ref) => {
|
|
24
|
+
const invalid = isFieldInvalid(void 0, ariaInvalid);
|
|
25
|
+
return /* @__PURE__ */ jsx(OTPInput, {
|
|
26
|
+
...props,
|
|
27
|
+
ref,
|
|
28
|
+
maxLength: OTP_LENGTH,
|
|
29
|
+
pattern: REGEXP_ONLY_DIGITS,
|
|
30
|
+
inputMode: "numeric",
|
|
31
|
+
autoComplete: "one-time-code",
|
|
32
|
+
pushPasswordManagerStrategy: "none",
|
|
33
|
+
pasteTransformer: keepDigits,
|
|
34
|
+
onPasteCapture: replaceWholeValueOnPaste,
|
|
35
|
+
disabled,
|
|
36
|
+
"aria-invalid": invalid || void 0,
|
|
37
|
+
containerClassName: cn("flex w-full items-center gap-2 has-disabled:opacity-50", className),
|
|
38
|
+
render: ({ slots }) => slots.map((slot, index) => /* @__PURE__ */ jsx(OTPSlot, {
|
|
39
|
+
...slot,
|
|
40
|
+
size,
|
|
41
|
+
invalid,
|
|
42
|
+
disabled
|
|
43
|
+
}, index))
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
InputOTP.displayName = "InputOTP";
|
|
47
|
+
//#endregion
|
|
48
|
+
export { InputOTP };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=InputOTP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InputOTP.js","names":["React"],"sources":["../../../../src/components/inputs/InputOTP/InputOTP.tsx"],"sourcesContent":["'use client'\nimport { OTPInput, REGEXP_ONLY_DIGITS, type OTPInputProps, type SlotProps } from 'input-otp'\nimport * as React from 'react'\n\nimport { type ControlSize } from '../Button'\nimport { isFieldInvalid } from '../shared'\n\nimport { cn } from '@/lib/utils'\n\nconst OTP_LENGTH = 6\n\nconst keepDigits = (text: string) => text.replace(/\\D/g, '')\n\nconst replaceWholeValueOnPaste = (event: React.ClipboardEvent<HTMLInputElement>) =>\n event.currentTarget.setSelectionRange(0, event.currentTarget.value.length)\n\nexport type InputOTPProps = Pick<\n OTPInputProps,\n | 'value'\n | 'onChange'\n | 'onComplete'\n | 'onBlur'\n | 'onPaste'\n | 'disabled'\n | 'name'\n | 'id'\n | 'autoFocus'\n | 'aria-invalid'\n | 'aria-describedby'\n> & {\n className?: string\n /**\n * Slot height, same as the other inputs: sm 32px, md 40px, lg 48px (the `--control-height-*` tokens).\n * @default lg\n */\n size?: ControlSize\n}\n\ntype OTPSlotProps = SlotProps & {\n size: ControlSize\n invalid: boolean\n disabled?: boolean\n}\n\nfunction OTPSlot({ char, isActive, hasFakeCaret, size, invalid, disabled }: Readonly<OTPSlotProps>) {\n return (\n <div\n data-slot=\"input-otp-slot\"\n data-size={size}\n data-active={isActive ? '' : undefined}\n data-invalid={invalid ? '' : undefined}\n data-disabled={disabled ? '' : undefined}\n className=\"\n relative flex h-(--control-height) min-w-0 flex-1 items-center justify-center rounded-lg border\n border-neutral-200 bg-white text-(length:--control-text) leading-(--control-leading) text-neutral-950\n transition-colors control\n data-active:border-neutral-950\n data-disabled:bg-neutral-50\n data-invalid:border-error-400\n data-invalid:data-active:border-error-700\n \"\n >\n {char}\n {hasFakeCaret && (\n <div className=\"pointer-events-none absolute h-1/2 w-px animate-pulse bg-neutral-950 motion-reduce:animate-none\" />\n )}\n </div>\n )\n}\n\nconst InputOTP = React.forwardRef<HTMLInputElement, Readonly<InputOTPProps>>(\n ({ className, size = 'lg', disabled, 'aria-invalid': ariaInvalid, ...props }, ref) => {\n const invalid = isFieldInvalid(undefined, ariaInvalid)\n\n return (\n <OTPInput\n {...props}\n ref={ref}\n maxLength={OTP_LENGTH}\n pattern={REGEXP_ONLY_DIGITS}\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n pushPasswordManagerStrategy=\"none\"\n pasteTransformer={keepDigits}\n onPasteCapture={replaceWholeValueOnPaste}\n disabled={disabled}\n aria-invalid={invalid || undefined}\n containerClassName={cn('flex w-full items-center gap-2 has-disabled:opacity-50', className)}\n render={({ slots }) =>\n slots.map((slot, index) => (\n <OTPSlot key={index} {...slot} size={size} invalid={invalid} disabled={disabled} />\n ))\n }\n />\n )\n },\n)\nInputOTP.displayName = 'InputOTP'\n\nexport { InputOTP }\n"],"mappings":";;;;;;;;AASA,IAAA,aAAA;AAEA,IAAA,cAAA,SAAA,KAAA,QAAA,OAAA,EAAA;AAEA,IAAA,4BAAA,UAAA,MAAA,cAAA,kBAAA,GAAA,MAAA,cAAA,MAAA,MAAA;AA+BA,SAAA,QAAA,EAAA,MAAA,UAAA,cAAA,MAAA,SAAA,YAAA;CACE,OAAA,qBAAA,OAAA;EAEI,aAAA;EACA,aAAA;EACA,eAAA,WAAA,KAAA,KAAA;EACA,gBAAA,UAAA,KAAA,KAAA;EACA,iBAAA,WAAA,KAAA,KAAA;EACA,WAAA;EANF,UAAA,CAAA,MAAA,gBAAA,oBAAA,OAAA,EAAA,WAAA,kGAAA,CAAA,CAAA;;AAsBJ;AAEA,IAAA,WAAA,QAAA,YAAA,EAAA,WAAA,OAAA,MAAA,UAAA,gBAAA,aAAA,GAAA,SAAA,QAAA;CAEI,MAAA,UAAA,eAAA,KAAA,GAAA,WAAA;CAEA,OAAA,oBAAA,UAAA;EAEI,GAAA;EACK;EACL,WAAA;EACA,SAAA;EACA,WAAA;EACA,cAAA;EACA,6BAAA;EACA,kBAAA;EACA,gBAAA;EACU;EACV,gBAAA,WAAA,KAAA;EACA,oBAAA,GAAA,0DAAA,SAAA;EACA,SAAA,EAAA,YAAA,MAAA,KAAA,MAAA,UAAA,oBAAA,SAAA;GAEyB,GAAA;GAAgB;GAAe;GAAmB;EAAW,GAAA,KAAA,CAAA;CAGvF,CAAA;AAEL,CAAA;AAEF,SAAA,cAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './InputOTP';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ColorToken } from '../../../lib/utils';
|
|
2
2
|
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
declare const Tabs: React.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
|
+
declare const Tabs: React.ForwardRefExoticComponent<Readonly<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref">> & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {
|
|
6
6
|
fullWidth?: boolean;
|
|
7
7
|
underlined?: boolean;
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import { cn, resolveColor } from "../../../lib/utils.js";
|
|
2
2
|
import { Typography } from "../../data-display/Typography/Typography.js";
|
|
3
|
+
import { useTrackInputModality } from "../../../lib/inputModality.js";
|
|
3
4
|
import { slidingIndicatorProps, useSlidingIndicator } from "../../../lib/useSlidingIndicator.js";
|
|
4
5
|
import * as React$1 from "react";
|
|
5
6
|
import { Slot } from "@radix-ui/react-slot";
|
|
6
7
|
import { jsx } from "react/jsx-runtime";
|
|
7
8
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
8
9
|
//#region src/components/navigation/Tabs/Tabs.tsx
|
|
9
|
-
var Tabs =
|
|
10
|
+
var Tabs = React$1.forwardRef((props, ref) => {
|
|
11
|
+
useTrackInputModality();
|
|
12
|
+
return /* @__PURE__ */ jsx(TabsPrimitive.Root, {
|
|
13
|
+
ref,
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
10
18
|
var TABS_TAB_ITEM_CLASSNAME = `data-[state=active]:text-foreground relative inline-flex shrink-0 items-center justify-center rounded-lg control-md h-(--control-height) px-3 whitespace-nowrap text-neutral-400 transition-colors press-fill hover:bg-neutral-50 [--focus-ring-offset:-2px] disabled:pointer-events-none disabled:opacity-50 data-[state=active]:hover:bg-transparent data-[state=active]:pointer-coarse:active:bg-transparent`;
|
|
11
19
|
var TAB_INDICATOR_INSET = 2;
|
|
12
20
|
function measureTab(active) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabs.js","names":["React"],"sources":["../../../../src/components/navigation/Tabs/Tabs.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport * as React from 'react'\n\nimport { Typography } from '../../data-display/Typography'\n\nimport { useSlidingIndicator, slidingIndicatorProps } from '@/lib/useSlidingIndicator'\nimport { cn, resolveColor, type ColorToken } from '@/lib/utils'\n\nconst Tabs = TabsPrimitive.Root\n\nconst TABS_TAB_ITEM_CLASSNAME = `data-[state=active]:text-foreground relative inline-flex shrink-0 items-center justify-center rounded-lg control-md h-(--control-height) px-3 whitespace-nowrap text-neutral-400 transition-colors press-fill hover:bg-neutral-50 [--focus-ring-offset:-2px] disabled:pointer-events-none disabled:opacity-50 data-[state=active]:hover:bg-transparent data-[state=active]:pointer-coarse:active:bg-transparent`\n\nconst TAB_INDICATOR_INSET = 2\n\nfunction measureTab(active: HTMLElement) {\n const range = document.createRange()\n range.selectNodeContents(active)\n const label = range.getBoundingClientRect()\n const hasLabel = label.width > 0\n const labelLeft = hasLabel ? label.left - active.getBoundingClientRect().left : 0\n const labelWidth = hasLabel ? label.width : active.offsetWidth\n const raw = active.style.getPropertyValue('--tab-active-color')\n return {\n left: active.offsetLeft + labelLeft + TAB_INDICATOR_INSET,\n width: Math.max(0, labelWidth - TAB_INDICATOR_INSET * 2),\n color: raw === '' ? undefined : raw,\n }\n}\n\nconst TAB_INDICATOR_OPTIONS = {\n activeSelector: '[data-state=active]',\n stateAttribute: 'data-state',\n measure: measureTab,\n}\n\ntype TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {\n fullWidth?: boolean\n underlined?: boolean\n}\n\nconst TabsList = React.forwardRef<React.ComponentRef<typeof TabsPrimitive.List>, Readonly<TabsListProps>>(\n ({ className, fullWidth, underlined, children, style, ...props }, ref) => {\n const listRef = React.useRef<HTMLDivElement>(null)\n React.useImperativeHandle(ref, () => listRef.current as HTMLDivElement, [])\n const indicator = useSlidingIndicator(listRef, TAB_INDICATOR_OPTIONS)\n\n return (\n <TabsPrimitive.List\n ref={listRef}\n {...slidingIndicatorProps(indicator)}\n className={cn(\n `\n relative flex scrollbar-none overflow-x-auto sliding-indicator-horizontal [-ms-overflow-style:none]\n after:absolute after:bottom-0 after:left-0 after:h-0.75 after:w-(--indicator-width)\n after:translate-x-(--indicator-left) after:bg-(--indicator-color)\n [&::-webkit-scrollbar]:hidden\n `,\n fullWidth ? 'w-full *:flex-1' : 'gap-2',\n underlined && 'shadow-[inset_0_-1px_0_var(--color-neutral-100)] *:mb-px',\n className,\n )}\n style={\n {\n '--indicator-left': `${indicator?.left ?? 0}px`,\n '--indicator-width': `${indicator?.width ?? 0}px`,\n '--indicator-color': indicator?.color ?? resolveColor(undefined),\n ...style,\n } as React.CSSProperties\n }\n {...props}\n >\n {children}\n </TabsPrimitive.List>\n )\n },\n)\nTabsList.displayName = TabsPrimitive.List.displayName\n\ntype TabsTriggerProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {\n color?: ColorToken | (string & {})\n}\n\nconst TabsTrigger = React.forwardRef<React.ComponentRef<typeof TabsPrimitive.Trigger>, Readonly<TabsTriggerProps>>(\n ({ className, children, color, style, ...props }, ref) => (\n <TabsPrimitive.Trigger\n asChild\n ref={ref}\n className={cn(TABS_TAB_ITEM_CLASSNAME, className)}\n style={\n {\n '--tab-active-color': resolveColor(color),\n ...style,\n } as React.CSSProperties\n }\n {...props}\n >\n <Typography variant=\"title-md\">{children}</Typography>\n </TabsPrimitive.Trigger>\n ),\n)\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\ntype TabsLinkProps = React.ComponentPropsWithoutRef<'a'> & {\n active?: boolean\n color?: ColorToken | (string & {})\n asChild?: boolean\n}\n\nconst TabsLink = React.forwardRef<HTMLAnchorElement, Readonly<TabsLinkProps>>(\n ({ className, children, color, style, active = false, asChild, ...props }, ref) => {\n const Comp = asChild ? Slot : 'a'\n\n return (\n <Comp\n ref={ref}\n data-state={active ? 'active' : 'inactive'}\n aria-current={active ? 'page' : undefined}\n className={cn(TABS_TAB_ITEM_CLASSNAME, className)}\n style={\n {\n '--tab-active-color': resolveColor(color),\n ...style,\n } as React.CSSProperties\n }\n {...props}\n >\n {asChild ? children : <Typography variant=\"title-md\">{children}</Typography>}\n </Comp>\n )\n },\n)\nTabsLink.displayName = 'TabsLink'\n\nconst TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n Readonly<React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(`mt-2`, className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsLink, TabsContent }\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tabs.js","names":["React"],"sources":["../../../../src/components/navigation/Tabs/Tabs.tsx"],"sourcesContent":["import { Slot } from '@radix-ui/react-slot'\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport * as React from 'react'\n\nimport { Typography } from '../../data-display/Typography'\n\nimport { useTrackInputModality } from '@/lib/inputModality'\nimport { useSlidingIndicator, slidingIndicatorProps } from '@/lib/useSlidingIndicator'\nimport { cn, resolveColor, type ColorToken } from '@/lib/utils'\n\nconst Tabs = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Root>,\n Readonly<React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>>\n>((props, ref) => {\n useTrackInputModality()\n\n return <TabsPrimitive.Root ref={ref} {...props} />\n})\nTabs.displayName = TabsPrimitive.Root.displayName\n\nconst TABS_TAB_ITEM_CLASSNAME = `data-[state=active]:text-foreground relative inline-flex shrink-0 items-center justify-center rounded-lg control-md h-(--control-height) px-3 whitespace-nowrap text-neutral-400 transition-colors press-fill hover:bg-neutral-50 [--focus-ring-offset:-2px] disabled:pointer-events-none disabled:opacity-50 data-[state=active]:hover:bg-transparent data-[state=active]:pointer-coarse:active:bg-transparent`\n\nconst TAB_INDICATOR_INSET = 2\n\nfunction measureTab(active: HTMLElement) {\n const range = document.createRange()\n range.selectNodeContents(active)\n const label = range.getBoundingClientRect()\n const hasLabel = label.width > 0\n const labelLeft = hasLabel ? label.left - active.getBoundingClientRect().left : 0\n const labelWidth = hasLabel ? label.width : active.offsetWidth\n const raw = active.style.getPropertyValue('--tab-active-color')\n return {\n left: active.offsetLeft + labelLeft + TAB_INDICATOR_INSET,\n width: Math.max(0, labelWidth - TAB_INDICATOR_INSET * 2),\n color: raw === '' ? undefined : raw,\n }\n}\n\nconst TAB_INDICATOR_OPTIONS = {\n activeSelector: '[data-state=active]',\n stateAttribute: 'data-state',\n measure: measureTab,\n}\n\ntype TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {\n fullWidth?: boolean\n underlined?: boolean\n}\n\nconst TabsList = React.forwardRef<React.ComponentRef<typeof TabsPrimitive.List>, Readonly<TabsListProps>>(\n ({ className, fullWidth, underlined, children, style, ...props }, ref) => {\n const listRef = React.useRef<HTMLDivElement>(null)\n React.useImperativeHandle(ref, () => listRef.current as HTMLDivElement, [])\n const indicator = useSlidingIndicator(listRef, TAB_INDICATOR_OPTIONS)\n\n return (\n <TabsPrimitive.List\n ref={listRef}\n {...slidingIndicatorProps(indicator)}\n className={cn(\n `\n relative flex scrollbar-none overflow-x-auto sliding-indicator-horizontal [-ms-overflow-style:none]\n after:absolute after:bottom-0 after:left-0 after:h-0.75 after:w-(--indicator-width)\n after:translate-x-(--indicator-left) after:bg-(--indicator-color)\n [&::-webkit-scrollbar]:hidden\n `,\n fullWidth ? 'w-full *:flex-1' : 'gap-2',\n underlined && 'shadow-[inset_0_-1px_0_var(--color-neutral-100)] *:mb-px',\n className,\n )}\n style={\n {\n '--indicator-left': `${indicator?.left ?? 0}px`,\n '--indicator-width': `${indicator?.width ?? 0}px`,\n '--indicator-color': indicator?.color ?? resolveColor(undefined),\n ...style,\n } as React.CSSProperties\n }\n {...props}\n >\n {children}\n </TabsPrimitive.List>\n )\n },\n)\nTabsList.displayName = TabsPrimitive.List.displayName\n\ntype TabsTriggerProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger> & {\n color?: ColorToken | (string & {})\n}\n\nconst TabsTrigger = React.forwardRef<React.ComponentRef<typeof TabsPrimitive.Trigger>, Readonly<TabsTriggerProps>>(\n ({ className, children, color, style, ...props }, ref) => (\n <TabsPrimitive.Trigger\n asChild\n ref={ref}\n className={cn(TABS_TAB_ITEM_CLASSNAME, className)}\n style={\n {\n '--tab-active-color': resolveColor(color),\n ...style,\n } as React.CSSProperties\n }\n {...props}\n >\n <Typography variant=\"title-md\">{children}</Typography>\n </TabsPrimitive.Trigger>\n ),\n)\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\ntype TabsLinkProps = React.ComponentPropsWithoutRef<'a'> & {\n active?: boolean\n color?: ColorToken | (string & {})\n asChild?: boolean\n}\n\nconst TabsLink = React.forwardRef<HTMLAnchorElement, Readonly<TabsLinkProps>>(\n ({ className, children, color, style, active = false, asChild, ...props }, ref) => {\n const Comp = asChild ? Slot : 'a'\n\n return (\n <Comp\n ref={ref}\n data-state={active ? 'active' : 'inactive'}\n aria-current={active ? 'page' : undefined}\n className={cn(TABS_TAB_ITEM_CLASSNAME, className)}\n style={\n {\n '--tab-active-color': resolveColor(color),\n ...style,\n } as React.CSSProperties\n }\n {...props}\n >\n {asChild ? children : <Typography variant=\"title-md\">{children}</Typography>}\n </Comp>\n )\n },\n)\nTabsLink.displayName = 'TabsLink'\n\nconst TabsContent = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Content>,\n Readonly<React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(`mt-2`, className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsLink, TabsContent }\n"],"mappings":";;;;;;;;;AAUA,IAAM,OAAOA,QAAM,YAGhB,OAAO,QAAQ;CAChB,sBAAsB;CAEtB,OAAO,oBAAC,cAAc,MAAf;EAAyB;EAAK,GAAI;CAAQ,CAAA;AACnD,CAAC;AACD,KAAK,cAAc,cAAc,KAAK;AAEtC,IAAM,0BAA0B;AAEhC,IAAM,sBAAsB;AAE5B,SAAS,WAAW,QAAqB;CACvC,MAAM,QAAQ,SAAS,YAAY;CACnC,MAAM,mBAAmB,MAAM;CAC/B,MAAM,QAAQ,MAAM,sBAAsB;CAC1C,MAAM,WAAW,MAAM,QAAQ;CAC/B,MAAM,YAAY,WAAW,MAAM,OAAO,OAAO,sBAAsB,CAAC,CAAC,OAAO;CAChF,MAAM,aAAa,WAAW,MAAM,QAAQ,OAAO;CACnD,MAAM,MAAM,OAAO,MAAM,iBAAiB,oBAAoB;CAC9D,OAAO;EACL,MAAM,OAAO,aAAa,YAAY;EACtC,OAAO,KAAK,IAAI,GAAG,aAAa,CAAuB;EACvD,OAAO,QAAQ,KAAK,KAAA,IAAY;CAClC;AACF;AAEA,IAAM,wBAAwB;CAC5B,gBAAgB;CAChB,gBAAgB;CAChB,SAAS;AACX;AAOA,IAAM,WAAWA,QAAM,YACpB,EAAE,WAAW,WAAW,YAAY,UAAU,OAAO,GAAG,SAAS,QAAQ;CACxE,MAAM,UAAUA,QAAM,OAAuB,IAAI;CACjD,QAAM,oBAAoB,WAAW,QAAQ,SAA2B,CAAC,CAAC;CAC1E,MAAM,YAAY,oBAAoB,SAAS,qBAAqB;CAEpE,OACE,oBAAC,cAAc,MAAf;EACE,KAAK;EACL,GAAI,sBAAsB,SAAS;EACnC,WAAW,GACT;;;;;aAMA,YAAY,oBAAoB,SAChC,cAAc,4DACd,SACF;EACA,OACE;GACE,oBAAoB,GAAG,WAAW,QAAQ,EAAE;GAC5C,qBAAqB,GAAG,WAAW,SAAS,EAAE;GAC9C,qBAAqB,WAAW,SAAS,aAAa,KAAA,CAAS;GAC/D,GAAG;EACL;EAEF,GAAI;EAEH;CACiB,CAAA;AAExB,CACF;AACA,SAAS,cAAc,cAAc,KAAK;AAM1C,IAAM,cAAcA,QAAM,YACvB,EAAE,WAAW,UAAU,OAAO,OAAO,GAAG,SAAS,QAChD,oBAAC,cAAc,SAAf;CACE,SAAA;CACK;CACL,WAAW,GAAG,yBAAyB,SAAS;CAChD,OACE;EACE,sBAAsB,aAAa,KAAK;EACxC,GAAG;CACL;CAEF,GAAI;CAEJ,UAAA,oBAAC,YAAD;EAAY,SAAQ;EAAY;CAAqB,CAAA;AAChC,CAAA,CAE3B;AACA,YAAY,cAAc,cAAc,QAAQ;AAQhD,IAAM,WAAWA,QAAM,YACpB,EAAE,WAAW,UAAU,OAAO,OAAO,SAAS,OAAO,SAAS,GAAG,SAAS,QAAQ;CAGjF,OACE,oBAHW,UAAU,OAAO,KAG5B;EACO;EACL,cAAY,SAAS,WAAW;EAChC,gBAAc,SAAS,SAAS,KAAA;EAChC,WAAW,GAAG,yBAAyB,SAAS;EAChD,OACE;GACE,sBAAsB,aAAa,KAAK;GACxC,GAAG;EACL;EAEF,GAAI;EAEH,UAAA,UAAU,WAAW,oBAAC,YAAD;GAAY,SAAQ;GAAY;EAAqB,CAAA;CACvE,CAAA;AAEV,CACF;AACA,SAAS,cAAc;AAEvB,IAAM,cAAcA,QAAM,YAGvB,EAAE,WAAW,GAAG,SAAS,QAAQ,oBAAC,cAAc,SAAf;CAA4B;CAAK,WAAW,GAAG,QAAQ,SAAS;CAAG,GAAI;AAAQ,CAAA,CAAC;AACpH,YAAY,cAAc,cAAc,QAAQ"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './components/inputs/Form';
|
|
|
10
10
|
export * from './components/inputs/InlineMultiSelect';
|
|
11
11
|
export * from './components/inputs/Input';
|
|
12
12
|
export * from './components/inputs/InputDate';
|
|
13
|
+
export * from './components/inputs/InputOTP';
|
|
13
14
|
export * from './components/inputs/LazyDatePicker';
|
|
14
15
|
export * from './components/inputs/MultiSelect';
|
|
15
16
|
export * from './components/inputs/PhoneInput';
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, For
|
|
|
21
21
|
import { InlineMultiSelect } from "./components/inputs/InlineMultiSelect/InlineMultiSelect.js";
|
|
22
22
|
import { Input } from "./components/inputs/Input/Input.js";
|
|
23
23
|
import { InputDate } from "./components/inputs/InputDate/InputDate.js";
|
|
24
|
+
import { InputOTP } from "./components/inputs/InputOTP/InputOTP.js";
|
|
24
25
|
import { LazyDatePicker } from "./components/inputs/LazyDatePicker/LazyDatePicker.js";
|
|
25
26
|
import { Chip, chipVariants } from "./components/data-display/Chip/Chip.js";
|
|
26
27
|
import { MultiSelect } from "./components/inputs/MultiSelect/MultiSelect.js";
|
|
@@ -57,4 +58,4 @@ import { SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, Si
|
|
|
57
58
|
import { SidebarInset, SidebarPageContent, SidebarPageHeader } from "./components/navigation/Sidebar/SidebarPage.js";
|
|
58
59
|
import { SidebarUser, SidebarUserMenuContent, SidebarUserMenuItem, SidebarUserMenuLabel, SidebarUserMenuRadioGroup, SidebarUserMenuRadioItem, SidebarUserMenuSeparator, SidebarUserMenuSubContent, SidebarUserMenuSubTrigger } from "./components/navigation/Sidebar/SidebarUser.js";
|
|
59
60
|
import { Tabs, TabsContent, TabsLink, TabsList, TabsTrigger } from "./components/navigation/Tabs/Tabs.js";
|
|
60
|
-
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbRoot, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardMedia, Carousel, CarouselContent, CarouselContext, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Chip, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, Combobox, ComboboxOptionWithTooltip, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CountrySelect, DataTable, DataTableToolbarButton, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Flag, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, InlineMultiSelect, Input, InputDate, Label, LazyDatePicker, Marquee, MultiSelect, NavigationBreadcrumb, NotificationBadge, PagesBreadcrumb, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PaginationRoot, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetRoot, SheetTitle, SheetTrigger, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarHeaderTrigger, SidebarInput, SidebarInset, SidebarLogo, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuCollapsible, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarPageContent, SidebarPageHeader, SidebarProvider, SidebarRoot, SidebarSeparator, SidebarTrigger, SidebarUser, SidebarUserMenuContent, SidebarUserMenuItem, SidebarUserMenuLabel, SidebarUserMenuRadioGroup, SidebarUserMenuRadioItem, SidebarUserMenuSeparator, SidebarUserMenuSubContent, SidebarUserMenuSubTrigger, Skeleton, StarRating, StaticComboboxList, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsLink, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TruncatedTypographyWithTooltip, Typography, VirtualizedComboboxList, badgeVariants, buttonVariants, chipVariants, flagVariants, isValidPhone, isoFromDialCode, notificationBadgeVariants, sidebarGroupActionVariants, sidebarGroupLabelVariants, sidebarMenuActionVariants, sidebarMenuBadgeVariants, sidebarMenuButtonVariants, sidebarMenuSubButtonVariants, sidebarMenuSubVariants, splitE164, toast, toggleVariants, typographyVariants, useCombobox, useFormField, useSidebar };
|
|
61
|
+
export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbRoot, BreadcrumbSeparator, Button, Calendar, Card, CardContent, CardMedia, Carousel, CarouselContent, CarouselContext, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, Chip, CollapsibleContent, CollapsibleRoot, CollapsibleTrigger, Combobox, ComboboxOptionWithTooltip, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, CountrySelect, DataTable, DataTableToolbarButton, DatePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Flag, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, InlineMultiSelect, Input, InputDate, InputOTP, Label, LazyDatePicker, Marquee, MultiSelect, NavigationBreadcrumb, NotificationBadge, PagesBreadcrumb, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PaginationRoot, PhoneInput, Popover, PopoverAnchor, PopoverContent, PopoverRoot, PopoverTrigger, Progress, RadioGroup, RadioGroupItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetOverlay, SheetPortal, SheetRoot, SheetTitle, SheetTrigger, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarHeaderTrigger, SidebarInput, SidebarInset, SidebarLogo, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuCollapsible, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarPageContent, SidebarPageHeader, SidebarProvider, SidebarRoot, SidebarSeparator, SidebarTrigger, SidebarUser, SidebarUserMenuContent, SidebarUserMenuItem, SidebarUserMenuLabel, SidebarUserMenuRadioGroup, SidebarUserMenuRadioItem, SidebarUserMenuSeparator, SidebarUserMenuSubContent, SidebarUserMenuSubTrigger, Skeleton, StarRating, StaticComboboxList, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsLink, TabsList, TabsTrigger, Textarea, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, TruncatedTypographyWithTooltip, Typography, VirtualizedComboboxList, badgeVariants, buttonVariants, chipVariants, flagVariants, isValidPhone, isoFromDialCode, notificationBadgeVariants, sidebarGroupActionVariants, sidebarGroupLabelVariants, sidebarMenuActionVariants, sidebarMenuBadgeVariants, sidebarMenuButtonVariants, sidebarMenuSubButtonVariants, sidebarMenuSubVariants, splitE164, toast, toggleVariants, typographyVariants, useCombobox, useFormField, useSidebar };
|
package/dist/theme.css
CHANGED
|
@@ -262,7 +262,13 @@
|
|
|
262
262
|
}
|
|
263
263
|
|
|
264
264
|
[data-input-modality='pointer']
|
|
265
|
-
:is(
|
|
265
|
+
:is(
|
|
266
|
+
[role='menuitem'],
|
|
267
|
+
[role='menuitemcheckbox'],
|
|
268
|
+
[role='menuitemradio'],
|
|
269
|
+
[role='option'],
|
|
270
|
+
[role='tab']
|
|
271
|
+
):focus-visible {
|
|
266
272
|
outline-style: none;
|
|
267
273
|
}
|
|
268
274
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "periplo-ui",
|
|
3
3
|
"description": "IATI UI library",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.23.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|
|
@@ -108,6 +108,10 @@
|
|
|
108
108
|
"types": "./dist/components/inputs/InputDate/index.d.ts",
|
|
109
109
|
"import": "./dist/components/inputs/InputDate/index.js"
|
|
110
110
|
},
|
|
111
|
+
"./input-otp": {
|
|
112
|
+
"types": "./dist/components/inputs/InputOTP/index.d.ts",
|
|
113
|
+
"import": "./dist/components/inputs/InputOTP/index.js"
|
|
114
|
+
},
|
|
111
115
|
"./label": {
|
|
112
116
|
"types": "./dist/components/data-display/Label/index.d.ts",
|
|
113
117
|
"import": "./dist/components/data-display/Label/index.js"
|
|
@@ -333,6 +337,7 @@
|
|
|
333
337
|
"eslint-plugin-testing-library": "7.16.2",
|
|
334
338
|
"glob": "13.0.6",
|
|
335
339
|
"husky": "9.1.7",
|
|
340
|
+
"input-otp": "1.5.0",
|
|
336
341
|
"jsdom": "30.1.1",
|
|
337
342
|
"lint-staged": "17.6.0",
|
|
338
343
|
"postcss": "8.5.28",
|
|
@@ -384,6 +389,7 @@
|
|
|
384
389
|
"country-flag-icons": "^1.6.20",
|
|
385
390
|
"date-fns": "^4.4.0",
|
|
386
391
|
"embla-carousel-react": "^8.6.0",
|
|
392
|
+
"input-otp": "^1.5.0",
|
|
387
393
|
"libphonenumber-js": "^1.13.14",
|
|
388
394
|
"react-aria": "^3.52.1",
|
|
389
395
|
"react-aria-components": "^1.21.1",
|