react-better-html 1.1.146 → 1.1.147
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.js +50 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3823,7 +3823,7 @@ var Chip_default = Chip2;
|
|
|
3823
3823
|
|
|
3824
3824
|
// src/components/InputField.tsx
|
|
3825
3825
|
import { forwardRef as forwardRef11, memo as memo18, useCallback as useCallback9, useState as useState7, useEffect as useEffect8, useMemo as useMemo6, useRef as useRef5, useId } from "react";
|
|
3826
|
-
import
|
|
3826
|
+
import styled10 from "styled-components";
|
|
3827
3827
|
|
|
3828
3828
|
// src/constants/countries.ts
|
|
3829
3829
|
var countries = [
|
|
@@ -5727,6 +5727,7 @@ var Dropdown_default = Dropdown2;
|
|
|
5727
5727
|
|
|
5728
5728
|
// src/components/Calendar.tsx
|
|
5729
5729
|
import { useCallback as useCallback8, useMemo as useMemo5, useState as useState6, memo as memo17, useEffect as useEffect7 } from "react";
|
|
5730
|
+
import styled9 from "styled-components";
|
|
5730
5731
|
import { jsx as jsx16, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
5731
5732
|
var getMonthName = (month, short = false) => {
|
|
5732
5733
|
return [
|
|
@@ -5756,6 +5757,16 @@ var getWeekDayName = (day, short = false) => {
|
|
|
5756
5757
|
][day];
|
|
5757
5758
|
};
|
|
5758
5759
|
var weekDaysIndex = [1, 2, 3, 4, 5, 6, 0];
|
|
5760
|
+
var yearsRange = Array.from({ length: 100 + 1 + 50 }, (_, index) => index + (/* @__PURE__ */ new Date()).getFullYear() - 100);
|
|
5761
|
+
var SelectComponent = styled9.select.withConfig({
|
|
5762
|
+
shouldForwardProp: (prop) => !["normalStyle", "hoverStyle"].includes(prop)
|
|
5763
|
+
})`
|
|
5764
|
+
position: absolute;
|
|
5765
|
+
top: 50%;
|
|
5766
|
+
right: 0;
|
|
5767
|
+
transform: translateY(-50%);
|
|
5768
|
+
opacity: 0;
|
|
5769
|
+
`;
|
|
5759
5770
|
function Calendar({ value, minDate, maxDate, onChange }) {
|
|
5760
5771
|
const theme2 = useTheme();
|
|
5761
5772
|
const [currentDate, setCurrentDate] = useState6(value ? new Date(value) : void 0);
|
|
@@ -5796,6 +5807,9 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
5796
5807
|
`${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, "0")}-${today.getDate().toString().padStart(2, "0")}`
|
|
5797
5808
|
);
|
|
5798
5809
|
}, [onChange]);
|
|
5810
|
+
const onChangeYearSelect = useCallback8((event) => {
|
|
5811
|
+
setCurrentYear(parseInt(event.target.value));
|
|
5812
|
+
}, []);
|
|
5799
5813
|
const firstDayOfMonth = useMemo5(() => {
|
|
5800
5814
|
const day = new Date(currentYear, currentMonth, 1).getDay();
|
|
5801
5815
|
return day === 0 ? 6 : day - 1;
|
|
@@ -5820,10 +5834,13 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
5820
5834
|
return /* @__PURE__ */ jsxs11(Div_default.column, { width: "100%", maxWidth: 320, gap: theme2.styles.gap, padding: theme2.styles.space / 2, userSelect: "none", children: [
|
|
5821
5835
|
/* @__PURE__ */ jsxs11(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
|
|
5822
5836
|
/* @__PURE__ */ jsx16(Button_default.icon, { icon: "chevronLeft", onClick: onClickPreviousMonthButton }),
|
|
5823
|
-
/* @__PURE__ */ jsxs11(
|
|
5824
|
-
getMonthName(currentMonth),
|
|
5825
|
-
" ",
|
|
5826
|
-
|
|
5837
|
+
/* @__PURE__ */ jsxs11(Div_default.row, { alignItems: "center", gap: 4, children: [
|
|
5838
|
+
/* @__PURE__ */ jsx16(Text_default, { fontWeight: 700, children: getMonthName(currentMonth) }),
|
|
5839
|
+
/* @__PURE__ */ jsxs11(Div_default.row, { position: "relative", alignItems: "center", gap: 2, children: [
|
|
5840
|
+
/* @__PURE__ */ jsx16(Text_default, { fontWeight: 700, children: currentYear }),
|
|
5841
|
+
/* @__PURE__ */ jsx16(Icon_default, { name: "chevronDown", size: 12 }),
|
|
5842
|
+
/* @__PURE__ */ jsx16(SelectComponent, { theme: theme2, value: currentYear, onChange: onChangeYearSelect, children: yearsRange.map((year) => /* @__PURE__ */ jsx16("option", { value: year, children: year }, year)) })
|
|
5843
|
+
] })
|
|
5827
5844
|
] }),
|
|
5828
5845
|
/* @__PURE__ */ jsx16(Button_default.icon, { icon: "chevronRight", onClick: onClickNextMonthButton })
|
|
5829
5846
|
] }),
|
|
@@ -5910,7 +5927,7 @@ var buttonWidth = 50;
|
|
|
5910
5927
|
var colorPickerSpacing = 4;
|
|
5911
5928
|
var colorPickerColorWidth = 12 + 27 + colorPickerSpacing;
|
|
5912
5929
|
var colorPickerValueWidth = 12 + 74 + colorPickerSpacing;
|
|
5913
|
-
var InputElement =
|
|
5930
|
+
var InputElement = styled10.input.withConfig({
|
|
5914
5931
|
shouldForwardProp: (prop) => !["theme", "withLeftIcon", "withRightIcon", "normalStyle", "hoverStyle"].includes(prop)
|
|
5915
5932
|
})`
|
|
5916
5933
|
position: relative;
|
|
@@ -5954,6 +5971,7 @@ var InputElement = styled9.input.withConfig({
|
|
|
5954
5971
|
&[type="date"],
|
|
5955
5972
|
&[type="datetime-local"],
|
|
5956
5973
|
&[type="time"] {
|
|
5974
|
+
min-height: 48px;
|
|
5957
5975
|
-webkit-appearance: none;
|
|
5958
5976
|
-moz-appearance: textfield;
|
|
5959
5977
|
|
|
@@ -6017,7 +6035,7 @@ var InputElement = styled9.input.withConfig({
|
|
|
6017
6035
|
${(props) => props.hoverStyle}
|
|
6018
6036
|
}
|
|
6019
6037
|
`;
|
|
6020
|
-
var TextareaElement =
|
|
6038
|
+
var TextareaElement = styled10.textarea.withConfig({
|
|
6021
6039
|
shouldForwardProp: (prop) => !["theme", "withLeftIcon", "withRightIcon", "normalStyle", "hoverStyle"].includes(prop)
|
|
6022
6040
|
})`
|
|
6023
6041
|
width: 100%;
|
|
@@ -6783,12 +6801,12 @@ var InputField_default = InputField2;
|
|
|
6783
6801
|
|
|
6784
6802
|
// src/components/ToggleInput.tsx
|
|
6785
6803
|
import { forwardRef as forwardRef12, useCallback as useCallback10, useId as useId2, useState as useState8 } from "react";
|
|
6786
|
-
import
|
|
6804
|
+
import styled11 from "styled-components";
|
|
6787
6805
|
import { jsx as jsx18, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
6788
6806
|
var componentSize = 26;
|
|
6789
6807
|
var switchComponentBallGap = 3;
|
|
6790
6808
|
var switchComponentMouseDownDifference = 4;
|
|
6791
|
-
var InputElement2 =
|
|
6809
|
+
var InputElement2 = styled11.input.withConfig({
|
|
6792
6810
|
shouldForwardProp: (prop) => !["theme", "normalStyle", "hoverStyle"].includes(prop)
|
|
6793
6811
|
})`
|
|
6794
6812
|
position: relative;
|
|
@@ -6824,7 +6842,7 @@ var InputElement2 = styled10.input.withConfig({
|
|
|
6824
6842
|
${(props) => props.hoverStyle}
|
|
6825
6843
|
}
|
|
6826
6844
|
`;
|
|
6827
|
-
var SwitchElement =
|
|
6845
|
+
var SwitchElement = styled11.div.withConfig({
|
|
6828
6846
|
shouldForwardProp: (prop) => !["theme", "checked", "disabled", "isMouseDown", "normalStyle", "hoverStyle"].includes(prop)
|
|
6829
6847
|
})`
|
|
6830
6848
|
--width: ${(props) => componentSize * 2 - props.theme.styles.gap / 2}px;
|
|
@@ -7026,7 +7044,9 @@ var ToggleInput_default = {
|
|
|
7026
7044
|
{
|
|
7027
7045
|
alignItems: "center",
|
|
7028
7046
|
gap: theme2.styles.gap,
|
|
7047
|
+
borderRadius: 999,
|
|
7029
7048
|
isTabAccessed: true,
|
|
7049
|
+
onClick: onClickElement,
|
|
7030
7050
|
onMouseDown: setIsMouseDown.setTrue,
|
|
7031
7051
|
onMouseUp: setIsMouseDown.setFalse,
|
|
7032
7052
|
onMouseOut: setIsMouseDown.setFalse,
|
|
@@ -7040,7 +7060,6 @@ var ToggleInput_default = {
|
|
|
7040
7060
|
checked,
|
|
7041
7061
|
disabled: disabled ?? false,
|
|
7042
7062
|
isMouseDown,
|
|
7043
|
-
onClick: onClickElement,
|
|
7044
7063
|
id: readyId,
|
|
7045
7064
|
role: "switch",
|
|
7046
7065
|
"aria-checked": checked,
|
|
@@ -7324,11 +7343,11 @@ import {
|
|
|
7324
7343
|
useEffect as useEffect10,
|
|
7325
7344
|
Fragment as Fragment5
|
|
7326
7345
|
} from "react";
|
|
7327
|
-
import
|
|
7346
|
+
import styled12, { css as css2 } from "styled-components";
|
|
7328
7347
|
import { Fragment as Fragment6, jsx as jsx22, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
7329
7348
|
var defaultImageWidth = 160;
|
|
7330
7349
|
var maximumVisiblePages = 11;
|
|
7331
|
-
var TableStyledComponent =
|
|
7350
|
+
var TableStyledComponent = styled12.table.withConfig({
|
|
7332
7351
|
shouldForwardProp: (prop) => ![
|
|
7333
7352
|
"isStriped",
|
|
7334
7353
|
"withHover",
|
|
@@ -7443,7 +7462,7 @@ var TableStyledComponent = styled11.table.withConfig({
|
|
|
7443
7462
|
}
|
|
7444
7463
|
}
|
|
7445
7464
|
`;
|
|
7446
|
-
var ThStyledComponent =
|
|
7465
|
+
var ThStyledComponent = styled12.th.withConfig({
|
|
7447
7466
|
shouldForwardProp: (prop) => !["width", "minWidth", "maxWidth", "textAlign"].includes(prop)
|
|
7448
7467
|
})`
|
|
7449
7468
|
${(props) => props.width ? `width: ${props.width}px;` : ""}
|
|
@@ -7451,7 +7470,7 @@ var ThStyledComponent = styled11.th.withConfig({
|
|
|
7451
7470
|
${(props) => props.maxWidth ? `max-width: ${props.maxWidth}px;` : ""}
|
|
7452
7471
|
${(props) => props.textAlign ? `text-align: ${props.textAlign} !important;` : ""}
|
|
7453
7472
|
`;
|
|
7454
|
-
var TdStyledComponent =
|
|
7473
|
+
var TdStyledComponent = styled12.td.withConfig({
|
|
7455
7474
|
shouldForwardProp: (prop) => !["width", "textAlign"].includes(prop)
|
|
7456
7475
|
})`
|
|
7457
7476
|
${(props) => props.textAlign ? `text-align: ${props.textAlign} !important;` : ""}
|
|
@@ -8161,7 +8180,7 @@ var Table_default = Table2;
|
|
|
8161
8180
|
|
|
8162
8181
|
// src/components/Tooltip.tsx
|
|
8163
8182
|
import { memo as memo23, useCallback as useCallback12, useRef as useRef7, useState as useState10, useEffect as useEffect11, forwardRef as forwardRef16, useImperativeHandle as useImperativeHandle3, useMemo as useMemo9 } from "react";
|
|
8164
|
-
import
|
|
8183
|
+
import styled13, { css as css3 } from "styled-components";
|
|
8165
8184
|
import { jsx as jsx23, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
8166
8185
|
var tooltipContainerStyle = (props) => ({
|
|
8167
8186
|
top: css3`
|
|
@@ -8215,7 +8234,7 @@ var tooltipPositionStyle = (props) => ({
|
|
|
8215
8234
|
`
|
|
8216
8235
|
}
|
|
8217
8236
|
});
|
|
8218
|
-
var TooltipContainer =
|
|
8237
|
+
var TooltipContainer = styled13.div.withConfig({
|
|
8219
8238
|
shouldForwardProp: (prop) => !["theme", "position", "align", "withArrow", "arrowSize", "isOpen", "gap"].includes(prop)
|
|
8220
8239
|
})`
|
|
8221
8240
|
position: absolute;
|