@lateralus-ai/shipping-ui 2.0.0-dev.0 → 2.0.0-dev.10
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/EmptyState.d.ts +1 -1
- package/dist/components/Entry.d.ts +27 -7
- package/dist/components/Modal.d.ts +36 -0
- package/dist/components/Tabs.d.ts +23 -8
- package/dist/components/index.d.ts +3 -2
- package/dist/index.cjs +32 -32
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +4406 -3917
- package/dist/patterns/Search/ResultRow.d.ts +16 -7
- package/dist/patterns/Search/SearchModal.d.ts +84 -2
- package/dist/patterns/Search/index.d.ts +2 -2
- package/dist/primitives/Badge.d.ts +7 -4
- package/dist/primitives/Button.d.ts +17 -8
- package/dist/primitives/button-styles.d.ts +4 -0
- package/dist/primitives/index.d.ts +4 -2
- package/dist/style.css +1 -1
- package/dist/tailwind-theme.d.ts +4 -4
- package/dist/theme-entry-BUK3MJUJ.mjs +261 -0
- package/dist/theme-entry-ygTpGaNC.js +1 -0
- package/dist/theme-entry.d.ts +2 -0
- package/dist/theme.cjs +1 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.esm.js +5 -0
- package/package.json +10 -3
- package/src/components/EmptyState.tsx +2 -2
- package/src/components/Entry.tsx +119 -45
- package/src/components/Modal.tsx +141 -0
- package/src/components/Tabs.tsx +146 -48
- package/src/components/index.ts +43 -13
- package/src/icons/arrow-paths.ts +8 -8
- package/src/icons/chevron-paths.ts +17 -17
- package/src/icons/icons-data.ts +656 -656
- package/src/index.ts +76 -50
- package/src/patterns/Search/ResultRow.tsx +44 -52
- package/src/patterns/Search/SearchModal.tsx +310 -88
- package/src/patterns/Search/index.ts +31 -5
- package/src/patterns/Sidebar/assets/logo-compliance-mark.png +5 -5
- package/src/patterns/Sidebar/assets/logo-compliance-mask.png +13 -13
- package/src/patterns/Sidebar/assets/logo-compliance.svg +17 -17
- package/src/patterns/Sidebar/assets/logo-technical-avatar.svg +17 -17
- package/src/patterns/Sidebar/assets/logo-technical-mark.png +5 -5
- package/src/patterns/Sidebar/assets/logo-technical.svg +16 -16
- package/src/patterns/Skeleton/Skeleton.tsx +56 -57
- package/src/primitives/Badge.tsx +20 -10
- package/src/primitives/Button.tsx +201 -37
- package/src/primitives/button-styles.ts +92 -0
- package/src/primitives/index.ts +7 -2
- package/src/stories/canvases/ButtonsCanvas.tsx +94 -44
- package/src/stories/canvases/ButtonsMatrixCanvas.tsx +8 -7
- package/src/stories/canvases/ContentCanvas.tsx +157 -88
- package/src/stories/canvases/SearchCanvas.tsx +150 -65
- package/src/stories/canvases/figma-buttons-layout.ts +83 -0
- package/src/stories/canvases/helpers.tsx +26 -43
- package/src/stories/components/Buttons.stories.tsx +11 -11
- package/src/stories/components/Chat.stories.tsx +11 -11
- package/src/stories/components/Content.stories.tsx +11 -11
- package/src/stories/components/Core.stories.tsx +11 -11
- package/src/stories/components/DomainForms.stories.tsx +11 -11
- package/src/stories/components/Filters.stories.tsx +11 -11
- package/src/stories/components/Forms.stories.tsx +11 -11
- package/src/stories/components/Icons.stories.tsx +11 -11
- package/src/stories/components/Illustrations.stories.tsx +11 -11
- package/src/stories/components/Library.stories.tsx +11 -11
- package/src/stories/components/Modals.stories.tsx +11 -11
- package/src/stories/components/Report.stories.tsx +11 -11
- package/src/stories/components/ReportLayout.stories.tsx +11 -11
- package/src/stories/components/Search.stories.tsx +11 -11
- package/src/stories/components/Settings.stories.tsx +11 -11
- package/src/stories/components/Ships.stories.tsx +11 -11
- package/src/stories/components/SidebarLayouts.stories.tsx +11 -11
- package/src/stories/components/Skeletons.stories.tsx +11 -11
- package/src/stories/components/Workflows.stories.tsx +11 -11
- package/src/stories/style-guide/Buttons.stories.tsx +11 -11
- package/src/stories/style-guide/ColorTokens.stories.tsx +11 -11
- package/src/stories/style-guide/Colors.stories.tsx +11 -11
- package/src/stories/style-guide/RaiseLevels.stories.tsx +11 -11
- package/src/stories/style-guide/Typography.stories.tsx +11 -11
- package/src/tailwind-theme.ts +4 -4
- package/src/theme-entry.ts +2 -0
- package/tailwind.config.ts +12 -0
package/src/components/Entry.tsx
CHANGED
|
@@ -1,64 +1,138 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
type KeyboardEvent,
|
|
3
|
+
type ReactNode,
|
|
4
|
+
} from "react";
|
|
5
|
+
import { ChatIcon, IssuesIcon, ReportIcon, StatusIcon } from "../icons";
|
|
3
6
|
import { cn } from "../utils/cn";
|
|
4
7
|
|
|
5
|
-
export type
|
|
6
|
-
|
|
8
|
+
export type EntryVariant = "chat" | "issue" | "report";
|
|
9
|
+
/** @deprecated Prefer `EntryVariant`. */
|
|
10
|
+
export type EntryType = EntryVariant;
|
|
11
|
+
export type EntryState = "idle" | "active";
|
|
7
12
|
|
|
8
13
|
export type EntryProps = {
|
|
9
|
-
type
|
|
14
|
+
/** Visual type — drives the default leading icon. */
|
|
15
|
+
variant?: EntryVariant;
|
|
16
|
+
/** @deprecated Use `variant`. */
|
|
17
|
+
type?: EntryVariant;
|
|
10
18
|
state?: EntryState;
|
|
11
|
-
title
|
|
12
|
-
|
|
13
|
-
|
|
19
|
+
title?: ReactNode;
|
|
20
|
+
/** Secondary line — excerpt, metadata, or highlighted query match. */
|
|
21
|
+
subtitle?: ReactNode;
|
|
22
|
+
/** Unread count badge in the title row (Figma red pill). */
|
|
23
|
+
count?: number;
|
|
24
|
+
/** Trailing actions (e.g. ellipsis menu). Shown on hover / when forced. */
|
|
25
|
+
trailing?: ReactNode;
|
|
26
|
+
/** Override the default variant icon. */
|
|
27
|
+
icon?: ReactNode;
|
|
14
28
|
onClick?: () => void;
|
|
15
29
|
className?: string;
|
|
30
|
+
/** @deprecated Use `count` or `trailing`. */
|
|
31
|
+
meta?: ReactNode;
|
|
16
32
|
};
|
|
17
33
|
|
|
18
|
-
const
|
|
19
|
-
chat: <ChatIcon
|
|
20
|
-
issue: <
|
|
34
|
+
const variantIcons: Record<EntryVariant, ReactNode> = {
|
|
35
|
+
chat: <ChatIcon className="size-4" />,
|
|
36
|
+
issue: <StatusIcon className="size-4" />,
|
|
37
|
+
report: <ReportIcon className="size-4" />,
|
|
21
38
|
};
|
|
22
39
|
|
|
40
|
+
/**
|
|
41
|
+
* List entry row — Figma `Entry` (389:10001).
|
|
42
|
+
* Shared by search results and activity lists.
|
|
43
|
+
*
|
|
44
|
+
* Renders a `div` (not `<button>`) so trailing controls can be real buttons
|
|
45
|
+
* without nested-button issues. Whole-row click uses `onClick` + keyboard.
|
|
46
|
+
*/
|
|
23
47
|
export const Entry = ({
|
|
48
|
+
variant,
|
|
24
49
|
type,
|
|
25
50
|
state = "idle",
|
|
26
|
-
title,
|
|
51
|
+
title = "Title",
|
|
27
52
|
subtitle,
|
|
28
|
-
|
|
53
|
+
count,
|
|
54
|
+
trailing,
|
|
55
|
+
icon,
|
|
29
56
|
onClick,
|
|
30
57
|
className,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
meta,
|
|
59
|
+
}: EntryProps) => {
|
|
60
|
+
const resolvedVariant: EntryVariant = variant ?? type ?? "chat";
|
|
61
|
+
const isInteractive = typeof onClick === "function";
|
|
62
|
+
|
|
63
|
+
const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
|
|
64
|
+
if (!onClick) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
68
|
+
event.preventDefault();
|
|
69
|
+
onClick();
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<div
|
|
75
|
+
role={isInteractive ? "button" : undefined}
|
|
76
|
+
tabIndex={isInteractive ? 0 : undefined}
|
|
77
|
+
data-variant={resolvedVariant}
|
|
78
|
+
data-state={state}
|
|
79
|
+
onClick={onClick}
|
|
80
|
+
onKeyDown={handleKeyDown}
|
|
81
|
+
className={cn(
|
|
82
|
+
"group flex w-full items-center gap-4 rounded-control p-2 text-left transition-colors",
|
|
83
|
+
"hover:bg-[rgba(38,36,32,0.04)]",
|
|
84
|
+
state === "active" && "bg-[rgba(38,36,32,0.04)]",
|
|
85
|
+
isInteractive && "cursor-pointer",
|
|
86
|
+
className,
|
|
56
87
|
)}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
88
|
+
>
|
|
89
|
+
<span className="shrink-0 text-display-on-light-secondary">
|
|
90
|
+
{icon ?? variantIcons[resolvedVariant] ?? (
|
|
91
|
+
<IssuesIcon className="size-4" />
|
|
92
|
+
)}
|
|
93
|
+
</span>
|
|
94
|
+
|
|
95
|
+
<span className="flex min-w-0 flex-1 flex-col">
|
|
96
|
+
<span className="flex min-h-6 w-full items-center gap-4">
|
|
97
|
+
<span className="min-w-0 flex-1 truncate text-caption-1-em text-display-on-light-primary">
|
|
98
|
+
{title}
|
|
99
|
+
</span>
|
|
100
|
+
{typeof count === "number" && count > 0 && (
|
|
101
|
+
<span
|
|
102
|
+
className="inline-flex min-h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-red-600 px-0.5 text-footnote-em text-white"
|
|
103
|
+
aria-label={`${count} unread`}
|
|
104
|
+
>
|
|
105
|
+
{count > 99 ? "99+" : count}
|
|
106
|
+
</span>
|
|
107
|
+
)}
|
|
108
|
+
{meta != null && typeof count !== "number" && (
|
|
109
|
+
<span className="shrink-0 text-footnote text-display-on-light-quaternary">
|
|
110
|
+
{meta}
|
|
111
|
+
</span>
|
|
112
|
+
)}
|
|
113
|
+
</span>
|
|
114
|
+
|
|
115
|
+
{(subtitle != null && subtitle !== false) || trailing ? (
|
|
116
|
+
<span className="flex min-h-6 w-full items-center gap-4">
|
|
117
|
+
{subtitle != null && subtitle !== false ? (
|
|
118
|
+
<span className="min-w-0 flex-1 truncate text-caption-2 text-display-on-light-secondary">
|
|
119
|
+
{subtitle}
|
|
120
|
+
</span>
|
|
121
|
+
) : (
|
|
122
|
+
<span className="min-w-0 flex-1" />
|
|
123
|
+
)}
|
|
124
|
+
{trailing != null && (
|
|
125
|
+
<span
|
|
126
|
+
className="inline-flex size-5 shrink-0 items-center justify-center"
|
|
127
|
+
onClick={(event) => event.stopPropagation()}
|
|
128
|
+
onKeyDown={(event) => event.stopPropagation()}
|
|
129
|
+
>
|
|
130
|
+
{trailing}
|
|
131
|
+
</span>
|
|
132
|
+
)}
|
|
133
|
+
</span>
|
|
134
|
+
) : null}
|
|
61
135
|
</span>
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
+
import {
|
|
3
|
+
forwardRef,
|
|
4
|
+
type ComponentPropsWithoutRef,
|
|
5
|
+
type ElementRef,
|
|
6
|
+
type ReactNode,
|
|
7
|
+
} from "react";
|
|
8
|
+
import { cn } from "../utils/cn";
|
|
9
|
+
|
|
10
|
+
export type ModalProps = ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
|
|
11
|
+
|
|
12
|
+
/** Generic dialog shell — portal, backdrop, focus trap, Escape. */
|
|
13
|
+
export const Modal = DialogPrimitive.Root;
|
|
14
|
+
|
|
15
|
+
export const ModalTrigger = DialogPrimitive.Trigger;
|
|
16
|
+
|
|
17
|
+
export const ModalClose = DialogPrimitive.Close;
|
|
18
|
+
|
|
19
|
+
export type ModalPortalProps = ComponentPropsWithoutRef<
|
|
20
|
+
typeof DialogPrimitive.Portal
|
|
21
|
+
>;
|
|
22
|
+
|
|
23
|
+
export const ModalPortal = DialogPrimitive.Portal;
|
|
24
|
+
|
|
25
|
+
export type ModalOverlayProps = ComponentPropsWithoutRef<
|
|
26
|
+
typeof DialogPrimitive.Overlay
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
/** Dark gray backdrop (app convention; Figma search frames omit overlay). */
|
|
30
|
+
export const ModalOverlay = forwardRef<
|
|
31
|
+
ElementRef<typeof DialogPrimitive.Overlay>,
|
|
32
|
+
ModalOverlayProps
|
|
33
|
+
>(({ className, ...props }, ref) => (
|
|
34
|
+
<DialogPrimitive.Overlay
|
|
35
|
+
ref={ref}
|
|
36
|
+
className={cn(
|
|
37
|
+
"fixed inset-0 z-[999] bg-grey-900/65 transition-opacity",
|
|
38
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in",
|
|
39
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out",
|
|
40
|
+
className,
|
|
41
|
+
)}
|
|
42
|
+
{...props}
|
|
43
|
+
/>
|
|
44
|
+
));
|
|
45
|
+
ModalOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
46
|
+
|
|
47
|
+
export type ModalContentProps = ComponentPropsWithoutRef<
|
|
48
|
+
typeof DialogPrimitive.Content
|
|
49
|
+
> & {
|
|
50
|
+
/** When false, backdrop is omitted. Defaults to true. */
|
|
51
|
+
showOverlay?: boolean;
|
|
52
|
+
overlayClassName?: string;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const ModalContent = forwardRef<
|
|
56
|
+
ElementRef<typeof DialogPrimitive.Content>,
|
|
57
|
+
ModalContentProps
|
|
58
|
+
>(
|
|
59
|
+
(
|
|
60
|
+
{
|
|
61
|
+
className,
|
|
62
|
+
children,
|
|
63
|
+
showOverlay = true,
|
|
64
|
+
overlayClassName,
|
|
65
|
+
...props
|
|
66
|
+
},
|
|
67
|
+
ref,
|
|
68
|
+
) => (
|
|
69
|
+
<ModalPortal>
|
|
70
|
+
{showOverlay && <ModalOverlay className={overlayClassName} />}
|
|
71
|
+
<DialogPrimitive.Content
|
|
72
|
+
ref={ref}
|
|
73
|
+
className={cn(
|
|
74
|
+
"fixed left-1/2 top-1/2 z-[999] w-full max-w-xl -translate-x-1/2 -translate-y-1/2",
|
|
75
|
+
"overflow-hidden rounded-xl border border-divider-primary bg-background-primary shadow-raise3",
|
|
76
|
+
"outline-none",
|
|
77
|
+
"data-[state=open]:animate-in data-[state=open]:fade-in-90",
|
|
78
|
+
"data-[state=closed]:animate-out data-[state=closed]:fade-out",
|
|
79
|
+
className,
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</DialogPrimitive.Content>
|
|
85
|
+
</ModalPortal>
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
ModalContent.displayName = DialogPrimitive.Content.displayName;
|
|
89
|
+
|
|
90
|
+
export type ModalTitleProps = ComponentPropsWithoutRef<
|
|
91
|
+
typeof DialogPrimitive.Title
|
|
92
|
+
>;
|
|
93
|
+
|
|
94
|
+
export const ModalTitle = forwardRef<
|
|
95
|
+
ElementRef<typeof DialogPrimitive.Title>,
|
|
96
|
+
ModalTitleProps
|
|
97
|
+
>(({ className, ...props }, ref) => (
|
|
98
|
+
<DialogPrimitive.Title
|
|
99
|
+
ref={ref}
|
|
100
|
+
className={cn("text-subheader-em text-display-on-light-primary", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
));
|
|
104
|
+
ModalTitle.displayName = DialogPrimitive.Title.displayName;
|
|
105
|
+
|
|
106
|
+
export type ModalDescriptionProps = ComponentPropsWithoutRef<
|
|
107
|
+
typeof DialogPrimitive.Description
|
|
108
|
+
>;
|
|
109
|
+
|
|
110
|
+
export const ModalDescription = forwardRef<
|
|
111
|
+
ElementRef<typeof DialogPrimitive.Description>,
|
|
112
|
+
ModalDescriptionProps
|
|
113
|
+
>(({ className, ...props }, ref) => (
|
|
114
|
+
<DialogPrimitive.Description
|
|
115
|
+
ref={ref}
|
|
116
|
+
className={cn("text-caption-2 text-display-on-light-secondary", className)}
|
|
117
|
+
{...props}
|
|
118
|
+
/>
|
|
119
|
+
));
|
|
120
|
+
ModalDescription.displayName = DialogPrimitive.Description.displayName;
|
|
121
|
+
|
|
122
|
+
export type ModalHeaderSlotProps = {
|
|
123
|
+
children: ReactNode;
|
|
124
|
+
className?: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export const ModalHeaderSlot = ({
|
|
128
|
+
children,
|
|
129
|
+
className,
|
|
130
|
+
}: ModalHeaderSlotProps) => (
|
|
131
|
+
<div className={cn("shrink-0", className)}>{children}</div>
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
export type ModalBodyProps = {
|
|
135
|
+
children: ReactNode;
|
|
136
|
+
className?: string;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export const ModalBody = ({ children, className }: ModalBodyProps) => (
|
|
140
|
+
<div className={cn("min-h-0 overflow-auto", className)}>{children}</div>
|
|
141
|
+
);
|
package/src/components/Tabs.tsx
CHANGED
|
@@ -1,48 +1,146 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
2
|
+
import {
|
|
3
|
+
createContext,
|
|
4
|
+
forwardRef,
|
|
5
|
+
useContext,
|
|
6
|
+
type ComponentPropsWithoutRef,
|
|
7
|
+
type ElementRef,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
} from "react";
|
|
10
|
+
import { cn } from "../utils/cn";
|
|
11
|
+
|
|
12
|
+
export type TabsType = "tabs" | "pills";
|
|
13
|
+
|
|
14
|
+
/** Soft = search filters (filled idle). Solid = workflow shell (ghost idle, blue active). */
|
|
15
|
+
export type TabsAppearance = "soft" | "solid";
|
|
16
|
+
|
|
17
|
+
type TabsContextValue = {
|
|
18
|
+
type: TabsType;
|
|
19
|
+
appearance: TabsAppearance;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const TabsContext = createContext<TabsContextValue>({
|
|
23
|
+
type: "tabs",
|
|
24
|
+
appearance: "soft",
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export type TabsProps = ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & {
|
|
28
|
+
type?: TabsType;
|
|
29
|
+
/** Only applies when `type="pills"`. Defaults to `soft`. */
|
|
30
|
+
appearance?: TabsAppearance;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Tabs = ({
|
|
34
|
+
type = "tabs",
|
|
35
|
+
appearance = "soft",
|
|
36
|
+
className,
|
|
37
|
+
children,
|
|
38
|
+
...props
|
|
39
|
+
}: TabsProps) => (
|
|
40
|
+
<TabsContext.Provider value={{ type, appearance }}>
|
|
41
|
+
<TabsPrimitive.Root
|
|
42
|
+
className={cn("flex flex-col", className)}
|
|
43
|
+
data-type={type}
|
|
44
|
+
data-appearance={type === "pills" ? appearance : undefined}
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
{children}
|
|
48
|
+
</TabsPrimitive.Root>
|
|
49
|
+
</TabsContext.Provider>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export type TabsListProps = ComponentPropsWithoutRef<typeof TabsPrimitive.List>;
|
|
53
|
+
|
|
54
|
+
export const TabsList = forwardRef<
|
|
55
|
+
ElementRef<typeof TabsPrimitive.List>,
|
|
56
|
+
TabsListProps
|
|
57
|
+
>(({ className, ...props }, ref) => {
|
|
58
|
+
const { type } = useContext(TabsContext);
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<TabsPrimitive.List
|
|
62
|
+
ref={ref}
|
|
63
|
+
className={cn(
|
|
64
|
+
"flex items-center",
|
|
65
|
+
type === "tabs" && "gap-6 border-b border-divider-primary",
|
|
66
|
+
type === "pills" && "gap-2",
|
|
67
|
+
className,
|
|
68
|
+
)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
74
|
+
|
|
75
|
+
export type TabsTriggerProps = ComponentPropsWithoutRef<
|
|
76
|
+
typeof TabsPrimitive.Trigger
|
|
77
|
+
> & {
|
|
78
|
+
children: ReactNode;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const TabsTrigger = forwardRef<
|
|
82
|
+
ElementRef<typeof TabsPrimitive.Trigger>,
|
|
83
|
+
TabsTriggerProps
|
|
84
|
+
>(({ className, children, ...props }, ref) => {
|
|
85
|
+
const { type, appearance } = useContext(TabsContext);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<TabsPrimitive.Trigger
|
|
89
|
+
ref={ref}
|
|
90
|
+
className={cn(
|
|
91
|
+
"inline-flex items-center justify-center gap-2.5 transition-colors outline-none",
|
|
92
|
+
"disabled:pointer-events-none disabled:opacity-50",
|
|
93
|
+
type === "tabs" && [
|
|
94
|
+
"relative h-12 gap-2 px-0 py-0 text-caption-2 text-display-on-light-secondary",
|
|
95
|
+
"hover:text-display-on-light-primary",
|
|
96
|
+
"data-[state=active]:text-caption-2-em data-[state=active]:text-display-on-light-primary",
|
|
97
|
+
"data-[state=active]:after:absolute data-[state=active]:after:inset-x-0 data-[state=active]:after:-bottom-px",
|
|
98
|
+
"data-[state=active]:after:h-0.5 data-[state=active]:after:rounded-full data-[state=active]:after:bg-grey-900",
|
|
99
|
+
],
|
|
100
|
+
type === "pills" &&
|
|
101
|
+
appearance === "soft" && [
|
|
102
|
+
"min-h-9 rounded-full px-3 py-1 text-caption-2-em",
|
|
103
|
+
"bg-grey-100 text-display-on-light-secondary",
|
|
104
|
+
"hover:bg-grey-200",
|
|
105
|
+
"data-[state=active]:bg-accent-bg-light data-[state=active]:text-display-on-light-primary",
|
|
106
|
+
],
|
|
107
|
+
type === "pills" &&
|
|
108
|
+
appearance === "solid" && [
|
|
109
|
+
"min-h-9 rounded-full px-3 py-1 text-caption-2-em",
|
|
110
|
+
"bg-transparent text-display-on-light-primary",
|
|
111
|
+
"hover:bg-grey-900/[0.04]",
|
|
112
|
+
"data-[state=active]:bg-blue-600 data-[state=active]:text-white",
|
|
113
|
+
"data-[state=active]:hover:bg-blue-600",
|
|
114
|
+
],
|
|
115
|
+
className,
|
|
116
|
+
)}
|
|
117
|
+
{...props}
|
|
118
|
+
>
|
|
119
|
+
{children}
|
|
120
|
+
</TabsPrimitive.Trigger>
|
|
121
|
+
);
|
|
122
|
+
});
|
|
123
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
124
|
+
|
|
125
|
+
export type TabsContentProps = ComponentPropsWithoutRef<
|
|
126
|
+
typeof TabsPrimitive.Content
|
|
127
|
+
>;
|
|
128
|
+
|
|
129
|
+
export const TabsContent = forwardRef<
|
|
130
|
+
ElementRef<typeof TabsPrimitive.Content>,
|
|
131
|
+
TabsContentProps
|
|
132
|
+
>(({ className, ...props }, ref) => (
|
|
133
|
+
<TabsPrimitive.Content
|
|
134
|
+
ref={ref}
|
|
135
|
+
className={cn("outline-none", className)}
|
|
136
|
+
{...props}
|
|
137
|
+
/>
|
|
138
|
+
));
|
|
139
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
140
|
+
|
|
141
|
+
/** @deprecated Prefer Tabs + TabsTrigger. Kept for Storybook atom demos. */
|
|
142
|
+
export type TabsItem = {
|
|
143
|
+
label: string;
|
|
144
|
+
value?: string;
|
|
145
|
+
count?: number;
|
|
146
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -1,13 +1,43 @@
|
|
|
1
|
-
export { Input, type InputProps, type InputState } from "./Input";
|
|
2
|
-
export { ReportInput, type ReportInputProps, type ReportInputState } from "./ReportInput";
|
|
3
|
-
export { InputType, type InputTypeProps, type InputTypeKind, type InputTypeState } from "./InputType";
|
|
4
|
-
export { Chip, type ChipProps, type ChipVariant } from "./Chip";
|
|
5
|
-
export { Checkbox, type CheckboxProps } from "./Checkbox";
|
|
6
|
-
export { Tab, type TabProps, type TabState } from "./Tab";
|
|
7
|
-
export {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
export { Input, type InputProps, type InputState } from "./Input";
|
|
2
|
+
export { ReportInput, type ReportInputProps, type ReportInputState } from "./ReportInput";
|
|
3
|
+
export { InputType, type InputTypeProps, type InputTypeKind, type InputTypeState } from "./InputType";
|
|
4
|
+
export { Chip, type ChipProps, type ChipVariant } from "./Chip";
|
|
5
|
+
export { Checkbox, type CheckboxProps } from "./Checkbox";
|
|
6
|
+
export { Tab, type TabProps, type TabState } from "./Tab";
|
|
7
|
+
export {
|
|
8
|
+
Tabs,
|
|
9
|
+
TabsList,
|
|
10
|
+
TabsTrigger,
|
|
11
|
+
TabsContent,
|
|
12
|
+
type TabsProps,
|
|
13
|
+
type TabsListProps,
|
|
14
|
+
type TabsTriggerProps,
|
|
15
|
+
type TabsContentProps,
|
|
16
|
+
type TabsItem,
|
|
17
|
+
type TabsType,
|
|
18
|
+
type TabsAppearance,
|
|
19
|
+
} from "./Tabs";
|
|
20
|
+
export { Header, type HeaderProps, type HeaderVariant } from "./Header";
|
|
21
|
+
export { Entry, type EntryProps, type EntryType, type EntryState, type EntryVariant } from "./Entry";
|
|
22
|
+
export { EmptyState, type EmptyStateProps } from "./EmptyState";
|
|
23
|
+
export {
|
|
24
|
+
Modal,
|
|
25
|
+
ModalTrigger,
|
|
26
|
+
ModalClose,
|
|
27
|
+
ModalPortal,
|
|
28
|
+
ModalOverlay,
|
|
29
|
+
ModalContent,
|
|
30
|
+
ModalTitle,
|
|
31
|
+
ModalDescription,
|
|
32
|
+
ModalHeaderSlot,
|
|
33
|
+
ModalBody,
|
|
34
|
+
type ModalProps,
|
|
35
|
+
type ModalOverlayProps,
|
|
36
|
+
type ModalContentProps,
|
|
37
|
+
type ModalTitleProps,
|
|
38
|
+
type ModalDescriptionProps,
|
|
39
|
+
type ModalBodyProps,
|
|
40
|
+
} from "./Modal";
|
|
41
|
+
export { ModalPanel } from "./ModalPanel";
|
|
42
|
+
export * from "./PdfViewer/";
|
|
43
|
+
export * from "./DocumentEditor";
|
package/src/icons/arrow-paths.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export const ARROW_PATHS = {
|
|
2
|
-
left: {
|
|
3
|
-
large: { d: "M10.2217 6.21973C10.5146 5.9271 10.9894 5.92692 11.2822 6.21973C11.5749 6.51254 11.5748 6.98742 11.2822 7.28027L7.56055 11.002H18.2549C18.6688 11.0023 19.0049 11.3379 19.0049 11.752C19.0049 12.166 18.6688 12.5016 18.2549 12.502H7.56055L11.2822 16.2236C11.5748 16.5165 11.5748 16.9914 11.2822 17.2842C10.9894 17.5769 10.5146 17.5768 10.2217 17.2842L5.21973 12.2822C5.16331 12.2258 5.12062 12.1611 5.08594 12.0938C5.07633 12.0751 5.06469 12.0576 5.05664 12.0381C5.04919 12.02 5.04504 12.0009 5.03906 11.9824C5.01544 11.9095 5 11.8327 5 11.752C5 11.6709 5.01525 11.5937 5.03906 11.5205C5.04453 11.5037 5.04801 11.4862 5.05469 11.4697L5.05859 11.46C5.06783 11.4381 5.08061 11.4182 5.0918 11.3975C5.12559 11.3348 5.16683 11.2746 5.21973 11.2217L10.2217 6.21973Z" },
|
|
4
|
-
},
|
|
5
|
-
right: {
|
|
6
|
-
large: { d: "M13.7808 17.282C13.4878 17.5746 13.013 17.5748 12.7202 17.282C12.4276 16.9892 12.4276 16.5143 12.7202 16.2214L16.4419 12.4998L5.74756 12.4998C5.33361 12.4995 4.99756 12.1638 4.99756 11.7498C4.99756 11.3357 5.3336 11.0001 5.74756 10.9998L16.4419 10.9998L12.7202 7.27808C12.4277 6.98524 12.4276 6.51036 12.7202 6.21753C13.013 5.92476 13.4879 5.9249 13.7808 6.21753L18.7827 11.2195C18.8391 11.2759 18.8818 11.3406 18.9165 11.408C18.9261 11.4266 18.9378 11.4441 18.9458 11.4636C18.9533 11.4817 18.9574 11.5008 18.9634 11.5193C18.987 11.5922 19.0024 11.669 19.0024 11.7498C19.0024 11.8309 18.9872 11.908 18.9634 11.9812C18.9579 11.998 18.9544 12.0155 18.9478 12.032L18.9438 12.0417C18.9346 12.0636 18.9218 12.0835 18.9106 12.1042C18.8769 12.1669 18.8356 12.2271 18.7827 12.28L13.7808 17.282Z" },
|
|
7
|
-
},
|
|
8
|
-
} as const;
|
|
1
|
+
export const ARROW_PATHS = {
|
|
2
|
+
left: {
|
|
3
|
+
large: { d: "M10.2217 6.21973C10.5146 5.9271 10.9894 5.92692 11.2822 6.21973C11.5749 6.51254 11.5748 6.98742 11.2822 7.28027L7.56055 11.002H18.2549C18.6688 11.0023 19.0049 11.3379 19.0049 11.752C19.0049 12.166 18.6688 12.5016 18.2549 12.502H7.56055L11.2822 16.2236C11.5748 16.5165 11.5748 16.9914 11.2822 17.2842C10.9894 17.5769 10.5146 17.5768 10.2217 17.2842L5.21973 12.2822C5.16331 12.2258 5.12062 12.1611 5.08594 12.0938C5.07633 12.0751 5.06469 12.0576 5.05664 12.0381C5.04919 12.02 5.04504 12.0009 5.03906 11.9824C5.01544 11.9095 5 11.8327 5 11.752C5 11.6709 5.01525 11.5937 5.03906 11.5205C5.04453 11.5037 5.04801 11.4862 5.05469 11.4697L5.05859 11.46C5.06783 11.4381 5.08061 11.4182 5.0918 11.3975C5.12559 11.3348 5.16683 11.2746 5.21973 11.2217L10.2217 6.21973Z" },
|
|
4
|
+
},
|
|
5
|
+
right: {
|
|
6
|
+
large: { d: "M13.7808 17.282C13.4878 17.5746 13.013 17.5748 12.7202 17.282C12.4276 16.9892 12.4276 16.5143 12.7202 16.2214L16.4419 12.4998L5.74756 12.4998C5.33361 12.4995 4.99756 12.1638 4.99756 11.7498C4.99756 11.3357 5.3336 11.0001 5.74756 10.9998L16.4419 10.9998L12.7202 7.27808C12.4277 6.98524 12.4276 6.51036 12.7202 6.21753C13.013 5.92476 13.4879 5.9249 13.7808 6.21753L18.7827 11.2195C18.8391 11.2759 18.8818 11.3406 18.9165 11.408C18.9261 11.4266 18.9378 11.4441 18.9458 11.4636C18.9533 11.4817 18.9574 11.5008 18.9634 11.5193C18.987 11.5922 19.0024 11.669 19.0024 11.7498C19.0024 11.8309 18.9872 11.908 18.9634 11.9812C18.9579 11.998 18.9544 12.0155 18.9478 12.032L18.9438 12.0417C18.9346 12.0636 18.9218 12.0835 18.9106 12.1042C18.8769 12.1669 18.8356 12.2271 18.7827 12.28L13.7808 17.282Z" },
|
|
7
|
+
},
|
|
8
|
+
} as const;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export const CHEVRON_PATHS = {
|
|
2
|
-
right: {
|
|
3
|
-
small: { d: "M10.9288 7.74314C11.0393 7.92719 11.0213 8.16626 10.8741 8.332L6.87414 12.832C6.69075 13.0383 6.37446 13.0572 6.16809 12.874C5.96185 12.6906 5.94294 12.3743 6.12609 12.1679L9.83117 7.99997L6.12609 3.832C5.94294 3.62563 5.96185 3.30933 6.16809 3.12595C6.37446 2.94274 6.69075 2.96168 6.87414 3.16794L10.8741 7.66794L10.9288 7.74314Z" },
|
|
4
|
-
},
|
|
5
|
-
left: {
|
|
6
|
-
small: { d: "M6.07117 8.25686C5.96073 8.07281 5.97872 7.83374 6.12586 7.668L10.1259 3.168C10.3093 2.96174 10.6255 2.94279 10.8319 3.12601C11.0381 3.30938 11.0571 3.62568 10.8739 3.83206L7.16883 8.00003L10.8739 12.168C11.0571 12.3744 11.0381 12.6907 10.8319 12.8741C10.6255 13.0573 10.3093 13.0383 10.1259 12.8321L6.12586 8.33206L6.07117 8.25686Z" },
|
|
7
|
-
},
|
|
8
|
-
down: {
|
|
9
|
-
small: { d: "M12.168 6.12597C12.3744 5.94274 12.6906 5.96165 12.874 6.16797C13.0572 6.37436 13.0383 6.69063 12.832 6.87402L8.33203 10.874C8.14266 11.0421 7.85733 11.0421 7.66797 10.874L3.16797 6.87402C2.96165 6.69063 2.94274 6.37436 3.12597 6.16797C3.30936 5.96165 3.62563 5.94274 3.83203 6.12597L8 9.83007L12.168 6.12597Z" },
|
|
10
|
-
},
|
|
11
|
-
up: {
|
|
12
|
-
small: { d: "M7.74314 6.07117C7.92719 5.96073 8.16626 5.97872 8.332 6.12586L12.832 10.1259C13.0383 10.3093 13.0572 10.6255 12.874 10.8319C12.6906 11.0381 12.3743 11.0571 12.1679 10.8739L7.99997 7.16883L3.832 10.8739C3.62563 11.0571 3.30933 11.0381 3.12595 10.8319C2.94274 10.6255 2.96168 10.3093 3.16794 10.1259L7.66794 6.12586L7.74314 6.07117Z" },
|
|
13
|
-
},
|
|
14
|
-
upDown: {
|
|
15
|
-
small: { d: "M12.1679 11.1259C12.3743 10.9426 12.6906 10.9615 12.874 11.1679C13.0572 11.3742 13.0383 11.6905 12.832 11.8739L8.332 15.8739C8.14266 16.0419 7.85728 16.0419 7.66794 15.8739L3.16794 11.8739C2.96165 11.6905 2.94278 11.3742 3.12595 11.1679C3.30933 10.9615 3.6256 10.9426 3.832 11.1259L7.99997 14.83L12.1679 11.1259ZM7.74313 0.0711718C7.92719 -0.0392683 8.16625 -0.021282 8.332 0.125859L12.832 4.12586C13.0383 4.30925 13.0572 4.62554 12.874 4.83191C12.6906 5.03814 12.3743 5.05706 12.1679 4.87391L7.99997 1.16883L3.832 4.87391C3.62563 5.05706 3.30932 5.03814 3.12595 4.83191C2.94274 4.62554 2.96168 4.30925 3.16794 4.12586L7.66794 0.125859L7.74313 0.0711718Z" },
|
|
16
|
-
},
|
|
17
|
-
} as const;
|
|
1
|
+
export const CHEVRON_PATHS = {
|
|
2
|
+
right: {
|
|
3
|
+
small: { d: "M10.9288 7.74314C11.0393 7.92719 11.0213 8.16626 10.8741 8.332L6.87414 12.832C6.69075 13.0383 6.37446 13.0572 6.16809 12.874C5.96185 12.6906 5.94294 12.3743 6.12609 12.1679L9.83117 7.99997L6.12609 3.832C5.94294 3.62563 5.96185 3.30933 6.16809 3.12595C6.37446 2.94274 6.69075 2.96168 6.87414 3.16794L10.8741 7.66794L10.9288 7.74314Z" },
|
|
4
|
+
},
|
|
5
|
+
left: {
|
|
6
|
+
small: { d: "M6.07117 8.25686C5.96073 8.07281 5.97872 7.83374 6.12586 7.668L10.1259 3.168C10.3093 2.96174 10.6255 2.94279 10.8319 3.12601C11.0381 3.30938 11.0571 3.62568 10.8739 3.83206L7.16883 8.00003L10.8739 12.168C11.0571 12.3744 11.0381 12.6907 10.8319 12.8741C10.6255 13.0573 10.3093 13.0383 10.1259 12.8321L6.12586 8.33206L6.07117 8.25686Z" },
|
|
7
|
+
},
|
|
8
|
+
down: {
|
|
9
|
+
small: { d: "M12.168 6.12597C12.3744 5.94274 12.6906 5.96165 12.874 6.16797C13.0572 6.37436 13.0383 6.69063 12.832 6.87402L8.33203 10.874C8.14266 11.0421 7.85733 11.0421 7.66797 10.874L3.16797 6.87402C2.96165 6.69063 2.94274 6.37436 3.12597 6.16797C3.30936 5.96165 3.62563 5.94274 3.83203 6.12597L8 9.83007L12.168 6.12597Z" },
|
|
10
|
+
},
|
|
11
|
+
up: {
|
|
12
|
+
small: { d: "M7.74314 6.07117C7.92719 5.96073 8.16626 5.97872 8.332 6.12586L12.832 10.1259C13.0383 10.3093 13.0572 10.6255 12.874 10.8319C12.6906 11.0381 12.3743 11.0571 12.1679 10.8739L7.99997 7.16883L3.832 10.8739C3.62563 11.0571 3.30933 11.0381 3.12595 10.8319C2.94274 10.6255 2.96168 10.3093 3.16794 10.1259L7.66794 6.12586L7.74314 6.07117Z" },
|
|
13
|
+
},
|
|
14
|
+
upDown: {
|
|
15
|
+
small: { d: "M12.1679 11.1259C12.3743 10.9426 12.6906 10.9615 12.874 11.1679C13.0572 11.3742 13.0383 11.6905 12.832 11.8739L8.332 15.8739C8.14266 16.0419 7.85728 16.0419 7.66794 15.8739L3.16794 11.8739C2.96165 11.6905 2.94278 11.3742 3.12595 11.1679C3.30933 10.9615 3.6256 10.9426 3.832 11.1259L7.99997 14.83L12.1679 11.1259ZM7.74313 0.0711718C7.92719 -0.0392683 8.16625 -0.021282 8.332 0.125859L12.832 4.12586C13.0383 4.30925 13.0572 4.62554 12.874 4.83191C12.6906 5.03814 12.3743 5.05706 12.1679 4.87391L7.99997 1.16883L3.832 4.87391C3.62563 5.05706 3.30932 5.03814 3.12595 4.83191C2.94274 4.62554 2.96168 4.30925 3.16794 4.12586L7.66794 0.125859L7.74313 0.0711718Z" },
|
|
16
|
+
},
|
|
17
|
+
} as const;
|