@platned/ui 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -0
- package/dist/index.cjs +1351 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +293 -0
- package/dist/index.d.ts +293 -0
- package/dist/index.js +1284 -0
- package/dist/index.js.map +1 -0
- package/dist/sidebar.cjs +402 -0
- package/dist/sidebar.cjs.map +1 -0
- package/dist/sidebar.d.cts +13 -0
- package/dist/sidebar.d.ts +13 -0
- package/dist/sidebar.js +367 -0
- package/dist/sidebar.js.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +69 -0
- package/tailwind-preset.js +77 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ButtonHTMLAttributes, ReactNode, InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes } from 'react';
|
|
3
|
+
|
|
4
|
+
type ButtonVariant = 'primary' | 'neutral' | 'subtle' | 'danger' | 'danger-subtle';
|
|
5
|
+
type ButtonSize = 'lg' | 'md' | 'sm';
|
|
6
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
variant?: ButtonVariant;
|
|
8
|
+
size?: ButtonSize;
|
|
9
|
+
leadingIcon?: ReactNode;
|
|
10
|
+
trailingIcon?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function Button({ variant, size, leadingIcon, trailingIcon, children, className, ...props }: ButtonProps): react.JSX.Element;
|
|
13
|
+
|
|
14
|
+
type IconButtonVariant = 'primary' | 'neutral' | 'subtle';
|
|
15
|
+
interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
16
|
+
variant?: IconButtonVariant;
|
|
17
|
+
size?: ButtonSize;
|
|
18
|
+
/** Required for accessibility — no visible text label */
|
|
19
|
+
'aria-label': string;
|
|
20
|
+
icon: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare function IconButton({ variant, size, icon, className, ...props }: IconButtonProps): react.JSX.Element;
|
|
23
|
+
|
|
24
|
+
type ButtonGroupVariant = 'primary' | 'neutral' | 'filter';
|
|
25
|
+
type ButtonGroupAlign = 'justify' | 'start' | 'end' | 'center' | 'stack';
|
|
26
|
+
interface ButtonGroupItem {
|
|
27
|
+
value: string;
|
|
28
|
+
label: ReactNode;
|
|
29
|
+
leadingIcon?: ReactNode;
|
|
30
|
+
trailingIcon?: ReactNode;
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
interface ButtonGroupProps {
|
|
34
|
+
items: ButtonGroupItem[];
|
|
35
|
+
value: string;
|
|
36
|
+
onChange: (value: string) => void;
|
|
37
|
+
variant?: ButtonGroupVariant;
|
|
38
|
+
size?: ButtonSize;
|
|
39
|
+
align?: ButtonGroupAlign;
|
|
40
|
+
/** Forwarded to the container as aria-label */
|
|
41
|
+
'aria-label'?: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
declare function ButtonGroup({ items, value, onChange, variant, size, align, className, 'aria-label': ariaLabel, }: ButtonGroupProps): react.JSX.Element;
|
|
45
|
+
|
|
46
|
+
type AvatarSize = 'sm' | 'md' | 'lg';
|
|
47
|
+
type AvatarShape = 'circle' | 'square';
|
|
48
|
+
interface AvatarInitialProps {
|
|
49
|
+
type?: 'initial';
|
|
50
|
+
/** Single character — Figma spec: one letter only to avoid overflow */
|
|
51
|
+
initial: string;
|
|
52
|
+
size?: AvatarSize;
|
|
53
|
+
shape?: AvatarShape;
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
interface AvatarImageProps {
|
|
57
|
+
type: 'image';
|
|
58
|
+
src: string;
|
|
59
|
+
alt?: string;
|
|
60
|
+
size?: AvatarSize;
|
|
61
|
+
shape?: AvatarShape;
|
|
62
|
+
className?: string;
|
|
63
|
+
}
|
|
64
|
+
type AvatarProps = AvatarInitialProps | AvatarImageProps;
|
|
65
|
+
declare function Avatar(props: AvatarProps): react.JSX.Element;
|
|
66
|
+
|
|
67
|
+
type AvatarGroupSpacing = 'spaced' | 'overlap';
|
|
68
|
+
interface AvatarGroupProps {
|
|
69
|
+
children: ReactNode;
|
|
70
|
+
/** Number shown in the overflow badge — omit to hide the badge */
|
|
71
|
+
overflow?: number;
|
|
72
|
+
spacing?: AvatarGroupSpacing;
|
|
73
|
+
className?: string;
|
|
74
|
+
}
|
|
75
|
+
declare function AvatarGroup({ children, overflow, spacing, className, }: AvatarGroupProps): react.JSX.Element;
|
|
76
|
+
|
|
77
|
+
interface NavItemProps {
|
|
78
|
+
icon?: ReactNode;
|
|
79
|
+
label: string;
|
|
80
|
+
isActive?: boolean;
|
|
81
|
+
/** Red indicator dot at top-right corner (e.g. unread count) */
|
|
82
|
+
indicator?: boolean;
|
|
83
|
+
/** Collapsed mode — icon only, label hidden */
|
|
84
|
+
collapsed?: boolean;
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
87
|
+
declare function NavItem({ icon, label, isActive, indicator, collapsed, className, }: NavItemProps): react.JSX.Element;
|
|
88
|
+
|
|
89
|
+
type InputSize = 'lg' | 'md' | 'sm';
|
|
90
|
+
interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
91
|
+
label?: string;
|
|
92
|
+
description?: string;
|
|
93
|
+
/** Red border + message shown below the input */
|
|
94
|
+
error?: string;
|
|
95
|
+
/** Neutral helper text shown below the input (hidden when error is set) */
|
|
96
|
+
hint?: string;
|
|
97
|
+
size?: InputSize;
|
|
98
|
+
leadingIcon?: ReactNode;
|
|
99
|
+
trailingIcon?: ReactNode;
|
|
100
|
+
}
|
|
101
|
+
declare const Input: react.ForwardRefExoticComponent<InputProps & react.RefAttributes<HTMLInputElement>>;
|
|
102
|
+
|
|
103
|
+
interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
104
|
+
label?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
error?: string;
|
|
107
|
+
hint?: string;
|
|
108
|
+
size?: InputSize;
|
|
109
|
+
}
|
|
110
|
+
declare const Textarea: react.ForwardRefExoticComponent<TextareaProps & react.RefAttributes<HTMLTextAreaElement>>;
|
|
111
|
+
|
|
112
|
+
interface SelectOption {
|
|
113
|
+
value: string;
|
|
114
|
+
label: string;
|
|
115
|
+
}
|
|
116
|
+
interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'size'> {
|
|
117
|
+
label?: string;
|
|
118
|
+
description?: string;
|
|
119
|
+
error?: string;
|
|
120
|
+
hint?: string;
|
|
121
|
+
size?: InputSize;
|
|
122
|
+
options: SelectOption[];
|
|
123
|
+
placeholder?: string;
|
|
124
|
+
}
|
|
125
|
+
declare const Select: react.ForwardRefExoticComponent<SelectProps & react.RefAttributes<HTMLSelectElement>>;
|
|
126
|
+
|
|
127
|
+
type StepStatus = 'complete' | 'active' | 'upcoming';
|
|
128
|
+
interface StepItem {
|
|
129
|
+
label: string;
|
|
130
|
+
status: StepStatus;
|
|
131
|
+
}
|
|
132
|
+
interface StepperProps {
|
|
133
|
+
steps: StepItem[];
|
|
134
|
+
className?: string;
|
|
135
|
+
}
|
|
136
|
+
declare function Stepper({ steps, className }: StepperProps): react.JSX.Element;
|
|
137
|
+
|
|
138
|
+
interface MultiSelectCardProps {
|
|
139
|
+
icon: ReactNode;
|
|
140
|
+
title: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
selected: boolean;
|
|
143
|
+
onToggle: () => void;
|
|
144
|
+
className?: string;
|
|
145
|
+
}
|
|
146
|
+
declare function MultiSelectCard({ icon, title, description, selected, onToggle, className, }: MultiSelectCardProps): react.JSX.Element;
|
|
147
|
+
|
|
148
|
+
interface ColumnDef<T> {
|
|
149
|
+
key: string;
|
|
150
|
+
header: string;
|
|
151
|
+
/** CSS width value — e.g. "320px", "10rem". When grow is true, acts as min-width. */
|
|
152
|
+
width: string;
|
|
153
|
+
/** When true the column fills remaining row width; width becomes a min-width floor. */
|
|
154
|
+
grow?: boolean;
|
|
155
|
+
render: (row: T) => ReactNode;
|
|
156
|
+
}
|
|
157
|
+
declare function DataTable<T>({ columns, rows, getRowKey, className, onRowClick, }: {
|
|
158
|
+
columns: ColumnDef<T>[];
|
|
159
|
+
rows: T[];
|
|
160
|
+
getRowKey: (row: T, index: number) => React.Key;
|
|
161
|
+
className?: string;
|
|
162
|
+
onRowClick?: (row: T) => void;
|
|
163
|
+
}): react.JSX.Element;
|
|
164
|
+
/** Primary bold text + optional muted subtitle — for lead entity/name cells */
|
|
165
|
+
declare function TableCellLeadText({ primary, secondary, }: {
|
|
166
|
+
primary: string;
|
|
167
|
+
secondary?: string;
|
|
168
|
+
}): react.JSX.Element;
|
|
169
|
+
/** Plain text cell — muted (secondary) by default, pass muted=false for primary colour */
|
|
170
|
+
declare function TableCellText({ children, muted, }: {
|
|
171
|
+
children: ReactNode;
|
|
172
|
+
muted?: boolean;
|
|
173
|
+
}): react.JSX.Element;
|
|
174
|
+
/** Small outlined chip — Supplier / Customer, entity type labels etc. */
|
|
175
|
+
declare function TableCellBadge({ label }: {
|
|
176
|
+
label: string;
|
|
177
|
+
}): react.JSX.Element;
|
|
178
|
+
/** Coloured pill with a leading dot — pass explicit colours for full design-system flexibility */
|
|
179
|
+
declare function TableCellStatusPill({ label, dotColor, backgroundColor, textColor, }: {
|
|
180
|
+
label: string;
|
|
181
|
+
dotColor: string;
|
|
182
|
+
backgroundColor: string;
|
|
183
|
+
textColor: string;
|
|
184
|
+
}): react.JSX.Element;
|
|
185
|
+
/** Mini horizontal progress bar with a percentage label below */
|
|
186
|
+
declare function TableCellProgress({ percent, barColor, }: {
|
|
187
|
+
percent: number;
|
|
188
|
+
barColor?: string;
|
|
189
|
+
}): react.JSX.Element;
|
|
190
|
+
|
|
191
|
+
interface StatTileProps {
|
|
192
|
+
label: string;
|
|
193
|
+
value: string | number;
|
|
194
|
+
dotColor?: string;
|
|
195
|
+
className?: string;
|
|
196
|
+
}
|
|
197
|
+
declare function StatTile({ label, value, dotColor, className }: StatTileProps): react.JSX.Element;
|
|
198
|
+
|
|
199
|
+
interface ToggleProps {
|
|
200
|
+
checked: boolean;
|
|
201
|
+
onChange: (checked: boolean) => void;
|
|
202
|
+
label?: string;
|
|
203
|
+
disabled?: boolean;
|
|
204
|
+
}
|
|
205
|
+
declare function Toggle({ checked, onChange, label, disabled }: ToggleProps): react.JSX.Element;
|
|
206
|
+
|
|
207
|
+
interface FileDropZoneProps {
|
|
208
|
+
className?: string;
|
|
209
|
+
}
|
|
210
|
+
declare function FileDropZone({ className }: FileDropZoneProps): react.JSX.Element;
|
|
211
|
+
|
|
212
|
+
declare function FormCard({ children, className, }: {
|
|
213
|
+
children: ReactNode;
|
|
214
|
+
className?: string;
|
|
215
|
+
}): react.JSX.Element;
|
|
216
|
+
interface FormCardHeaderProps {
|
|
217
|
+
title: string;
|
|
218
|
+
subtitle?: string;
|
|
219
|
+
}
|
|
220
|
+
declare function FormCardHeader({ title, subtitle }: FormCardHeaderProps): react.JSX.Element;
|
|
221
|
+
interface FormCardFooterProps {
|
|
222
|
+
onSaveDraft?: () => void;
|
|
223
|
+
onBack?: () => void;
|
|
224
|
+
onContinue?: () => void;
|
|
225
|
+
continueLabel?: string;
|
|
226
|
+
backDisabled?: boolean;
|
|
227
|
+
}
|
|
228
|
+
declare function FormCardFooter({ onSaveDraft, onBack, onContinue, continueLabel, backDisabled, }: FormCardFooterProps): react.JSX.Element;
|
|
229
|
+
|
|
230
|
+
type DocumentStatus = 'uploaded' | 'under-review' | 'processing' | 'missing' | 'not-provided';
|
|
231
|
+
interface DocumentRowProps {
|
|
232
|
+
title: string;
|
|
233
|
+
required: boolean;
|
|
234
|
+
description: string;
|
|
235
|
+
status: DocumentStatus;
|
|
236
|
+
fileName?: string;
|
|
237
|
+
fileSize?: string;
|
|
238
|
+
fileType?: string;
|
|
239
|
+
}
|
|
240
|
+
declare function DocumentRow({ title, required, description, status, fileName, fileSize, fileType, }: DocumentRowProps): react.JSX.Element;
|
|
241
|
+
|
|
242
|
+
interface ModalProps {
|
|
243
|
+
isOpen: boolean;
|
|
244
|
+
onClose: () => void;
|
|
245
|
+
title: string;
|
|
246
|
+
subtitle?: string;
|
|
247
|
+
children: ReactNode;
|
|
248
|
+
footer?: ReactNode;
|
|
249
|
+
maxWidth?: string;
|
|
250
|
+
}
|
|
251
|
+
declare function Modal({ isOpen, onClose, title, subtitle, children, footer, maxWidth }: ModalProps): react.JSX.Element | null;
|
|
252
|
+
|
|
253
|
+
interface RoleBadgeProps {
|
|
254
|
+
role: string;
|
|
255
|
+
size?: 'sm' | 'md';
|
|
256
|
+
}
|
|
257
|
+
declare function RoleBadge({ role, size }: RoleBadgeProps): react.JSX.Element;
|
|
258
|
+
|
|
259
|
+
interface RoleOption {
|
|
260
|
+
role: string;
|
|
261
|
+
description: string;
|
|
262
|
+
}
|
|
263
|
+
declare const ROLE_COMBO_OPTIONS: RoleOption[];
|
|
264
|
+
interface RoleComboBoxProps {
|
|
265
|
+
value: string;
|
|
266
|
+
onChange: (role: string) => void;
|
|
267
|
+
options?: RoleOption[];
|
|
268
|
+
}
|
|
269
|
+
declare function RoleComboBox({ value, onChange, options }: RoleComboBoxProps): react.JSX.Element;
|
|
270
|
+
|
|
271
|
+
declare function Panel({ children, className }: {
|
|
272
|
+
children: ReactNode;
|
|
273
|
+
className?: string;
|
|
274
|
+
}): react.JSX.Element;
|
|
275
|
+
declare function MetricCard({ label, value, tone }: {
|
|
276
|
+
label: string;
|
|
277
|
+
value: string | number;
|
|
278
|
+
tone?: 'default' | 'signal' | 'ember' | 'moss';
|
|
279
|
+
}): react.JSX.Element;
|
|
280
|
+
declare function SeverityBadge({ severity }: {
|
|
281
|
+
severity?: string | null;
|
|
282
|
+
}): react.JSX.Element;
|
|
283
|
+
declare function SentimentBadge({ sentiment }: {
|
|
284
|
+
sentiment?: string | null;
|
|
285
|
+
}): react.JSX.Element;
|
|
286
|
+
|
|
287
|
+
declare function SectionHeading({ eyebrow, title, detail }: {
|
|
288
|
+
eyebrow: string;
|
|
289
|
+
title: string;
|
|
290
|
+
detail?: string;
|
|
291
|
+
}): react.JSX.Element;
|
|
292
|
+
|
|
293
|
+
export { Avatar, AvatarGroup, type AvatarGroupProps, type AvatarGroupSpacing, type AvatarImageProps, type AvatarInitialProps, type AvatarProps, type AvatarShape, type AvatarSize, Button, ButtonGroup, type ButtonGroupAlign, type ButtonGroupItem, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonSize, type ButtonVariant, type ColumnDef, DataTable, DocumentRow, type DocumentRowProps, type DocumentStatus, FileDropZone, type FileDropZoneProps, FormCard, FormCardFooter, type FormCardFooterProps, FormCardHeader, type FormCardHeaderProps, IconButton, type IconButtonProps, type IconButtonVariant, Input, type InputProps, type InputSize, MetricCard, Modal, type ModalProps, MultiSelectCard, type MultiSelectCardProps, NavItem, type NavItemProps, Panel, ROLE_COMBO_OPTIONS, RoleBadge, type RoleBadgeProps, RoleComboBox, type RoleComboBoxProps, type RoleOption, SectionHeading, Select, type SelectOption, type SelectProps, SentimentBadge, SeverityBadge, StatTile, type StatTileProps, type StepItem, type StepStatus, Stepper, type StepperProps, TableCellBadge, TableCellLeadText, TableCellProgress, TableCellStatusPill, TableCellText, Textarea, type TextareaProps, Toggle, type ToggleProps };
|