ssovee-os-web-ui 0.1.21 → 0.1.23
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 +13 -1
- package/dist/index.cjs +190 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +110 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +188 -43
- package/dist/index.js.map +1 -1
- package/dist/sdk.cjs +265 -0
- package/dist/sdk.cjs.map +1 -0
- package/dist/sdk.d.cts +24 -0
- package/dist/sdk.d.ts +24 -0
- package/dist/sdk.js +260 -0
- package/dist/sdk.js.map +1 -0
- package/package.json +11 -2
package/dist/index.css
CHANGED
|
@@ -363,6 +363,9 @@
|
|
|
363
363
|
.ml-12 {
|
|
364
364
|
margin-left: calc(var(--spacing) * 12);
|
|
365
365
|
}
|
|
366
|
+
.contents {
|
|
367
|
+
display: contents;
|
|
368
|
+
}
|
|
366
369
|
.flex {
|
|
367
370
|
display: flex;
|
|
368
371
|
}
|
|
@@ -1094,6 +1097,9 @@
|
|
|
1094
1097
|
.text-yellow-800 {
|
|
1095
1098
|
color: var(--color-yellow-800);
|
|
1096
1099
|
}
|
|
1100
|
+
.underline {
|
|
1101
|
+
text-decoration-line: underline;
|
|
1102
|
+
}
|
|
1097
1103
|
.underline-offset-2 {
|
|
1098
1104
|
text-underline-offset: 2px;
|
|
1099
1105
|
}
|
|
@@ -1132,6 +1138,9 @@
|
|
|
1132
1138
|
outline-style: var(--tw-outline-style);
|
|
1133
1139
|
outline-width: 1px;
|
|
1134
1140
|
}
|
|
1141
|
+
.filter {
|
|
1142
|
+
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
1143
|
+
}
|
|
1135
1144
|
.backdrop-blur-sm {
|
|
1136
1145
|
--tw-backdrop-blur: blur(var(--blur-sm));
|
|
1137
1146
|
-webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
|
|
@@ -1511,6 +1520,41 @@
|
|
|
1511
1520
|
box-shadow: inset 0 1.5px 1.5px rgba(0, 0, 0, 0.1), inset 0 -0.5px 0 rgba(255, 255, 255, 0.09), inset 0 -1px 0 rgba(255, 255, 255, 0.08), inset 0 0.5px 0 rgba(255, 255, 255, 0.05);
|
|
1512
1521
|
}
|
|
1513
1522
|
}
|
|
1523
|
+
.window-grid {
|
|
1524
|
+
display: grid;
|
|
1525
|
+
grid-template-columns: repeat(12, minmax(0, 1fr));
|
|
1526
|
+
gap: 0.5rem;
|
|
1527
|
+
}
|
|
1528
|
+
.col-span-mobile-12, .col-span-tablet-12, .col-span-desktop-12 {
|
|
1529
|
+
grid-column: span 12 / span 12;
|
|
1530
|
+
}
|
|
1531
|
+
.col-span-mobile-10, .col-span-tablet-10, .col-span-desktop-10 {
|
|
1532
|
+
grid-column: span 10 / span 10;
|
|
1533
|
+
}
|
|
1534
|
+
.col-span-mobile-9, .col-span-tablet-9, .col-span-desktop-9 {
|
|
1535
|
+
grid-column: span 9 / span 9;
|
|
1536
|
+
}
|
|
1537
|
+
.col-span-mobile-8, .col-span-tablet-8, .col-span-desktop-8 {
|
|
1538
|
+
grid-column: span 8 / span 8;
|
|
1539
|
+
}
|
|
1540
|
+
.col-span-mobile-7 {
|
|
1541
|
+
grid-column: span 7 / span 7;
|
|
1542
|
+
}
|
|
1543
|
+
.col-span-mobile-6, .col-span-tablet-6, .col-span-desktop-6 {
|
|
1544
|
+
grid-column: span 6 / span 6;
|
|
1545
|
+
}
|
|
1546
|
+
.col-span-mobile-4, .col-span-tablet-4, .col-span-desktop-4 {
|
|
1547
|
+
grid-column: span 4 / span 4;
|
|
1548
|
+
}
|
|
1549
|
+
.col-span-mobile-3, .col-span-tablet-3, .col-span-desktop-3 {
|
|
1550
|
+
grid-column: span 3 / span 3;
|
|
1551
|
+
}
|
|
1552
|
+
.col-span-mobile-2, .col-span-tablet-2, .col-span-desktop-2 {
|
|
1553
|
+
grid-column: span 2 / span 2;
|
|
1554
|
+
}
|
|
1555
|
+
.col-span-mobile-1, .col-span-tablet-1, .col-span-desktop-1 {
|
|
1556
|
+
grid-column: span 1 / span 1;
|
|
1557
|
+
}
|
|
1514
1558
|
@property --tw-translate-x {
|
|
1515
1559
|
syntax: "*";
|
|
1516
1560
|
inherits: false;
|
|
@@ -1639,6 +1683,59 @@
|
|
|
1639
1683
|
inherits: false;
|
|
1640
1684
|
initial-value: solid;
|
|
1641
1685
|
}
|
|
1686
|
+
@property --tw-blur {
|
|
1687
|
+
syntax: "*";
|
|
1688
|
+
inherits: false;
|
|
1689
|
+
}
|
|
1690
|
+
@property --tw-brightness {
|
|
1691
|
+
syntax: "*";
|
|
1692
|
+
inherits: false;
|
|
1693
|
+
}
|
|
1694
|
+
@property --tw-contrast {
|
|
1695
|
+
syntax: "*";
|
|
1696
|
+
inherits: false;
|
|
1697
|
+
}
|
|
1698
|
+
@property --tw-grayscale {
|
|
1699
|
+
syntax: "*";
|
|
1700
|
+
inherits: false;
|
|
1701
|
+
}
|
|
1702
|
+
@property --tw-hue-rotate {
|
|
1703
|
+
syntax: "*";
|
|
1704
|
+
inherits: false;
|
|
1705
|
+
}
|
|
1706
|
+
@property --tw-invert {
|
|
1707
|
+
syntax: "*";
|
|
1708
|
+
inherits: false;
|
|
1709
|
+
}
|
|
1710
|
+
@property --tw-opacity {
|
|
1711
|
+
syntax: "*";
|
|
1712
|
+
inherits: false;
|
|
1713
|
+
}
|
|
1714
|
+
@property --tw-saturate {
|
|
1715
|
+
syntax: "*";
|
|
1716
|
+
inherits: false;
|
|
1717
|
+
}
|
|
1718
|
+
@property --tw-sepia {
|
|
1719
|
+
syntax: "*";
|
|
1720
|
+
inherits: false;
|
|
1721
|
+
}
|
|
1722
|
+
@property --tw-drop-shadow {
|
|
1723
|
+
syntax: "*";
|
|
1724
|
+
inherits: false;
|
|
1725
|
+
}
|
|
1726
|
+
@property --tw-drop-shadow-color {
|
|
1727
|
+
syntax: "*";
|
|
1728
|
+
inherits: false;
|
|
1729
|
+
}
|
|
1730
|
+
@property --tw-drop-shadow-alpha {
|
|
1731
|
+
syntax: "<percentage>";
|
|
1732
|
+
inherits: false;
|
|
1733
|
+
initial-value: 100%;
|
|
1734
|
+
}
|
|
1735
|
+
@property --tw-drop-shadow-size {
|
|
1736
|
+
syntax: "*";
|
|
1737
|
+
inherits: false;
|
|
1738
|
+
}
|
|
1642
1739
|
@property --tw-backdrop-blur {
|
|
1643
1740
|
syntax: "*";
|
|
1644
1741
|
inherits: false;
|
|
@@ -1730,6 +1827,19 @@
|
|
|
1730
1827
|
--tw-ring-offset-color: #fff;
|
|
1731
1828
|
--tw-ring-offset-shadow: 0 0 #0000;
|
|
1732
1829
|
--tw-outline-style: solid;
|
|
1830
|
+
--tw-blur: initial;
|
|
1831
|
+
--tw-brightness: initial;
|
|
1832
|
+
--tw-contrast: initial;
|
|
1833
|
+
--tw-grayscale: initial;
|
|
1834
|
+
--tw-hue-rotate: initial;
|
|
1835
|
+
--tw-invert: initial;
|
|
1836
|
+
--tw-opacity: initial;
|
|
1837
|
+
--tw-saturate: initial;
|
|
1838
|
+
--tw-sepia: initial;
|
|
1839
|
+
--tw-drop-shadow: initial;
|
|
1840
|
+
--tw-drop-shadow-color: initial;
|
|
1841
|
+
--tw-drop-shadow-alpha: 100%;
|
|
1842
|
+
--tw-drop-shadow-size: initial;
|
|
1733
1843
|
--tw-backdrop-blur: initial;
|
|
1734
1844
|
--tw-backdrop-brightness: initial;
|
|
1735
1845
|
--tw-backdrop-contrast: initial;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
+
export { useDeviceSupport, useGridClasses, useShortcutFormatter, useSound } from './sdk.cjs';
|
|
3
4
|
|
|
4
5
|
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
6
|
variant?: "primary" | "secondary" | "outline" | "ghost" | "danger" | "success" | "filled" | "text";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
|
+
export { useDeviceSupport, useGridClasses, useShortcutFormatter, useSound } from './sdk.js';
|
|
3
4
|
|
|
4
5
|
interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
5
6
|
variant?: "primary" | "secondary" | "outline" | "ghost" | "danger" | "success" | "filled" | "text";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React20 from 'react';
|
|
2
|
-
import React20__default, { useRef, useImperativeHandle, useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import React20__default, { useRef, useImperativeHandle, useCallback, useEffect, useState, useMemo } from 'react';
|
|
3
3
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { ArrowCircleRightIcon, CaretDownIcon, CheckIcon, MagnifyingGlassIcon, XIcon, CaretLeftIcon, CaretRightIcon, CaretUpIcon, InfoIcon, WarningIcon, CheckCircleIcon, UploadIcon } from '@phosphor-icons/react';
|
|
5
|
+
import { UAParser } from 'ua-parser-js';
|
|
5
6
|
|
|
6
7
|
// src/components/Button.tsx
|
|
7
8
|
|
|
@@ -1291,64 +1292,138 @@ var Tooltip = ({
|
|
|
1291
1292
|
);
|
|
1292
1293
|
};
|
|
1293
1294
|
var Tooltip_default = Tooltip;
|
|
1295
|
+
|
|
1296
|
+
// src/utils/constants.ts
|
|
1294
1297
|
var globalKeyboardShortcuts = [
|
|
1295
|
-
{
|
|
1296
|
-
|
|
1298
|
+
{
|
|
1299
|
+
command: "toggle_theme",
|
|
1300
|
+
shortcut: ["Ctrl", "Shift", "M"],
|
|
1301
|
+
usage: "Toggle between light and dark theme"
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
command: "app_switcher",
|
|
1305
|
+
shortcut: ["Ctrl", "Shift", "S"],
|
|
1306
|
+
usage: "Switch between open apps"
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
command: "exit_app",
|
|
1310
|
+
shortcut: ["Ctrl", "E"],
|
|
1311
|
+
usage: "Exit or quit the application"
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
command: "maximize_app",
|
|
1315
|
+
shortcut: ["Ctrl", "ArrowUp"],
|
|
1316
|
+
usage: "Maximize the application window"
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
command: "minimize_app",
|
|
1320
|
+
shortcut: ["Ctrl", "ArrowDown"],
|
|
1321
|
+
usage: "Minimize the application window"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
command: "global_search",
|
|
1325
|
+
shortcut: ["Ctrl", "Shift", "K"],
|
|
1326
|
+
usage: "Open global search"
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
command: "toggle_search_mode",
|
|
1330
|
+
shortcut: ["Ctrl", "Shift", "L"],
|
|
1331
|
+
usage: "Enable AI and Voice command (start/stop voice input in search)"
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
command: "toggle_control_center",
|
|
1335
|
+
shortcut: ["Ctrl", "Shift", "O"],
|
|
1336
|
+
usage: "Toggle control center panel or drawer"
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
command: "arrow_up",
|
|
1340
|
+
shortcut: ["ArrowUp"],
|
|
1341
|
+
usage: "Navigate up in lists, menus and options"
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
command: "arrow_down",
|
|
1345
|
+
shortcut: ["ArrowDown"],
|
|
1346
|
+
usage: "Navigate down in lists, menus and options"
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
command: "escape_button_action",
|
|
1350
|
+
shortcut: ["Escape"],
|
|
1351
|
+
usage: "Close or go back from any open alert, popup, search, or control center"
|
|
1352
|
+
},
|
|
1353
|
+
{
|
|
1354
|
+
command: "enter_button_action",
|
|
1355
|
+
shortcut: ["Enter"],
|
|
1356
|
+
usage: "Select or confirm the currently focused item"
|
|
1357
|
+
},
|
|
1358
|
+
{
|
|
1359
|
+
command: "toggle_filters",
|
|
1360
|
+
shortcut: ["Ctrl", "Shift", "U"],
|
|
1361
|
+
usage: "To open or close filters of any current active app"
|
|
1362
|
+
},
|
|
1363
|
+
{
|
|
1364
|
+
command: "focus_search",
|
|
1365
|
+
shortcut: ["Ctrl", "k"],
|
|
1366
|
+
usage: "Focus on current app search"
|
|
1367
|
+
},
|
|
1368
|
+
{
|
|
1369
|
+
command: "toggle_all_apps",
|
|
1370
|
+
shortcut: ["Ctrl", "Shift", "A"],
|
|
1371
|
+
usage: "Toggle showing all available apps and plugins"
|
|
1372
|
+
}
|
|
1297
1373
|
];
|
|
1298
1374
|
var keyMap = {
|
|
1375
|
+
mac: {
|
|
1376
|
+
ctrl: "\u2318",
|
|
1377
|
+
alt: "\u2325",
|
|
1378
|
+
shift: "\u21E7",
|
|
1379
|
+
enter: "\u23CE",
|
|
1380
|
+
backspace: "\u232B",
|
|
1381
|
+
arrowup: "\u2191",
|
|
1382
|
+
arrowdown: "\u2193"
|
|
1383
|
+
},
|
|
1299
1384
|
windows: {
|
|
1300
1385
|
ctrl: "Ctrl",
|
|
1301
1386
|
alt: "Alt",
|
|
1302
1387
|
shift: "Shift",
|
|
1303
|
-
meta: "Win",
|
|
1304
|
-
escape: "Esc",
|
|
1305
1388
|
enter: "Enter",
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
ctrl: "Ctrl",
|
|
1310
|
-
alt: "\u2325",
|
|
1311
|
-
shift: "\u21E7",
|
|
1312
|
-
meta: "\u2318",
|
|
1313
|
-
escape: "Esc",
|
|
1314
|
-
enter: "Enter",
|
|
1315
|
-
k: "K"
|
|
1389
|
+
backspace: "Backspace",
|
|
1390
|
+
arrowup: "\u2191",
|
|
1391
|
+
arrowdown: "\u2193"
|
|
1316
1392
|
},
|
|
1317
1393
|
linux: {
|
|
1318
1394
|
ctrl: "Ctrl",
|
|
1319
1395
|
alt: "Alt",
|
|
1320
1396
|
shift: "Shift",
|
|
1321
|
-
meta: "Meta",
|
|
1322
|
-
escape: "Esc",
|
|
1323
1397
|
enter: "Enter",
|
|
1324
|
-
|
|
1398
|
+
backspace: "Backspace",
|
|
1399
|
+
arrowup: "\u2191",
|
|
1400
|
+
arrowdown: "\u2193"
|
|
1325
1401
|
}
|
|
1326
1402
|
};
|
|
1327
1403
|
var detectOS = () => {
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
if (
|
|
1333
|
-
|
|
1334
|
-
return "linux";
|
|
1404
|
+
const parser = new UAParser();
|
|
1405
|
+
const osName = parser.getOS().name?.toLowerCase() || "";
|
|
1406
|
+
if (osName.includes("mac")) return "mac";
|
|
1407
|
+
if (osName.includes("windows")) return "windows";
|
|
1408
|
+
if (osName.includes("linux")) return "linux";
|
|
1409
|
+
return "windows";
|
|
1335
1410
|
};
|
|
1411
|
+
var normalizeKey = (key) => key.toLowerCase();
|
|
1336
1412
|
var matchShortcut = (event, shortcut, os) => {
|
|
1337
|
-
const
|
|
1338
|
-
const
|
|
1339
|
-
if (
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
if (
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
return matchesPrimaryKey && shiftMatches;
|
|
1413
|
+
const keySet = new Set(shortcut.map(normalizeKey));
|
|
1414
|
+
const pressed = [];
|
|
1415
|
+
if (os === "mac") {
|
|
1416
|
+
if (event.metaKey) pressed.push("ctrl");
|
|
1417
|
+
} else {
|
|
1418
|
+
if (event.ctrlKey) pressed.push("ctrl");
|
|
1419
|
+
}
|
|
1420
|
+
if (event.altKey) pressed.push("alt");
|
|
1421
|
+
if (event.shiftKey) pressed.push("shift");
|
|
1422
|
+
if (event.key && !["Control", "Meta", "Alt", "Shift"].includes(event.key)) {
|
|
1423
|
+
pressed.push(normalizeKey(event.key));
|
|
1424
|
+
}
|
|
1425
|
+
if (pressed.length !== shortcut.length) return false;
|
|
1426
|
+
return pressed.every((k) => keySet.has(k));
|
|
1352
1427
|
};
|
|
1353
1428
|
var useShortcutFormatter = () => {
|
|
1354
1429
|
const [os, setOS] = useState("windows");
|
|
@@ -1359,7 +1434,7 @@ var useShortcutFormatter = () => {
|
|
|
1359
1434
|
useEffect(() => {
|
|
1360
1435
|
const handleKeyDown = (event) => {
|
|
1361
1436
|
for (const shortcut of globalKeyboardShortcuts) {
|
|
1362
|
-
if (matchShortcut(event, shortcut.shortcut)) {
|
|
1437
|
+
if (matchShortcut(event, shortcut.shortcut, os)) {
|
|
1363
1438
|
const listeners = listenersRef.current.get(shortcut.command);
|
|
1364
1439
|
if (listeners) {
|
|
1365
1440
|
event.preventDefault();
|
|
@@ -1377,7 +1452,7 @@ var useShortcutFormatter = () => {
|
|
|
1377
1452
|
return keys.map((key) => keyMap[os][key.toLowerCase()] || key.toUpperCase()).join(" + ");
|
|
1378
1453
|
};
|
|
1379
1454
|
const getShortcutByCommand = (command) => {
|
|
1380
|
-
const found = globalKeyboardShortcuts.find((
|
|
1455
|
+
const found = globalKeyboardShortcuts.find((s) => s.command === command);
|
|
1381
1456
|
return found ? found.shortcut : [""];
|
|
1382
1457
|
};
|
|
1383
1458
|
const addShortcutListener = (command, listener) => {
|
|
@@ -2019,7 +2094,77 @@ var TableCaption = React20.forwardRef(({ className, ...props }, ref) => /* @__PU
|
|
|
2019
2094
|
}
|
|
2020
2095
|
));
|
|
2021
2096
|
TableCaption.displayName = "TableCaption";
|
|
2097
|
+
var useGridClasses = (windowSize, gridRules) => {
|
|
2098
|
+
const deviceType = useMemo(() => {
|
|
2099
|
+
if (windowSize.width <= 640) return "mobile";
|
|
2100
|
+
if (windowSize.width <= 1024) return "tablet";
|
|
2101
|
+
return "desktop";
|
|
2102
|
+
}, [windowSize]);
|
|
2103
|
+
const gridClasses = useMemo(() => {
|
|
2104
|
+
const classes = {};
|
|
2105
|
+
for (const element in gridRules) {
|
|
2106
|
+
const classRules = gridRules[element];
|
|
2107
|
+
const colSpan = classRules["col-span"][deviceType];
|
|
2108
|
+
classes[element] = `col-span-${deviceType}-${colSpan}`;
|
|
2109
|
+
}
|
|
2110
|
+
return classes;
|
|
2111
|
+
}, [deviceType, gridRules]);
|
|
2112
|
+
return { gridClasses, deviceType };
|
|
2113
|
+
};
|
|
2114
|
+
var useGridClasses_default = useGridClasses;
|
|
2115
|
+
var useDeviceSupport = () => {
|
|
2116
|
+
const [isSupported, setIsSupported] = useState(true);
|
|
2117
|
+
useEffect(() => {
|
|
2118
|
+
function checkSupport() {
|
|
2119
|
+
const ua = typeof window !== "undefined" ? window.navigator.userAgent : "";
|
|
2120
|
+
const width = typeof window !== "undefined" ? window.innerWidth : 1920;
|
|
2121
|
+
const height = typeof window !== "undefined" ? window.innerHeight : 1080;
|
|
2122
|
+
const isTouch = typeof window !== "undefined" ? "ontouchstart" in window : false;
|
|
2123
|
+
const isMobile = /Mobi|Android|iPhone|iPod/.test(ua) && width <= 767;
|
|
2124
|
+
const isTablet = /iPad|Tablet|Android/.test(ua) && !/Mobile/.test(ua) || isTouch && width >= 600 && width <= 1024;
|
|
2125
|
+
const isTabletPortrait = isTablet && width < height;
|
|
2126
|
+
const isTabletLandscape = isTablet && width > height && width >= 1024 && width <= 1366;
|
|
2127
|
+
const isLaptop = width >= 1024 && !isMobile && (!isTablet || isTabletLandscape);
|
|
2128
|
+
if (isMobile) {
|
|
2129
|
+
setIsSupported(false);
|
|
2130
|
+
} else if (isTabletPortrait) {
|
|
2131
|
+
setIsSupported(false);
|
|
2132
|
+
} else if (isTabletLandscape) {
|
|
2133
|
+
setIsSupported(true);
|
|
2134
|
+
} else if (isLaptop) {
|
|
2135
|
+
setIsSupported(true);
|
|
2136
|
+
} else {
|
|
2137
|
+
setIsSupported(true);
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
checkSupport();
|
|
2141
|
+
window.addEventListener("resize", checkSupport);
|
|
2142
|
+
return () => window.removeEventListener("resize", checkSupport);
|
|
2143
|
+
}, []);
|
|
2144
|
+
return isSupported;
|
|
2145
|
+
};
|
|
2146
|
+
var soundMap = {
|
|
2147
|
+
click: "/sounds/click-tone.wav",
|
|
2148
|
+
alert: "/sounds/error-tone.wav",
|
|
2149
|
+
notification: "/sounds/notification-tone.wav",
|
|
2150
|
+
error: "/sounds/error-tone.wav",
|
|
2151
|
+
success: "/sounds/success-tone.wav",
|
|
2152
|
+
swipe: "/sounds/swipe-tone.wav"
|
|
2153
|
+
};
|
|
2154
|
+
var useSound = () => {
|
|
2155
|
+
const playSound = useCallback((type) => {
|
|
2156
|
+
if (typeof window === "undefined" || typeof window.Audio === "undefined") {
|
|
2157
|
+
return;
|
|
2158
|
+
}
|
|
2159
|
+
const soundSrc = soundMap[type];
|
|
2160
|
+
const audio = new window.Audio(soundSrc);
|
|
2161
|
+
audio.play().catch((err) => {
|
|
2162
|
+
console.error("Sound playback failed:", err);
|
|
2163
|
+
});
|
|
2164
|
+
}, []);
|
|
2165
|
+
return { playSound };
|
|
2166
|
+
};
|
|
2022
2167
|
|
|
2023
|
-
export { Accordion_default as Accordion, Alert_default as Alert, Avatar_default as Avatar, Badge_default as Badge, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Divider_default as Divider, Dropdown_default as Dropdown, FileUpload_default as FileUpload, ImageWithPlaceholder_default as ImageWithPlaceholder, Input_default as Input, Loading_default as Loading, Modal_default as Modal, Pagination_default as Pagination, Progress_default as Progress, Radio_default as Radio, SearchInput_default as SearchInput, Select_default as Select, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs_default as Tabs, TextArea_default as TextArea, Toast_default as Toast, Toggle_default as Toggle, Tooltip_default as Tooltip, Typography_default as Typography };
|
|
2168
|
+
export { Accordion_default as Accordion, Alert_default as Alert, Avatar_default as Avatar, Badge_default as Badge, Button_default as Button, Card_default as Card, Checkbox_default as Checkbox, Divider_default as Divider, Dropdown_default as Dropdown, FileUpload_default as FileUpload, ImageWithPlaceholder_default as ImageWithPlaceholder, Input_default as Input, Loading_default as Loading, Modal_default as Modal, Pagination_default as Pagination, Progress_default as Progress, Radio_default as Radio, SearchInput_default as SearchInput, Select_default as Select, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs_default as Tabs, TextArea_default as TextArea, Toast_default as Toast, Toggle_default as Toggle, Tooltip_default as Tooltip, Typography_default as Typography, useDeviceSupport, useGridClasses_default as useGridClasses, useShortcutFormatter_default as useShortcutFormatter, useSound };
|
|
2024
2169
|
//# sourceMappingURL=index.js.map
|
|
2025
2170
|
//# sourceMappingURL=index.js.map
|