@liiift-studio/mac-os9-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ATTRIBUTION.md +100 -0
- package/LICENSE +50 -0
- package/README.md +243 -0
- package/dist/index.cjs +1625 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +1703 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +1716 -0
- package/dist/index.d.ts +1716 -0
- package/dist/index.js +1561 -0
- package/dist/index.js.map +1 -0
- package/package.json +109 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1561 @@
|
|
|
1
|
+
import React4, { forwardRef, useRef, useEffect, useCallback, useState, Children, isValidElement } from 'react';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
// src/components/Button/Button.module.css
|
|
5
|
+
var Button_default = {};
|
|
6
|
+
var Button = forwardRef(
|
|
7
|
+
(props, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
variant = "default",
|
|
10
|
+
size = "md",
|
|
11
|
+
disabled = false,
|
|
12
|
+
fullWidth = false,
|
|
13
|
+
loading = false,
|
|
14
|
+
loadingText,
|
|
15
|
+
useCursorLoading = false,
|
|
16
|
+
leftIcon,
|
|
17
|
+
rightIcon,
|
|
18
|
+
iconOnly = false,
|
|
19
|
+
ariaLabel,
|
|
20
|
+
ariaDescribedBy,
|
|
21
|
+
ariaPressed,
|
|
22
|
+
className = "",
|
|
23
|
+
children,
|
|
24
|
+
...restProps
|
|
25
|
+
} = props;
|
|
26
|
+
const isLink = props.as === "a";
|
|
27
|
+
const classNames = [
|
|
28
|
+
Button_default.button,
|
|
29
|
+
Button_default[`button--${variant}`],
|
|
30
|
+
Button_default[`button--${size}`],
|
|
31
|
+
fullWidth && Button_default["button--full-width"],
|
|
32
|
+
disabled && Button_default["button--disabled"],
|
|
33
|
+
loading && Button_default["button--loading"],
|
|
34
|
+
loading && useCursorLoading && Button_default["button--cursor-loading"],
|
|
35
|
+
iconOnly && Button_default["button--icon-only"],
|
|
36
|
+
(leftIcon || rightIcon) && Button_default["button--with-icon"],
|
|
37
|
+
className
|
|
38
|
+
].filter(Boolean).join(" ");
|
|
39
|
+
const ariaAttributes = {
|
|
40
|
+
"aria-label": iconOnly ? ariaLabel || (typeof children === "string" ? children : void 0) : ariaLabel,
|
|
41
|
+
"aria-describedby": ariaDescribedBy,
|
|
42
|
+
"aria-pressed": ariaPressed,
|
|
43
|
+
"aria-disabled": disabled || loading,
|
|
44
|
+
"aria-busy": loading
|
|
45
|
+
};
|
|
46
|
+
if (isLink) {
|
|
47
|
+
const { href, target, rel, download, ...linkProps } = restProps;
|
|
48
|
+
let finalRel = rel;
|
|
49
|
+
if (target === "_blank" && !rel) {
|
|
50
|
+
finalRel = "noopener noreferrer";
|
|
51
|
+
}
|
|
52
|
+
const handleClick = (e) => {
|
|
53
|
+
if (disabled || loading) {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
linkProps.onClick?.(e);
|
|
58
|
+
};
|
|
59
|
+
return /* @__PURE__ */ jsx(
|
|
60
|
+
"a",
|
|
61
|
+
{
|
|
62
|
+
ref,
|
|
63
|
+
href: disabled || loading ? void 0 : href,
|
|
64
|
+
target,
|
|
65
|
+
rel: finalRel,
|
|
66
|
+
download,
|
|
67
|
+
className: classNames,
|
|
68
|
+
...ariaAttributes,
|
|
69
|
+
...linkProps,
|
|
70
|
+
onClick: handleClick,
|
|
71
|
+
children: renderButtonContent()
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
const {
|
|
76
|
+
type = "button",
|
|
77
|
+
form,
|
|
78
|
+
formAction,
|
|
79
|
+
formMethod,
|
|
80
|
+
formNoValidate,
|
|
81
|
+
formTarget,
|
|
82
|
+
...buttonProps
|
|
83
|
+
} = restProps;
|
|
84
|
+
return /* @__PURE__ */ jsx(
|
|
85
|
+
"button",
|
|
86
|
+
{
|
|
87
|
+
ref,
|
|
88
|
+
type,
|
|
89
|
+
disabled: disabled || loading,
|
|
90
|
+
form,
|
|
91
|
+
formAction,
|
|
92
|
+
formMethod,
|
|
93
|
+
formNoValidate,
|
|
94
|
+
formTarget,
|
|
95
|
+
className: classNames,
|
|
96
|
+
...ariaAttributes,
|
|
97
|
+
...buttonProps,
|
|
98
|
+
children: renderButtonContent()
|
|
99
|
+
}
|
|
100
|
+
);
|
|
101
|
+
function renderButtonContent() {
|
|
102
|
+
if (loading) {
|
|
103
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
104
|
+
!useCursorLoading && /* @__PURE__ */ jsx("span", { className: Button_default["button__loading-spinner"], "aria-hidden": "true", children: "\u23F3" }),
|
|
105
|
+
/* @__PURE__ */ jsx("span", { className: Button_default["button__text"], children: loadingText || children })
|
|
106
|
+
] });
|
|
107
|
+
}
|
|
108
|
+
if (iconOnly) {
|
|
109
|
+
return /* @__PURE__ */ jsx("span", { className: Button_default["button__icon-only"], children });
|
|
110
|
+
}
|
|
111
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
112
|
+
leftIcon && /* @__PURE__ */ jsx("span", { className: Button_default["button__icon-left"], "aria-hidden": "true", children: leftIcon }),
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: Button_default["button__text"], children }),
|
|
114
|
+
rightIcon && /* @__PURE__ */ jsx("span", { className: Button_default["button__icon-right"], "aria-hidden": "true", children: rightIcon })
|
|
115
|
+
] });
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
Button.displayName = "Button";
|
|
120
|
+
|
|
121
|
+
// src/components/Icon/Icon.module.css
|
|
122
|
+
var Icon_default = {};
|
|
123
|
+
var Icon = forwardRef(
|
|
124
|
+
({ size = "md", children, label, className = "", ...props }, ref) => {
|
|
125
|
+
const classNames = [Icon_default.icon, Icon_default[`icon--${size}`], className].filter(Boolean).join(" ");
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
"svg",
|
|
128
|
+
{
|
|
129
|
+
ref,
|
|
130
|
+
className: classNames,
|
|
131
|
+
viewBox: "0 0 24 24",
|
|
132
|
+
fill: "currentColor",
|
|
133
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
134
|
+
"aria-label": label,
|
|
135
|
+
"aria-hidden": !label,
|
|
136
|
+
role: label ? "img" : "presentation",
|
|
137
|
+
...props,
|
|
138
|
+
children
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
Icon.displayName = "Icon";
|
|
144
|
+
|
|
145
|
+
// src/components/IconButton/IconButton.module.css
|
|
146
|
+
var IconButton_default = {};
|
|
147
|
+
var IconButton = forwardRef(
|
|
148
|
+
({
|
|
149
|
+
icon,
|
|
150
|
+
label,
|
|
151
|
+
labelPosition = "right",
|
|
152
|
+
variant = "default",
|
|
153
|
+
size = "md",
|
|
154
|
+
disabled = false,
|
|
155
|
+
className = "",
|
|
156
|
+
...props
|
|
157
|
+
}, ref) => {
|
|
158
|
+
const classNames = [
|
|
159
|
+
IconButton_default.iconButton,
|
|
160
|
+
IconButton_default[`iconButton--${variant}`],
|
|
161
|
+
IconButton_default[`iconButton--${size}`],
|
|
162
|
+
label && IconButton_default[`iconButton--with-label`],
|
|
163
|
+
label && IconButton_default[`iconButton--label-${labelPosition}`],
|
|
164
|
+
disabled && IconButton_default["iconButton--disabled"],
|
|
165
|
+
className
|
|
166
|
+
].filter(Boolean).join(" ");
|
|
167
|
+
return /* @__PURE__ */ jsxs(
|
|
168
|
+
"button",
|
|
169
|
+
{
|
|
170
|
+
ref,
|
|
171
|
+
type: "button",
|
|
172
|
+
className: classNames,
|
|
173
|
+
disabled,
|
|
174
|
+
...props,
|
|
175
|
+
children: [
|
|
176
|
+
label && (labelPosition === "left" || labelPosition === "top") && /* @__PURE__ */ jsx("span", { className: IconButton_default.label, children: label }),
|
|
177
|
+
/* @__PURE__ */ jsx("span", { className: IconButton_default.icon, children: icon }),
|
|
178
|
+
label && (labelPosition === "right" || labelPosition === "bottom") && /* @__PURE__ */ jsx("span", { className: IconButton_default.label, children: label })
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
IconButton.displayName = "IconButton";
|
|
185
|
+
|
|
186
|
+
// src/components/Checkbox/Checkbox.module.css
|
|
187
|
+
var Checkbox_default = {};
|
|
188
|
+
var Checkbox = forwardRef(
|
|
189
|
+
({
|
|
190
|
+
checked,
|
|
191
|
+
defaultChecked,
|
|
192
|
+
indeterminate = false,
|
|
193
|
+
disabled = false,
|
|
194
|
+
label,
|
|
195
|
+
labelPosition = "right",
|
|
196
|
+
size = "md",
|
|
197
|
+
error = false,
|
|
198
|
+
ariaLabel,
|
|
199
|
+
ariaDescribedBy,
|
|
200
|
+
className = "",
|
|
201
|
+
onChange,
|
|
202
|
+
id,
|
|
203
|
+
...props
|
|
204
|
+
}, ref) => {
|
|
205
|
+
const inputRef = React4.useRef(null);
|
|
206
|
+
const combinedRef = ref || inputRef;
|
|
207
|
+
React4.useEffect(() => {
|
|
208
|
+
if (combinedRef?.current) {
|
|
209
|
+
combinedRef.current.indeterminate = indeterminate;
|
|
210
|
+
}
|
|
211
|
+
}, [indeterminate, combinedRef]);
|
|
212
|
+
const checkboxId = id || React4.useId();
|
|
213
|
+
const wrapperClassNames = [
|
|
214
|
+
Checkbox_default.wrapper,
|
|
215
|
+
Checkbox_default[`wrapper--${size}`],
|
|
216
|
+
Checkbox_default[`wrapper--label-${labelPosition}`],
|
|
217
|
+
disabled && Checkbox_default["wrapper--disabled"],
|
|
218
|
+
error && Checkbox_default["wrapper--error"],
|
|
219
|
+
className
|
|
220
|
+
].filter(Boolean).join(" ");
|
|
221
|
+
const checkboxClassNames = [
|
|
222
|
+
Checkbox_default.checkbox,
|
|
223
|
+
Checkbox_default[`checkbox--${size}`],
|
|
224
|
+
indeterminate && Checkbox_default["checkbox--indeterminate"],
|
|
225
|
+
error && Checkbox_default["checkbox--error"]
|
|
226
|
+
].filter(Boolean).join(" ");
|
|
227
|
+
const labelClassNames = [Checkbox_default.label, Checkbox_default[`label--${size}`]].filter(Boolean).join(" ");
|
|
228
|
+
const ariaAttributes = {
|
|
229
|
+
"aria-label": !label ? ariaLabel : void 0,
|
|
230
|
+
"aria-describedby": ariaDescribedBy,
|
|
231
|
+
"aria-invalid": error,
|
|
232
|
+
"aria-checked": indeterminate ? "mixed" : void 0
|
|
233
|
+
};
|
|
234
|
+
return /* @__PURE__ */ jsxs("div", { className: wrapperClassNames, children: [
|
|
235
|
+
label && labelPosition === "left" && /* @__PURE__ */ jsx("label", { htmlFor: checkboxId, className: labelClassNames, children: label }),
|
|
236
|
+
/* @__PURE__ */ jsx(
|
|
237
|
+
"input",
|
|
238
|
+
{
|
|
239
|
+
ref: combinedRef,
|
|
240
|
+
type: "checkbox",
|
|
241
|
+
id: checkboxId,
|
|
242
|
+
className: checkboxClassNames,
|
|
243
|
+
checked,
|
|
244
|
+
defaultChecked,
|
|
245
|
+
disabled,
|
|
246
|
+
onChange,
|
|
247
|
+
...ariaAttributes,
|
|
248
|
+
...props
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
label && labelPosition === "right" && /* @__PURE__ */ jsx("label", { htmlFor: checkboxId, className: labelClassNames, children: label })
|
|
252
|
+
] });
|
|
253
|
+
}
|
|
254
|
+
);
|
|
255
|
+
Checkbox.displayName = "Checkbox";
|
|
256
|
+
|
|
257
|
+
// src/components/Radio/Radio.module.css
|
|
258
|
+
var Radio_default = {};
|
|
259
|
+
var Radio = forwardRef(
|
|
260
|
+
({
|
|
261
|
+
checked,
|
|
262
|
+
defaultChecked,
|
|
263
|
+
disabled = false,
|
|
264
|
+
label,
|
|
265
|
+
labelPosition = "right",
|
|
266
|
+
size = "md",
|
|
267
|
+
error = false,
|
|
268
|
+
ariaLabel,
|
|
269
|
+
ariaDescribedBy,
|
|
270
|
+
className = "",
|
|
271
|
+
value,
|
|
272
|
+
name,
|
|
273
|
+
onChange,
|
|
274
|
+
id,
|
|
275
|
+
...props
|
|
276
|
+
}, ref) => {
|
|
277
|
+
const radioId = id || React4.useId();
|
|
278
|
+
const wrapperClassNames = [
|
|
279
|
+
Radio_default.wrapper,
|
|
280
|
+
Radio_default[`wrapper--${size}`],
|
|
281
|
+
Radio_default[`wrapper--label-${labelPosition}`],
|
|
282
|
+
disabled && Radio_default["wrapper--disabled"],
|
|
283
|
+
error && Radio_default["wrapper--error"],
|
|
284
|
+
className
|
|
285
|
+
].filter(Boolean).join(" ");
|
|
286
|
+
const radioClassNames = [
|
|
287
|
+
Radio_default.radio,
|
|
288
|
+
Radio_default[`radio--${size}`],
|
|
289
|
+
error && Radio_default["radio--error"]
|
|
290
|
+
].filter(Boolean).join(" ");
|
|
291
|
+
const labelClassNames = [Radio_default.label, Radio_default[`label--${size}`]].filter(Boolean).join(" ");
|
|
292
|
+
const ariaAttributes = {
|
|
293
|
+
"aria-label": !label ? ariaLabel : void 0,
|
|
294
|
+
"aria-describedby": ariaDescribedBy,
|
|
295
|
+
"aria-invalid": error
|
|
296
|
+
};
|
|
297
|
+
return /* @__PURE__ */ jsxs("div", { className: wrapperClassNames, children: [
|
|
298
|
+
label && labelPosition === "left" && /* @__PURE__ */ jsx("label", { htmlFor: radioId, className: labelClassNames, children: label }),
|
|
299
|
+
/* @__PURE__ */ jsx(
|
|
300
|
+
"input",
|
|
301
|
+
{
|
|
302
|
+
ref,
|
|
303
|
+
type: "radio",
|
|
304
|
+
id: radioId,
|
|
305
|
+
className: radioClassNames,
|
|
306
|
+
checked,
|
|
307
|
+
defaultChecked,
|
|
308
|
+
disabled,
|
|
309
|
+
value,
|
|
310
|
+
name,
|
|
311
|
+
onChange,
|
|
312
|
+
...ariaAttributes,
|
|
313
|
+
...props
|
|
314
|
+
}
|
|
315
|
+
),
|
|
316
|
+
label && labelPosition === "right" && /* @__PURE__ */ jsx("label", { htmlFor: radioId, className: labelClassNames, children: label })
|
|
317
|
+
] });
|
|
318
|
+
}
|
|
319
|
+
);
|
|
320
|
+
Radio.displayName = "Radio";
|
|
321
|
+
|
|
322
|
+
// src/components/TextField/TextField.module.css
|
|
323
|
+
var TextField_default = {};
|
|
324
|
+
var TextField = forwardRef(
|
|
325
|
+
({
|
|
326
|
+
label,
|
|
327
|
+
labelPosition = "top",
|
|
328
|
+
size = "md",
|
|
329
|
+
fullWidth = false,
|
|
330
|
+
error = false,
|
|
331
|
+
errorMessage,
|
|
332
|
+
helperText,
|
|
333
|
+
leftIcon,
|
|
334
|
+
rightIcon,
|
|
335
|
+
ariaLabel,
|
|
336
|
+
ariaDescribedBy,
|
|
337
|
+
className = "",
|
|
338
|
+
wrapperClassName = "",
|
|
339
|
+
type = "text",
|
|
340
|
+
id,
|
|
341
|
+
disabled,
|
|
342
|
+
...props
|
|
343
|
+
}, ref) => {
|
|
344
|
+
const inputId = id || React4.useId();
|
|
345
|
+
const helperId = `${inputId}-helper`;
|
|
346
|
+
const errorId = `${inputId}-error`;
|
|
347
|
+
const describedByIds = [
|
|
348
|
+
helperText && helperId,
|
|
349
|
+
error && errorMessage && errorId,
|
|
350
|
+
ariaDescribedBy
|
|
351
|
+
].filter(Boolean).join(" ");
|
|
352
|
+
const wrapperClassNames = [
|
|
353
|
+
TextField_default.wrapper,
|
|
354
|
+
TextField_default[`wrapper--${size}`],
|
|
355
|
+
TextField_default[`wrapper--label-${labelPosition}`],
|
|
356
|
+
fullWidth && TextField_default["wrapper--full-width"],
|
|
357
|
+
disabled && TextField_default["wrapper--disabled"],
|
|
358
|
+
wrapperClassName
|
|
359
|
+
].filter(Boolean).join(" ");
|
|
360
|
+
const inputWrapperClassNames = [
|
|
361
|
+
TextField_default["input-wrapper"],
|
|
362
|
+
(leftIcon || rightIcon) && TextField_default["input-wrapper--with-icon"],
|
|
363
|
+
leftIcon && TextField_default["input-wrapper--with-left-icon"],
|
|
364
|
+
rightIcon && TextField_default["input-wrapper--with-right-icon"]
|
|
365
|
+
].filter(Boolean).join(" ");
|
|
366
|
+
const inputClassNames = [
|
|
367
|
+
TextField_default.input,
|
|
368
|
+
TextField_default[`input--${size}`],
|
|
369
|
+
error && TextField_default["input--error"],
|
|
370
|
+
fullWidth && TextField_default["input--full-width"],
|
|
371
|
+
className
|
|
372
|
+
].filter(Boolean).join(" ");
|
|
373
|
+
const labelClassNames = [TextField_default.label, TextField_default[`label--${size}`]].filter(Boolean).join(" ");
|
|
374
|
+
const ariaAttributes = {
|
|
375
|
+
"aria-label": !label ? ariaLabel : void 0,
|
|
376
|
+
"aria-describedby": describedByIds || void 0,
|
|
377
|
+
"aria-invalid": error
|
|
378
|
+
};
|
|
379
|
+
return /* @__PURE__ */ jsxs("div", { className: wrapperClassNames, children: [
|
|
380
|
+
label && (labelPosition === "top" || labelPosition === "left") && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: labelClassNames, children: label }),
|
|
381
|
+
/* @__PURE__ */ jsxs("div", { className: inputWrapperClassNames, children: [
|
|
382
|
+
leftIcon && /* @__PURE__ */ jsx("span", { className: TextField_default["input-icon-left"], "aria-hidden": "true", children: leftIcon }),
|
|
383
|
+
/* @__PURE__ */ jsx(
|
|
384
|
+
"input",
|
|
385
|
+
{
|
|
386
|
+
ref,
|
|
387
|
+
type,
|
|
388
|
+
id: inputId,
|
|
389
|
+
className: inputClassNames,
|
|
390
|
+
disabled,
|
|
391
|
+
...ariaAttributes,
|
|
392
|
+
...props
|
|
393
|
+
}
|
|
394
|
+
),
|
|
395
|
+
rightIcon && /* @__PURE__ */ jsx("span", { className: TextField_default["input-icon-right"], "aria-hidden": "true", children: rightIcon })
|
|
396
|
+
] }),
|
|
397
|
+
label && labelPosition === "right" && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: labelClassNames, children: label }),
|
|
398
|
+
helperText && !error && /* @__PURE__ */ jsx("p", { id: helperId, className: TextField_default["helper-text"], children: helperText }),
|
|
399
|
+
error && errorMessage && /* @__PURE__ */ jsx("p", { id: errorId, className: TextField_default["error-message"], children: errorMessage })
|
|
400
|
+
] });
|
|
401
|
+
}
|
|
402
|
+
);
|
|
403
|
+
TextField.displayName = "TextField";
|
|
404
|
+
|
|
405
|
+
// src/components/Select/Select.module.css
|
|
406
|
+
var Select_default = {};
|
|
407
|
+
var Select = forwardRef(
|
|
408
|
+
({
|
|
409
|
+
label,
|
|
410
|
+
labelPosition = "top",
|
|
411
|
+
size = "md",
|
|
412
|
+
fullWidth = false,
|
|
413
|
+
error = false,
|
|
414
|
+
errorMessage,
|
|
415
|
+
helperText,
|
|
416
|
+
options,
|
|
417
|
+
placeholder,
|
|
418
|
+
ariaLabel,
|
|
419
|
+
ariaDescribedBy,
|
|
420
|
+
className = "",
|
|
421
|
+
wrapperClassName = "",
|
|
422
|
+
id,
|
|
423
|
+
disabled,
|
|
424
|
+
children,
|
|
425
|
+
...props
|
|
426
|
+
}, ref) => {
|
|
427
|
+
const selectId = id || React4.useId();
|
|
428
|
+
const helperId = `${selectId}-helper`;
|
|
429
|
+
const errorId = `${selectId}-error`;
|
|
430
|
+
const describedByIds = [
|
|
431
|
+
helperText && helperId,
|
|
432
|
+
error && errorMessage && errorId,
|
|
433
|
+
ariaDescribedBy
|
|
434
|
+
].filter(Boolean).join(" ");
|
|
435
|
+
const wrapperClassNames = [
|
|
436
|
+
Select_default.wrapper,
|
|
437
|
+
Select_default[`wrapper--${size}`],
|
|
438
|
+
Select_default[`wrapper--label-${labelPosition}`],
|
|
439
|
+
fullWidth && Select_default["wrapper--full-width"],
|
|
440
|
+
disabled && Select_default["wrapper--disabled"],
|
|
441
|
+
wrapperClassName
|
|
442
|
+
].filter(Boolean).join(" ");
|
|
443
|
+
const selectClassNames = [
|
|
444
|
+
Select_default.select,
|
|
445
|
+
Select_default[`select--${size}`],
|
|
446
|
+
error && Select_default["select--error"],
|
|
447
|
+
fullWidth && Select_default["select--full-width"],
|
|
448
|
+
className
|
|
449
|
+
].filter(Boolean).join(" ");
|
|
450
|
+
const labelClassNames = [Select_default.label, Select_default[`label--${size}`]].filter(Boolean).join(" ");
|
|
451
|
+
const ariaAttributes = {
|
|
452
|
+
"aria-label": !label ? ariaLabel : void 0,
|
|
453
|
+
"aria-describedby": describedByIds || void 0,
|
|
454
|
+
"aria-invalid": error
|
|
455
|
+
};
|
|
456
|
+
const renderOptions = () => {
|
|
457
|
+
if (options) {
|
|
458
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
459
|
+
placeholder && /* @__PURE__ */ jsx("option", { value: "", disabled: true, children: placeholder }),
|
|
460
|
+
options.map((option) => /* @__PURE__ */ jsx("option", { value: option.value, disabled: option.disabled, children: option.label }, option.value))
|
|
461
|
+
] });
|
|
462
|
+
}
|
|
463
|
+
return children;
|
|
464
|
+
};
|
|
465
|
+
return /* @__PURE__ */ jsxs("div", { className: wrapperClassNames, children: [
|
|
466
|
+
label && (labelPosition === "top" || labelPosition === "left") && /* @__PURE__ */ jsx("label", { htmlFor: selectId, className: labelClassNames, children: label }),
|
|
467
|
+
/* @__PURE__ */ jsx(
|
|
468
|
+
"select",
|
|
469
|
+
{
|
|
470
|
+
ref,
|
|
471
|
+
id: selectId,
|
|
472
|
+
className: selectClassNames,
|
|
473
|
+
disabled,
|
|
474
|
+
...ariaAttributes,
|
|
475
|
+
...props,
|
|
476
|
+
children: renderOptions()
|
|
477
|
+
}
|
|
478
|
+
),
|
|
479
|
+
label && labelPosition === "right" && /* @__PURE__ */ jsx("label", { htmlFor: selectId, className: labelClassNames, children: label }),
|
|
480
|
+
helperText && !error && /* @__PURE__ */ jsx("p", { id: helperId, className: Select_default["helper-text"], children: helperText }),
|
|
481
|
+
error && errorMessage && /* @__PURE__ */ jsx("p", { id: errorId, className: Select_default["error-message"], children: errorMessage })
|
|
482
|
+
] });
|
|
483
|
+
}
|
|
484
|
+
);
|
|
485
|
+
Select.displayName = "Select";
|
|
486
|
+
|
|
487
|
+
// src/components/Tabs/Tabs.module.css
|
|
488
|
+
var Tabs_default = {};
|
|
489
|
+
var TabPanel = ({ children }) => {
|
|
490
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
491
|
+
};
|
|
492
|
+
TabPanel.displayName = "TabPanel";
|
|
493
|
+
var Tabs = ({
|
|
494
|
+
children,
|
|
495
|
+
defaultActiveTab = 0,
|
|
496
|
+
activeTab: controlledActiveTab,
|
|
497
|
+
onChange,
|
|
498
|
+
size = "md",
|
|
499
|
+
fullWidth = false,
|
|
500
|
+
className = "",
|
|
501
|
+
tabListClassName = "",
|
|
502
|
+
panelClassName = "",
|
|
503
|
+
ariaLabel = "Tabs"
|
|
504
|
+
}) => {
|
|
505
|
+
const [uncontrolledActiveTab, setUncontrolledActiveTab] = useState(defaultActiveTab);
|
|
506
|
+
const isControlled = controlledActiveTab !== void 0;
|
|
507
|
+
const activeTabIndex = isControlled ? controlledActiveTab : uncontrolledActiveTab;
|
|
508
|
+
const tabs = Children.toArray(children).filter(
|
|
509
|
+
(child) => isValidElement(child)
|
|
510
|
+
);
|
|
511
|
+
const handleTabChange = useCallback(
|
|
512
|
+
(index) => {
|
|
513
|
+
const tab = tabs[index];
|
|
514
|
+
if (!tab || tab.props.disabled) return;
|
|
515
|
+
if (!isControlled) {
|
|
516
|
+
setUncontrolledActiveTab(index);
|
|
517
|
+
}
|
|
518
|
+
onChange?.(index, tab.props.value);
|
|
519
|
+
},
|
|
520
|
+
[tabs, isControlled, onChange]
|
|
521
|
+
);
|
|
522
|
+
const handleKeyDown = useCallback(
|
|
523
|
+
(event, currentIndex) => {
|
|
524
|
+
let newIndex = currentIndex;
|
|
525
|
+
switch (event.key) {
|
|
526
|
+
case "ArrowLeft":
|
|
527
|
+
case "ArrowUp":
|
|
528
|
+
event.preventDefault();
|
|
529
|
+
newIndex = currentIndex - 1;
|
|
530
|
+
if (newIndex < 0) newIndex = tabs.length - 1;
|
|
531
|
+
while (tabs[newIndex]?.props.disabled && newIndex !== currentIndex) {
|
|
532
|
+
newIndex--;
|
|
533
|
+
if (newIndex < 0) newIndex = tabs.length - 1;
|
|
534
|
+
}
|
|
535
|
+
break;
|
|
536
|
+
case "ArrowRight":
|
|
537
|
+
case "ArrowDown":
|
|
538
|
+
event.preventDefault();
|
|
539
|
+
newIndex = currentIndex + 1;
|
|
540
|
+
if (newIndex >= tabs.length) newIndex = 0;
|
|
541
|
+
while (tabs[newIndex]?.props.disabled && newIndex !== currentIndex) {
|
|
542
|
+
newIndex++;
|
|
543
|
+
if (newIndex >= tabs.length) newIndex = 0;
|
|
544
|
+
}
|
|
545
|
+
break;
|
|
546
|
+
case "Home":
|
|
547
|
+
event.preventDefault();
|
|
548
|
+
newIndex = 0;
|
|
549
|
+
while (tabs[newIndex]?.props.disabled && newIndex < tabs.length - 1) {
|
|
550
|
+
newIndex++;
|
|
551
|
+
}
|
|
552
|
+
break;
|
|
553
|
+
case "End":
|
|
554
|
+
event.preventDefault();
|
|
555
|
+
newIndex = tabs.length - 1;
|
|
556
|
+
while (tabs[newIndex]?.props.disabled && newIndex > 0) {
|
|
557
|
+
newIndex--;
|
|
558
|
+
}
|
|
559
|
+
break;
|
|
560
|
+
default:
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
handleTabChange(newIndex);
|
|
564
|
+
},
|
|
565
|
+
[tabs, handleTabChange]
|
|
566
|
+
);
|
|
567
|
+
const containerClassNames = [Tabs_default.container, className].filter(Boolean).join(" ");
|
|
568
|
+
const tabListClassNames = [
|
|
569
|
+
Tabs_default.tabList,
|
|
570
|
+
Tabs_default[`tabList--${size}`],
|
|
571
|
+
fullWidth && Tabs_default["tabList--full-width"],
|
|
572
|
+
tabListClassName
|
|
573
|
+
].filter(Boolean).join(" ");
|
|
574
|
+
const panelContainerClassNames = [
|
|
575
|
+
Tabs_default.panelContainer,
|
|
576
|
+
Tabs_default[`panelContainer--${size}`],
|
|
577
|
+
panelClassName
|
|
578
|
+
].filter(Boolean).join(" ");
|
|
579
|
+
return /* @__PURE__ */ jsxs("div", { className: containerClassNames, children: [
|
|
580
|
+
/* @__PURE__ */ jsx("div", { role: "tablist", "aria-label": ariaLabel, className: tabListClassNames, children: tabs.map((tab, index) => {
|
|
581
|
+
const isActive = index === activeTabIndex;
|
|
582
|
+
const isDisabled = tab.props.disabled;
|
|
583
|
+
const tabClassNames = [
|
|
584
|
+
Tabs_default.tab,
|
|
585
|
+
Tabs_default[`tab--${size}`],
|
|
586
|
+
isActive && Tabs_default["tab--active"],
|
|
587
|
+
isDisabled && Tabs_default["tab--disabled"],
|
|
588
|
+
fullWidth && Tabs_default["tab--full-width"]
|
|
589
|
+
].filter(Boolean).join(" ");
|
|
590
|
+
return /* @__PURE__ */ jsxs(
|
|
591
|
+
"button",
|
|
592
|
+
{
|
|
593
|
+
role: "tab",
|
|
594
|
+
type: "button",
|
|
595
|
+
"aria-selected": isActive,
|
|
596
|
+
"aria-controls": `panel-${index}`,
|
|
597
|
+
id: `tab-${index}`,
|
|
598
|
+
tabIndex: isActive ? 0 : -1,
|
|
599
|
+
disabled: isDisabled,
|
|
600
|
+
className: tabClassNames,
|
|
601
|
+
onClick: () => handleTabChange(index),
|
|
602
|
+
onKeyDown: (e) => handleKeyDown(e, index),
|
|
603
|
+
children: [
|
|
604
|
+
tab.props.icon && /* @__PURE__ */ jsx("span", { className: Tabs_default.tabIcon, children: tab.props.icon }),
|
|
605
|
+
tab.props.label
|
|
606
|
+
]
|
|
607
|
+
},
|
|
608
|
+
index
|
|
609
|
+
);
|
|
610
|
+
}) }),
|
|
611
|
+
tabs.map((tab, index) => {
|
|
612
|
+
const isActive = index === activeTabIndex;
|
|
613
|
+
return /* @__PURE__ */ jsx(
|
|
614
|
+
"div",
|
|
615
|
+
{
|
|
616
|
+
role: "tabpanel",
|
|
617
|
+
id: `panel-${index}`,
|
|
618
|
+
"aria-labelledby": `tab-${index}`,
|
|
619
|
+
hidden: !isActive,
|
|
620
|
+
className: panelContainerClassNames,
|
|
621
|
+
children: isActive && tab.props.children
|
|
622
|
+
},
|
|
623
|
+
index
|
|
624
|
+
);
|
|
625
|
+
})
|
|
626
|
+
] });
|
|
627
|
+
};
|
|
628
|
+
Tabs.displayName = "Tabs";
|
|
629
|
+
|
|
630
|
+
// src/components/Window/Window.module.css
|
|
631
|
+
var Window_default = {};
|
|
632
|
+
var Window = forwardRef(
|
|
633
|
+
({
|
|
634
|
+
children,
|
|
635
|
+
title,
|
|
636
|
+
titleBar,
|
|
637
|
+
active = true,
|
|
638
|
+
width = "auto",
|
|
639
|
+
height = "auto",
|
|
640
|
+
className = "",
|
|
641
|
+
contentClassName = "",
|
|
642
|
+
showControls = true,
|
|
643
|
+
onClose,
|
|
644
|
+
onMinimize,
|
|
645
|
+
onMaximize,
|
|
646
|
+
resizable = false
|
|
647
|
+
}, ref) => {
|
|
648
|
+
const windowClassNames = [
|
|
649
|
+
Window_default.window,
|
|
650
|
+
active ? Window_default["window--active"] : Window_default["window--inactive"],
|
|
651
|
+
className
|
|
652
|
+
].filter(Boolean).join(" ");
|
|
653
|
+
const contentClassNames = [Window_default.content, contentClassName].filter(Boolean).join(" ");
|
|
654
|
+
const windowStyle = {};
|
|
655
|
+
if (width !== "auto") {
|
|
656
|
+
windowStyle.width = typeof width === "number" ? `${width}px` : width;
|
|
657
|
+
}
|
|
658
|
+
if (height !== "auto") {
|
|
659
|
+
windowStyle.height = typeof height === "number" ? `${height}px` : height;
|
|
660
|
+
}
|
|
661
|
+
const renderTitleBar = () => {
|
|
662
|
+
if (titleBar) {
|
|
663
|
+
return titleBar;
|
|
664
|
+
}
|
|
665
|
+
if (title) {
|
|
666
|
+
return /* @__PURE__ */ jsxs("div", { className: Window_default.titleBar, "data-numControls": [onClose, onMinimize, onMaximize].filter(Boolean).length, children: [
|
|
667
|
+
showControls && /* @__PURE__ */ jsxs("div", { className: Window_default.controls, children: [
|
|
668
|
+
onClose && /* @__PURE__ */ jsx(
|
|
669
|
+
"button",
|
|
670
|
+
{
|
|
671
|
+
type: "button",
|
|
672
|
+
className: Window_default.controlButton,
|
|
673
|
+
onClick: onClose,
|
|
674
|
+
"aria-label": "Close",
|
|
675
|
+
title: "Close",
|
|
676
|
+
children: /* @__PURE__ */ jsx("div", { className: Window_default.closeBox })
|
|
677
|
+
}
|
|
678
|
+
),
|
|
679
|
+
onMinimize && /* @__PURE__ */ jsx(
|
|
680
|
+
"button",
|
|
681
|
+
{
|
|
682
|
+
type: "button",
|
|
683
|
+
className: Window_default.controlButton,
|
|
684
|
+
onClick: onMinimize,
|
|
685
|
+
"aria-label": "Minimize",
|
|
686
|
+
title: "Minimize",
|
|
687
|
+
children: /* @__PURE__ */ jsx("div", { className: Window_default.minimizeBox })
|
|
688
|
+
}
|
|
689
|
+
),
|
|
690
|
+
onMaximize && /* @__PURE__ */ jsx(
|
|
691
|
+
"button",
|
|
692
|
+
{
|
|
693
|
+
type: "button",
|
|
694
|
+
className: Window_default.controlButton,
|
|
695
|
+
onClick: onMaximize,
|
|
696
|
+
"aria-label": "Maximize",
|
|
697
|
+
title: "Maximize",
|
|
698
|
+
children: /* @__PURE__ */ jsx("div", { className: Window_default.maximizeBox })
|
|
699
|
+
}
|
|
700
|
+
)
|
|
701
|
+
] }),
|
|
702
|
+
/* @__PURE__ */ jsxs("div", { className: Window_default.titleCenter, children: [
|
|
703
|
+
/* @__PURE__ */ jsxs("svg", { width: "132", height: "13", viewBox: "0 0 132 13", fill: "none", preserveAspectRatio: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
704
|
+
/* @__PURE__ */ jsx("rect", { width: "130.517", height: "13", fill: "#DDDDDD" }),
|
|
705
|
+
/* @__PURE__ */ jsx("rect", { width: "1", height: "13", fill: "#EEEEEE" }),
|
|
706
|
+
/* @__PURE__ */ jsx("rect", { x: "130", width: "1", height: "13", fill: "#C5C5C5" }),
|
|
707
|
+
/* @__PURE__ */ jsx("rect", { y: "1", width: "131.268", height: "1", fill: "#999999" }),
|
|
708
|
+
/* @__PURE__ */ jsx("rect", { y: "5", width: "131.268", height: "1", fill: "#999999" }),
|
|
709
|
+
/* @__PURE__ */ jsx("rect", { y: "9", width: "131.268", height: "1", fill: "#999999" }),
|
|
710
|
+
/* @__PURE__ */ jsx("rect", { y: "3", width: "131.268", height: "1", fill: "#999999" }),
|
|
711
|
+
/* @__PURE__ */ jsx("rect", { y: "7", width: "131.268", height: "1", fill: "#999999" }),
|
|
712
|
+
/* @__PURE__ */ jsx("rect", { y: "11", width: "131.268", height: "1", fill: "#999999" })
|
|
713
|
+
] }),
|
|
714
|
+
/* @__PURE__ */ jsx("div", { className: Window_default.titleText, children: title }),
|
|
715
|
+
/* @__PURE__ */ jsxs("svg", { width: "132", height: "13", viewBox: "0 0 132 13", fill: "none", preserveAspectRatio: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
716
|
+
/* @__PURE__ */ jsx("rect", { width: "130.517", height: "13", fill: "#DDDDDD" }),
|
|
717
|
+
/* @__PURE__ */ jsx("rect", { width: "1", height: "13", fill: "#EEEEEE" }),
|
|
718
|
+
/* @__PURE__ */ jsx("rect", { x: "130", width: "1", height: "13", fill: "#C5C5C5" }),
|
|
719
|
+
/* @__PURE__ */ jsx("rect", { y: "1", width: "131.268", height: "1", fill: "#999999" }),
|
|
720
|
+
/* @__PURE__ */ jsx("rect", { y: "5", width: "131.268", height: "1", fill: "#999999" }),
|
|
721
|
+
/* @__PURE__ */ jsx("rect", { y: "9", width: "131.268", height: "1", fill: "#999999" }),
|
|
722
|
+
/* @__PURE__ */ jsx("rect", { y: "3", width: "131.268", height: "1", fill: "#999999" }),
|
|
723
|
+
/* @__PURE__ */ jsx("rect", { y: "7", width: "131.268", height: "1", fill: "#999999" }),
|
|
724
|
+
/* @__PURE__ */ jsx("rect", { y: "11", width: "131.268", height: "1", fill: "#999999" })
|
|
725
|
+
] })
|
|
726
|
+
] })
|
|
727
|
+
] });
|
|
728
|
+
}
|
|
729
|
+
return null;
|
|
730
|
+
};
|
|
731
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: windowClassNames, style: windowStyle, children: [
|
|
732
|
+
renderTitleBar(),
|
|
733
|
+
/* @__PURE__ */ jsx("div", { className: contentClassNames, children }),
|
|
734
|
+
resizable && /* @__PURE__ */ jsx("div", { className: Window_default.resizeHandle, "aria-hidden": "true" })
|
|
735
|
+
] });
|
|
736
|
+
}
|
|
737
|
+
);
|
|
738
|
+
Window.displayName = "Window";
|
|
739
|
+
|
|
740
|
+
// src/components/Dialog/Dialog.module.css
|
|
741
|
+
var Dialog_default = {};
|
|
742
|
+
var Dialog = forwardRef(
|
|
743
|
+
({
|
|
744
|
+
open = false,
|
|
745
|
+
onClose,
|
|
746
|
+
closeOnBackdropClick = true,
|
|
747
|
+
closeOnEscape = true,
|
|
748
|
+
backdropClassName = "",
|
|
749
|
+
trapFocus = true,
|
|
750
|
+
initialFocus,
|
|
751
|
+
children,
|
|
752
|
+
...windowProps
|
|
753
|
+
}, ref) => {
|
|
754
|
+
const dialogRef = useRef(null);
|
|
755
|
+
const previousActiveElement = useRef(null);
|
|
756
|
+
useEffect(() => {
|
|
757
|
+
if (!open || !closeOnEscape) return;
|
|
758
|
+
const handleEscape = (event) => {
|
|
759
|
+
if (event.key === "Escape") {
|
|
760
|
+
event.preventDefault();
|
|
761
|
+
event.stopPropagation();
|
|
762
|
+
onClose?.();
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
document.addEventListener("keydown", handleEscape);
|
|
766
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
767
|
+
}, [open, closeOnEscape, onClose]);
|
|
768
|
+
useEffect(() => {
|
|
769
|
+
if (open) {
|
|
770
|
+
previousActiveElement.current = document.activeElement;
|
|
771
|
+
} else if (previousActiveElement.current) {
|
|
772
|
+
previousActiveElement.current.focus();
|
|
773
|
+
}
|
|
774
|
+
}, [open]);
|
|
775
|
+
useEffect(() => {
|
|
776
|
+
if (!open || !initialFocus) return;
|
|
777
|
+
const focusElement = () => {
|
|
778
|
+
if (typeof initialFocus === "string") {
|
|
779
|
+
const element = dialogRef.current?.querySelector(initialFocus);
|
|
780
|
+
element?.focus();
|
|
781
|
+
} else if (initialFocus.current) {
|
|
782
|
+
initialFocus.current.focus();
|
|
783
|
+
}
|
|
784
|
+
};
|
|
785
|
+
setTimeout(focusElement, 10);
|
|
786
|
+
}, [open, initialFocus]);
|
|
787
|
+
useEffect(() => {
|
|
788
|
+
if (!open || !trapFocus) return;
|
|
789
|
+
const handleTabKey = (event) => {
|
|
790
|
+
if (event.key !== "Tab" || !dialogRef.current) return;
|
|
791
|
+
const focusableElements = dialogRef.current.querySelectorAll(
|
|
792
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
793
|
+
);
|
|
794
|
+
const firstElement = focusableElements[0];
|
|
795
|
+
const lastElement = focusableElements[focusableElements.length - 1];
|
|
796
|
+
if (event.shiftKey) {
|
|
797
|
+
if (document.activeElement === firstElement) {
|
|
798
|
+
event.preventDefault();
|
|
799
|
+
lastElement?.focus();
|
|
800
|
+
}
|
|
801
|
+
} else {
|
|
802
|
+
if (document.activeElement === lastElement) {
|
|
803
|
+
event.preventDefault();
|
|
804
|
+
firstElement?.focus();
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
};
|
|
808
|
+
document.addEventListener("keydown", handleTabKey);
|
|
809
|
+
return () => document.removeEventListener("keydown", handleTabKey);
|
|
810
|
+
}, [open, trapFocus]);
|
|
811
|
+
useEffect(() => {
|
|
812
|
+
if (open) {
|
|
813
|
+
document.body.style.overflow = "hidden";
|
|
814
|
+
} else {
|
|
815
|
+
document.body.style.overflow = "";
|
|
816
|
+
}
|
|
817
|
+
return () => {
|
|
818
|
+
document.body.style.overflow = "";
|
|
819
|
+
};
|
|
820
|
+
}, [open]);
|
|
821
|
+
const handleBackdropClick = useCallback(
|
|
822
|
+
(event) => {
|
|
823
|
+
if (closeOnBackdropClick && event.target === event.currentTarget) {
|
|
824
|
+
onClose?.();
|
|
825
|
+
}
|
|
826
|
+
},
|
|
827
|
+
[closeOnBackdropClick, onClose]
|
|
828
|
+
);
|
|
829
|
+
if (!open) return null;
|
|
830
|
+
const backdropClassNames = [Dialog_default.backdrop, backdropClassName].filter(Boolean).join(" ");
|
|
831
|
+
return /* @__PURE__ */ jsx(
|
|
832
|
+
"div",
|
|
833
|
+
{
|
|
834
|
+
className: backdropClassNames,
|
|
835
|
+
onClick: handleBackdropClick,
|
|
836
|
+
role: "presentation",
|
|
837
|
+
"aria-modal": "true",
|
|
838
|
+
children: /* @__PURE__ */ jsx("div", { className: Dialog_default.dialogContainer, ref: dialogRef, role: "dialog", "aria-modal": "true", children: /* @__PURE__ */ jsx(Window, { ...windowProps, ref, active: true, onClose, children }) })
|
|
839
|
+
}
|
|
840
|
+
);
|
|
841
|
+
}
|
|
842
|
+
);
|
|
843
|
+
Dialog.displayName = "Dialog";
|
|
844
|
+
|
|
845
|
+
// src/components/MenuBar/MenuBar.module.css
|
|
846
|
+
var MenuBar_default = {};
|
|
847
|
+
var MenuBar = forwardRef(
|
|
848
|
+
({ menus, openMenuIndex, onMenuOpen, onMenuClose, className = "", dropdownClassName = "" }, ref) => {
|
|
849
|
+
const [menuBarElement, setMenuBarElement] = useState(null);
|
|
850
|
+
const [focusedIndex, setFocusedIndex] = useState(-1);
|
|
851
|
+
useEffect(() => {
|
|
852
|
+
if (openMenuIndex === void 0 || !menuBarElement) return;
|
|
853
|
+
const handleClickOutside = (event) => {
|
|
854
|
+
if (menuBarElement && !menuBarElement.contains(event.target)) {
|
|
855
|
+
onMenuClose?.();
|
|
856
|
+
}
|
|
857
|
+
};
|
|
858
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
859
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
860
|
+
}, [openMenuIndex, onMenuClose, menuBarElement]);
|
|
861
|
+
useEffect(() => {
|
|
862
|
+
if (openMenuIndex === void 0) return;
|
|
863
|
+
const handleEscape = (event) => {
|
|
864
|
+
if (event.key === "Escape") {
|
|
865
|
+
event.preventDefault();
|
|
866
|
+
onMenuClose?.();
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
document.addEventListener("keydown", handleEscape);
|
|
870
|
+
return () => document.removeEventListener("keydown", handleEscape);
|
|
871
|
+
}, [openMenuIndex, onMenuClose]);
|
|
872
|
+
const handleKeyDown = useCallback(
|
|
873
|
+
(event) => {
|
|
874
|
+
switch (event.key) {
|
|
875
|
+
case "ArrowLeft":
|
|
876
|
+
event.preventDefault();
|
|
877
|
+
if (openMenuIndex !== void 0) {
|
|
878
|
+
const prevIndex = openMenuIndex > 0 ? openMenuIndex - 1 : menus.length - 1;
|
|
879
|
+
if (!menus[prevIndex]?.disabled) {
|
|
880
|
+
onMenuOpen?.(prevIndex);
|
|
881
|
+
}
|
|
882
|
+
} else if (focusedIndex > 0) {
|
|
883
|
+
setFocusedIndex(focusedIndex - 1);
|
|
884
|
+
}
|
|
885
|
+
break;
|
|
886
|
+
case "ArrowRight":
|
|
887
|
+
event.preventDefault();
|
|
888
|
+
if (openMenuIndex !== void 0) {
|
|
889
|
+
const nextIndex = openMenuIndex < menus.length - 1 ? openMenuIndex + 1 : 0;
|
|
890
|
+
if (!menus[nextIndex]?.disabled) {
|
|
891
|
+
onMenuOpen?.(nextIndex);
|
|
892
|
+
}
|
|
893
|
+
} else if (focusedIndex < menus.length - 1) {
|
|
894
|
+
setFocusedIndex(focusedIndex + 1);
|
|
895
|
+
}
|
|
896
|
+
break;
|
|
897
|
+
case "ArrowDown":
|
|
898
|
+
event.preventDefault();
|
|
899
|
+
if (openMenuIndex === void 0 && focusedIndex >= 0) {
|
|
900
|
+
if (!menus[focusedIndex]?.disabled) {
|
|
901
|
+
onMenuOpen?.(focusedIndex);
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
break;
|
|
905
|
+
case "Enter":
|
|
906
|
+
case " ":
|
|
907
|
+
event.preventDefault();
|
|
908
|
+
if (openMenuIndex === void 0 && focusedIndex >= 0) {
|
|
909
|
+
if (!menus[focusedIndex]?.disabled) {
|
|
910
|
+
onMenuOpen?.(focusedIndex);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
},
|
|
916
|
+
[openMenuIndex, focusedIndex, menus, onMenuOpen, onMenuClose]
|
|
917
|
+
);
|
|
918
|
+
const handleMenuClick = (index) => {
|
|
919
|
+
if (menus[index]?.disabled) return;
|
|
920
|
+
if (openMenuIndex === index) {
|
|
921
|
+
onMenuClose?.();
|
|
922
|
+
} else {
|
|
923
|
+
onMenuOpen?.(index);
|
|
924
|
+
}
|
|
925
|
+
};
|
|
926
|
+
const menuBarClassNames = [MenuBar_default.menuBar, className].filter(Boolean).join(" ");
|
|
927
|
+
const dropdownClassNames = [MenuBar_default.dropdown, dropdownClassName].filter(Boolean).join(" ");
|
|
928
|
+
const handleRef = useCallback(
|
|
929
|
+
(node) => {
|
|
930
|
+
setMenuBarElement(node);
|
|
931
|
+
if (typeof ref === "function") {
|
|
932
|
+
ref(node);
|
|
933
|
+
}
|
|
934
|
+
},
|
|
935
|
+
[ref]
|
|
936
|
+
);
|
|
937
|
+
return /* @__PURE__ */ jsx("div", { ref: handleRef, className: menuBarClassNames, role: "menubar", onKeyDown: handleKeyDown, children: menus.map((menu, index) => {
|
|
938
|
+
const isOpen = openMenuIndex === index;
|
|
939
|
+
const menuButtonClassNames = [
|
|
940
|
+
MenuBar_default.menuButton,
|
|
941
|
+
isOpen ? MenuBar_default["menuButton--open"] : "",
|
|
942
|
+
menu.disabled ? MenuBar_default["menuButton--disabled"] : ""
|
|
943
|
+
].filter(Boolean).join(" ");
|
|
944
|
+
return /* @__PURE__ */ jsxs("div", { className: MenuBar_default.menuContainer, children: [
|
|
945
|
+
/* @__PURE__ */ jsx(
|
|
946
|
+
"button",
|
|
947
|
+
{
|
|
948
|
+
type: "button",
|
|
949
|
+
className: menuButtonClassNames,
|
|
950
|
+
onClick: () => handleMenuClick(index),
|
|
951
|
+
onFocus: () => setFocusedIndex(index),
|
|
952
|
+
onBlur: () => setFocusedIndex(-1),
|
|
953
|
+
disabled: menu.disabled,
|
|
954
|
+
"aria-haspopup": "true",
|
|
955
|
+
"aria-expanded": isOpen,
|
|
956
|
+
"aria-disabled": menu.disabled,
|
|
957
|
+
children: menu.label
|
|
958
|
+
}
|
|
959
|
+
),
|
|
960
|
+
isOpen && /* @__PURE__ */ jsx("div", { className: dropdownClassNames, role: "menu", children: menu.items })
|
|
961
|
+
] }, index);
|
|
962
|
+
}) });
|
|
963
|
+
}
|
|
964
|
+
);
|
|
965
|
+
MenuBar.displayName = "MenuBar";
|
|
966
|
+
|
|
967
|
+
// src/components/MenuBar/MenuItem.module.css
|
|
968
|
+
var MenuItem_default = {};
|
|
969
|
+
var MenuItem = forwardRef(
|
|
970
|
+
({
|
|
971
|
+
label,
|
|
972
|
+
shortcut,
|
|
973
|
+
disabled = false,
|
|
974
|
+
selected = false,
|
|
975
|
+
separator = false,
|
|
976
|
+
checked = false,
|
|
977
|
+
icon,
|
|
978
|
+
onClick,
|
|
979
|
+
onFocus,
|
|
980
|
+
onBlur,
|
|
981
|
+
className = "",
|
|
982
|
+
hasSubmenu = false
|
|
983
|
+
}, ref) => {
|
|
984
|
+
const menuItemClassNames = [
|
|
985
|
+
MenuItem_default.menuItem,
|
|
986
|
+
selected ? MenuItem_default["menuItem--selected"] : "",
|
|
987
|
+
disabled ? MenuItem_default["menuItem--disabled"] : "",
|
|
988
|
+
separator ? MenuItem_default["menuItem--separator"] : "",
|
|
989
|
+
className
|
|
990
|
+
].filter(Boolean).join(" ");
|
|
991
|
+
const handleClick = (event) => {
|
|
992
|
+
if (disabled) {
|
|
993
|
+
event.preventDefault();
|
|
994
|
+
return;
|
|
995
|
+
}
|
|
996
|
+
onClick?.(event);
|
|
997
|
+
};
|
|
998
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
999
|
+
/* @__PURE__ */ jsxs(
|
|
1000
|
+
"button",
|
|
1001
|
+
{
|
|
1002
|
+
ref,
|
|
1003
|
+
type: "button",
|
|
1004
|
+
className: menuItemClassNames,
|
|
1005
|
+
onClick: handleClick,
|
|
1006
|
+
onFocus,
|
|
1007
|
+
onBlur,
|
|
1008
|
+
disabled,
|
|
1009
|
+
role: "menuitem",
|
|
1010
|
+
"aria-disabled": disabled,
|
|
1011
|
+
"aria-checked": checked ? "true" : void 0,
|
|
1012
|
+
children: [
|
|
1013
|
+
/* @__PURE__ */ jsx("span", { className: MenuItem_default.checkmark, children: checked && "\u2713" }),
|
|
1014
|
+
icon && /* @__PURE__ */ jsx("span", { className: MenuItem_default.icon, children: icon }),
|
|
1015
|
+
/* @__PURE__ */ jsx("span", { className: MenuItem_default.label, children: label }),
|
|
1016
|
+
shortcut && /* @__PURE__ */ jsx("span", { className: MenuItem_default.shortcut, children: shortcut }),
|
|
1017
|
+
hasSubmenu && /* @__PURE__ */ jsx("span", { className: MenuItem_default.submenuArrow, children: "\u25B6" })
|
|
1018
|
+
]
|
|
1019
|
+
}
|
|
1020
|
+
),
|
|
1021
|
+
separator && /* @__PURE__ */ jsx("div", { className: MenuItem_default.separatorLine, role: "separator" })
|
|
1022
|
+
] });
|
|
1023
|
+
}
|
|
1024
|
+
);
|
|
1025
|
+
MenuItem.displayName = "MenuItem";
|
|
1026
|
+
|
|
1027
|
+
// src/components/Scrollbar/Scrollbar.module.css
|
|
1028
|
+
var Scrollbar_default = {};
|
|
1029
|
+
var Scrollbar = forwardRef(
|
|
1030
|
+
({
|
|
1031
|
+
orientation = "vertical",
|
|
1032
|
+
value = 0,
|
|
1033
|
+
viewportRatio = 0.2,
|
|
1034
|
+
onChange,
|
|
1035
|
+
className = "",
|
|
1036
|
+
disabled = false
|
|
1037
|
+
}, ref) => {
|
|
1038
|
+
const trackRef = useRef(null);
|
|
1039
|
+
const [isDragging, setIsDragging] = useState(false);
|
|
1040
|
+
const [dragStartPos, setDragStartPos] = useState(0);
|
|
1041
|
+
const [dragStartValue, setDragStartValue] = useState(0);
|
|
1042
|
+
const isVertical = orientation === "vertical";
|
|
1043
|
+
const thumbSize = Math.max(viewportRatio * 100, 10);
|
|
1044
|
+
const maxThumbPos = 100 - thumbSize;
|
|
1045
|
+
const thumbPos = value * maxThumbPos;
|
|
1046
|
+
const classNames = [
|
|
1047
|
+
Scrollbar_default.scrollbar,
|
|
1048
|
+
Scrollbar_default[`scrollbar--${orientation}`],
|
|
1049
|
+
disabled && Scrollbar_default["scrollbar--disabled"],
|
|
1050
|
+
className
|
|
1051
|
+
].filter(Boolean).join(" ");
|
|
1052
|
+
const handleDecrement = useCallback(() => {
|
|
1053
|
+
if (disabled || !onChange) return;
|
|
1054
|
+
const newValue = Math.max(0, value - 0.1);
|
|
1055
|
+
onChange(newValue);
|
|
1056
|
+
}, [disabled, onChange, value]);
|
|
1057
|
+
const handleIncrement = useCallback(() => {
|
|
1058
|
+
if (disabled || !onChange) return;
|
|
1059
|
+
const newValue = Math.min(1, value + 0.1);
|
|
1060
|
+
onChange(newValue);
|
|
1061
|
+
}, [disabled, onChange, value]);
|
|
1062
|
+
const handleTrackClick = useCallback(
|
|
1063
|
+
(event) => {
|
|
1064
|
+
if (disabled || !onChange || !trackRef.current) return;
|
|
1065
|
+
const rect = trackRef.current.getBoundingClientRect();
|
|
1066
|
+
const clickPos = isVertical ? event.clientY - rect.top : event.clientX - rect.left;
|
|
1067
|
+
const trackSize = isVertical ? rect.height : rect.width;
|
|
1068
|
+
const clickRatio = clickPos / trackSize;
|
|
1069
|
+
const newValue = Math.max(0, Math.min(1, clickRatio));
|
|
1070
|
+
onChange(newValue);
|
|
1071
|
+
},
|
|
1072
|
+
[disabled, onChange, isVertical]
|
|
1073
|
+
);
|
|
1074
|
+
const handleThumbMouseDown = useCallback(
|
|
1075
|
+
(event) => {
|
|
1076
|
+
if (disabled) return;
|
|
1077
|
+
event.preventDefault();
|
|
1078
|
+
event.stopPropagation();
|
|
1079
|
+
setIsDragging(true);
|
|
1080
|
+
setDragStartPos(isVertical ? event.clientY : event.clientX);
|
|
1081
|
+
setDragStartValue(value);
|
|
1082
|
+
},
|
|
1083
|
+
[disabled, isVertical, value]
|
|
1084
|
+
);
|
|
1085
|
+
useEffect(() => {
|
|
1086
|
+
if (!isDragging || !onChange || !trackRef.current) return;
|
|
1087
|
+
const handleMouseMove = (event) => {
|
|
1088
|
+
const currentPos = isVertical ? event.clientY : event.clientX;
|
|
1089
|
+
const delta = currentPos - dragStartPos;
|
|
1090
|
+
const rect = trackRef.current.getBoundingClientRect();
|
|
1091
|
+
const trackSize = isVertical ? rect.height : rect.width;
|
|
1092
|
+
const deltaRatio = delta / trackSize;
|
|
1093
|
+
const newValue = Math.max(0, Math.min(1, dragStartValue + deltaRatio));
|
|
1094
|
+
onChange(newValue);
|
|
1095
|
+
};
|
|
1096
|
+
const handleMouseUp = () => {
|
|
1097
|
+
setIsDragging(false);
|
|
1098
|
+
};
|
|
1099
|
+
document.addEventListener("mousemove", handleMouseMove);
|
|
1100
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
1101
|
+
return () => {
|
|
1102
|
+
document.removeEventListener("mousemove", handleMouseMove);
|
|
1103
|
+
document.removeEventListener("mouseup", handleMouseUp);
|
|
1104
|
+
};
|
|
1105
|
+
}, [isDragging, dragStartPos, dragStartValue, onChange, isVertical]);
|
|
1106
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: classNames, children: [
|
|
1107
|
+
/* @__PURE__ */ jsx(
|
|
1108
|
+
"button",
|
|
1109
|
+
{
|
|
1110
|
+
type: "button",
|
|
1111
|
+
className: `${Scrollbar_default.arrow} ${Scrollbar_default["arrow--start"]}`,
|
|
1112
|
+
onClick: handleDecrement,
|
|
1113
|
+
disabled,
|
|
1114
|
+
"aria-label": isVertical ? "Scroll up" : "Scroll left",
|
|
1115
|
+
children: /* @__PURE__ */ jsx("div", { className: Scrollbar_default.arrowIcon })
|
|
1116
|
+
}
|
|
1117
|
+
),
|
|
1118
|
+
/* @__PURE__ */ jsx(
|
|
1119
|
+
"div",
|
|
1120
|
+
{
|
|
1121
|
+
ref: trackRef,
|
|
1122
|
+
className: Scrollbar_default.track,
|
|
1123
|
+
onClick: handleTrackClick,
|
|
1124
|
+
role: "scrollbar",
|
|
1125
|
+
"aria-valuenow": Math.round(value * 100),
|
|
1126
|
+
"aria-valuemin": 0,
|
|
1127
|
+
"aria-valuemax": 100,
|
|
1128
|
+
"aria-orientation": orientation,
|
|
1129
|
+
children: /* @__PURE__ */ jsx(
|
|
1130
|
+
"div",
|
|
1131
|
+
{
|
|
1132
|
+
className: Scrollbar_default.thumb,
|
|
1133
|
+
style: {
|
|
1134
|
+
[isVertical ? "height" : "width"]: `${thumbSize}%`,
|
|
1135
|
+
[isVertical ? "top" : "left"]: `${thumbPos}%`
|
|
1136
|
+
},
|
|
1137
|
+
onMouseDown: handleThumbMouseDown
|
|
1138
|
+
}
|
|
1139
|
+
)
|
|
1140
|
+
}
|
|
1141
|
+
),
|
|
1142
|
+
/* @__PURE__ */ jsx(
|
|
1143
|
+
"button",
|
|
1144
|
+
{
|
|
1145
|
+
type: "button",
|
|
1146
|
+
className: `${Scrollbar_default.arrow} ${Scrollbar_default["arrow--end"]}`,
|
|
1147
|
+
onClick: handleIncrement,
|
|
1148
|
+
disabled,
|
|
1149
|
+
"aria-label": isVertical ? "Scroll down" : "Scroll right",
|
|
1150
|
+
children: /* @__PURE__ */ jsx("div", { className: Scrollbar_default.arrowIcon })
|
|
1151
|
+
}
|
|
1152
|
+
)
|
|
1153
|
+
] });
|
|
1154
|
+
}
|
|
1155
|
+
);
|
|
1156
|
+
Scrollbar.displayName = "Scrollbar";
|
|
1157
|
+
|
|
1158
|
+
// src/components/ListView/ListView.module.css
|
|
1159
|
+
var ListView_default = {};
|
|
1160
|
+
var ListView = forwardRef(
|
|
1161
|
+
({
|
|
1162
|
+
columns,
|
|
1163
|
+
items,
|
|
1164
|
+
selectedIds = [],
|
|
1165
|
+
onSelectionChange,
|
|
1166
|
+
onItemOpen,
|
|
1167
|
+
onSort,
|
|
1168
|
+
className = "",
|
|
1169
|
+
height = "auto"
|
|
1170
|
+
}, ref) => {
|
|
1171
|
+
const [sortColumn, setSortColumn] = useState(null);
|
|
1172
|
+
const [sortDirection, setSortDirection] = useState("asc");
|
|
1173
|
+
const classNames = [ListView_default.listView, className].filter(Boolean).join(" ");
|
|
1174
|
+
const handleColumnClick = useCallback(
|
|
1175
|
+
(columnKey, sortable = true) => {
|
|
1176
|
+
if (!sortable || !onSort) return;
|
|
1177
|
+
const newDirection = sortColumn === columnKey && sortDirection === "asc" ? "desc" : "asc";
|
|
1178
|
+
setSortColumn(columnKey);
|
|
1179
|
+
setSortDirection(newDirection);
|
|
1180
|
+
onSort(columnKey, newDirection);
|
|
1181
|
+
},
|
|
1182
|
+
[sortColumn, sortDirection, onSort]
|
|
1183
|
+
);
|
|
1184
|
+
const handleRowClick = useCallback(
|
|
1185
|
+
(itemId, event) => {
|
|
1186
|
+
if (!onSelectionChange) return;
|
|
1187
|
+
if (event.metaKey || event.ctrlKey) {
|
|
1188
|
+
if (selectedIds.includes(itemId)) {
|
|
1189
|
+
onSelectionChange(selectedIds.filter((id) => id !== itemId));
|
|
1190
|
+
} else {
|
|
1191
|
+
onSelectionChange([...selectedIds, itemId]);
|
|
1192
|
+
}
|
|
1193
|
+
} else if (event.shiftKey && selectedIds.length > 0) {
|
|
1194
|
+
const lastSelectedId = selectedIds[selectedIds.length - 1];
|
|
1195
|
+
const lastIndex = items.findIndex((item) => item.id === lastSelectedId);
|
|
1196
|
+
const currentIndex = items.findIndex((item) => item.id === itemId);
|
|
1197
|
+
const start = Math.min(lastIndex, currentIndex);
|
|
1198
|
+
const end = Math.max(lastIndex, currentIndex);
|
|
1199
|
+
const rangeIds = items.slice(start, end + 1).map((item) => item.id);
|
|
1200
|
+
onSelectionChange(rangeIds);
|
|
1201
|
+
} else {
|
|
1202
|
+
onSelectionChange([itemId]);
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
[selectedIds, items, onSelectionChange]
|
|
1206
|
+
);
|
|
1207
|
+
const handleRowDoubleClick = useCallback(
|
|
1208
|
+
(item) => {
|
|
1209
|
+
if (onItemOpen) {
|
|
1210
|
+
onItemOpen(item);
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
[onItemOpen]
|
|
1214
|
+
);
|
|
1215
|
+
const containerStyle = {};
|
|
1216
|
+
if (height !== "auto") {
|
|
1217
|
+
containerStyle.height = typeof height === "number" ? `${height}px` : height;
|
|
1218
|
+
}
|
|
1219
|
+
return /* @__PURE__ */ jsxs("div", { ref, className: classNames, style: containerStyle, children: [
|
|
1220
|
+
/* @__PURE__ */ jsx("div", { className: ListView_default.header, children: columns.map((column) => /* @__PURE__ */ jsxs(
|
|
1221
|
+
"div",
|
|
1222
|
+
{
|
|
1223
|
+
className: `${ListView_default.headerCell} ${column.sortable !== false ? ListView_default.sortable : ""}`,
|
|
1224
|
+
style: {
|
|
1225
|
+
width: typeof column.width === "number" ? `${column.width}px` : column.width
|
|
1226
|
+
},
|
|
1227
|
+
onClick: () => handleColumnClick(column.key, column.sortable),
|
|
1228
|
+
children: [
|
|
1229
|
+
column.label,
|
|
1230
|
+
sortColumn === column.key && /* @__PURE__ */ jsx("span", { className: ListView_default.sortIndicator, children: sortDirection === "asc" ? "\u25B2" : "\u25BC" })
|
|
1231
|
+
]
|
|
1232
|
+
},
|
|
1233
|
+
column.key
|
|
1234
|
+
)) }),
|
|
1235
|
+
/* @__PURE__ */ jsx("div", { className: ListView_default.body, children: items.map((item) => {
|
|
1236
|
+
const isSelected = selectedIds.includes(item.id);
|
|
1237
|
+
return /* @__PURE__ */ jsx(
|
|
1238
|
+
"div",
|
|
1239
|
+
{
|
|
1240
|
+
className: `${ListView_default.row} ${isSelected ? ListView_default.selected : ""}`,
|
|
1241
|
+
onClick: (e) => handleRowClick(item.id, e),
|
|
1242
|
+
onDoubleClick: () => handleRowDoubleClick(item),
|
|
1243
|
+
children: columns.map((column, index) => /* @__PURE__ */ jsxs(
|
|
1244
|
+
"div",
|
|
1245
|
+
{
|
|
1246
|
+
className: ListView_default.cell,
|
|
1247
|
+
style: {
|
|
1248
|
+
width: typeof column.width === "number" ? `${column.width}px` : column.width
|
|
1249
|
+
},
|
|
1250
|
+
children: [
|
|
1251
|
+
index === 0 && item.icon && /* @__PURE__ */ jsx("span", { className: ListView_default.icon, children: item.icon }),
|
|
1252
|
+
item[column.key]
|
|
1253
|
+
]
|
|
1254
|
+
},
|
|
1255
|
+
column.key
|
|
1256
|
+
))
|
|
1257
|
+
},
|
|
1258
|
+
item.id
|
|
1259
|
+
);
|
|
1260
|
+
}) })
|
|
1261
|
+
] });
|
|
1262
|
+
}
|
|
1263
|
+
);
|
|
1264
|
+
ListView.displayName = "ListView";
|
|
1265
|
+
|
|
1266
|
+
// src/components/FolderList/FolderList.module.css
|
|
1267
|
+
var FolderList_default = {};
|
|
1268
|
+
var FolderList = forwardRef(
|
|
1269
|
+
({
|
|
1270
|
+
columns = [
|
|
1271
|
+
{ key: "name", label: "Name", width: "40%" },
|
|
1272
|
+
{ key: "modified", label: "Date Modified", width: "30%" },
|
|
1273
|
+
{ key: "size", label: "Size", width: "30%" }
|
|
1274
|
+
],
|
|
1275
|
+
items,
|
|
1276
|
+
selectedIds,
|
|
1277
|
+
onSelectionChange,
|
|
1278
|
+
onItemOpen,
|
|
1279
|
+
onSort,
|
|
1280
|
+
listHeight = 400,
|
|
1281
|
+
...windowProps
|
|
1282
|
+
}, ref) => {
|
|
1283
|
+
return /* @__PURE__ */ jsx(Window, { ref, contentClassName: FolderList_default.folderListContent, ...windowProps, children: /* @__PURE__ */ jsx(
|
|
1284
|
+
ListView,
|
|
1285
|
+
{
|
|
1286
|
+
columns,
|
|
1287
|
+
items,
|
|
1288
|
+
selectedIds,
|
|
1289
|
+
onSelectionChange,
|
|
1290
|
+
onItemOpen,
|
|
1291
|
+
onSort,
|
|
1292
|
+
height: listHeight,
|
|
1293
|
+
className: FolderList_default.listView
|
|
1294
|
+
}
|
|
1295
|
+
) });
|
|
1296
|
+
}
|
|
1297
|
+
);
|
|
1298
|
+
FolderList.displayName = "FolderList";
|
|
1299
|
+
var SaveIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Save", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z" }) });
|
|
1300
|
+
var FolderIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Folder", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z" }) });
|
|
1301
|
+
var CloseIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Close", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }) });
|
|
1302
|
+
var ArrowRightIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Arrow Right", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" }) });
|
|
1303
|
+
var ArrowLeftIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Arrow Left", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }) });
|
|
1304
|
+
var DownloadIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Download", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M19 9h-4V3H9v6H5l7 7 7-7zM5 18v2h14v-2H5z" }) });
|
|
1305
|
+
var LinkIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Link", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z" }) });
|
|
1306
|
+
var MailIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Mail", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z" }) });
|
|
1307
|
+
var PrintIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Print", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M19 8H5c-1.66 0-3 1.34-3 3v6h4v4h12v-4h4v-6c0-1.66-1.34-3-3-3zm-3 11H8v-5h8v5zm3-7c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm-1-9H6v4h12V3z" }) });
|
|
1308
|
+
var TrashIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Delete", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" }) });
|
|
1309
|
+
var SearchIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Search", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" }) });
|
|
1310
|
+
var UserIcon = () => /* @__PURE__ */ jsx(Icon, { label: "User", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z" }) });
|
|
1311
|
+
var LockIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Lock", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z" }) });
|
|
1312
|
+
var CalendarIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Calendar", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z" }) });
|
|
1313
|
+
var DocumentIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Document", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z" }) });
|
|
1314
|
+
var FileIcon = () => /* @__PURE__ */ jsx(Icon, { label: "File", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M8 16h8v2H8zm0-4h8v2H8zm6-10H6c-1.1 0-2 .9-2 2v16c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z" }) });
|
|
1315
|
+
var ImageIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Image", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z" }) });
|
|
1316
|
+
var MusicIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Music", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3h-6z" }) });
|
|
1317
|
+
var VideoIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Video", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M18 4l2 4h-3l-2-4h-2l2 4h-3l-2-4H8l2 4H7L5 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4h-4z" }) });
|
|
1318
|
+
var SettingsIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Settings", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94L14.4 2.81c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" }) });
|
|
1319
|
+
var HomeIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Home", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z" }) });
|
|
1320
|
+
var StarIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Star", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z" }) });
|
|
1321
|
+
var HeartIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Heart", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" }) });
|
|
1322
|
+
var InfoIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Info", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) });
|
|
1323
|
+
var WarningIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Warning", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }) });
|
|
1324
|
+
var ErrorIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Error", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }) });
|
|
1325
|
+
var CheckIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Check", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }) });
|
|
1326
|
+
var PlusIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Plus", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" }) });
|
|
1327
|
+
var MinusIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Minus", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M19 13H5v-2h14v2z" }) });
|
|
1328
|
+
var RefreshIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Refresh", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z" }) });
|
|
1329
|
+
var MenuIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Menu", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z" }) });
|
|
1330
|
+
var MoreIcon = () => /* @__PURE__ */ jsx(Icon, { label: "More", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) });
|
|
1331
|
+
var ChevronUpIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Chevron Up", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" }) });
|
|
1332
|
+
var ChevronDownIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Chevron Down", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z" }) });
|
|
1333
|
+
var EyeIcon = () => /* @__PURE__ */ jsx(Icon, { label: "Eye", size: "sm", children: /* @__PURE__ */ jsx("path", { d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z" }) });
|
|
1334
|
+
|
|
1335
|
+
// src/tokens/index.ts
|
|
1336
|
+
var colors = {
|
|
1337
|
+
// Grayscale palette (Figma style IDs included for reference)
|
|
1338
|
+
gray100: "#FFFFFF",
|
|
1339
|
+
// 18:47 - White
|
|
1340
|
+
gray200: "#EEEEEE",
|
|
1341
|
+
// 19:2507 - Base UI background
|
|
1342
|
+
gray300: "#DDDDDD",
|
|
1343
|
+
// 18:60 - Inferred mid-tone
|
|
1344
|
+
gray400: "#CCCCCC",
|
|
1345
|
+
// 18:1970 - Inferred mid-tone
|
|
1346
|
+
gray500: "#999999",
|
|
1347
|
+
// 20:7306 - Inferred mid-tone
|
|
1348
|
+
gray600: "#666666",
|
|
1349
|
+
// 18:52 - Inferred dark tone
|
|
1350
|
+
gray700: "#4D4D4D",
|
|
1351
|
+
// 18:46 - Inferred dark tone
|
|
1352
|
+
gray800: "#333333",
|
|
1353
|
+
// 45:184845 - Inferred very dark
|
|
1354
|
+
gray900: "#262626",
|
|
1355
|
+
// 18:48 - Black (strokes, borders, text)
|
|
1356
|
+
// Accent colors
|
|
1357
|
+
lavender: "#CCCCFF",
|
|
1358
|
+
// 60:134029 - Cover background
|
|
1359
|
+
azul: "#0066CC",
|
|
1360
|
+
// 49:36229 - Accent (inferred)
|
|
1361
|
+
linkRed: "#CC0000",
|
|
1362
|
+
// 102:398, 102:3935 - Link color (inferred)
|
|
1363
|
+
// Semantic mappings
|
|
1364
|
+
background: "#EEEEEE",
|
|
1365
|
+
// Gray 200
|
|
1366
|
+
foreground: "#262626",
|
|
1367
|
+
// Gray 900
|
|
1368
|
+
border: "#262626",
|
|
1369
|
+
// Gray 900
|
|
1370
|
+
text: "#262626",
|
|
1371
|
+
// Gray 900
|
|
1372
|
+
textInverse: "#FFFFFF",
|
|
1373
|
+
// Gray 100
|
|
1374
|
+
surface: "#EEEEEE",
|
|
1375
|
+
// Gray 200
|
|
1376
|
+
surfaceInset: "#FFFFFF",
|
|
1377
|
+
// Gray 100 (for inset areas)
|
|
1378
|
+
// Legacy names for compatibility
|
|
1379
|
+
black: "#262626",
|
|
1380
|
+
white: "#FFFFFF",
|
|
1381
|
+
// Status colors (Mac OS 9 style)
|
|
1382
|
+
focus: "#000080",
|
|
1383
|
+
error: "#CC0000",
|
|
1384
|
+
success: "#008000",
|
|
1385
|
+
warning: "#FF8C00"
|
|
1386
|
+
};
|
|
1387
|
+
var typography = {
|
|
1388
|
+
fontFamily: {
|
|
1389
|
+
// Charcoal - Primary system UI font used throughout Mac OS 9
|
|
1390
|
+
// Fallback chain: Try Charcoal variants, then Chicago, then modern system fonts
|
|
1391
|
+
system: 'Charcoal, "Charcoal CY", Chicago, "Chicago Classic", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
|
|
1392
|
+
// Geneva - Used for dialog text and body content in Mac OS 9
|
|
1393
|
+
// More readable for longer text than Charcoal
|
|
1394
|
+
body: 'Geneva, "Geneva CY", "Lucida Grande", "Lucida Sans Unicode", sans-serif',
|
|
1395
|
+
// Apple Garamond Light - Used for headlines in Figma
|
|
1396
|
+
display: '"Apple Garamond Light", "Apple Garamond", Garamond, Georgia, serif',
|
|
1397
|
+
// Chicago - Classic Mac OS system font (menu bar, classic UI)
|
|
1398
|
+
chicago: 'Chicago, "Chicago Classic", "Charcoal CY", Charcoal, monospace',
|
|
1399
|
+
// Monaco - Mac OS 9 monospace font
|
|
1400
|
+
mono: 'Monaco, "Monaco CY", "SF Mono", "Courier New", Courier, monospace'
|
|
1401
|
+
},
|
|
1402
|
+
fontSize: {
|
|
1403
|
+
xs: "9px",
|
|
1404
|
+
// Smallest UI text (9pt Chicago/Charcoal)
|
|
1405
|
+
sm: "10px",
|
|
1406
|
+
// Small labels (10pt)
|
|
1407
|
+
md: "12px",
|
|
1408
|
+
// Standard UI text - Mac OS 9 default (12pt)
|
|
1409
|
+
lg: "13px",
|
|
1410
|
+
// Slightly larger UI text
|
|
1411
|
+
xl: "14px",
|
|
1412
|
+
// Large UI text
|
|
1413
|
+
"2xl": "16px",
|
|
1414
|
+
// Headings
|
|
1415
|
+
"3xl": "18px",
|
|
1416
|
+
// Large headings
|
|
1417
|
+
"4xl": "20px",
|
|
1418
|
+
// Major headings
|
|
1419
|
+
"5xl": "24px"
|
|
1420
|
+
// Display text
|
|
1421
|
+
},
|
|
1422
|
+
fontWeight: {
|
|
1423
|
+
normal: 700,
|
|
1424
|
+
// Charcoal Bold is the Mac OS 9 default
|
|
1425
|
+
medium: 700,
|
|
1426
|
+
// Medium (same as bold for Charcoal)
|
|
1427
|
+
semibold: 700,
|
|
1428
|
+
// Semibold (same as bold)
|
|
1429
|
+
bold: 700,
|
|
1430
|
+
// Bold weight
|
|
1431
|
+
light: 400
|
|
1432
|
+
// Light weight (regular Charcoal)
|
|
1433
|
+
},
|
|
1434
|
+
lineHeight: {
|
|
1435
|
+
tight: 1.2,
|
|
1436
|
+
// Tight leading (Mac OS 9 style)
|
|
1437
|
+
snug: 1.3,
|
|
1438
|
+
// Snug
|
|
1439
|
+
normal: 1.4,
|
|
1440
|
+
// Normal (Mac OS 9 used tighter line heights)
|
|
1441
|
+
relaxed: 1.5,
|
|
1442
|
+
// Relaxed
|
|
1443
|
+
loose: 1.6
|
|
1444
|
+
// Loose
|
|
1445
|
+
},
|
|
1446
|
+
letterSpacing: {
|
|
1447
|
+
tighter: "-0.02em",
|
|
1448
|
+
// Slightly tighter
|
|
1449
|
+
tight: "-0.01em",
|
|
1450
|
+
// Tight
|
|
1451
|
+
normal: "0",
|
|
1452
|
+
// Normal - Mac OS 9 default
|
|
1453
|
+
wide: "0.01em",
|
|
1454
|
+
// Wide
|
|
1455
|
+
wider: "0.02em"
|
|
1456
|
+
// Wider
|
|
1457
|
+
}
|
|
1458
|
+
};
|
|
1459
|
+
var spacing = {
|
|
1460
|
+
"0": "0",
|
|
1461
|
+
px: "1px",
|
|
1462
|
+
"0.5": "2px",
|
|
1463
|
+
// Minimal spacing
|
|
1464
|
+
"1": "4px",
|
|
1465
|
+
// Base grid unit
|
|
1466
|
+
"1.5": "6px",
|
|
1467
|
+
"2": "8px",
|
|
1468
|
+
"2.5": "10px",
|
|
1469
|
+
"3": "12px",
|
|
1470
|
+
"4": "16px",
|
|
1471
|
+
"5": "20px",
|
|
1472
|
+
"6": "24px",
|
|
1473
|
+
"8": "32px",
|
|
1474
|
+
"10": "40px",
|
|
1475
|
+
"12": "48px",
|
|
1476
|
+
"16": "64px",
|
|
1477
|
+
// Legacy names
|
|
1478
|
+
xs: "2px",
|
|
1479
|
+
sm: "4px",
|
|
1480
|
+
md: "8px",
|
|
1481
|
+
lg: "12px",
|
|
1482
|
+
xl: "16px",
|
|
1483
|
+
"2xl": "24px",
|
|
1484
|
+
"3xl": "32px"
|
|
1485
|
+
};
|
|
1486
|
+
var shadows = {
|
|
1487
|
+
// Standard raised bevel (default button state)
|
|
1488
|
+
bevel: "inset 2px 2px 0 rgba(255, 255, 255, 0.6), inset -2px -2px 0 rgba(38, 38, 38, 0.4), 2px 2px 0 rgba(38, 38, 38, 1)",
|
|
1489
|
+
// Inverted bevel for pressed/inset states
|
|
1490
|
+
inset: "inset -2px -2px 0 rgba(255, 255, 255, 0.6), inset 2px 2px 0 rgba(38, 38, 38, 0.4), 2px 2px 0 rgba(38, 38, 38, 1)",
|
|
1491
|
+
// Individual layers for custom composition
|
|
1492
|
+
dropShadow: "2px 2px 0 rgba(38, 38, 38, 1)",
|
|
1493
|
+
innerHighlight: "inset 2px 2px 0 rgba(255, 255, 255, 0.6)",
|
|
1494
|
+
innerShadow: "inset -2px -2px 0 rgba(38, 38, 38, 0.4)",
|
|
1495
|
+
// Legacy format for compatibility
|
|
1496
|
+
raised: {
|
|
1497
|
+
highlight: "inset 2px 2px 0 rgba(255, 255, 255, 0.6)",
|
|
1498
|
+
shadow: "inset -2px -2px 0 rgba(38, 38, 38, 0.4)",
|
|
1499
|
+
full: "inset 2px 2px 0 rgba(255, 255, 255, 0.6), inset -2px -2px 0 rgba(38, 38, 38, 0.4), 2px 2px 0 rgba(38, 38, 38, 1)"
|
|
1500
|
+
},
|
|
1501
|
+
// No shadow (flat)
|
|
1502
|
+
none: "none"
|
|
1503
|
+
};
|
|
1504
|
+
var borders = {
|
|
1505
|
+
width: {
|
|
1506
|
+
none: "0",
|
|
1507
|
+
thin: "1px",
|
|
1508
|
+
medium: "2px",
|
|
1509
|
+
thick: "3px"
|
|
1510
|
+
},
|
|
1511
|
+
style: {
|
|
1512
|
+
solid: "solid",
|
|
1513
|
+
dashed: "dashed",
|
|
1514
|
+
dotted: "dotted",
|
|
1515
|
+
none: "none"
|
|
1516
|
+
},
|
|
1517
|
+
radius: {
|
|
1518
|
+
none: "0",
|
|
1519
|
+
// Mac OS 9 always used square corners
|
|
1520
|
+
sm: "0",
|
|
1521
|
+
// Kept for API consistency
|
|
1522
|
+
md: "0",
|
|
1523
|
+
lg: "0",
|
|
1524
|
+
full: "0"
|
|
1525
|
+
}
|
|
1526
|
+
};
|
|
1527
|
+
var zIndex = {
|
|
1528
|
+
base: 0,
|
|
1529
|
+
dropdown: 1e3,
|
|
1530
|
+
sticky: 1100,
|
|
1531
|
+
modal: 1200,
|
|
1532
|
+
popover: 1300,
|
|
1533
|
+
tooltip: 1400
|
|
1534
|
+
};
|
|
1535
|
+
var transitions = {
|
|
1536
|
+
duration: {
|
|
1537
|
+
instant: "0ms",
|
|
1538
|
+
fast: "100ms",
|
|
1539
|
+
normal: "200ms",
|
|
1540
|
+
slow: "300ms"
|
|
1541
|
+
},
|
|
1542
|
+
timing: {
|
|
1543
|
+
linear: "linear",
|
|
1544
|
+
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
|
|
1545
|
+
easeOut: "cubic-bezier(0, 0, 0.2, 1)",
|
|
1546
|
+
easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
1547
|
+
}
|
|
1548
|
+
};
|
|
1549
|
+
var tokens = {
|
|
1550
|
+
colors,
|
|
1551
|
+
typography,
|
|
1552
|
+
spacing,
|
|
1553
|
+
borders,
|
|
1554
|
+
shadows,
|
|
1555
|
+
zIndex,
|
|
1556
|
+
transitions
|
|
1557
|
+
};
|
|
1558
|
+
|
|
1559
|
+
export { ArrowLeftIcon, ArrowRightIcon, Button, CalendarIcon, CheckIcon, Checkbox, ChevronDownIcon, ChevronUpIcon, CloseIcon, Dialog, DocumentIcon, DownloadIcon, ErrorIcon, EyeIcon, FileIcon, FolderIcon, FolderList, HeartIcon, HomeIcon, Icon, IconButton, ImageIcon, InfoIcon, LinkIcon, ListView, LockIcon, MailIcon, MenuBar, MenuIcon, MenuItem, MinusIcon, MoreIcon, MusicIcon, PlusIcon, PrintIcon, Radio, RefreshIcon, SaveIcon, Scrollbar, SearchIcon, Select, SettingsIcon, StarIcon, TabPanel, Tabs, TextField, TrashIcon, UserIcon, VideoIcon, WarningIcon, Window, borders, colors, shadows, spacing, tokens, transitions, typography, zIndex };
|
|
1560
|
+
//# sourceMappingURL=index.js.map
|
|
1561
|
+
//# sourceMappingURL=index.js.map
|