@alulore/kumiko 0.17.3 → 0.18.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/dist/avatar/avatar-name.d.ts +12 -0
- package/dist/avatar/avatar-name.js +42 -0
- package/dist/avatar/avatar.css +274 -0
- package/dist/avatar/avatar.d.ts +72 -0
- package/dist/avatar/avatar.js +45 -0
- package/dist/avatar/index.d.ts +3 -0
- package/dist/avatar/index.js +3 -0
- package/dist/board/board-api.d.ts +1 -0
- package/dist/board/board-selection.d.ts +1 -0
- package/dist/board/board-slots.d.ts +7 -0
- package/dist/board/board-slots.js +2 -1
- package/dist/board/refused-home.js +26 -1
- package/dist/dialog/dialog.css +7 -1
- package/dist/dialog/dialog.d.ts +9 -0
- package/dist/dialog/dialog.js +20 -0
- package/dist/dialog/index.d.ts +4 -3
- package/dist/dialog/index.js +4 -3
- package/dist/drawer/drawer.css +514 -0
- package/dist/drawer/drawer.d.ts +55 -0
- package/dist/drawer/drawer.js +43 -0
- package/dist/drawer/index.d.ts +2 -0
- package/dist/drawer/index.js +2 -0
- package/dist/file-input/file-dropzone.d.ts +67 -0
- package/dist/file-input/file-dropzone.js +97 -0
- package/dist/file-input/file-input.css +505 -0
- package/dist/file-input/file-input.d.ts +29 -0
- package/dist/file-input/file-input.js +21 -0
- package/dist/file-input/file-preview.d.ts +15 -0
- package/dist/file-input/file-preview.js +41 -0
- package/dist/file-input/index.d.ts +4 -0
- package/dist/file-input/index.js +4 -0
- package/dist/hover-card/hover-card.js +2 -0
- package/dist/media-viewer/index.d.ts +1 -0
- package/dist/media-viewer/index.js +1 -0
- package/dist/media-viewer/labels.d.ts +27 -0
- package/dist/media-viewer/labels.js +23 -0
- package/dist/media-viewer/media-viewer.d.ts +3 -0
- package/dist/media-viewer/media-viewer.js +6 -3
- package/dist/media-viewer/video-controls.js +4 -2
- package/dist/media-viewer/viewer-chrome.js +11 -5
- package/dist/menu/menu.js +2 -0
- package/dist/motion/settle-close.d.ts +5 -0
- package/dist/motion/settle-close.js +78 -0
- package/dist/otp-input/index.d.ts +2 -0
- package/dist/otp-input/index.js +2 -0
- package/dist/otp-input/otp-input.css +336 -0
- package/dist/otp-input/otp-input.d.ts +56 -0
- package/dist/otp-input/otp-input.js +44 -0
- package/dist/popover/index.d.ts +2 -1
- package/dist/popover/index.js +2 -1
- package/dist/popover/popover.d.ts +3 -0
- package/dist/popover/popover.js +8 -0
- package/dist/server-render.test.d.ts +1 -0
- package/dist/server-render.test.js +57 -0
- package/dist/skeleton/index.d.ts +1 -0
- package/dist/skeleton/index.js +1 -0
- package/dist/skeleton/skeleton.css +143 -0
- package/dist/skeleton/skeleton.d.ts +44 -0
- package/dist/skeleton/skeleton.js +22 -0
- package/dist/smooth-caret/smooth-caret.css +4 -2
- package/dist/tabs/index.d.ts +2 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tabs/tabs.css +616 -0
- package/dist/tabs/tabs.d.ts +51 -0
- package/dist/tabs/tabs.js +20 -0
- package/dist/titlebar/index.d.ts +1 -1
- package/dist/titlebar/index.js +1 -1
- package/dist/titlebar/titlebar.d.ts +15 -2
- package/dist/titlebar/titlebar.js +18 -9
- package/dist/toast/index.d.ts +2 -1
- package/dist/toast/index.js +2 -1
- package/dist/tooltip/tooltip.js +2 -0
- package/package.json +59 -5
|
@@ -11,6 +11,17 @@ export interface TitlebarButtonProps extends React.ComponentProps<"button"> {
|
|
|
11
11
|
}
|
|
12
12
|
/** A round 32px tool button for the bar's end. It carries no drag: buttons never do. */
|
|
13
13
|
export declare function TitlebarButton({ look, tilt, type, ...props }: TitlebarButtonProps): React.JSX.Element;
|
|
14
|
+
/** The names screen readers hear for the drawn window controls. Pass your own through `labels` to translate them. */
|
|
15
|
+
export interface TitlebarLabels {
|
|
16
|
+
/** The group that holds the buttons. */
|
|
17
|
+
controls: string;
|
|
18
|
+
minimize: string;
|
|
19
|
+
maximize: string;
|
|
20
|
+
/** The maximise button while the window is maximised. */
|
|
21
|
+
restore: string;
|
|
22
|
+
close: string;
|
|
23
|
+
}
|
|
24
|
+
export declare const titlebarLabels: TitlebarLabels;
|
|
14
25
|
export interface WindowControlsProps {
|
|
15
26
|
/** @defaultValue "native" */
|
|
16
27
|
controls?: WindowControls;
|
|
@@ -24,13 +35,15 @@ export interface WindowControlsProps {
|
|
|
24
35
|
onMinimize?: () => void;
|
|
25
36
|
onToggleMaximize?: () => void;
|
|
26
37
|
onClose?: () => void;
|
|
38
|
+
/** The drawn controls' names. Any you leave out stay English. */
|
|
39
|
+
labels?: Partial<TitlebarLabels>;
|
|
27
40
|
}
|
|
28
41
|
/**
|
|
29
42
|
* The window-control area. `native` is empty space the OS draws over (Electron's `titleBarOverlay`, or the
|
|
30
43
|
* traffic lights); `windows` and `mac` are drawn here and call your handlers, so the app must wire them to
|
|
31
44
|
* its window. Drawn controls lose Windows 11's snap layouts on the maximise button.
|
|
32
45
|
*/
|
|
33
|
-
export declare function TitlebarWindowControls({ controls, side, ...drawn }: WindowControlsProps): React.JSX.Element | null;
|
|
46
|
+
export declare function TitlebarWindowControls({ controls, side, labels, ...drawn }: WindowControlsProps): React.JSX.Element | null;
|
|
34
47
|
export type TitlebarProps = Omit<React.ComponentProps<"header">, "title"> & TitlebarLooks & WindowControlsProps & {
|
|
35
48
|
/** The brand's mark, at the start. */
|
|
36
49
|
mark?: React.ReactNode;
|
|
@@ -51,4 +64,4 @@ export type TitlebarProps = Omit<React.ComponentProps<"header">, "title"> & Titl
|
|
|
51
64
|
* and every popup opened from it, does not. A custom child opts out with `data-kumiko-titlebar="no-drag"`, or in
|
|
52
65
|
* with `data-kumiko-titlebar="drag"`.
|
|
53
66
|
*/
|
|
54
|
-
export declare function Titlebar({ layout, height, edge, look, tilt, divider, dimInactive, controls, side, maximized, onMinimize, onToggleMaximize, onClose, mark, name, end, active, children, ...props }: TitlebarProps): React.JSX.Element;
|
|
67
|
+
export declare function Titlebar({ layout, height, edge, look, tilt, divider, dimInactive, controls, side, maximized, onMinimize, onToggleMaximize, onClose, labels, mark, name, end, active, children, ...props }: TitlebarProps): React.JSX.Element;
|
|
@@ -20,27 +20,35 @@ function flag(on) {
|
|
|
20
20
|
export function TitlebarButton({ look, tilt, type = "button", ...props }) {
|
|
21
21
|
return (_jsx("button", { type: type, "data-slot": "titlebar-button", "data-kumiko-titlebar-button": "", "data-look": look, "data-tilt": tiltAttribute(tilt), ...props }));
|
|
22
22
|
}
|
|
23
|
+
export const titlebarLabels = {
|
|
24
|
+
controls: "Window controls",
|
|
25
|
+
minimize: "Minimize",
|
|
26
|
+
maximize: "Maximize",
|
|
27
|
+
restore: "Restore",
|
|
28
|
+
close: "Close"
|
|
29
|
+
};
|
|
23
30
|
function WindowsGlyph({ glyph }) {
|
|
24
31
|
return (_jsxs("svg", { viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: 1, "aria-hidden": true, children: [glyph === "min" ? _jsx("path", { d: "M0 5.5h10" }) : null, glyph === "max" ? _jsx("rect", { x: "0.5", y: "0.5", width: "9", height: "9" }) : null, glyph === "restore" ? _jsx("path", { d: "M2.5 2.5V0.5h7v7h-2M0.5 2.5h7v7h-7z" }) : null, glyph === "close" ? _jsx("path", { d: "M0 0l10 10M10 0L0 10" }) : null] }));
|
|
25
32
|
}
|
|
26
|
-
function WindowsControls({ side, maximized, onMinimize, onToggleMaximize, onClose }) {
|
|
27
|
-
return (_jsxs("div", { role: "group", "aria-label":
|
|
33
|
+
function WindowsControls({ side, maximized, onMinimize, onToggleMaximize, onClose, labels }) {
|
|
34
|
+
return (_jsxs("div", { role: "group", "aria-label": labels.controls, "data-slot": "titlebar-controls", "data-kind": "windows", "data-side": side, children: [_jsx("button", { type: "button", "aria-label": labels.minimize, onClick: onMinimize, children: _jsx(WindowsGlyph, { glyph: "min" }) }), _jsx("button", { type: "button", "aria-label": maximized ? labels.restore : labels.maximize, onClick: onToggleMaximize, children: _jsx(WindowsGlyph, { glyph: maximized ? "restore" : "max" }) }), _jsx("button", { type: "button", "aria-label": labels.close, "data-close": "", onClick: onClose, children: _jsx(WindowsGlyph, { glyph: "close" }) })] }));
|
|
28
35
|
}
|
|
29
|
-
function MacControls({ side, maximized, onMinimize, onToggleMaximize, onClose }) {
|
|
30
|
-
return (_jsxs("div", { role: "group", "aria-label":
|
|
36
|
+
function MacControls({ side, maximized, onMinimize, onToggleMaximize, onClose, labels }) {
|
|
37
|
+
return (_jsxs("div", { role: "group", "aria-label": labels.controls, "data-slot": "titlebar-controls", "data-kind": "mac", "data-side": side, children: [_jsx("button", { type: "button", "aria-label": labels.close, "data-dot": "close", onClick: onClose }), _jsx("button", { type: "button", "aria-label": labels.minimize, "data-dot": "min", onClick: onMinimize }), _jsx("button", { type: "button", "aria-label": maximized ? labels.restore : labels.maximize, "data-dot": "max", onClick: onToggleMaximize })] }));
|
|
31
38
|
}
|
|
32
39
|
/**
|
|
33
40
|
* The window-control area. `native` is empty space the OS draws over (Electron's `titleBarOverlay`, or the
|
|
34
41
|
* traffic lights); `windows` and `mac` are drawn here and call your handlers, so the app must wire them to
|
|
35
42
|
* its window. Drawn controls lose Windows 11's snap layouts on the maximise button.
|
|
36
43
|
*/
|
|
37
|
-
export function TitlebarWindowControls({ controls = "native", side, ...drawn }) {
|
|
44
|
+
export function TitlebarWindowControls({ controls = "native", side, labels, ...drawn }) {
|
|
45
|
+
const named = { ...titlebarLabels, ...labels };
|
|
38
46
|
const placed = side ?? (controls === "mac" ? "start" : "end");
|
|
39
47
|
if (controls === "windows") {
|
|
40
|
-
return _jsx(WindowsControls, { side: placed, ...drawn });
|
|
48
|
+
return _jsx(WindowsControls, { side: placed, labels: named, ...drawn });
|
|
41
49
|
}
|
|
42
50
|
if (controls === "mac") {
|
|
43
|
-
return _jsx(MacControls, { side: placed, ...drawn });
|
|
51
|
+
return _jsx(MacControls, { side: placed, labels: named, ...drawn });
|
|
44
52
|
}
|
|
45
53
|
if (controls === "none") {
|
|
46
54
|
return null;
|
|
@@ -58,11 +66,12 @@ function Middle({ children }) {
|
|
|
58
66
|
* and every popup opened from it, does not. A custom child opts out with `data-kumiko-titlebar="no-drag"`, or in
|
|
59
67
|
* with `data-kumiko-titlebar="drag"`.
|
|
60
68
|
*/
|
|
61
|
-
export function Titlebar({ layout, height, edge, look, tilt, divider, dimInactive, controls = "native", side, maximized, onMinimize, onToggleMaximize, onClose, mark, name, end, active, children, ...props }) {
|
|
69
|
+
export function Titlebar({ layout, height, edge, look, tilt, divider, dimInactive, controls = "native", side, maximized, onMinimize, onToggleMaximize, onClose, labels, mark, name, end, active, children, ...props }) {
|
|
62
70
|
const windowActive = useWindowActive();
|
|
63
71
|
const isActive = active ?? windowActive;
|
|
64
72
|
const placed = side ?? (controls === "mac" ? "start" : "end");
|
|
65
73
|
const words = titlebarWords({ layout, height, edge, look, tilt, divider, dimInactive });
|
|
66
|
-
const
|
|
74
|
+
const drawn = { controls, maximized, onMinimize, onToggleMaximize, onClose, labels };
|
|
75
|
+
const area = _jsx(TitlebarWindowControls, { side: placed, ...drawn });
|
|
67
76
|
return (_jsxs("header", { "data-slot": "titlebar", "data-kumiko-titlebar": words, "data-inactive": flag(!isActive), ...props, children: [placed === "start" ? area : null, _jsx(Brand, { mark: mark, name: name }), _jsx(Middle, { children: children }), _jsx("div", { "data-slot": "titlebar-end", children: end }), placed === "end" ? area : null] }));
|
|
68
77
|
}
|
package/dist/toast/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { createToaster, Toast, toast, ToastAction, ToastClose, ToastDescription, ToastRegion, ToastTitle, type ToastActionData, type ToastActionDetails, type ToastActionProps, type ToastButtonState, type ToastCancel, type ToastCloseProps, type ToastData, type ToastDismissDetails, type ToastDismissReason, type Toaster, type ToastItem, type ToastOptions, type ToastPauseReason, type ToastRegionOptions, type ToastRegionProps, type ToastRegionState, type ToastState, type ToastType } from "@ui-sdk/react/toast";
|
|
2
|
-
export { OverlayHost
|
|
2
|
+
export { OverlayHost } from "../dialog/dialog";
|
|
3
|
+
export { type OverlayHostProps } from "@ui-sdk/react/overlays";
|
package/dist/toast/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { createToaster, Toast, toast, ToastAction, ToastClose, ToastDescription, ToastRegion, ToastTitle } from "@ui-sdk/react/toast";
|
|
2
|
-
export { OverlayHost } from "
|
|
2
|
+
export { OverlayHost } from "../dialog/dialog";
|
|
3
|
+
export {} from "@ui-sdk/react/overlays";
|
package/dist/tooltip/tooltip.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip as SdkTooltip, TooltipArrow, TooltipContent as SdkTooltipContent } from "@ui-sdk/react/tooltip";
|
|
3
|
+
import { useSettledClose } from "../motion/settle-close";
|
|
3
4
|
/** How long the pointer rests on a trigger before its tooltip opens, unless `delay` says otherwise. */
|
|
4
5
|
const restingDelay = 300;
|
|
5
6
|
/** The ui-sdk tooltip, which waits 300ms instead of 600ms. Any `delay` still overrides it. */
|
|
6
7
|
export function Tooltip({ delay = restingDelay, ...props }) {
|
|
8
|
+
useSettledClose();
|
|
7
9
|
return _jsx(SdkTooltip, { delay: delay, ...props });
|
|
8
10
|
}
|
|
9
11
|
/** The ui-sdk tooltip content, with an arrow after its children unless `arrow` is `false`. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alulore/kumiko",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Polished, cozy React components with gentle motion, built on ui-sdk. Every look and behaviour can be switched with props and CSS tokens.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -16,6 +16,15 @@
|
|
|
16
16
|
"**/*.css"
|
|
17
17
|
],
|
|
18
18
|
"exports": {
|
|
19
|
+
"./avatar": {
|
|
20
|
+
"source": "./src/avatar/index.ts",
|
|
21
|
+
"types": "./dist/avatar/index.d.ts",
|
|
22
|
+
"default": "./dist/avatar/index.js"
|
|
23
|
+
},
|
|
24
|
+
"./avatar.css": {
|
|
25
|
+
"source": "./src/avatar/avatar.css",
|
|
26
|
+
"default": "./dist/avatar/avatar.css"
|
|
27
|
+
},
|
|
19
28
|
"./board": {
|
|
20
29
|
"source": "./src/board/index.ts",
|
|
21
30
|
"types": "./dist/board/index.d.ts",
|
|
@@ -52,6 +61,24 @@
|
|
|
52
61
|
"source": "./src/dialog/dialog.css",
|
|
53
62
|
"default": "./dist/dialog/dialog.css"
|
|
54
63
|
},
|
|
64
|
+
"./drawer": {
|
|
65
|
+
"source": "./src/drawer/index.ts",
|
|
66
|
+
"types": "./dist/drawer/index.d.ts",
|
|
67
|
+
"default": "./dist/drawer/index.js"
|
|
68
|
+
},
|
|
69
|
+
"./drawer.css": {
|
|
70
|
+
"source": "./src/drawer/drawer.css",
|
|
71
|
+
"default": "./dist/drawer/drawer.css"
|
|
72
|
+
},
|
|
73
|
+
"./file-input": {
|
|
74
|
+
"source": "./src/file-input/index.ts",
|
|
75
|
+
"types": "./dist/file-input/index.d.ts",
|
|
76
|
+
"default": "./dist/file-input/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./file-input.css": {
|
|
79
|
+
"source": "./src/file-input/file-input.css",
|
|
80
|
+
"default": "./dist/file-input/file-input.css"
|
|
81
|
+
},
|
|
55
82
|
"./hover-card": {
|
|
56
83
|
"source": "./src/hover-card/index.ts",
|
|
57
84
|
"types": "./dist/hover-card/index.d.ts",
|
|
@@ -97,6 +124,15 @@
|
|
|
97
124
|
"source": "./src/motion/motion.css",
|
|
98
125
|
"default": "./dist/motion/motion.css"
|
|
99
126
|
},
|
|
127
|
+
"./otp-input": {
|
|
128
|
+
"source": "./src/otp-input/index.ts",
|
|
129
|
+
"types": "./dist/otp-input/index.d.ts",
|
|
130
|
+
"default": "./dist/otp-input/index.js"
|
|
131
|
+
},
|
|
132
|
+
"./otp-input.css": {
|
|
133
|
+
"source": "./src/otp-input/otp-input.css",
|
|
134
|
+
"default": "./dist/otp-input/otp-input.css"
|
|
135
|
+
},
|
|
100
136
|
"./popover": {
|
|
101
137
|
"source": "./src/popover/index.ts",
|
|
102
138
|
"types": "./dist/popover/index.d.ts",
|
|
@@ -142,6 +178,15 @@
|
|
|
142
178
|
"source": "./src/separator/separator.css",
|
|
143
179
|
"default": "./dist/separator/separator.css"
|
|
144
180
|
},
|
|
181
|
+
"./skeleton": {
|
|
182
|
+
"source": "./src/skeleton/index.ts",
|
|
183
|
+
"types": "./dist/skeleton/index.d.ts",
|
|
184
|
+
"default": "./dist/skeleton/index.js"
|
|
185
|
+
},
|
|
186
|
+
"./skeleton.css": {
|
|
187
|
+
"source": "./src/skeleton/skeleton.css",
|
|
188
|
+
"default": "./dist/skeleton/skeleton.css"
|
|
189
|
+
},
|
|
145
190
|
"./slider": {
|
|
146
191
|
"source": "./src/slider/index.ts",
|
|
147
192
|
"types": "./dist/slider/index.d.ts",
|
|
@@ -165,6 +210,15 @@
|
|
|
165
210
|
"source": "./src/switch/switch.css",
|
|
166
211
|
"default": "./dist/switch/switch.css"
|
|
167
212
|
},
|
|
213
|
+
"./tabs": {
|
|
214
|
+
"source": "./src/tabs/index.ts",
|
|
215
|
+
"types": "./dist/tabs/index.d.ts",
|
|
216
|
+
"default": "./dist/tabs/index.js"
|
|
217
|
+
},
|
|
218
|
+
"./tabs.css": {
|
|
219
|
+
"source": "./src/tabs/tabs.css",
|
|
220
|
+
"default": "./dist/tabs/tabs.css"
|
|
221
|
+
},
|
|
168
222
|
"./toast": {
|
|
169
223
|
"source": "./src/toast/index.ts",
|
|
170
224
|
"types": "./dist/toast/index.d.ts",
|
|
@@ -292,8 +346,8 @@
|
|
|
292
346
|
"devDependencies": {
|
|
293
347
|
"@types/react": "^19.3.0",
|
|
294
348
|
"@types/react-dom": "^19.3.0",
|
|
295
|
-
"@ui-sdk/core": "0.1.0-beta.
|
|
296
|
-
"@ui-sdk/react": "0.1.0-beta.
|
|
349
|
+
"@ui-sdk/core": "0.1.0-beta.13",
|
|
350
|
+
"@ui-sdk/react": "0.1.0-beta.13",
|
|
297
351
|
"@vitejs/plugin-react": "^6.3.0",
|
|
298
352
|
"@vitest/browser-playwright": "5.1.0",
|
|
299
353
|
"playwright": "^1.65.1",
|
|
@@ -304,8 +358,8 @@
|
|
|
304
358
|
"vitest-browser-react": "^2.3.0"
|
|
305
359
|
},
|
|
306
360
|
"peerDependencies": {
|
|
307
|
-
"@ui-sdk/core": "0.1.0-beta.
|
|
308
|
-
"@ui-sdk/react": "0.1.0-beta.
|
|
361
|
+
"@ui-sdk/core": "0.1.0-beta.13",
|
|
362
|
+
"@ui-sdk/react": "0.1.0-beta.13",
|
|
309
363
|
"react": "^19.3.1",
|
|
310
364
|
"react-dom": "^19.3.1"
|
|
311
365
|
}
|