thailife-react 0.0.22 → 0.0.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/dist/components/Autocomplete/Autocomplete.d.ts +17 -0
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -0
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +9 -0
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts.map +1 -0
- package/dist/components/Box/Box.d.ts +86 -0
- package/dist/components/Box/Box.d.ts.map +1 -0
- package/dist/components/Box/Box.stories.d.ts +15 -0
- package/dist/components/Box/Box.stories.d.ts.map +1 -0
- package/dist/components/Button/Button.d.ts +5 -5
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Button/Button.stories.d.ts +0 -7
- package/dist/components/Button/Button.stories.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +3 -8
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -8
- package/dist/components/Checkbox/Checkbox.stories.d.ts.map +1 -1
- package/dist/components/Container/Container.d.ts +9 -0
- package/dist/components/Container/Container.d.ts.map +1 -0
- package/dist/components/Container/Container.stories.d.ts +12 -0
- package/dist/components/Container/Container.stories.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.d.ts +30 -0
- package/dist/components/DataTable/DataTable.d.ts.map +1 -0
- package/dist/components/DataTable/DataTable.stories.d.ts +7 -0
- package/dist/components/DataTable/DataTable.stories.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +8 -15
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.stories.d.ts +1 -11
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/Grid/Grid.d.ts +30 -0
- package/dist/components/Grid/Grid.d.ts.map +1 -0
- package/dist/components/Grid/Grid.stories.d.ts +13 -0
- package/dist/components/Grid/Grid.stories.d.ts.map +1 -0
- package/dist/components/Input/Input.d.ts +5 -8
- package/dist/components/Input/Input.d.ts.map +1 -1
- package/dist/components/Input/Input.stories.d.ts +0 -8
- package/dist/components/Input/Input.stories.d.ts.map +1 -1
- package/dist/components/InputFile/InputFile.d.ts +3 -11
- package/dist/components/InputFile/InputFile.d.ts.map +1 -1
- package/dist/components/InputFile/InputFile.stories.d.ts +0 -8
- package/dist/components/InputFile/InputFile.stories.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +3 -7
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/Radio.stories.d.ts +0 -7
- package/dist/components/Radio/Radio.stories.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +3 -9
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.stories.d.ts +0 -8
- package/dist/components/Select/Select.stories.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts +3 -8
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts +0 -8
- package/dist/components/Textarea/Textarea.stories.d.ts.map +1 -1
- package/dist/index.d.ts +13 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +764 -218
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +767 -217
- package/dist/index.js.map +1 -1
- package/dist/styles/index.css +1 -602
- package/dist/styles/index.d.ts +0 -76
- package/dist/styles/index.d.ts.map +1 -1
- package/package.json +4 -1
package/dist/index.js
CHANGED
|
@@ -1448,363 +1448,270 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
1448
1448
|
|
|
1449
1449
|
var jsxRuntimeExports = jsxRuntime.exports;
|
|
1450
1450
|
|
|
1451
|
-
|
|
1452
|
-
const cssClasses = {
|
|
1453
|
-
// Button
|
|
1454
|
-
button: "btn",
|
|
1455
|
-
buttonContained: "btn--contained",
|
|
1456
|
-
buttonOutlined: "btn--outlined",
|
|
1457
|
-
buttonLink: "btn--link",
|
|
1458
|
-
buttonSmall: "btn--sm",
|
|
1459
|
-
buttonMedium: "btn--md",
|
|
1460
|
-
buttonLarge: "btn--lg",
|
|
1461
|
-
buttonError: "btn--error",
|
|
1462
|
-
buttonDark: "btn--dark",
|
|
1463
|
-
buttonLight: "btn--light",
|
|
1464
|
-
buttonFullWidth: "btn--full-width",
|
|
1465
|
-
// Input
|
|
1466
|
-
inputContainer: "input-container",
|
|
1467
|
-
inputContainerFullWidth: "input-container--full-width",
|
|
1468
|
-
inputLabel: "input-label",
|
|
1469
|
-
input: "input",
|
|
1470
|
-
inputError: "input--error",
|
|
1471
|
-
inputFullWidth: "input--full-width",
|
|
1472
|
-
inputHelperText: "input-helper-text",
|
|
1473
|
-
inputHelperTextError: "input-helper-text--error",
|
|
1474
|
-
// Checkbox
|
|
1475
|
-
checkboxContainer: "checkbox-container",
|
|
1476
|
-
checkboxContainerFullWidth: "checkbox-container--full-width",
|
|
1477
|
-
checkboxWrapper: "checkbox-wrapper",
|
|
1478
|
-
checkbox: "checkbox",
|
|
1479
|
-
checkboxError: "checkbox--error",
|
|
1480
|
-
checkboxLabelContainer: "checkbox-label-container",
|
|
1481
|
-
checkboxLabel: "checkbox-label",
|
|
1482
|
-
// Radio
|
|
1483
|
-
radioContainer: "radio-container",
|
|
1484
|
-
radioContainerFullWidth: "radio-container--full-width",
|
|
1485
|
-
radioWrapper: "radio-wrapper",
|
|
1486
|
-
radio: "radio",
|
|
1487
|
-
radioError: "radio--error",
|
|
1488
|
-
radioLabelContainer: "radio-label-container",
|
|
1489
|
-
radioLabel: "radio-label",
|
|
1490
|
-
// Select
|
|
1491
|
-
selectContainer: "select-container",
|
|
1492
|
-
selectContainerFullWidth: "select-container--full-width",
|
|
1493
|
-
selectLabel: "select-label",
|
|
1494
|
-
selectWrapper: "select-wrapper",
|
|
1495
|
-
select: "select",
|
|
1496
|
-
selectError: "select--error",
|
|
1497
|
-
selectFullWidth: "select--full-width",
|
|
1498
|
-
selectIcon: "select-icon",
|
|
1499
|
-
// Textarea
|
|
1500
|
-
textareaContainer: "textarea-container",
|
|
1501
|
-
textareaContainerFullWidth: "textarea-container--full-width",
|
|
1502
|
-
textareaLabel: "textarea-label",
|
|
1503
|
-
textarea: "textarea",
|
|
1504
|
-
textareaError: "textarea--error",
|
|
1505
|
-
textareaFullWidth: "textarea--full-width",
|
|
1506
|
-
// InputFile
|
|
1507
|
-
inputFileContainer: "input-file-container",
|
|
1508
|
-
inputFileContainerFullWidth: "input-file-container--full-width",
|
|
1509
|
-
inputFileLabel: "input-file-label",
|
|
1510
|
-
inputFileWrapper: "input-file-wrapper",
|
|
1511
|
-
inputFileHidden: "input-file-hidden",
|
|
1512
|
-
inputFileUploadArea: "input-file-upload-area",
|
|
1513
|
-
inputFileUploadAreaError: "input-file-upload-area--error",
|
|
1514
|
-
inputFileUploadAreaFullWidth: "input-file-upload-area--full-width",
|
|
1515
|
-
inputFileButtonText: "input-file-button-text",
|
|
1516
|
-
inputFileMultipleText: "input-file-multiple-text",
|
|
1517
|
-
// Utility
|
|
1518
|
-
textCenter: "text-center",
|
|
1519
|
-
textLeft: "text-left",
|
|
1520
|
-
textRight: "text-right",
|
|
1521
|
-
fontBold: "font-bold",
|
|
1522
|
-
fontNormal: "font-normal",
|
|
1523
|
-
fontLight: "font-light",
|
|
1524
|
-
rounded: "rounded",
|
|
1525
|
-
roundedSm: "rounded-sm",
|
|
1526
|
-
roundedLg: "rounded-lg",
|
|
1527
|
-
roundedFull: "rounded-full",
|
|
1528
|
-
shadow: "shadow",
|
|
1529
|
-
shadowSm: "shadow-sm",
|
|
1530
|
-
shadowMd: "shadow-md",
|
|
1531
|
-
shadowLg: "shadow-lg",
|
|
1532
|
-
shadowXl: "shadow-xl"
|
|
1533
|
-
};
|
|
1534
|
-
|
|
1535
|
-
const _excluded$8 = ["className", "color", "variant", "size", "fullWidth", "loading", "disabled", "children"];
|
|
1451
|
+
const _excluded$d = ["className", "color", "variant", "size", "fullWidth", "loading", "disabled", "children"];
|
|
1536
1452
|
const Button = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1537
1453
|
let {
|
|
1538
1454
|
className,
|
|
1539
|
-
color =
|
|
1540
|
-
variant =
|
|
1541
|
-
size =
|
|
1455
|
+
color = 'primary',
|
|
1456
|
+
variant = 'contained',
|
|
1457
|
+
size = 'md',
|
|
1542
1458
|
fullWidth = false,
|
|
1543
1459
|
loading = false,
|
|
1544
1460
|
disabled,
|
|
1545
1461
|
children
|
|
1546
1462
|
} = _ref,
|
|
1547
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
const colorClass = color === "error" ? cssClasses.buttonError : color === "dark" ? cssClasses.buttonDark : color === "light" ? cssClasses.buttonLight : "";
|
|
1552
|
-
const fullWidthClass = fullWidth ? cssClasses.buttonFullWidth : "";
|
|
1553
|
-
const combinedClasses = [baseClass, variantClass, sizeClass, colorClass, fullWidthClass, className].filter(Boolean).join(" ");
|
|
1554
|
-
return jsxRuntimeExports.jsx("button", _objectSpread2(_objectSpread2({
|
|
1555
|
-
className: combinedClasses,
|
|
1463
|
+
props = _objectWithoutProperties(_ref, _excluded$d);
|
|
1464
|
+
const classNames = ['btn', "btn--".concat(variant), "btn--".concat(size), "btn--".concat(color), fullWidth ? 'btn--full-width' : '', loading ? 'btn--loading' : '', disabled ? 'btn--disabled' : '', className].filter(Boolean).join(' ');
|
|
1465
|
+
return jsxRuntimeExports.jsxs("button", _objectSpread2(_objectSpread2({
|
|
1466
|
+
className: classNames,
|
|
1556
1467
|
disabled: disabled || loading,
|
|
1557
1468
|
ref: ref
|
|
1558
1469
|
}, props), {}, {
|
|
1559
|
-
children:
|
|
1470
|
+
children: [loading && jsxRuntimeExports.jsx("span", {
|
|
1471
|
+
className: "btn__loader"
|
|
1472
|
+
}), children]
|
|
1560
1473
|
}));
|
|
1561
1474
|
});
|
|
1562
|
-
Button.displayName =
|
|
1475
|
+
Button.displayName = 'Button';
|
|
1476
|
+
|
|
1477
|
+
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
1563
1478
|
|
|
1564
|
-
const _excluded$
|
|
1479
|
+
const _excluded$c = ["className", "type", "label", "error", "helperText", "size", "fullWidth", "id", "unit"];
|
|
1565
1480
|
const Input = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1566
1481
|
let {
|
|
1567
1482
|
className,
|
|
1568
|
-
type =
|
|
1483
|
+
type = 'text',
|
|
1569
1484
|
label,
|
|
1570
1485
|
error,
|
|
1571
1486
|
helperText,
|
|
1572
|
-
size =
|
|
1487
|
+
size = 'md',
|
|
1573
1488
|
fullWidth = false,
|
|
1574
|
-
id
|
|
1489
|
+
id,
|
|
1490
|
+
unit
|
|
1575
1491
|
} = _ref,
|
|
1576
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1492
|
+
props = _objectWithoutProperties(_ref, _excluded$c);
|
|
1577
1493
|
const inputId = id || "input-".concat(Math.random().toString(36).substr(2, 9));
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1494
|
+
return (
|
|
1495
|
+
// <div className={clsx('input-container', fullWidth && 'input-container--full-width', className)}>
|
|
1496
|
+
// {label && (
|
|
1497
|
+
// <label className="input-label" htmlFor={inputId}>
|
|
1498
|
+
// {label}
|
|
1499
|
+
// </label>
|
|
1500
|
+
// )}
|
|
1501
|
+
// <input
|
|
1502
|
+
// type={type}
|
|
1503
|
+
// className={clsx('input', error && 'input--error', fullWidth && 'input--full-width')}
|
|
1504
|
+
// ref={ref}
|
|
1505
|
+
// id={inputId}
|
|
1506
|
+
// {...props}
|
|
1507
|
+
// />
|
|
1508
|
+
// {(error || helperText) && <p className={clsx('input-helper-text', error && 'input-helper-text--error')}>{error || helperText}</p>}
|
|
1509
|
+
// </div>
|
|
1510
|
+
jsxRuntimeExports.jsxs("div", {
|
|
1511
|
+
className: clsx('input-container', fullWidth && 'input-container--full-width', unit && 'input-container--has-unit', className),
|
|
1512
|
+
children: [jsxRuntimeExports.jsx("input", _objectSpread2({
|
|
1513
|
+
type: type,
|
|
1514
|
+
className: clsx('input', error && 'input--error', fullWidth && 'input--full-width'),
|
|
1515
|
+
ref: ref,
|
|
1516
|
+
id: inputId
|
|
1517
|
+
}, props)), unit && jsxRuntimeExports.jsx("span", {
|
|
1518
|
+
className: "input-unit",
|
|
1519
|
+
children: unit
|
|
1520
|
+
})]
|
|
1521
|
+
})
|
|
1522
|
+
);
|
|
1598
1523
|
});
|
|
1599
|
-
Input.displayName =
|
|
1524
|
+
Input.displayName = 'Input';
|
|
1600
1525
|
|
|
1601
|
-
const _excluded$
|
|
1526
|
+
const _excluded$b = ["className", "label", "error", "helperText", "size", "fullWidth", "rows", "id"];
|
|
1602
1527
|
const Textarea = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1603
1528
|
let {
|
|
1604
1529
|
className,
|
|
1605
1530
|
label,
|
|
1606
1531
|
error,
|
|
1607
1532
|
helperText,
|
|
1608
|
-
size =
|
|
1533
|
+
size = 'md',
|
|
1609
1534
|
fullWidth = false,
|
|
1610
1535
|
rows = 3,
|
|
1611
1536
|
id
|
|
1612
1537
|
} = _ref,
|
|
1613
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1538
|
+
props = _objectWithoutProperties(_ref, _excluded$b);
|
|
1614
1539
|
const textareaId = id || "textarea-".concat(Math.random().toString(36).substr(2, 9));
|
|
1615
|
-
const containerClass = fullWidth ? cssClasses.textareaContainerFullWidth : cssClasses.textareaContainer;
|
|
1616
|
-
const textareaClass = error ? "".concat(cssClasses.textarea, " ").concat(cssClasses.textareaError) : cssClasses.textarea;
|
|
1617
|
-
const textareaFullWidthClass = fullWidth ? cssClasses.textareaFullWidth : "";
|
|
1618
|
-
const helperTextClass = error ? cssClasses.inputHelperTextError : cssClasses.inputHelperText;
|
|
1619
1540
|
return jsxRuntimeExports.jsxs("div", {
|
|
1620
|
-
className:
|
|
1541
|
+
className: clsx('textarea-container', fullWidth && 'textarea-container--full-width', className),
|
|
1621
1542
|
children: [label && jsxRuntimeExports.jsx("label", {
|
|
1622
|
-
className:
|
|
1543
|
+
className: "textarea-label",
|
|
1623
1544
|
htmlFor: textareaId,
|
|
1624
1545
|
children: label
|
|
1625
1546
|
}), jsxRuntimeExports.jsx("textarea", _objectSpread2({
|
|
1626
|
-
className:
|
|
1547
|
+
className: clsx('textarea', error && 'textarea--error', fullWidth && 'textarea--full-width'),
|
|
1627
1548
|
ref: ref,
|
|
1628
1549
|
id: textareaId,
|
|
1629
1550
|
rows: rows
|
|
1630
1551
|
}, props)), (error || helperText) && jsxRuntimeExports.jsx("p", {
|
|
1631
|
-
className:
|
|
1552
|
+
className: clsx('input-helper-text', error && 'input-helper-text--error'),
|
|
1632
1553
|
children: error || helperText
|
|
1633
1554
|
})]
|
|
1634
1555
|
});
|
|
1635
1556
|
});
|
|
1636
|
-
Textarea.displayName =
|
|
1557
|
+
Textarea.displayName = 'Textarea';
|
|
1637
1558
|
|
|
1638
|
-
const _excluded$
|
|
1559
|
+
const _excluded$a = ["className", "label", "error", "helperText", "size", "fullWidth", "multiple", "accept", "buttonText", "id"];
|
|
1639
1560
|
const InputFile = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1640
1561
|
let {
|
|
1641
1562
|
className,
|
|
1642
1563
|
label,
|
|
1643
1564
|
error,
|
|
1644
1565
|
helperText,
|
|
1645
|
-
size =
|
|
1566
|
+
size = 'md',
|
|
1646
1567
|
fullWidth = false,
|
|
1647
1568
|
multiple = false,
|
|
1648
1569
|
accept,
|
|
1649
|
-
buttonText =
|
|
1570
|
+
buttonText = 'Choose File',
|
|
1650
1571
|
id
|
|
1651
1572
|
} = _ref,
|
|
1652
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1573
|
+
props = _objectWithoutProperties(_ref, _excluded$a);
|
|
1653
1574
|
const inputId = id || "input-file-".concat(Math.random().toString(36).substr(2, 9));
|
|
1654
|
-
const containerClass = fullWidth ? cssClasses.inputFileContainerFullWidth : cssClasses.inputFileContainer;
|
|
1655
|
-
const uploadAreaClass = error ? "".concat(cssClasses.inputFileUploadArea, " ").concat(cssClasses.inputFileUploadAreaError) : cssClasses.inputFileUploadArea;
|
|
1656
|
-
const uploadAreaFullWidthClass = fullWidth ? cssClasses.inputFileUploadAreaFullWidth : "";
|
|
1657
|
-
const helperTextClass = error ? cssClasses.inputHelperTextError : cssClasses.inputHelperText;
|
|
1658
1575
|
return jsxRuntimeExports.jsxs("div", {
|
|
1659
|
-
className:
|
|
1576
|
+
className: clsx('input-file-container', fullWidth && 'input-file-container--full-width', className),
|
|
1660
1577
|
children: [label && jsxRuntimeExports.jsx("label", {
|
|
1661
|
-
className:
|
|
1578
|
+
className: "input-file-label",
|
|
1662
1579
|
htmlFor: inputId,
|
|
1663
1580
|
children: label
|
|
1664
1581
|
}), jsxRuntimeExports.jsxs("div", {
|
|
1665
|
-
className:
|
|
1582
|
+
className: "input-file-wrapper",
|
|
1666
1583
|
children: [jsxRuntimeExports.jsx("input", _objectSpread2({
|
|
1667
1584
|
type: "file",
|
|
1668
|
-
className:
|
|
1585
|
+
className: "input-file-hidden",
|
|
1669
1586
|
ref: ref,
|
|
1670
1587
|
id: inputId,
|
|
1671
1588
|
multiple: multiple,
|
|
1672
1589
|
accept: accept
|
|
1673
1590
|
}, props)), jsxRuntimeExports.jsxs("div", {
|
|
1674
|
-
className:
|
|
1591
|
+
className: clsx('input-file-upload-area', error && 'input-file-upload-area--error', fullWidth && 'input-file-upload-area--full-width'),
|
|
1675
1592
|
children: [jsxRuntimeExports.jsx("span", {
|
|
1676
|
-
className:
|
|
1593
|
+
className: "input-file-button-text",
|
|
1677
1594
|
children: buttonText
|
|
1678
1595
|
}), multiple && jsxRuntimeExports.jsx("span", {
|
|
1679
|
-
className:
|
|
1596
|
+
className: "input-file-multiple-text",
|
|
1680
1597
|
children: "or drag and drop"
|
|
1681
1598
|
})]
|
|
1682
1599
|
})]
|
|
1683
1600
|
}), (error || helperText) && jsxRuntimeExports.jsx("p", {
|
|
1684
|
-
className:
|
|
1601
|
+
className: clsx('input-helper-text', error && 'input-helper-text--error'),
|
|
1685
1602
|
children: error || helperText
|
|
1686
1603
|
})]
|
|
1687
1604
|
});
|
|
1688
1605
|
});
|
|
1689
|
-
InputFile.displayName =
|
|
1606
|
+
InputFile.displayName = 'InputFile';
|
|
1690
1607
|
|
|
1691
|
-
const _excluded$
|
|
1608
|
+
const _excluded$9 = ["className", "label", "error", "helperText", "size", "fullWidth", "indeterminate", "id"];
|
|
1692
1609
|
const Checkbox = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1693
1610
|
let {
|
|
1694
1611
|
className,
|
|
1695
1612
|
label,
|
|
1696
1613
|
error,
|
|
1697
1614
|
helperText,
|
|
1698
|
-
size =
|
|
1615
|
+
size = 'md',
|
|
1699
1616
|
fullWidth = false,
|
|
1700
1617
|
indeterminate = false,
|
|
1701
1618
|
id
|
|
1702
1619
|
} = _ref,
|
|
1703
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1620
|
+
props = _objectWithoutProperties(_ref, _excluded$9);
|
|
1704
1621
|
const checkboxId = id || "checkbox-".concat(Math.random().toString(36).substr(2, 9));
|
|
1705
1622
|
React.useEffect(() => {
|
|
1706
|
-
if (ref && typeof ref ===
|
|
1623
|
+
if (ref && typeof ref === 'object' && ref.current) {
|
|
1707
1624
|
ref.current.indeterminate = indeterminate;
|
|
1708
1625
|
}
|
|
1709
1626
|
}, [indeterminate, ref]);
|
|
1710
|
-
const containerClass = fullWidth ? cssClasses.checkboxContainerFullWidth : cssClasses.checkboxContainer;
|
|
1711
|
-
const checkboxClass = error ? "".concat(cssClasses.checkbox, " ").concat(cssClasses.checkboxError) : cssClasses.checkbox;
|
|
1712
|
-
const helperTextClass = error ? cssClasses.inputHelperTextError : cssClasses.inputHelperText;
|
|
1713
1627
|
return jsxRuntimeExports.jsxs("div", {
|
|
1714
|
-
className:
|
|
1628
|
+
className: clsx('checkbox-container', fullWidth && 'checkbox-container--full-width', className),
|
|
1715
1629
|
children: [jsxRuntimeExports.jsx("div", {
|
|
1716
|
-
className:
|
|
1630
|
+
className: "checkbox-wrapper",
|
|
1717
1631
|
children: jsxRuntimeExports.jsx("input", _objectSpread2({
|
|
1718
1632
|
type: "checkbox",
|
|
1719
|
-
className:
|
|
1633
|
+
className: clsx('checkbox', "checkbox--".concat(size), error && 'checkbox--error'),
|
|
1720
1634
|
ref: ref,
|
|
1721
1635
|
id: checkboxId
|
|
1722
1636
|
}, props))
|
|
1723
1637
|
}), jsxRuntimeExports.jsxs("div", {
|
|
1724
|
-
className:
|
|
1638
|
+
className: "checkbox-label-container",
|
|
1725
1639
|
children: [label && jsxRuntimeExports.jsx("label", {
|
|
1726
|
-
className:
|
|
1640
|
+
className: "checkbox-label",
|
|
1727
1641
|
htmlFor: checkboxId,
|
|
1728
1642
|
children: label
|
|
1729
1643
|
}), (error || helperText) && jsxRuntimeExports.jsx("p", {
|
|
1730
|
-
className:
|
|
1644
|
+
className: clsx('input-helper-text', error && 'input-helper-text--error'),
|
|
1731
1645
|
children: error || helperText
|
|
1732
1646
|
})]
|
|
1733
1647
|
})]
|
|
1734
1648
|
});
|
|
1735
1649
|
});
|
|
1736
|
-
Checkbox.displayName =
|
|
1650
|
+
Checkbox.displayName = 'Checkbox';
|
|
1737
1651
|
|
|
1738
|
-
const _excluded$
|
|
1652
|
+
const _excluded$8 = ["className", "label", "error", "helperText", "size", "fullWidth", "id"];
|
|
1739
1653
|
const Radio = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1740
1654
|
let {
|
|
1741
1655
|
className,
|
|
1742
1656
|
label,
|
|
1743
1657
|
error,
|
|
1744
1658
|
helperText,
|
|
1745
|
-
size =
|
|
1659
|
+
size = 'md',
|
|
1746
1660
|
fullWidth = false,
|
|
1747
1661
|
id
|
|
1748
1662
|
} = _ref,
|
|
1749
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1663
|
+
props = _objectWithoutProperties(_ref, _excluded$8);
|
|
1750
1664
|
const radioId = id || "radio-".concat(Math.random().toString(36).substr(2, 9));
|
|
1751
|
-
const containerClass = fullWidth ? cssClasses.radioContainerFullWidth : cssClasses.radioContainer;
|
|
1752
|
-
const radioClass = error ? "".concat(cssClasses.radio, " ").concat(cssClasses.radioError) : cssClasses.radio;
|
|
1753
|
-
const helperTextClass = error ? cssClasses.inputHelperTextError : cssClasses.inputHelperText;
|
|
1754
1665
|
return jsxRuntimeExports.jsxs("div", {
|
|
1755
|
-
className:
|
|
1666
|
+
className: clsx('radio-container', fullWidth && 'radio-container--full-width', className),
|
|
1756
1667
|
children: [jsxRuntimeExports.jsx("div", {
|
|
1757
|
-
className:
|
|
1668
|
+
className: "radio-wrapper",
|
|
1758
1669
|
children: jsxRuntimeExports.jsx("input", _objectSpread2({
|
|
1759
1670
|
type: "radio",
|
|
1760
|
-
className:
|
|
1671
|
+
className: clsx('radio', error && 'radio--error'),
|
|
1761
1672
|
ref: ref,
|
|
1762
1673
|
id: radioId
|
|
1763
1674
|
}, props))
|
|
1764
1675
|
}), jsxRuntimeExports.jsxs("div", {
|
|
1765
|
-
className:
|
|
1676
|
+
className: "radio-label-container",
|
|
1766
1677
|
children: [label && jsxRuntimeExports.jsx("label", {
|
|
1767
|
-
className:
|
|
1678
|
+
className: "radio-label",
|
|
1768
1679
|
htmlFor: radioId,
|
|
1769
1680
|
children: label
|
|
1770
1681
|
}), (error || helperText) && jsxRuntimeExports.jsx("p", {
|
|
1771
|
-
className:
|
|
1682
|
+
className: clsx('input-helper-text', error && 'input-helper-text--error'),
|
|
1772
1683
|
children: error || helperText
|
|
1773
1684
|
})]
|
|
1774
1685
|
})]
|
|
1775
1686
|
});
|
|
1776
1687
|
});
|
|
1777
|
-
Radio.displayName =
|
|
1688
|
+
Radio.displayName = 'Radio';
|
|
1778
1689
|
|
|
1779
|
-
const _excluded$
|
|
1690
|
+
const _excluded$7 = ["className", "label", "error", "helperText", "size", "fullWidth", "options", "placeholder", "id"];
|
|
1780
1691
|
const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1781
1692
|
let {
|
|
1782
1693
|
className,
|
|
1783
1694
|
label,
|
|
1784
1695
|
error,
|
|
1785
1696
|
helperText,
|
|
1786
|
-
size =
|
|
1697
|
+
size = 'md',
|
|
1787
1698
|
fullWidth = false,
|
|
1788
1699
|
options,
|
|
1789
1700
|
placeholder,
|
|
1790
1701
|
id
|
|
1791
1702
|
} = _ref,
|
|
1792
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
1703
|
+
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
1793
1704
|
const selectId = id || "select-".concat(Math.random().toString(36).substr(2, 9));
|
|
1794
|
-
const containerClass = fullWidth ? cssClasses.selectContainerFullWidth : cssClasses.selectContainer;
|
|
1795
|
-
const selectClass = error ? "".concat(cssClasses.select, " ").concat(cssClasses.selectError) : cssClasses.select;
|
|
1796
|
-
const selectFullWidthClass = fullWidth ? cssClasses.selectFullWidth : "";
|
|
1797
|
-
const helperTextClass = error ? cssClasses.inputHelperTextError : cssClasses.inputHelperText;
|
|
1798
1705
|
return jsxRuntimeExports.jsxs("div", {
|
|
1799
|
-
className:
|
|
1706
|
+
className: clsx('select-container', fullWidth && 'select-container--full-width', className),
|
|
1800
1707
|
children: [label && jsxRuntimeExports.jsx("label", {
|
|
1801
|
-
className:
|
|
1708
|
+
className: "select-label",
|
|
1802
1709
|
htmlFor: selectId,
|
|
1803
1710
|
children: label
|
|
1804
1711
|
}), jsxRuntimeExports.jsxs("div", {
|
|
1805
|
-
className:
|
|
1712
|
+
className: "select-wrapper",
|
|
1806
1713
|
children: [jsxRuntimeExports.jsxs("select", _objectSpread2(_objectSpread2({
|
|
1807
|
-
className:
|
|
1714
|
+
className: clsx('select', error && 'select--error', fullWidth && 'select--full-width'),
|
|
1808
1715
|
ref: ref,
|
|
1809
1716
|
id: selectId
|
|
1810
1717
|
}, props), {}, {
|
|
@@ -1818,7 +1725,7 @@ const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1818
1725
|
children: option.label
|
|
1819
1726
|
}, option.value))]
|
|
1820
1727
|
})), jsxRuntimeExports.jsx("div", {
|
|
1821
|
-
className:
|
|
1728
|
+
className: "select-icon",
|
|
1822
1729
|
children: jsxRuntimeExports.jsx("svg", {
|
|
1823
1730
|
width: "16",
|
|
1824
1731
|
height: "16",
|
|
@@ -1826,7 +1733,7 @@ const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1826
1733
|
stroke: "currentColor",
|
|
1827
1734
|
viewBox: "0 0 24 24",
|
|
1828
1735
|
style: {
|
|
1829
|
-
color:
|
|
1736
|
+
color: '#9ca3af'
|
|
1830
1737
|
},
|
|
1831
1738
|
children: jsxRuntimeExports.jsx("path", {
|
|
1832
1739
|
strokeLinecap: "round",
|
|
@@ -1837,12 +1744,12 @@ const Select = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1837
1744
|
})
|
|
1838
1745
|
})]
|
|
1839
1746
|
}), (error || helperText) && jsxRuntimeExports.jsx("p", {
|
|
1840
|
-
className:
|
|
1747
|
+
className: clsx('input-helper-text', error && 'input-helper-text--error'),
|
|
1841
1748
|
children: error || helperText
|
|
1842
1749
|
})]
|
|
1843
1750
|
});
|
|
1844
1751
|
});
|
|
1845
|
-
Select.displayName =
|
|
1752
|
+
Select.displayName = 'Select';
|
|
1846
1753
|
|
|
1847
1754
|
/**
|
|
1848
1755
|
* @license lucide-react v0.542.0 - ISC
|
|
@@ -1892,7 +1799,7 @@ var defaultAttributes = {
|
|
|
1892
1799
|
strokeLinejoin: "round"
|
|
1893
1800
|
};
|
|
1894
1801
|
|
|
1895
|
-
const _excluded$
|
|
1802
|
+
const _excluded$6 = ["color", "size", "strokeWidth", "absoluteStrokeWidth", "className", "children", "iconNode"];
|
|
1896
1803
|
const Icon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1897
1804
|
let {
|
|
1898
1805
|
color = "currentColor",
|
|
@@ -1903,7 +1810,7 @@ const Icon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1903
1810
|
children,
|
|
1904
1811
|
iconNode
|
|
1905
1812
|
} = _ref,
|
|
1906
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
1813
|
+
rest = _objectWithoutProperties(_ref, _excluded$6);
|
|
1907
1814
|
return /*#__PURE__*/React.createElement("svg", _objectSpread2(_objectSpread2(_objectSpread2({
|
|
1908
1815
|
ref
|
|
1909
1816
|
}, defaultAttributes), {}, {
|
|
@@ -1920,13 +1827,13 @@ const Icon = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
1920
1827
|
}), ...(Array.isArray(children) ? children : [children])]);
|
|
1921
1828
|
});
|
|
1922
1829
|
|
|
1923
|
-
const _excluded = ["className"];
|
|
1830
|
+
const _excluded$5 = ["className"];
|
|
1924
1831
|
const createLucideIcon = (iconName, iconNode) => {
|
|
1925
1832
|
const Component = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
1926
1833
|
let {
|
|
1927
1834
|
className
|
|
1928
1835
|
} = _ref,
|
|
1929
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
1836
|
+
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
1930
1837
|
return /*#__PURE__*/React.createElement(Icon, _objectSpread2({
|
|
1931
1838
|
ref,
|
|
1932
1839
|
iconNode,
|
|
@@ -2032,7 +1939,7 @@ const isDisabled = (date, disabledPast, disabledFuture) => {
|
|
|
2032
1939
|
}
|
|
2033
1940
|
return false;
|
|
2034
1941
|
};
|
|
2035
|
-
const DatePicker =
|
|
1942
|
+
const DatePicker = _ref => {
|
|
2036
1943
|
let {
|
|
2037
1944
|
format = 'DD/MM/YYYY',
|
|
2038
1945
|
language = 'en',
|
|
@@ -2045,8 +1952,13 @@ const DatePicker = (_ref, props) => {
|
|
|
2045
1952
|
showClear = true,
|
|
2046
1953
|
showToday = true,
|
|
2047
1954
|
disabledPast = false,
|
|
2048
|
-
|
|
2049
|
-
|
|
1955
|
+
disabledFuture = false,
|
|
1956
|
+
fullWidth = false,
|
|
1957
|
+
label,
|
|
1958
|
+
error,
|
|
1959
|
+
helperText,
|
|
1960
|
+
id,
|
|
1961
|
+
showIcon = true
|
|
2050
1962
|
} = _ref;
|
|
2051
1963
|
// State
|
|
2052
1964
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
@@ -2061,6 +1973,7 @@ const DatePicker = (_ref, props) => {
|
|
|
2061
1973
|
// Constants
|
|
2062
1974
|
const includeTime = format.includes('HH:mm');
|
|
2063
1975
|
const t = translations[language];
|
|
1976
|
+
const inputId = id || "datepicker-".concat(Math.random().toString(36).substr(2, 9));
|
|
2064
1977
|
// Initialize from value prop
|
|
2065
1978
|
React.useEffect(() => {
|
|
2066
1979
|
if (value) {
|
|
@@ -2221,32 +2134,37 @@ const DatePicker = (_ref, props) => {
|
|
|
2221
2134
|
const calendarDays = generateCalendarDays();
|
|
2222
2135
|
const today = new Date();
|
|
2223
2136
|
const displayYear = yearType === 'be' ? convertYear(currentYear) : currentYear;
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2137
|
+
const containerClasses = ['datepicker-container', fullWidth ? 'datepicker-container-full-width' : '', className].filter(Boolean).join(' ');
|
|
2138
|
+
const inputClasses = ['datepicker-input', error ? 'datepicker-input-error' : ''].filter(Boolean).join(' ');
|
|
2139
|
+
return jsxRuntimeExports.jsxs("div", {
|
|
2140
|
+
className: containerClasses,
|
|
2141
|
+
children: [label && jsxRuntimeExports.jsx("label", {
|
|
2142
|
+
className: "input-label",
|
|
2143
|
+
htmlFor: inputId,
|
|
2144
|
+
children: label
|
|
2227
2145
|
}), jsxRuntimeExports.jsxs("div", {
|
|
2228
2146
|
ref: containerRef,
|
|
2229
|
-
className: "
|
|
2147
|
+
className: "datepicker ".concat(fullWidth ? 'datepicker-full-width' : ''),
|
|
2230
2148
|
children: [jsxRuntimeExports.jsxs("div", {
|
|
2231
|
-
className: "
|
|
2232
|
-
children: [jsxRuntimeExports.jsx("input",
|
|
2149
|
+
className: "datepicker-input-wrapper",
|
|
2150
|
+
children: [jsxRuntimeExports.jsx("input", {
|
|
2233
2151
|
type: "text",
|
|
2234
2152
|
value: inputValue,
|
|
2235
2153
|
placeholder: placeholder || format,
|
|
2236
2154
|
disabled: disabled,
|
|
2237
2155
|
readOnly: true,
|
|
2238
2156
|
onClick: () => !disabled && setIsOpen(true),
|
|
2239
|
-
className:
|
|
2240
|
-
|
|
2241
|
-
|
|
2157
|
+
className: inputClasses,
|
|
2158
|
+
id: inputId
|
|
2159
|
+
}), showIcon && jsxRuntimeExports.jsx("div", {
|
|
2160
|
+
className: "datepicker-icon",
|
|
2242
2161
|
children: jsxRuntimeExports.jsx(CalendarDays, {
|
|
2243
2162
|
size: "18"
|
|
2244
2163
|
})
|
|
2245
2164
|
})]
|
|
2246
2165
|
}), isOpen && jsxRuntimeExports.jsx("div", {
|
|
2247
|
-
className: "
|
|
2166
|
+
className: "datepicker-dropdown",
|
|
2248
2167
|
children: jsxRuntimeExports.jsxs("div", {
|
|
2249
|
-
className: "datetime-picker-calendar",
|
|
2250
2168
|
children: [jsxRuntimeExports.jsxs("div", {
|
|
2251
2169
|
className: "calendar-header",
|
|
2252
2170
|
children: [jsxRuntimeExports.jsx("button", {
|
|
@@ -2294,6 +2212,7 @@ const DatePicker = (_ref, props) => {
|
|
|
2294
2212
|
const isSelected = selectedDate && isSameDay(actualDate, selectedDate);
|
|
2295
2213
|
const isToday = isSameDay(actualDate, today);
|
|
2296
2214
|
const isDayDisabled = isDisabled(actualDate, disabledPast, disabledFuture);
|
|
2215
|
+
const dayClasses = ['calendar-day', dateInfo.isOtherMonth ? 'calendar-day-other-month' : '', isSelected ? 'calendar-day-selected' : '', isToday ? 'calendar-day-today' : '', isDayDisabled ? 'calendar-day-disabled' : ''].filter(Boolean).join(' ');
|
|
2297
2216
|
return jsxRuntimeExports.jsx("button", {
|
|
2298
2217
|
type: "button",
|
|
2299
2218
|
onClick: () => {
|
|
@@ -2320,7 +2239,7 @@ const DatePicker = (_ref, props) => {
|
|
|
2320
2239
|
}
|
|
2321
2240
|
},
|
|
2322
2241
|
disabled: isDayDisabled,
|
|
2323
|
-
className:
|
|
2242
|
+
className: dayClasses,
|
|
2324
2243
|
children: dateInfo.day
|
|
2325
2244
|
}, index);
|
|
2326
2245
|
})
|
|
@@ -2363,7 +2282,7 @@ const DatePicker = (_ref, props) => {
|
|
|
2363
2282
|
type: "button",
|
|
2364
2283
|
onClick: handleToday,
|
|
2365
2284
|
disabled: isDisabled(today, disabledPast, disabledFuture),
|
|
2366
|
-
className: "footer-button today-button ".concat(isDisabled(today, disabledPast, disabledFuture) ? 'disabled' : ''),
|
|
2285
|
+
className: "footer-button today-button ".concat(isDisabled(today, disabledPast, disabledFuture) ? 'calendar-day-disabled' : ''),
|
|
2367
2286
|
children: t.today
|
|
2368
2287
|
}), showClear && jsxRuntimeExports.jsx("button", {
|
|
2369
2288
|
type: "button",
|
|
@@ -2379,21 +2298,652 @@ const DatePicker = (_ref, props) => {
|
|
|
2379
2298
|
})]
|
|
2380
2299
|
})
|
|
2381
2300
|
})]
|
|
2301
|
+
}), (error || helperText) && jsxRuntimeExports.jsx("p", {
|
|
2302
|
+
className: "input-helper-text ".concat(error ? 'input-helper-text-error' : ''),
|
|
2303
|
+
children: error || helperText
|
|
2304
|
+
})]
|
|
2305
|
+
});
|
|
2306
|
+
};
|
|
2307
|
+
|
|
2308
|
+
const _excluded$4 = ["columns", "data", "className", "emptyMessage", "pagination", "paginationPerPage", "paginationRowsPerPageOptions", "search", "searchPlaceholder", "searchableColumns", "onSort", "onPageChange", "onRowsPerPageChange", "onSearch"];
|
|
2309
|
+
const DataTable = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
2310
|
+
let {
|
|
2311
|
+
columns,
|
|
2312
|
+
data,
|
|
2313
|
+
className,
|
|
2314
|
+
emptyMessage = "No data available",
|
|
2315
|
+
pagination = false,
|
|
2316
|
+
paginationPerPage = 10,
|
|
2317
|
+
paginationRowsPerPageOptions = [10, 25, 50, 100],
|
|
2318
|
+
search = false,
|
|
2319
|
+
searchPlaceholder = "Search...",
|
|
2320
|
+
searchableColumns,
|
|
2321
|
+
onSort,
|
|
2322
|
+
onPageChange,
|
|
2323
|
+
onRowsPerPageChange,
|
|
2324
|
+
onSearch
|
|
2325
|
+
} = _ref,
|
|
2326
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
2327
|
+
const [sortField, setSortField] = React.useState(null);
|
|
2328
|
+
const [sortDirection, setSortDirection] = React.useState("asc");
|
|
2329
|
+
const [currentPage, setCurrentPage] = React.useState(1);
|
|
2330
|
+
const [rowsPerPage, setRowsPerPage] = React.useState(paginationPerPage);
|
|
2331
|
+
const rowsPerPageOptions = React.useMemo(() => {
|
|
2332
|
+
const options = [...paginationRowsPerPageOptions];
|
|
2333
|
+
if (!options.includes(paginationPerPage)) {
|
|
2334
|
+
options.push(paginationPerPage);
|
|
2335
|
+
options.sort((a, b) => a - b);
|
|
2336
|
+
}
|
|
2337
|
+
return options;
|
|
2338
|
+
}, [paginationRowsPerPageOptions, paginationPerPage]);
|
|
2339
|
+
const [searchTerm, setSearchTerm] = React.useState("");
|
|
2340
|
+
const defaultSearchableColumns = searchableColumns || columns.map(col => col.key);
|
|
2341
|
+
const filteredData = React.useMemo(() => {
|
|
2342
|
+
if (!searchTerm) return data;
|
|
2343
|
+
return data.filter(row => defaultSearchableColumns.some(key => String(row[key]).toLowerCase().includes(searchTerm.toLowerCase())));
|
|
2344
|
+
}, [data, searchTerm, defaultSearchableColumns]);
|
|
2345
|
+
const sortedData = React.useMemo(() => {
|
|
2346
|
+
if (!sortField) return filteredData;
|
|
2347
|
+
return [...filteredData].sort((a, b) => {
|
|
2348
|
+
const aValue = a[sortField];
|
|
2349
|
+
const bValue = b[sortField];
|
|
2350
|
+
if (aValue < bValue) return sortDirection === "asc" ? -1 : 1;
|
|
2351
|
+
if (aValue > bValue) return sortDirection === "asc" ? 1 : -1;
|
|
2352
|
+
return 0;
|
|
2353
|
+
});
|
|
2354
|
+
}, [filteredData, sortField, sortDirection]);
|
|
2355
|
+
const paginatedData = React.useMemo(() => {
|
|
2356
|
+
if (!pagination) return sortedData;
|
|
2357
|
+
const start = (currentPage - 1) * rowsPerPage;
|
|
2358
|
+
return sortedData.slice(start, start + rowsPerPage);
|
|
2359
|
+
}, [sortedData, currentPage, rowsPerPage, pagination]);
|
|
2360
|
+
const totalPages = Math.ceil(sortedData.length / rowsPerPage);
|
|
2361
|
+
const handleSort = columnKey => {
|
|
2362
|
+
const newDirection = sortField === columnKey && sortDirection === "asc" ? "desc" : "asc";
|
|
2363
|
+
setSortField(columnKey);
|
|
2364
|
+
setSortDirection(newDirection);
|
|
2365
|
+
onSort === null || onSort === void 0 || onSort(columnKey, newDirection);
|
|
2366
|
+
};
|
|
2367
|
+
const handlePageChange = page => {
|
|
2368
|
+
setCurrentPage(page);
|
|
2369
|
+
onPageChange === null || onPageChange === void 0 || onPageChange(page);
|
|
2370
|
+
};
|
|
2371
|
+
const handleRowsPerPageChange = newRowsPerPage => {
|
|
2372
|
+
setRowsPerPage(newRowsPerPage);
|
|
2373
|
+
setCurrentPage(1);
|
|
2374
|
+
onRowsPerPageChange === null || onRowsPerPageChange === void 0 || onRowsPerPageChange(newRowsPerPage);
|
|
2375
|
+
};
|
|
2376
|
+
const handleSearchChange = e => {
|
|
2377
|
+
const term = e.target.value;
|
|
2378
|
+
setSearchTerm(term);
|
|
2379
|
+
setCurrentPage(1);
|
|
2380
|
+
onSearch === null || onSearch === void 0 || onSearch(term);
|
|
2381
|
+
};
|
|
2382
|
+
const renderPagination = () => {
|
|
2383
|
+
if (!pagination) return null;
|
|
2384
|
+
const pageNumbers = [];
|
|
2385
|
+
const maxPagesToShow = 5;
|
|
2386
|
+
const halfPages = Math.floor(maxPagesToShow / 2);
|
|
2387
|
+
let startPage = Math.max(1, currentPage - halfPages);
|
|
2388
|
+
let endPage = Math.min(totalPages, startPage + maxPagesToShow - 1);
|
|
2389
|
+
if (endPage - startPage < maxPagesToShow - 1) {
|
|
2390
|
+
startPage = Math.max(1, endPage - maxPagesToShow + 1);
|
|
2391
|
+
}
|
|
2392
|
+
for (let i = startPage; i <= endPage; i++) {
|
|
2393
|
+
pageNumbers.push(i);
|
|
2394
|
+
}
|
|
2395
|
+
return jsxRuntimeExports.jsxs("div", {
|
|
2396
|
+
className: "data-table-pagination-container",
|
|
2397
|
+
children: [jsxRuntimeExports.jsxs("div", {
|
|
2398
|
+
children: ["Rows per page:", jsxRuntimeExports.jsx("select", {
|
|
2399
|
+
value: rowsPerPage,
|
|
2400
|
+
onChange: e => handleRowsPerPageChange(Number(e.target.value)),
|
|
2401
|
+
className: "data-table-pagination-select",
|
|
2402
|
+
children: rowsPerPageOptions.map(option => jsxRuntimeExports.jsx("option", {
|
|
2403
|
+
value: option,
|
|
2404
|
+
children: option
|
|
2405
|
+
}, option))
|
|
2406
|
+
})]
|
|
2407
|
+
}), jsxRuntimeExports.jsxs("div", {
|
|
2408
|
+
className: "data-table-pagination-controls",
|
|
2409
|
+
children: [jsxRuntimeExports.jsx("button", {
|
|
2410
|
+
onClick: () => handlePageChange(1),
|
|
2411
|
+
disabled: currentPage === 1,
|
|
2412
|
+
className: "data-table-pagination-button",
|
|
2413
|
+
children: "First"
|
|
2414
|
+
}), jsxRuntimeExports.jsx("button", {
|
|
2415
|
+
onClick: () => handlePageChange(currentPage - 1),
|
|
2416
|
+
disabled: currentPage === 1,
|
|
2417
|
+
className: "data-table-pagination-button",
|
|
2418
|
+
children: "Previous"
|
|
2419
|
+
}), startPage > 1 && jsxRuntimeExports.jsx("span", {
|
|
2420
|
+
className: "pagination-ellipsis",
|
|
2421
|
+
children: "..."
|
|
2422
|
+
}), pageNumbers.map(page => jsxRuntimeExports.jsx("button", {
|
|
2423
|
+
onClick: () => handlePageChange(page),
|
|
2424
|
+
className: "data-table-pagination-button ".concat(currentPage === page ? 'active' : ''),
|
|
2425
|
+
children: page
|
|
2426
|
+
}, page)), endPage < totalPages && jsxRuntimeExports.jsx("span", {
|
|
2427
|
+
className: "pagination-ellipsis",
|
|
2428
|
+
children: "..."
|
|
2429
|
+
}), jsxRuntimeExports.jsx("button", {
|
|
2430
|
+
onClick: () => handlePageChange(currentPage + 1),
|
|
2431
|
+
disabled: currentPage === totalPages,
|
|
2432
|
+
className: "data-table-pagination-button",
|
|
2433
|
+
children: "Next"
|
|
2434
|
+
}), jsxRuntimeExports.jsx("button", {
|
|
2435
|
+
onClick: () => handlePageChange(totalPages),
|
|
2436
|
+
disabled: currentPage === totalPages,
|
|
2437
|
+
className: "data-table-pagination-button",
|
|
2438
|
+
children: "Last"
|
|
2439
|
+
})]
|
|
2440
|
+
})]
|
|
2441
|
+
});
|
|
2442
|
+
};
|
|
2443
|
+
return jsxRuntimeExports.jsxs("div", {
|
|
2444
|
+
className: "data-table-container",
|
|
2445
|
+
children: [search && jsxRuntimeExports.jsx("div", {
|
|
2446
|
+
className: "data-table-search-container",
|
|
2447
|
+
children: jsxRuntimeExports.jsx(Input, {
|
|
2448
|
+
type: "text",
|
|
2449
|
+
placeholder: searchPlaceholder,
|
|
2450
|
+
value: searchTerm,
|
|
2451
|
+
onChange: handleSearchChange,
|
|
2452
|
+
fullWidth: true
|
|
2453
|
+
})
|
|
2454
|
+
}), jsxRuntimeExports.jsxs("table", _objectSpread2(_objectSpread2({
|
|
2455
|
+
className: "data-table ".concat(className || ''),
|
|
2456
|
+
ref: ref
|
|
2457
|
+
}, props), {}, {
|
|
2458
|
+
children: [jsxRuntimeExports.jsx("thead", {
|
|
2459
|
+
className: "data-table-header",
|
|
2460
|
+
children: jsxRuntimeExports.jsx("tr", {
|
|
2461
|
+
children: columns.map(column => {
|
|
2462
|
+
const thClasses = ["data-table-header-cell", column.align === "center" && "text-center", column.align === "right" && "text-right", column.sortable && "sortable"].filter(Boolean).join(" ");
|
|
2463
|
+
const contentClasses = ["header-cell-content", "justify-".concat(column.align || 'start')].join(' ');
|
|
2464
|
+
return jsxRuntimeExports.jsx("th", {
|
|
2465
|
+
className: thClasses,
|
|
2466
|
+
style: {
|
|
2467
|
+
width: column.width
|
|
2468
|
+
},
|
|
2469
|
+
onClick: column.sortable ? () => handleSort(column.key) : undefined,
|
|
2470
|
+
children: jsxRuntimeExports.jsxs("div", {
|
|
2471
|
+
className: contentClasses,
|
|
2472
|
+
children: [column.label, column.sortable && sortField === column.key && jsxRuntimeExports.jsx("span", {
|
|
2473
|
+
className: "sort-icon",
|
|
2474
|
+
children: sortDirection === "asc" ? "↑" : "↓"
|
|
2475
|
+
})]
|
|
2476
|
+
})
|
|
2477
|
+
}, column.key);
|
|
2478
|
+
})
|
|
2479
|
+
})
|
|
2480
|
+
}), jsxRuntimeExports.jsx("tbody", {
|
|
2481
|
+
className: "data-table-body",
|
|
2482
|
+
children: paginatedData.length === 0 ? jsxRuntimeExports.jsx("tr", {
|
|
2483
|
+
children: jsxRuntimeExports.jsx("td", {
|
|
2484
|
+
colSpan: columns.length,
|
|
2485
|
+
className: "data-table-empty-cell",
|
|
2486
|
+
children: emptyMessage
|
|
2487
|
+
})
|
|
2488
|
+
}) : paginatedData.map((row, rowIndex) => jsxRuntimeExports.jsx("tr", {
|
|
2489
|
+
className: "data-table-row",
|
|
2490
|
+
children: columns.map(column => {
|
|
2491
|
+
const value = row[column.key];
|
|
2492
|
+
const cellContent = column.render ? column.render(value, row, rowIndex) : value;
|
|
2493
|
+
const tdClasses = ["data-table-cell", column.align === "center" && "text-center", column.align === "right" && "text-right"].filter(Boolean).join(" ");
|
|
2494
|
+
return jsxRuntimeExports.jsx("td", {
|
|
2495
|
+
className: tdClasses,
|
|
2496
|
+
children: cellContent
|
|
2497
|
+
}, column.key);
|
|
2498
|
+
})
|
|
2499
|
+
}, rowIndex))
|
|
2500
|
+
})]
|
|
2501
|
+
})), renderPagination()]
|
|
2502
|
+
});
|
|
2503
|
+
});
|
|
2504
|
+
DataTable.displayName = "DataTable";
|
|
2505
|
+
|
|
2506
|
+
const _excluded$3 = ["options", "value", "onChange", "placeholder", "disabled", "fullWidth", "label", "helperText", "error", "multiple"];
|
|
2507
|
+
const Autocomplete = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
2508
|
+
let {
|
|
2509
|
+
options,
|
|
2510
|
+
value,
|
|
2511
|
+
onChange,
|
|
2512
|
+
placeholder = 'Type to search...',
|
|
2513
|
+
disabled = false,
|
|
2514
|
+
fullWidth = false,
|
|
2515
|
+
label,
|
|
2516
|
+
helperText,
|
|
2517
|
+
error = false,
|
|
2518
|
+
multiple = false
|
|
2519
|
+
} = _ref,
|
|
2520
|
+
props = _objectWithoutProperties(_ref, _excluded$3);
|
|
2521
|
+
const getInitialInputValue = () => {
|
|
2522
|
+
if (!multiple && value && typeof value === 'string') {
|
|
2523
|
+
return value;
|
|
2524
|
+
}
|
|
2525
|
+
return '';
|
|
2526
|
+
};
|
|
2527
|
+
const [inputValue, setInputValue] = React.useState(getInitialInputValue);
|
|
2528
|
+
const [showDropdown, setShowDropdown] = React.useState(false);
|
|
2529
|
+
const [filteredOptions, setFilteredOptions] = React.useState([]);
|
|
2530
|
+
const [selectedIndex, setSelectedIndex] = React.useState(-1);
|
|
2531
|
+
const inputRef = React.useRef(null);
|
|
2532
|
+
const dropdownRef = React.useRef(null);
|
|
2533
|
+
const currentValues = Array.isArray(value) ? value : value ? [value] : [];
|
|
2534
|
+
const isSelected = option => currentValues.includes(option);
|
|
2535
|
+
React.useEffect(() => {
|
|
2536
|
+
if (!multiple && value && typeof value === 'string') {
|
|
2537
|
+
setInputValue(value);
|
|
2538
|
+
} else if (!multiple && !value) {
|
|
2539
|
+
setInputValue('');
|
|
2540
|
+
}
|
|
2541
|
+
}, [value, multiple]);
|
|
2542
|
+
React.useEffect(() => {
|
|
2543
|
+
const filtered = options.filter(option => option.toLowerCase().includes(inputValue.toLowerCase()) && (!multiple || !isSelected(option)));
|
|
2544
|
+
setFilteredOptions(filtered);
|
|
2545
|
+
setSelectedIndex(-1);
|
|
2546
|
+
}, [inputValue, options, multiple, currentValues]);
|
|
2547
|
+
React.useEffect(() => {
|
|
2548
|
+
if (!multiple && showDropdown && inputValue === '' && options.length > 0) {
|
|
2549
|
+
setFilteredOptions(options.filter(option => !isSelected(option)));
|
|
2550
|
+
}
|
|
2551
|
+
}, [showDropdown, inputValue, options, multiple, isSelected]);
|
|
2552
|
+
const handleInputChange = e => {
|
|
2553
|
+
const newValue = e.target.value;
|
|
2554
|
+
setInputValue(newValue);
|
|
2555
|
+
setShowDropdown(true);
|
|
2556
|
+
if (!multiple && value && newValue !== value) {
|
|
2557
|
+
onChange === null || onChange === void 0 || onChange('');
|
|
2558
|
+
}
|
|
2559
|
+
};
|
|
2560
|
+
const handleInputFocus = () => {
|
|
2561
|
+
setShowDropdown(true);
|
|
2562
|
+
if (!multiple && (inputValue === '' || !value)) {
|
|
2563
|
+
setFilteredOptions(options);
|
|
2564
|
+
}
|
|
2565
|
+
};
|
|
2566
|
+
const handleInputBlur = () => {
|
|
2567
|
+
setTimeout(() => setShowDropdown(false), 150);
|
|
2568
|
+
};
|
|
2569
|
+
const handleOptionClick = option => {
|
|
2570
|
+
if (multiple) {
|
|
2571
|
+
const newValues = isSelected(option) ? currentValues.filter(v => v !== option) : [...currentValues, option];
|
|
2572
|
+
onChange === null || onChange === void 0 || onChange(newValues);
|
|
2573
|
+
setInputValue('');
|
|
2574
|
+
} else {
|
|
2575
|
+
onChange === null || onChange === void 0 || onChange(option);
|
|
2576
|
+
setInputValue(option);
|
|
2577
|
+
setFilteredOptions([]);
|
|
2578
|
+
}
|
|
2579
|
+
setShowDropdown(false);
|
|
2580
|
+
};
|
|
2581
|
+
const handleRemoveTag = option => {
|
|
2582
|
+
if (multiple) {
|
|
2583
|
+
const newValues = currentValues.filter(v => v !== option);
|
|
2584
|
+
onChange === null || onChange === void 0 || onChange(newValues);
|
|
2585
|
+
}
|
|
2586
|
+
};
|
|
2587
|
+
const handleKeyDown = e => {
|
|
2588
|
+
if (!showDropdown) return;
|
|
2589
|
+
switch (e.key) {
|
|
2590
|
+
case 'ArrowDown':
|
|
2591
|
+
e.preventDefault();
|
|
2592
|
+
setSelectedIndex(prev => Math.min(prev + 1, filteredOptions.length - 1));
|
|
2593
|
+
break;
|
|
2594
|
+
case 'ArrowUp':
|
|
2595
|
+
e.preventDefault();
|
|
2596
|
+
setSelectedIndex(prev => Math.max(prev - 1, -1));
|
|
2597
|
+
break;
|
|
2598
|
+
case 'Enter':
|
|
2599
|
+
e.preventDefault();
|
|
2600
|
+
if (selectedIndex >= 0 && filteredOptions[selectedIndex]) {
|
|
2601
|
+
handleOptionClick(filteredOptions[selectedIndex]);
|
|
2602
|
+
}
|
|
2603
|
+
break;
|
|
2604
|
+
case 'Escape':
|
|
2605
|
+
setShowDropdown(false);
|
|
2606
|
+
setSelectedIndex(-1);
|
|
2607
|
+
break;
|
|
2608
|
+
}
|
|
2609
|
+
};
|
|
2610
|
+
return jsxRuntimeExports.jsxs("div", {
|
|
2611
|
+
className: clsx('autocomplete-container', fullWidth && 'autocomplete-container--full-width'),
|
|
2612
|
+
children: [label && jsxRuntimeExports.jsx("label", {
|
|
2613
|
+
className: "input-label",
|
|
2614
|
+
children: label
|
|
2615
|
+
}), jsxRuntimeExports.jsxs("div", {
|
|
2616
|
+
className: "autocomplete-wrapper",
|
|
2617
|
+
children: [jsxRuntimeExports.jsxs("div", {
|
|
2618
|
+
className: clsx('autocomplete-input-area', error && 'autocomplete-input-area--error', disabled && 'autocomplete-input-area--disabled', fullWidth && 'autocomplete-input-area--full-width'),
|
|
2619
|
+
children: [multiple && currentValues.map((val, index) => jsxRuntimeExports.jsxs("span", {
|
|
2620
|
+
className: "autocomplete-tag",
|
|
2621
|
+
children: [val, jsxRuntimeExports.jsx("button", {
|
|
2622
|
+
type: "button",
|
|
2623
|
+
onClick: () => handleRemoveTag(val),
|
|
2624
|
+
className: "autocomplete-tag-remove",
|
|
2625
|
+
children: "\u00D7"
|
|
2626
|
+
})]
|
|
2627
|
+
}, "".concat(val, "-").concat(index))), jsxRuntimeExports.jsx("input", _objectSpread2({
|
|
2628
|
+
ref: ref || inputRef,
|
|
2629
|
+
type: "text",
|
|
2630
|
+
value: inputValue,
|
|
2631
|
+
onChange: handleInputChange,
|
|
2632
|
+
onFocus: handleInputFocus,
|
|
2633
|
+
onBlur: handleInputBlur,
|
|
2634
|
+
onKeyDown: handleKeyDown,
|
|
2635
|
+
placeholder: multiple ? currentValues.length > 0 ? '' : placeholder : inputValue ? '' : placeholder,
|
|
2636
|
+
disabled: disabled,
|
|
2637
|
+
className: "autocomplete-input"
|
|
2638
|
+
}, props))]
|
|
2639
|
+
}), showDropdown && filteredOptions.length > 0 && jsxRuntimeExports.jsx("ul", {
|
|
2640
|
+
ref: dropdownRef,
|
|
2641
|
+
className: "autocomplete-dropdown",
|
|
2642
|
+
children: filteredOptions.map((option, index) => jsxRuntimeExports.jsx("li", {
|
|
2643
|
+
onClick: () => handleOptionClick(option),
|
|
2644
|
+
className: clsx('autocomplete-option', selectedIndex === index && 'autocomplete-option--selected'),
|
|
2645
|
+
children: option
|
|
2646
|
+
}, option))
|
|
2647
|
+
})]
|
|
2648
|
+
}), helperText && jsxRuntimeExports.jsx("div", {
|
|
2649
|
+
className: clsx('input-helper-text', error && 'input-helper-text--error'),
|
|
2650
|
+
children: helperText
|
|
2382
2651
|
})]
|
|
2383
2652
|
});
|
|
2653
|
+
});
|
|
2654
|
+
Autocomplete.displayName = 'Autocomplete';
|
|
2655
|
+
|
|
2656
|
+
const _excluded$2 = ["component", "sx", "children", "className", "style", "display", "flexDirection", "justifyContent", "alignItems", "flexWrap", "gap", "p", "pt", "pr", "pb", "pl", "px", "py", "m", "mt", "mr", "mb", "ml", "mx", "my", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "bgcolor", "color", "borderRadius", "boxShadow", "position", "top", "right", "bottom", "left", "zIndex", "overflow", "textAlign"];
|
|
2657
|
+
// Hardcoded theme for now
|
|
2658
|
+
const theme = {
|
|
2659
|
+
spacing: {
|
|
2660
|
+
'0': '0',
|
|
2661
|
+
'1': '0.25rem',
|
|
2662
|
+
'2': '0.5rem',
|
|
2663
|
+
'3': '0.75rem',
|
|
2664
|
+
'4': '1rem',
|
|
2665
|
+
'5': '1.25rem',
|
|
2666
|
+
'6': '1.5rem',
|
|
2667
|
+
'8': '2rem',
|
|
2668
|
+
'10': '2.5rem',
|
|
2669
|
+
'12': '3rem',
|
|
2670
|
+
'16': '4rem',
|
|
2671
|
+
'20': '5rem',
|
|
2672
|
+
'24': '6rem',
|
|
2673
|
+
'32': '8rem',
|
|
2674
|
+
'40': '10rem',
|
|
2675
|
+
'48': '12rem',
|
|
2676
|
+
'56': '14rem',
|
|
2677
|
+
'64': '16rem'
|
|
2678
|
+
},
|
|
2679
|
+
borderRadius: {
|
|
2680
|
+
sm: '0.125rem',
|
|
2681
|
+
md: '0.25rem',
|
|
2682
|
+
lg: '0.5rem',
|
|
2683
|
+
full: '9999px'
|
|
2684
|
+
},
|
|
2685
|
+
shadows: {
|
|
2686
|
+
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
|
|
2687
|
+
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)',
|
|
2688
|
+
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)'
|
|
2689
|
+
}
|
|
2690
|
+
};
|
|
2691
|
+
// Helper function to convert system props to a style object
|
|
2692
|
+
const createSystemStyles = props => {
|
|
2693
|
+
const styles = {};
|
|
2694
|
+
if (props.display) styles.display = props.display;
|
|
2695
|
+
if (props.flexDirection) styles.flexDirection = props.flexDirection;
|
|
2696
|
+
if (props.justifyContent) styles.justifyContent = props.justifyContent;
|
|
2697
|
+
if (props.alignItems) styles.alignItems = props.alignItems;
|
|
2698
|
+
if (props.flexWrap) styles.flexWrap = props.flexWrap;
|
|
2699
|
+
if (props.gap) styles.gap = theme.spacing[props.gap];
|
|
2700
|
+
// Padding
|
|
2701
|
+
if (props.p) styles.padding = theme.spacing[props.p];
|
|
2702
|
+
if (props.pt) styles.paddingTop = theme.spacing[props.pt];
|
|
2703
|
+
if (props.pr) styles.paddingRight = theme.spacing[props.pr];
|
|
2704
|
+
if (props.pb) styles.paddingBottom = theme.spacing[props.pb];
|
|
2705
|
+
if (props.pl) styles.paddingLeft = theme.spacing[props.pl];
|
|
2706
|
+
if (props.px) {
|
|
2707
|
+
styles.paddingLeft = theme.spacing[props.px];
|
|
2708
|
+
styles.paddingRight = theme.spacing[props.px];
|
|
2709
|
+
}
|
|
2710
|
+
if (props.py) {
|
|
2711
|
+
styles.paddingTop = theme.spacing[props.py];
|
|
2712
|
+
styles.paddingBottom = theme.spacing[props.py];
|
|
2713
|
+
}
|
|
2714
|
+
// Margin
|
|
2715
|
+
if (props.m) styles.margin = theme.spacing[props.m];
|
|
2716
|
+
if (props.mt) styles.marginTop = theme.spacing[props.mt];
|
|
2717
|
+
if (props.mr) styles.marginRight = theme.spacing[props.mr];
|
|
2718
|
+
if (props.mb) styles.marginBottom = theme.spacing[props.mb];
|
|
2719
|
+
if (props.ml) styles.marginLeft = theme.spacing[props.ml];
|
|
2720
|
+
if (props.mx) {
|
|
2721
|
+
styles.marginLeft = theme.spacing[props.mx];
|
|
2722
|
+
styles.marginRight = theme.spacing[props.mx];
|
|
2723
|
+
}
|
|
2724
|
+
if (props.my) {
|
|
2725
|
+
styles.marginTop = theme.spacing[props.my];
|
|
2726
|
+
styles.marginBottom = theme.spacing[props.my];
|
|
2727
|
+
}
|
|
2728
|
+
// Dimensions
|
|
2729
|
+
if (props.width) styles.width = typeof props.width === 'number' ? "".concat(props.width, "px") : props.width;
|
|
2730
|
+
if (props.height) styles.height = typeof props.height === 'number' ? "".concat(props.height, "px") : props.height;
|
|
2731
|
+
if (props.minWidth) styles.minWidth = typeof props.minWidth === 'number' ? "".concat(props.minWidth, "px") : props.minWidth;
|
|
2732
|
+
if (props.minHeight) styles.minHeight = typeof props.minHeight === 'number' ? "".concat(props.minHeight, "px") : props.minHeight;
|
|
2733
|
+
if (props.maxWidth) styles.maxWidth = typeof props.maxWidth === 'number' ? "".concat(props.maxWidth, "px") : props.maxWidth;
|
|
2734
|
+
if (props.maxHeight) styles.maxHeight = typeof props.maxHeight === 'number' ? "".concat(props.maxHeight, "px") : props.maxHeight;
|
|
2735
|
+
// Colors
|
|
2736
|
+
if (props.bgcolor) styles.backgroundColor = props.bgcolor;
|
|
2737
|
+
if (props.color) styles.color = props.color;
|
|
2738
|
+
// Border radius
|
|
2739
|
+
if (props.borderRadius) styles.borderRadius = theme.borderRadius[props.borderRadius];
|
|
2740
|
+
// Box shadow
|
|
2741
|
+
if (props.boxShadow) styles.boxShadow = theme.shadows[props.boxShadow];
|
|
2742
|
+
// Position
|
|
2743
|
+
if (props.position) styles.position = props.position;
|
|
2744
|
+
if (props.top) styles.top = typeof props.top === 'number' ? "".concat(props.top, "px") : props.top;
|
|
2745
|
+
if (props.right) styles.right = typeof props.right === 'number' ? "".concat(props.right, "px") : props.right;
|
|
2746
|
+
if (props.bottom) styles.bottom = typeof props.bottom === 'number' ? "".concat(props.bottom, "px") : props.bottom;
|
|
2747
|
+
if (props.left) styles.left = typeof props.left === 'number' ? "".concat(props.left, "px") : props.left;
|
|
2748
|
+
if (props.zIndex) styles.zIndex = props.zIndex;
|
|
2749
|
+
// Overflow
|
|
2750
|
+
if (props.overflow) styles.overflow = props.overflow;
|
|
2751
|
+
// Text align
|
|
2752
|
+
if (props.textAlign) styles.textAlign = props.textAlign;
|
|
2753
|
+
return styles;
|
|
2384
2754
|
};
|
|
2755
|
+
const Box = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
2756
|
+
const {
|
|
2757
|
+
component = 'div',
|
|
2758
|
+
sx,
|
|
2759
|
+
children,
|
|
2760
|
+
className,
|
|
2761
|
+
style,
|
|
2762
|
+
// System props
|
|
2763
|
+
display,
|
|
2764
|
+
flexDirection,
|
|
2765
|
+
justifyContent,
|
|
2766
|
+
alignItems,
|
|
2767
|
+
flexWrap,
|
|
2768
|
+
gap,
|
|
2769
|
+
p,
|
|
2770
|
+
pt,
|
|
2771
|
+
pr,
|
|
2772
|
+
pb,
|
|
2773
|
+
pl,
|
|
2774
|
+
px,
|
|
2775
|
+
py,
|
|
2776
|
+
m,
|
|
2777
|
+
mt,
|
|
2778
|
+
mr,
|
|
2779
|
+
mb,
|
|
2780
|
+
ml,
|
|
2781
|
+
mx,
|
|
2782
|
+
my,
|
|
2783
|
+
width,
|
|
2784
|
+
height,
|
|
2785
|
+
minWidth,
|
|
2786
|
+
minHeight,
|
|
2787
|
+
maxWidth,
|
|
2788
|
+
maxHeight,
|
|
2789
|
+
bgcolor,
|
|
2790
|
+
color,
|
|
2791
|
+
borderRadius,
|
|
2792
|
+
boxShadow,
|
|
2793
|
+
position,
|
|
2794
|
+
top,
|
|
2795
|
+
right,
|
|
2796
|
+
bottom,
|
|
2797
|
+
left,
|
|
2798
|
+
zIndex,
|
|
2799
|
+
overflow,
|
|
2800
|
+
textAlign
|
|
2801
|
+
} = props,
|
|
2802
|
+
otherProps = _objectWithoutProperties(props, _excluded$2);
|
|
2803
|
+
const Component = component;
|
|
2804
|
+
// Create system styles from individual props
|
|
2805
|
+
const systemProps = {
|
|
2806
|
+
display,
|
|
2807
|
+
flexDirection,
|
|
2808
|
+
justifyContent,
|
|
2809
|
+
alignItems,
|
|
2810
|
+
flexWrap,
|
|
2811
|
+
gap,
|
|
2812
|
+
p,
|
|
2813
|
+
pt,
|
|
2814
|
+
pr,
|
|
2815
|
+
pb,
|
|
2816
|
+
pl,
|
|
2817
|
+
px,
|
|
2818
|
+
py,
|
|
2819
|
+
m,
|
|
2820
|
+
mt,
|
|
2821
|
+
mr,
|
|
2822
|
+
mb,
|
|
2823
|
+
ml,
|
|
2824
|
+
mx,
|
|
2825
|
+
my,
|
|
2826
|
+
width,
|
|
2827
|
+
height,
|
|
2828
|
+
minWidth,
|
|
2829
|
+
minHeight,
|
|
2830
|
+
maxWidth,
|
|
2831
|
+
maxHeight,
|
|
2832
|
+
bgcolor,
|
|
2833
|
+
color,
|
|
2834
|
+
borderRadius,
|
|
2835
|
+
boxShadow,
|
|
2836
|
+
position,
|
|
2837
|
+
top,
|
|
2838
|
+
right,
|
|
2839
|
+
bottom,
|
|
2840
|
+
left,
|
|
2841
|
+
zIndex,
|
|
2842
|
+
overflow,
|
|
2843
|
+
textAlign
|
|
2844
|
+
};
|
|
2845
|
+
const systemStyles = createSystemStyles(systemProps);
|
|
2846
|
+
const sxStyles = sx ? createSystemStyles(sx) : {};
|
|
2847
|
+
const combinedStyles = _objectSpread2(_objectSpread2(_objectSpread2({}, systemStyles), sxStyles), style);
|
|
2848
|
+
return jsxRuntimeExports.jsx(Component, _objectSpread2(_objectSpread2({
|
|
2849
|
+
className: className,
|
|
2850
|
+
style: combinedStyles,
|
|
2851
|
+
ref: ref
|
|
2852
|
+
}, otherProps), {}, {
|
|
2853
|
+
children: children
|
|
2854
|
+
}));
|
|
2855
|
+
});
|
|
2856
|
+
Box.displayName = 'Box';
|
|
2857
|
+
|
|
2858
|
+
const _excluded$1 = ["className", "maxWidth", "disableGutters", "fixed", "children"];
|
|
2859
|
+
const Container = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
2860
|
+
let {
|
|
2861
|
+
className,
|
|
2862
|
+
maxWidth = 'lg',
|
|
2863
|
+
disableGutters = false,
|
|
2864
|
+
fixed = false,
|
|
2865
|
+
children
|
|
2866
|
+
} = _ref,
|
|
2867
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
2868
|
+
const classNames = clsx('container', !disableGutters && 'container--gutters', fixed && 'container--fixed', maxWidth !== 'none' && "container--max-width-".concat(maxWidth), className);
|
|
2869
|
+
return jsxRuntimeExports.jsx("div", _objectSpread2(_objectSpread2({
|
|
2870
|
+
className: classNames,
|
|
2871
|
+
ref: ref
|
|
2872
|
+
}, props), {}, {
|
|
2873
|
+
children: children
|
|
2874
|
+
}));
|
|
2875
|
+
});
|
|
2876
|
+
Container.displayName = 'Container';
|
|
2877
|
+
|
|
2878
|
+
const _excluded = ["children", "className", "container", "item", "spacing", "direction", "justifyContent", "alignItems", "wrap", "xs", "sm", "md", "lg", "xl"];
|
|
2879
|
+
const Grid = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
2880
|
+
let {
|
|
2881
|
+
children,
|
|
2882
|
+
className,
|
|
2883
|
+
container = false,
|
|
2884
|
+
item = false,
|
|
2885
|
+
spacing = 0,
|
|
2886
|
+
direction = 'row',
|
|
2887
|
+
justifyContent,
|
|
2888
|
+
alignItems,
|
|
2889
|
+
wrap = 'wrap',
|
|
2890
|
+
xs,
|
|
2891
|
+
sm,
|
|
2892
|
+
md,
|
|
2893
|
+
lg,
|
|
2894
|
+
xl
|
|
2895
|
+
} = _ref,
|
|
2896
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
2897
|
+
const classNames = ['grid'];
|
|
2898
|
+
if (container) {
|
|
2899
|
+
classNames.push('grid-container');
|
|
2900
|
+
classNames.push("grid-direction-".concat(direction));
|
|
2901
|
+
if (justifyContent) {
|
|
2902
|
+
classNames.push("grid-justify-content-".concat(justifyContent));
|
|
2903
|
+
}
|
|
2904
|
+
if (alignItems) {
|
|
2905
|
+
classNames.push("grid-align-items-".concat(alignItems));
|
|
2906
|
+
}
|
|
2907
|
+
classNames.push("grid-wrap-".concat(wrap));
|
|
2908
|
+
if (spacing) {
|
|
2909
|
+
classNames.push("grid-spacing-".concat(spacing));
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
if (item) {
|
|
2913
|
+
classNames.push('grid-item');
|
|
2914
|
+
if (xs) classNames.push("grid-xs-".concat(String(xs)));
|
|
2915
|
+
if (sm) classNames.push("grid-sm-".concat(String(sm)));
|
|
2916
|
+
if (md) classNames.push("grid-md-".concat(String(md)));
|
|
2917
|
+
if (lg) classNames.push("grid-lg-".concat(String(lg)));
|
|
2918
|
+
if (xl) classNames.push("grid-xl-".concat(String(xl)));
|
|
2919
|
+
}
|
|
2920
|
+
if (className) {
|
|
2921
|
+
classNames.push(className);
|
|
2922
|
+
}
|
|
2923
|
+
return jsxRuntimeExports.jsx("div", _objectSpread2(_objectSpread2({
|
|
2924
|
+
className: classNames.join(' '),
|
|
2925
|
+
ref: ref
|
|
2926
|
+
}, props), {}, {
|
|
2927
|
+
children: children
|
|
2928
|
+
}));
|
|
2929
|
+
});
|
|
2930
|
+
Grid.displayName = 'Grid';
|
|
2385
2931
|
|
|
2386
2932
|
// Ensure React is available before importing components
|
|
2387
2933
|
|
|
2388
2934
|
exports.React = React;
|
|
2389
2935
|
exports.default = React;
|
|
2936
|
+
exports.Autocomplete = Autocomplete;
|
|
2937
|
+
exports.Box = Box;
|
|
2390
2938
|
exports.Button = Button;
|
|
2391
2939
|
exports.Checkbox = Checkbox;
|
|
2940
|
+
exports.Container = Container;
|
|
2941
|
+
exports.DataTable = DataTable;
|
|
2392
2942
|
exports.DatePicker = DatePicker;
|
|
2943
|
+
exports.Grid = Grid;
|
|
2393
2944
|
exports.Input = Input;
|
|
2394
2945
|
exports.InputFile = InputFile;
|
|
2395
2946
|
exports.Radio = Radio;
|
|
2396
2947
|
exports.Select = Select;
|
|
2397
2948
|
exports.Textarea = Textarea;
|
|
2398
|
-
exports.cssClasses = cssClasses;
|
|
2399
2949
|
//# sourceMappingURL=index.js.map
|