@imc0nt0/wooris 0.0.3 → 0.0.5
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/index.cjs.js +363 -47
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +361 -50
- package/dist/index.esm.js.map +1 -1
- package/package.json +6 -4
- package/dist/tokens.css +0 -1
- package/src/tokens.css +0 -33
package/dist/index.cjs.js
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
|
|
6
|
+
function _arrayLikeToArray(r, a) {
|
|
7
|
+
(null == a || a > r.length) && (a = r.length);
|
|
8
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
function _arrayWithHoles(r) {
|
|
12
|
+
if (Array.isArray(r)) return r;
|
|
13
|
+
}
|
|
14
|
+
function _arrayWithoutHoles(r) {
|
|
15
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
16
|
+
}
|
|
6
17
|
function _defineProperty(e, r, t) {
|
|
7
18
|
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
8
19
|
value: t,
|
|
@@ -11,6 +22,42 @@ function _defineProperty(e, r, t) {
|
|
|
11
22
|
writable: !0
|
|
12
23
|
}) : e[r] = t, e;
|
|
13
24
|
}
|
|
25
|
+
function _iterableToArray(r) {
|
|
26
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
27
|
+
}
|
|
28
|
+
function _iterableToArrayLimit(r, l) {
|
|
29
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
30
|
+
if (null != t) {
|
|
31
|
+
var e,
|
|
32
|
+
n,
|
|
33
|
+
i,
|
|
34
|
+
u,
|
|
35
|
+
a = [],
|
|
36
|
+
f = !0,
|
|
37
|
+
o = !1;
|
|
38
|
+
try {
|
|
39
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
40
|
+
if (Object(t) !== t) return;
|
|
41
|
+
f = !1;
|
|
42
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
43
|
+
} catch (r) {
|
|
44
|
+
o = !0, n = r;
|
|
45
|
+
} finally {
|
|
46
|
+
try {
|
|
47
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
48
|
+
} finally {
|
|
49
|
+
if (o) throw n;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return a;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function _nonIterableRest() {
|
|
56
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
57
|
+
}
|
|
58
|
+
function _nonIterableSpread() {
|
|
59
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
60
|
+
}
|
|
14
61
|
function ownKeys(e, r) {
|
|
15
62
|
var t = Object.keys(e);
|
|
16
63
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -52,6 +99,12 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
52
99
|
}
|
|
53
100
|
return t;
|
|
54
101
|
}
|
|
102
|
+
function _slicedToArray(r, e) {
|
|
103
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
104
|
+
}
|
|
105
|
+
function _toConsumableArray(r) {
|
|
106
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
107
|
+
}
|
|
55
108
|
function _toPrimitive(t, r) {
|
|
56
109
|
if ("object" != typeof t || !t) return t;
|
|
57
110
|
var e = t[Symbol.toPrimitive];
|
|
@@ -66,6 +119,13 @@ function _toPropertyKey(t) {
|
|
|
66
119
|
var i = _toPrimitive(t, "string");
|
|
67
120
|
return "symbol" == typeof i ? i : i + "";
|
|
68
121
|
}
|
|
122
|
+
function _unsupportedIterableToArray(r, a) {
|
|
123
|
+
if (r) {
|
|
124
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
125
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
126
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
69
129
|
|
|
70
130
|
var propTypesExports = {};
|
|
71
131
|
var propTypes = {
|
|
@@ -1257,61 +1317,39 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1257
1317
|
propTypes.exports = requireFactoryWithThrowingShims()();
|
|
1258
1318
|
}
|
|
1259
1319
|
|
|
1260
|
-
var _excluded$
|
|
1261
|
-
var VARIANT_STYLE = {
|
|
1262
|
-
primary: 'background: var(--color-primary); color: white;',
|
|
1263
|
-
success: 'background: var(--color-success); color: white;',
|
|
1264
|
-
error: 'background: var(--color-error); color: white;',
|
|
1265
|
-
info: 'background: var(--color-info); color: white;',
|
|
1266
|
-
warning: 'background: var(--color-warning); color: black;'
|
|
1267
|
-
};
|
|
1320
|
+
var _excluded$3 = ["children", "variant", "type", "onClick", "className", "disabled"];
|
|
1268
1321
|
var Button = function Button(_ref) {
|
|
1269
1322
|
var children = _ref.children,
|
|
1270
1323
|
_ref$variant = _ref.variant,
|
|
1271
1324
|
variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
|
|
1325
|
+
_ref$type = _ref.type,
|
|
1326
|
+
type = _ref$type === void 0 ? 'md' : _ref$type,
|
|
1272
1327
|
onClick = _ref.onClick,
|
|
1273
1328
|
_ref$className = _ref.className,
|
|
1274
1329
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1275
1330
|
_ref$disabled = _ref.disabled,
|
|
1276
1331
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
1277
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
1278
|
-
var
|
|
1279
|
-
|
|
1280
|
-
|
|
1332
|
+
rest = _objectWithoutProperties(_ref, _excluded$3);
|
|
1333
|
+
var variantClass = "wooris-btn-".concat(variant);
|
|
1334
|
+
var typeClass = "wooris-btn-".concat(type);
|
|
1335
|
+
return /*#__PURE__*/jsxRuntime.jsx("button", _objectSpread2(_objectSpread2({
|
|
1336
|
+
className: "wooris-btn ".concat(variantClass, " ").concat(typeClass, " ").concat(className),
|
|
1281
1337
|
onClick: onClick,
|
|
1282
|
-
disabled: disabled
|
|
1283
|
-
style: {},
|
|
1284
|
-
"data-variant": variant
|
|
1338
|
+
disabled: disabled
|
|
1285
1339
|
}, rest), {}, {
|
|
1286
|
-
children:
|
|
1287
|
-
style: {
|
|
1288
|
-
display: 'inline-flex',
|
|
1289
|
-
alignItems: 'center',
|
|
1290
|
-
gap: 8
|
|
1291
|
-
},
|
|
1292
|
-
dangerouslySetInnerHTML: {
|
|
1293
|
-
__html: ''
|
|
1294
|
-
}
|
|
1295
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1296
|
-
style: {},
|
|
1297
|
-
children: children
|
|
1298
|
-
}), /*#__PURE__*/jsxRuntime.jsx("style", {
|
|
1299
|
-
jsx: true,
|
|
1300
|
-
children: ""
|
|
1301
|
-
}), /*#__PURE__*/jsxRuntime.jsx("style", {
|
|
1302
|
-
children: "button[data-variant=\"".concat(variant, "\"]{ ").concat(styleString, " }")
|
|
1303
|
-
})]
|
|
1340
|
+
children: children
|
|
1304
1341
|
}));
|
|
1305
1342
|
};
|
|
1306
1343
|
Button.propTypes = {
|
|
1307
1344
|
children: propTypesExports.node,
|
|
1308
1345
|
variant: propTypesExports.oneOf(['primary', 'success', 'error', 'info', 'warning']),
|
|
1346
|
+
type: propTypesExports.oneOf(['xs', 'sm', 'md', 'lg', 'xl', 'xl2', 'xl3']),
|
|
1309
1347
|
onClick: propTypesExports.func,
|
|
1310
1348
|
className: propTypesExports.string,
|
|
1311
1349
|
disabled: propTypesExports.bool
|
|
1312
1350
|
};
|
|
1313
1351
|
|
|
1314
|
-
var _excluded = ["placeholder", "value", "onChange", "className", "type"];
|
|
1352
|
+
var _excluded$2 = ["placeholder", "value", "onChange", "className", "type"];
|
|
1315
1353
|
var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
1316
1354
|
var _ref$placeholder = _ref.placeholder,
|
|
1317
1355
|
placeholder = _ref$placeholder === void 0 ? '' : _ref$placeholder,
|
|
@@ -1321,7 +1359,7 @@ var Input = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
1321
1359
|
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1322
1360
|
_ref$type = _ref.type,
|
|
1323
1361
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1324
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
1362
|
+
rest = _objectWithoutProperties(_ref, _excluded$2);
|
|
1325
1363
|
return /*#__PURE__*/jsxRuntime.jsx("input", _objectSpread2({
|
|
1326
1364
|
ref: ref,
|
|
1327
1365
|
className: "wooris-input ".concat(className),
|
|
@@ -1346,19 +1384,9 @@ var Badge = function Badge(_ref) {
|
|
|
1346
1384
|
variant = _ref$variant === void 0 ? 'primary' : _ref$variant,
|
|
1347
1385
|
_ref$className = _ref.className,
|
|
1348
1386
|
className = _ref$className === void 0 ? '' : _ref$className;
|
|
1349
|
-
var
|
|
1350
|
-
primary: 'var(--color-primary)',
|
|
1351
|
-
success: 'var(--color-success)',
|
|
1352
|
-
error: 'var(--color-error)',
|
|
1353
|
-
info: 'var(--color-info)',
|
|
1354
|
-
warning: 'var(--color-warning)'
|
|
1355
|
-
}[variant] || 'var(--color-primary)';
|
|
1387
|
+
var variantClass = "wooris-badge-".concat(variant);
|
|
1356
1388
|
return /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
1357
|
-
className: "wooris-badge ".concat(className),
|
|
1358
|
-
style: {
|
|
1359
|
-
background: bg,
|
|
1360
|
-
color: '#fff'
|
|
1361
|
-
},
|
|
1389
|
+
className: "wooris-badge ".concat(variantClass, " ").concat(className),
|
|
1362
1390
|
children: children
|
|
1363
1391
|
});
|
|
1364
1392
|
};
|
|
@@ -1423,6 +1451,286 @@ Modal.propTypes = {
|
|
|
1423
1451
|
closeOnBackdrop: propTypesExports.bool
|
|
1424
1452
|
};
|
|
1425
1453
|
|
|
1454
|
+
var _excluded$1 = ["children", "container", "item", "spacing", "type", "xs", "sm", "md", "lg"];
|
|
1455
|
+
var Grid = function Grid(_ref) {
|
|
1456
|
+
var children = _ref.children,
|
|
1457
|
+
_ref$container = _ref.container,
|
|
1458
|
+
container = _ref$container === void 0 ? false : _ref$container,
|
|
1459
|
+
_ref$item = _ref.item,
|
|
1460
|
+
item = _ref$item === void 0 ? false : _ref$item,
|
|
1461
|
+
_ref$spacing = _ref.spacing,
|
|
1462
|
+
spacing = _ref$spacing === void 0 ? 0 : _ref$spacing,
|
|
1463
|
+
_ref$type = _ref.type,
|
|
1464
|
+
type = _ref$type === void 0 ? 'md' : _ref$type,
|
|
1465
|
+
xs = _ref.xs,
|
|
1466
|
+
sm = _ref.sm,
|
|
1467
|
+
md = _ref.md,
|
|
1468
|
+
lg = _ref.lg,
|
|
1469
|
+
rest = _objectWithoutProperties(_ref, _excluded$1);
|
|
1470
|
+
var classNames = ['wooris-grid'];
|
|
1471
|
+
var styles = {};
|
|
1472
|
+
if (container) {
|
|
1473
|
+
classNames.push('wooris-grid-container');
|
|
1474
|
+
if (spacing > 0) {
|
|
1475
|
+
styles.gap = "".concat(spacing * 8, "px");
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
if (item) {
|
|
1479
|
+
classNames.push('wooris-grid-item');
|
|
1480
|
+
classNames.push("wooris-grid-item-".concat(type)); // Apply type class to items
|
|
1481
|
+
if (xs) classNames.push("wooris-grid-xs-".concat(xs));
|
|
1482
|
+
if (sm) classNames.push("wooris-grid-sm-".concat(sm));
|
|
1483
|
+
if (md) classNames.push("wooris-grid-md-".concat(md));
|
|
1484
|
+
if (lg) classNames.push("wooris-grid-lg-".concat(lg));
|
|
1485
|
+
}
|
|
1486
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread2(_objectSpread2({
|
|
1487
|
+
className: classNames.join(' '),
|
|
1488
|
+
style: styles
|
|
1489
|
+
}, rest), {}, {
|
|
1490
|
+
children: children
|
|
1491
|
+
}));
|
|
1492
|
+
};
|
|
1493
|
+
Grid.propTypes = {
|
|
1494
|
+
children: propTypesExports.node,
|
|
1495
|
+
container: propTypesExports.bool,
|
|
1496
|
+
item: propTypesExports.bool,
|
|
1497
|
+
spacing: propTypesExports.number,
|
|
1498
|
+
type: propTypesExports.oneOf(['xs', 'sm', 'md', 'lg', 'xl', 'xl2', 'xl3']),
|
|
1499
|
+
// Updated type prop types
|
|
1500
|
+
xs: propTypesExports.number,
|
|
1501
|
+
sm: propTypesExports.number,
|
|
1502
|
+
md: propTypesExports.number,
|
|
1503
|
+
lg: propTypesExports.number
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1506
|
+
var _excluded = ["children", "type", "className"];
|
|
1507
|
+
var Card = function Card(_ref) {
|
|
1508
|
+
var children = _ref.children,
|
|
1509
|
+
_ref$type = _ref.type,
|
|
1510
|
+
type = _ref$type === void 0 ? 'md' : _ref$type,
|
|
1511
|
+
_ref$className = _ref.className,
|
|
1512
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
1513
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
1514
|
+
var typeClass = "wooris-card-".concat(type);
|
|
1515
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread2(_objectSpread2({
|
|
1516
|
+
className: "wooris-card ".concat(typeClass, " ").concat(className)
|
|
1517
|
+
}, rest), {}, {
|
|
1518
|
+
children: children
|
|
1519
|
+
}));
|
|
1520
|
+
};
|
|
1521
|
+
Card.propTypes = {
|
|
1522
|
+
children: propTypesExports.node,
|
|
1523
|
+
type: propTypesExports.oneOf(['xs', 'sm', 'md', 'lg', 'xl', 'xl2', 'xl3']),
|
|
1524
|
+
className: propTypesExports.string
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
function styleInject(css, ref) {
|
|
1528
|
+
if ( ref === void 0 ) ref = {};
|
|
1529
|
+
var insertAt = ref.insertAt;
|
|
1530
|
+
|
|
1531
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
1532
|
+
|
|
1533
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
1534
|
+
var style = document.createElement('style');
|
|
1535
|
+
style.type = 'text/css';
|
|
1536
|
+
|
|
1537
|
+
if (insertAt === 'top') {
|
|
1538
|
+
if (head.firstChild) {
|
|
1539
|
+
head.insertBefore(style, head.firstChild);
|
|
1540
|
+
} else {
|
|
1541
|
+
head.appendChild(style);
|
|
1542
|
+
}
|
|
1543
|
+
} else {
|
|
1544
|
+
head.appendChild(style);
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
if (style.styleSheet) {
|
|
1548
|
+
style.styleSheet.cssText = css;
|
|
1549
|
+
} else {
|
|
1550
|
+
style.appendChild(document.createTextNode(css));
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
var css_248z$1 = ".wooris-toast-container {\n position: fixed;\n bottom: 20px;\n right: 20px;\n z-index: 1000;\n display: flex;\n flex-direction: column;\n gap: 10px; /* Space between toasts */\n align-items: flex-end; /* Align toasts to the right */\n}\n\n.wooris-toast {\n padding: 10px 20px;\n border-radius: 5px;\n color: #fff;\n display: flex;\n align-items: center;\n justify-content: space-between;\n box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);\n min-width: 250px;\n opacity: 0;\n transform: translateX(100%); /* Slide in from right */\n animation: slideInToast 0.3s forwards;\n}\n\n.wooris-toast-message {\n margin-right: 10px;\n}\n\n.wooris-toast-close {\n background: none;\n border: none;\n color: #fff;\n font-size: 1.2em;\n cursor: pointer;\n}\n\n/* Types */\n\n.wooris-toast-info {\n background-color: #2196f3; /* Blue */\n}\n\n.wooris-toast-success {\n background-color: #4caf50; /* Green */\n}\n\n.wooris-toast-error {\n background-color: #f44336; /* Red */\n}\n\n.wooris-toast-warning {\n background-color: #ff9800; /* Orange */\n}\n\n@keyframes slideInToast {\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n";
|
|
1555
|
+
styleInject(css_248z$1,{"insertAt":"top"});
|
|
1556
|
+
|
|
1557
|
+
var ToastAlert = function ToastAlert(_ref) {
|
|
1558
|
+
var message = _ref.message,
|
|
1559
|
+
_ref$type = _ref.type,
|
|
1560
|
+
type = _ref$type === void 0 ? 'info' : _ref$type,
|
|
1561
|
+
_ref$duration = _ref.duration,
|
|
1562
|
+
duration = _ref$duration === void 0 ? 3000 : _ref$duration,
|
|
1563
|
+
onClose = _ref.onClose;
|
|
1564
|
+
React.useEffect(function () {
|
|
1565
|
+
var timer = setTimeout(function () {
|
|
1566
|
+
if (onClose) {
|
|
1567
|
+
onClose();
|
|
1568
|
+
}
|
|
1569
|
+
}, duration);
|
|
1570
|
+
return function () {
|
|
1571
|
+
return clearTimeout(timer);
|
|
1572
|
+
};
|
|
1573
|
+
}, [duration, onClose]);
|
|
1574
|
+
var toastClass = "wooris-toast wooris-toast-".concat(type);
|
|
1575
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1576
|
+
className: toastClass,
|
|
1577
|
+
role: "alert",
|
|
1578
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1579
|
+
className: "wooris-toast-message",
|
|
1580
|
+
children: message
|
|
1581
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
1582
|
+
className: "wooris-toast-close",
|
|
1583
|
+
onClick: onClose,
|
|
1584
|
+
children: "\xD7"
|
|
1585
|
+
})]
|
|
1586
|
+
});
|
|
1587
|
+
};
|
|
1588
|
+
ToastAlert.propTypes = {
|
|
1589
|
+
message: propTypesExports.string.isRequired,
|
|
1590
|
+
type: propTypesExports.oneOf(['success', 'error', 'info', 'warning']),
|
|
1591
|
+
duration: propTypesExports.number,
|
|
1592
|
+
onClose: propTypesExports.func
|
|
1593
|
+
};
|
|
1594
|
+
|
|
1595
|
+
const byteToHex = [];
|
|
1596
|
+
for (let i = 0; i < 256; ++i) {
|
|
1597
|
+
byteToHex.push((i + 0x100).toString(16).slice(1));
|
|
1598
|
+
}
|
|
1599
|
+
function unsafeStringify(arr, offset = 0) {
|
|
1600
|
+
return (byteToHex[arr[offset + 0]] +
|
|
1601
|
+
byteToHex[arr[offset + 1]] +
|
|
1602
|
+
byteToHex[arr[offset + 2]] +
|
|
1603
|
+
byteToHex[arr[offset + 3]] +
|
|
1604
|
+
'-' +
|
|
1605
|
+
byteToHex[arr[offset + 4]] +
|
|
1606
|
+
byteToHex[arr[offset + 5]] +
|
|
1607
|
+
'-' +
|
|
1608
|
+
byteToHex[arr[offset + 6]] +
|
|
1609
|
+
byteToHex[arr[offset + 7]] +
|
|
1610
|
+
'-' +
|
|
1611
|
+
byteToHex[arr[offset + 8]] +
|
|
1612
|
+
byteToHex[arr[offset + 9]] +
|
|
1613
|
+
'-' +
|
|
1614
|
+
byteToHex[arr[offset + 10]] +
|
|
1615
|
+
byteToHex[arr[offset + 11]] +
|
|
1616
|
+
byteToHex[arr[offset + 12]] +
|
|
1617
|
+
byteToHex[arr[offset + 13]] +
|
|
1618
|
+
byteToHex[arr[offset + 14]] +
|
|
1619
|
+
byteToHex[arr[offset + 15]]).toLowerCase();
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
let getRandomValues;
|
|
1623
|
+
const rnds8 = new Uint8Array(16);
|
|
1624
|
+
function rng() {
|
|
1625
|
+
if (!getRandomValues) {
|
|
1626
|
+
if (typeof crypto === 'undefined' || !crypto.getRandomValues) {
|
|
1627
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
1628
|
+
}
|
|
1629
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
1630
|
+
}
|
|
1631
|
+
return getRandomValues(rnds8);
|
|
1632
|
+
}
|
|
1633
|
+
|
|
1634
|
+
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
|
1635
|
+
var native = { randomUUID };
|
|
1636
|
+
|
|
1637
|
+
function _v4(options, buf, offset) {
|
|
1638
|
+
options = options || {};
|
|
1639
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
1640
|
+
if (rnds.length < 16) {
|
|
1641
|
+
throw new Error('Random bytes length must be >= 16');
|
|
1642
|
+
}
|
|
1643
|
+
rnds[6] = (rnds[6] & 0x0f) | 0x40;
|
|
1644
|
+
rnds[8] = (rnds[8] & 0x3f) | 0x80;
|
|
1645
|
+
if (buf) {
|
|
1646
|
+
offset = offset || 0;
|
|
1647
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
1648
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
1649
|
+
}
|
|
1650
|
+
for (let i = 0; i < 16; ++i) {
|
|
1651
|
+
buf[offset + i] = rnds[i];
|
|
1652
|
+
}
|
|
1653
|
+
return buf;
|
|
1654
|
+
}
|
|
1655
|
+
return unsafeStringify(rnds);
|
|
1656
|
+
}
|
|
1657
|
+
function v4(options, buf, offset) {
|
|
1658
|
+
if (native.randomUUID && !buf && !options) {
|
|
1659
|
+
return native.randomUUID();
|
|
1660
|
+
}
|
|
1661
|
+
return _v4(options, buf, offset);
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
var ToastContext = /*#__PURE__*/React.createContext();
|
|
1665
|
+
|
|
1666
|
+
// Custom hook to use the toast functions
|
|
1667
|
+
var useToast = function useToast() {
|
|
1668
|
+
return React.useContext(ToastContext);
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1671
|
+
// Toast Provider component
|
|
1672
|
+
var ToastProvider = function ToastProvider(_ref) {
|
|
1673
|
+
var children = _ref.children;
|
|
1674
|
+
var _useState = React.useState([]),
|
|
1675
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1676
|
+
toasts = _useState2[0],
|
|
1677
|
+
setToasts = _useState2[1];
|
|
1678
|
+
var addToast = React.useCallback(function (message) {
|
|
1679
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'info';
|
|
1680
|
+
var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3000;
|
|
1681
|
+
var id = v4();
|
|
1682
|
+
setToasts(function (prevToasts) {
|
|
1683
|
+
return [].concat(_toConsumableArray(prevToasts), [{
|
|
1684
|
+
id: id,
|
|
1685
|
+
message: message,
|
|
1686
|
+
type: type,
|
|
1687
|
+
duration: duration
|
|
1688
|
+
}]);
|
|
1689
|
+
});
|
|
1690
|
+
}, []);
|
|
1691
|
+
var removeToast = React.useCallback(function (id) {
|
|
1692
|
+
setToasts(function (prevToasts) {
|
|
1693
|
+
return prevToasts.filter(function (toast) {
|
|
1694
|
+
return toast.id !== id;
|
|
1695
|
+
});
|
|
1696
|
+
});
|
|
1697
|
+
}, []);
|
|
1698
|
+
var showInfo = React.useCallback(function (message, duration) {
|
|
1699
|
+
return addToast(message, 'info', duration);
|
|
1700
|
+
}, [addToast]);
|
|
1701
|
+
var showSuccess = React.useCallback(function (message, duration) {
|
|
1702
|
+
return addToast(message, 'success', duration);
|
|
1703
|
+
}, [addToast]);
|
|
1704
|
+
var showError = React.useCallback(function (message, duration) {
|
|
1705
|
+
return addToast(message, 'error', duration);
|
|
1706
|
+
}, [addToast]);
|
|
1707
|
+
var showWarning = React.useCallback(function (message, duration) {
|
|
1708
|
+
return addToast(message, 'warning', duration);
|
|
1709
|
+
}, [addToast]);
|
|
1710
|
+
var contextValue = {
|
|
1711
|
+
showInfo: showInfo,
|
|
1712
|
+
showSuccess: showSuccess,
|
|
1713
|
+
showError: showError,
|
|
1714
|
+
showWarning: showWarning
|
|
1715
|
+
};
|
|
1716
|
+
return /*#__PURE__*/jsxRuntime.jsxs(ToastContext.Provider, {
|
|
1717
|
+
value: contextValue,
|
|
1718
|
+
children: [children, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1719
|
+
className: "wooris-toast-container",
|
|
1720
|
+
children: [" ", toasts.map(function (toast) {
|
|
1721
|
+
return /*#__PURE__*/jsxRuntime.jsx(ToastAlert, {
|
|
1722
|
+
message: toast.message,
|
|
1723
|
+
type: toast.type,
|
|
1724
|
+
duration: toast.duration,
|
|
1725
|
+
onClose: function onClose() {
|
|
1726
|
+
return removeToast(toast.id);
|
|
1727
|
+
}
|
|
1728
|
+
}, toast.id);
|
|
1729
|
+
})]
|
|
1730
|
+
})]
|
|
1731
|
+
});
|
|
1732
|
+
};
|
|
1733
|
+
|
|
1426
1734
|
var colors = {
|
|
1427
1735
|
success: "#10B981",
|
|
1428
1736
|
error: "#EF4444",
|
|
@@ -1440,11 +1748,19 @@ var tokens = {
|
|
|
1440
1748
|
fonts: fonts
|
|
1441
1749
|
};
|
|
1442
1750
|
|
|
1751
|
+
var css_248z = "@font-face {\n font-family: \"Freesentation-5Medium\";\n src: url(\"https://cdn.jsdelivr.net/gh/projectnoonnu/2404@1.0/Freesentation-5Medium.woff2\") format(\"woff2\");\n font-weight: 500;\n font-style: normal;\n font-display: swap;\n}\n\n\n:root {\n --color-success: #10B981;\n --color-error: #EF4444;\n --color-info: #3B82F6;\n --color-warning: #F59E0B;\n\n\n --color-primary: var(--color-info);\n --color-text: #111827;\n --color-bg: #ffffff;\n\n\n --font-sans: \"Freesentation-5Medium\", system-ui, -apple-system, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial;\n --font-size-base: 16px;\n --radius-sm: 6px;\n --radius-md: 10px;\n\n --breakpoint-sm: 600px;\n --breakpoint-md: 960px;\n --breakpoint-lg: 1280px;\n}\n\n\n.wooris-btn { font-family: var(--font-sans); border-radius: var(--radius-md); padding: 0.5rem 1rem; border: none; cursor: pointer; }\n\n\n.wooris-btn-primary { background: var(--color-primary); color: white; }\n\n\n.wooris-btn-success { background: var(--color-success); color: white; }\n\n\n.wooris-btn-error { background: var(--color-error); color: white; }\n\n\n.wooris-btn-info { background: var(--color-info); color: white; }\n\n\n.wooris-btn-warning { background: var(--color-warning); color: black; }\n\n\n.wooris-btn:disabled { opacity: 0.5; cursor: not-allowed; }\n\n\n/* Button Sizes */\n\n\n.wooris-btn-xs {\n padding: 0.2rem 0.5rem;\n font-size: 0.7rem;\n}\n\n\n.wooris-btn-sm {\n padding: 0.3rem 0.7rem;\n font-size: 0.8rem;\n}\n\n\n.wooris-btn-md {\n padding: 0.5rem 1rem;\n font-size: 1rem;\n}\n\n\n.wooris-btn-lg {\n padding: 0.7rem 1.2rem;\n font-size: 1.2rem;\n}\n\n\n.wooris-btn-xl {\n padding: 0.9rem 1.4rem;\n font-size: 1.4rem;\n}\n\n\n.wooris-btn-xl2 {\n padding: 1.1rem 1.6rem;\n font-size: 1.6rem;\n}\n\n\n.wooris-btn-xl3 {\n padding: 1.3rem 1.8rem;\n font-size: 1.8rem;\n}\n\n\n.wooris-badge { display:inline-flex; align-items:center; gap:0.4rem; font-family:var(--font-sans); padding: 0.2rem 0.5rem; border-radius: 9999px; font-size: 0.875rem; color: white; }\n\n\n.wooris-badge-primary { background: var(--color-primary); }\n\n\n.wooris-badge-success { background: var(--color-success); }\n\n\n.wooris-badge-error { background: var(--color-error); }\n\n\n.wooris-badge-info { background: var(--color-info); }\n\n\n.wooris-badge-warning { background: var(--color-warning); color: black; }\n\n\n.wooris-input { font-family:var(--font-sans); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); border: 1px solid #e5e7eb; }\n\n\n.wooris-modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display:flex; align-items:center; justify-content:center; z-index: 9999; }\n\n\n.wooris-modal-sheet { background: white; border-radius: 12px; padding: 1rem; min-width: 320px; max-width: 720px; box-shadow: 0 10px 30px rgba(2,6,23,0.2); }\n\n\n/* Grid Styles */\n\n\n.wooris-grid-container {\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n}\n\n\n.wooris-grid-item {\n min-width: 0; /* Ensures item can shrink */\n}\n\n\n/* Grid Item Sizes */\n\n\n.wooris-grid-item-xs {\n padding: 0.25rem;\n}\n\n\n.wooris-grid-item-sm {\n padding: 0.5rem;\n}\n\n\n.wooris-grid-item-md {\n padding: 1rem;\n}\n\n\n.wooris-grid-item-lg {\n padding: 1.5rem;\n}\n\n\n.wooris-grid-item-xl {\n padding: 2rem;\n}\n\n\n.wooris-grid-item-xl2 {\n padding: 2.5rem;\n}\n\n\n.wooris-grid-item-xl3 {\n padding: 3rem;\n}\n\n\n/* XS (default mobile-first) */\n\n\n.wooris-grid-xs-1 { grid-column: span 1 / span 1; }\n\n\n.wooris-grid-xs-2 { grid-column: span 2 / span 2; }\n\n\n.wooris-grid-xs-3 { grid-column: span 3 / span 3; }\n\n\n.wooris-grid-xs-4 { grid-column: span 4 / span 4; }\n\n\n.wooris-grid-xs-5 { grid-column: span 5 / span 5; }\n\n\n.wooris-grid-xs-6 { grid-column: span 6 / span 6; }\n\n\n.wooris-grid-xs-7 { grid-column: span 7 / span 7; }\n\n\n.wooris-grid-xs-8 { grid-column: span 8 / span 8; }\n\n\n.wooris-grid-xs-9 { grid-column: span 9 / span 9; }\n\n\n.wooris-grid-xs-10 { grid-column: span 10 / span 10; }\n\n\n.wooris-grid-xs-11 { grid-column: span 11 / span 11; }\n\n\n.wooris-grid-xs-12 { grid-column: span 12 / span 12; }\n\n\n/* SM breakpoint */\n\n\n@media (min-width: var(--breakpoint-sm)) {\n .wooris-grid-sm-1 { grid-column: span 1 / span 1; }\n .wooris-grid-sm-2 { grid-column: span 2 / span 2; }\n .wooris-grid-sm-3 { grid-column: span 3 / span 3; }\n .wooris-grid-sm-4 { grid-column: span 4 / span 4; }\n .wooris-grid-sm-5 { grid-column: span 5 / span 5; }\n .wooris-grid-sm-6 { grid-column: span 6 / span 6; }\n .wooris-grid-sm-7 { grid-column: span 7 / span 7; }\n .wooris-grid-sm-8 { grid-column: span 8 / span 8; }\n .wooris-grid-sm-9 { grid-column: span 9 / span 9; }\n .wooris-grid-sm-10 { grid-column: span 10 / span 10; }\n .wooris-grid-sm-11 { grid-column: span 11 / span 11; }\n .wooris-grid-sm-12 { grid-column: span 12 / span 12; }\n}\n\n\n/* MD breakpoint */\n\n\n@media (min-width: var(--breakpoint-md)) {\n .wooris-grid-md-1 { grid-column: span 1 / span 1; }\n .wooris-grid-md-2 { grid-column: span 2 / span 2; }\n .wooris-grid-md-3 { grid-column: span 3 / span 3; }\n .wooris-grid-md-4 { grid-column: span 4 / span 4; }\n .wooris-grid-md-5 { grid-column: span 5 / span 5; }\n .wooris-grid-md-6 { grid-column: span 6 / span 6; }\n .wooris-grid-md-7 { grid-column: span 7 / span 7; }\n .wooris-grid-md-8 { grid-column: span 8 / span 8; }\n .wooris-grid-md-9 { grid-column: span 9 / span 9; }\n .wooris-grid-md-10 { grid-column: span 10 / span 10; }\n .wooris-grid-md-11 { grid-column: span 11 / span 11; }\n .wooris-grid-md-12 { grid-column: span 12 / span 12; }\n}\n\n\n/* LG breakpoint */\n\n\n@media (min-width: var(--breakpoint-lg)) {\n .wooris-grid-lg-1 { grid-column: span 1 / span 1; }\n .wooris-grid-lg-2 { grid-column: span 2 / span 2; }\n .wooris-grid-lg-3 { grid-column: span 3 / span 3; }\n .wooris-grid-lg-4 { grid-column: span 4 / span 4; }\n .wooris-grid-lg-5 { grid-column: span 5 / span 5; }\n .wooris-grid-lg-6 { grid-column: span 6 / span 6; }\n .wooris-grid-lg-7 { grid-column: span 7 / span 7; }\n .wooris-grid-lg-8 { grid-column: span 8 / span 8; }\n .wooris-grid-lg-9 { grid-column: span 9 / span 9; }\n .wooris-grid-lg-10 { grid-column: span 10 / span 10; }\n .wooris-grid-lg-11 { grid-column: span 11 / span 11; }\n .wooris-grid-lg-12 { grid-column: span 12 / span 12; }\n}\n\n\n/* Card Styles */\n\n\n.wooris-card {\n background: var(--color-bg);\n border-radius: var(--radius-md);\n box-shadow: 0 1px 3px rgba(0,0,0,0.1);\n border: 1px solid #e5e7eb;\n}\n\n\n.wooris-card-xs {\n padding: 0.5rem;\n font-size: 0.75rem;\n}\n\n\n.wooris-card-sm {\n padding: 0.75rem;\n font-size: 0.875rem;\n}\n\n\n.wooris-card-md {\n padding: 1rem;\n font-size: 1rem;\n}\n\n\n.wooris-card-lg {\n padding: 1.5rem;\n font-size: 1.125rem;\n}\n\n\n.wooris-card-xl {\n padding: 2rem;\n font-size: 1.25rem;\n}\n\n\n.wooris-card-xl2 {\n padding: 2.5rem;\n font-size: 1.375rem;\n}\n\n\n.wooris-card-xl3 {\n padding: 3rem;\n font-size: 1.5rem;\n}\n\n\n* { box-sizing: border-box; }\n\n\nbody { margin: 0; font-family: var(--font-sans); color: var(--color-text); }";
|
|
1752
|
+
styleInject(css_248z,{"insertAt":"top"});
|
|
1753
|
+
|
|
1443
1754
|
exports.Badge = Badge;
|
|
1444
1755
|
exports.Button = Button;
|
|
1756
|
+
exports.Card = Card;
|
|
1757
|
+
exports.Grid = Grid;
|
|
1445
1758
|
exports.Input = Input;
|
|
1446
1759
|
exports.Modal = Modal;
|
|
1760
|
+
exports.ToastAlert = ToastAlert;
|
|
1761
|
+
exports.ToastProvider = ToastProvider;
|
|
1447
1762
|
exports.colors = colors;
|
|
1448
1763
|
exports.fonts = fonts;
|
|
1449
1764
|
exports.tokens = tokens;
|
|
1765
|
+
exports.useToast = useToast;
|
|
1450
1766
|
//# sourceMappingURL=index.cjs.js.map
|