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.js
CHANGED
|
@@ -3909,7 +3909,7 @@ var Chip_default = Chip2;
|
|
|
3909
3909
|
|
|
3910
3910
|
// src/components/InputField.tsx
|
|
3911
3911
|
var import_react20 = require("react");
|
|
3912
|
-
var
|
|
3912
|
+
var import_styled_components11 = __toESM(require("styled-components"));
|
|
3913
3913
|
|
|
3914
3914
|
// src/constants/countries.ts
|
|
3915
3915
|
var countries = [
|
|
@@ -5813,6 +5813,7 @@ var Dropdown_default = Dropdown2;
|
|
|
5813
5813
|
|
|
5814
5814
|
// src/components/Calendar.tsx
|
|
5815
5815
|
var import_react19 = require("react");
|
|
5816
|
+
var import_styled_components10 = __toESM(require("styled-components"));
|
|
5816
5817
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
5817
5818
|
var getMonthName = (month, short = false) => {
|
|
5818
5819
|
return [
|
|
@@ -5842,6 +5843,16 @@ var getWeekDayName = (day, short = false) => {
|
|
|
5842
5843
|
][day];
|
|
5843
5844
|
};
|
|
5844
5845
|
var weekDaysIndex = [1, 2, 3, 4, 5, 6, 0];
|
|
5846
|
+
var yearsRange = Array.from({ length: 100 + 1 + 50 }, (_, index) => index + (/* @__PURE__ */ new Date()).getFullYear() - 100);
|
|
5847
|
+
var SelectComponent = import_styled_components10.default.select.withConfig({
|
|
5848
|
+
shouldForwardProp: (prop) => !["normalStyle", "hoverStyle"].includes(prop)
|
|
5849
|
+
})`
|
|
5850
|
+
position: absolute;
|
|
5851
|
+
top: 50%;
|
|
5852
|
+
right: 0;
|
|
5853
|
+
transform: translateY(-50%);
|
|
5854
|
+
opacity: 0;
|
|
5855
|
+
`;
|
|
5845
5856
|
function Calendar({ value, minDate, maxDate, onChange }) {
|
|
5846
5857
|
const theme2 = useTheme();
|
|
5847
5858
|
const [currentDate, setCurrentDate] = (0, import_react19.useState)(value ? new Date(value) : void 0);
|
|
@@ -5882,6 +5893,9 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
5882
5893
|
`${today.getFullYear()}-${(today.getMonth() + 1).toString().padStart(2, "0")}-${today.getDate().toString().padStart(2, "0")}`
|
|
5883
5894
|
);
|
|
5884
5895
|
}, [onChange]);
|
|
5896
|
+
const onChangeYearSelect = (0, import_react19.useCallback)((event) => {
|
|
5897
|
+
setCurrentYear(parseInt(event.target.value));
|
|
5898
|
+
}, []);
|
|
5885
5899
|
const firstDayOfMonth = (0, import_react19.useMemo)(() => {
|
|
5886
5900
|
const day = new Date(currentYear, currentMonth, 1).getDay();
|
|
5887
5901
|
return day === 0 ? 6 : day - 1;
|
|
@@ -5906,10 +5920,13 @@ function Calendar({ value, minDate, maxDate, onChange }) {
|
|
|
5906
5920
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Div_default.column, { width: "100%", maxWidth: 320, gap: theme2.styles.gap, padding: theme2.styles.space / 2, userSelect: "none", children: [
|
|
5907
5921
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Div_default.row, { width: "100%", justifyContent: "space-between", alignItems: "center", children: [
|
|
5908
5922
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button_default.icon, { icon: "chevronLeft", onClick: onClickPreviousMonthButton }),
|
|
5909
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
5910
|
-
getMonthName(currentMonth),
|
|
5911
|
-
" ",
|
|
5912
|
-
|
|
5923
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Div_default.row, { alignItems: "center", gap: 4, children: [
|
|
5924
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text_default, { fontWeight: 700, children: getMonthName(currentMonth) }),
|
|
5925
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Div_default.row, { position: "relative", alignItems: "center", gap: 2, children: [
|
|
5926
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Text_default, { fontWeight: 700, children: currentYear }),
|
|
5927
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { name: "chevronDown", size: 12 }),
|
|
5928
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SelectComponent, { theme: theme2, value: currentYear, onChange: onChangeYearSelect, children: yearsRange.map((year) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("option", { value: year, children: year }, year)) })
|
|
5929
|
+
] })
|
|
5913
5930
|
] }),
|
|
5914
5931
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button_default.icon, { icon: "chevronRight", onClick: onClickNextMonthButton })
|
|
5915
5932
|
] }),
|
|
@@ -5996,7 +6013,7 @@ var buttonWidth = 50;
|
|
|
5996
6013
|
var colorPickerSpacing = 4;
|
|
5997
6014
|
var colorPickerColorWidth = 12 + 27 + colorPickerSpacing;
|
|
5998
6015
|
var colorPickerValueWidth = 12 + 74 + colorPickerSpacing;
|
|
5999
|
-
var InputElement =
|
|
6016
|
+
var InputElement = import_styled_components11.default.input.withConfig({
|
|
6000
6017
|
shouldForwardProp: (prop) => !["theme", "withLeftIcon", "withRightIcon", "normalStyle", "hoverStyle"].includes(prop)
|
|
6001
6018
|
})`
|
|
6002
6019
|
position: relative;
|
|
@@ -6040,6 +6057,7 @@ var InputElement = import_styled_components10.default.input.withConfig({
|
|
|
6040
6057
|
&[type="date"],
|
|
6041
6058
|
&[type="datetime-local"],
|
|
6042
6059
|
&[type="time"] {
|
|
6060
|
+
min-height: 48px;
|
|
6043
6061
|
-webkit-appearance: none;
|
|
6044
6062
|
-moz-appearance: textfield;
|
|
6045
6063
|
|
|
@@ -6103,7 +6121,7 @@ var InputElement = import_styled_components10.default.input.withConfig({
|
|
|
6103
6121
|
${(props) => props.hoverStyle}
|
|
6104
6122
|
}
|
|
6105
6123
|
`;
|
|
6106
|
-
var TextareaElement =
|
|
6124
|
+
var TextareaElement = import_styled_components11.default.textarea.withConfig({
|
|
6107
6125
|
shouldForwardProp: (prop) => !["theme", "withLeftIcon", "withRightIcon", "normalStyle", "hoverStyle"].includes(prop)
|
|
6108
6126
|
})`
|
|
6109
6127
|
width: 100%;
|
|
@@ -6869,12 +6887,12 @@ var InputField_default = InputField2;
|
|
|
6869
6887
|
|
|
6870
6888
|
// src/components/ToggleInput.tsx
|
|
6871
6889
|
var import_react21 = require("react");
|
|
6872
|
-
var
|
|
6890
|
+
var import_styled_components12 = __toESM(require("styled-components"));
|
|
6873
6891
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
6874
6892
|
var componentSize = 26;
|
|
6875
6893
|
var switchComponentBallGap = 3;
|
|
6876
6894
|
var switchComponentMouseDownDifference = 4;
|
|
6877
|
-
var InputElement2 =
|
|
6895
|
+
var InputElement2 = import_styled_components12.default.input.withConfig({
|
|
6878
6896
|
shouldForwardProp: (prop) => !["theme", "normalStyle", "hoverStyle"].includes(prop)
|
|
6879
6897
|
})`
|
|
6880
6898
|
position: relative;
|
|
@@ -6910,7 +6928,7 @@ var InputElement2 = import_styled_components11.default.input.withConfig({
|
|
|
6910
6928
|
${(props) => props.hoverStyle}
|
|
6911
6929
|
}
|
|
6912
6930
|
`;
|
|
6913
|
-
var SwitchElement =
|
|
6931
|
+
var SwitchElement = import_styled_components12.default.div.withConfig({
|
|
6914
6932
|
shouldForwardProp: (prop) => !["theme", "checked", "disabled", "isMouseDown", "normalStyle", "hoverStyle"].includes(prop)
|
|
6915
6933
|
})`
|
|
6916
6934
|
--width: ${(props) => componentSize * 2 - props.theme.styles.gap / 2}px;
|
|
@@ -7112,7 +7130,9 @@ var ToggleInput_default = {
|
|
|
7112
7130
|
{
|
|
7113
7131
|
alignItems: "center",
|
|
7114
7132
|
gap: theme2.styles.gap,
|
|
7133
|
+
borderRadius: 999,
|
|
7115
7134
|
isTabAccessed: true,
|
|
7135
|
+
onClick: onClickElement,
|
|
7116
7136
|
onMouseDown: setIsMouseDown.setTrue,
|
|
7117
7137
|
onMouseUp: setIsMouseDown.setFalse,
|
|
7118
7138
|
onMouseOut: setIsMouseDown.setFalse,
|
|
@@ -7126,7 +7146,6 @@ var ToggleInput_default = {
|
|
|
7126
7146
|
checked,
|
|
7127
7147
|
disabled: disabled ?? false,
|
|
7128
7148
|
isMouseDown,
|
|
7129
|
-
onClick: onClickElement,
|
|
7130
7149
|
id: readyId,
|
|
7131
7150
|
role: "switch",
|
|
7132
7151
|
"aria-checked": checked,
|
|
@@ -7400,11 +7419,11 @@ var ColorThemeSwitch_default = ColorThemeSwitch2;
|
|
|
7400
7419
|
|
|
7401
7420
|
// src/components/Table.tsx
|
|
7402
7421
|
var import_react25 = require("react");
|
|
7403
|
-
var
|
|
7422
|
+
var import_styled_components13 = __toESM(require("styled-components"));
|
|
7404
7423
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
7405
7424
|
var defaultImageWidth = 160;
|
|
7406
7425
|
var maximumVisiblePages = 11;
|
|
7407
|
-
var TableStyledComponent =
|
|
7426
|
+
var TableStyledComponent = import_styled_components13.default.table.withConfig({
|
|
7408
7427
|
shouldForwardProp: (prop) => ![
|
|
7409
7428
|
"isStriped",
|
|
7410
7429
|
"withHover",
|
|
@@ -7484,13 +7503,13 @@ var TableStyledComponent = import_styled_components12.default.table.withConfig({
|
|
|
7484
7503
|
}
|
|
7485
7504
|
}
|
|
7486
7505
|
|
|
7487
|
-
${(props) => props.isStriped ?
|
|
7506
|
+
${(props) => props.isStriped ? import_styled_components13.css`
|
|
7488
7507
|
&:nth-child(even) {
|
|
7489
7508
|
background-color: ${props.theme.colors.backgroundSecondary};
|
|
7490
7509
|
}
|
|
7491
7510
|
` : ""}
|
|
7492
7511
|
|
|
7493
|
-
${(props) => props.withHover ?
|
|
7512
|
+
${(props) => props.withHover ? import_styled_components13.css`
|
|
7494
7513
|
transition: ${props.theme.styles.transition};
|
|
7495
7514
|
|
|
7496
7515
|
&:not(.isHeader):not(.isFooter):not(.withoutHover):hover {
|
|
@@ -7519,7 +7538,7 @@ var TableStyledComponent = import_styled_components12.default.table.withConfig({
|
|
|
7519
7538
|
}
|
|
7520
7539
|
}
|
|
7521
7540
|
`;
|
|
7522
|
-
var ThStyledComponent =
|
|
7541
|
+
var ThStyledComponent = import_styled_components13.default.th.withConfig({
|
|
7523
7542
|
shouldForwardProp: (prop) => !["width", "minWidth", "maxWidth", "textAlign"].includes(prop)
|
|
7524
7543
|
})`
|
|
7525
7544
|
${(props) => props.width ? `width: ${props.width}px;` : ""}
|
|
@@ -7527,7 +7546,7 @@ var ThStyledComponent = import_styled_components12.default.th.withConfig({
|
|
|
7527
7546
|
${(props) => props.maxWidth ? `max-width: ${props.maxWidth}px;` : ""}
|
|
7528
7547
|
${(props) => props.textAlign ? `text-align: ${props.textAlign} !important;` : ""}
|
|
7529
7548
|
`;
|
|
7530
|
-
var TdStyledComponent =
|
|
7549
|
+
var TdStyledComponent = import_styled_components13.default.td.withConfig({
|
|
7531
7550
|
shouldForwardProp: (prop) => !["width", "textAlign"].includes(prop)
|
|
7532
7551
|
})`
|
|
7533
7552
|
${(props) => props.textAlign ? `text-align: ${props.textAlign} !important;` : ""}
|
|
@@ -8237,61 +8256,61 @@ var Table_default = Table2;
|
|
|
8237
8256
|
|
|
8238
8257
|
// src/components/Tooltip.tsx
|
|
8239
8258
|
var import_react26 = require("react");
|
|
8240
|
-
var
|
|
8259
|
+
var import_styled_components14 = __toESM(require("styled-components"));
|
|
8241
8260
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
8242
8261
|
var tooltipContainerStyle = (props) => ({
|
|
8243
|
-
top:
|
|
8262
|
+
top: import_styled_components14.css`
|
|
8244
8263
|
bottom: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
8245
8264
|
${props.align === "center" ? "left: 50%;" : props.align === "left" ? "left: 0;" : "right: 0;"}
|
|
8246
8265
|
`,
|
|
8247
|
-
bottom:
|
|
8266
|
+
bottom: import_styled_components14.css`
|
|
8248
8267
|
top: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
8249
8268
|
${props.align === "center" ? "left: 50%;" : props.align === "left" ? "left: 0;" : "right: 0;"};
|
|
8250
8269
|
`,
|
|
8251
|
-
left:
|
|
8270
|
+
left: import_styled_components14.css`
|
|
8252
8271
|
${props.align === "center" ? "top: 50%;" : props.align === "top" ? "top: 0;" : "bottom: 0;"};
|
|
8253
8272
|
right: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
8254
8273
|
`,
|
|
8255
|
-
right:
|
|
8274
|
+
right: import_styled_components14.css`
|
|
8256
8275
|
${props.align === "center" ? "top: 50%;" : props.align === "top" ? "top: 0;" : "bottom: 0;"};
|
|
8257
8276
|
left: calc(100% + ${props.gap}px + ${props.arrowSize}px);
|
|
8258
8277
|
`
|
|
8259
8278
|
});
|
|
8260
8279
|
var tooltipPositionStyle = (props) => ({
|
|
8261
8280
|
top: {
|
|
8262
|
-
opened:
|
|
8281
|
+
opened: import_styled_components14.css`
|
|
8263
8282
|
transform: translateX(${props.align === "center" ? "-50%" : "0"});
|
|
8264
8283
|
`,
|
|
8265
|
-
closed:
|
|
8284
|
+
closed: import_styled_components14.css`
|
|
8266
8285
|
transform: translateX(${props.align === "center" ? "-50%" : "0"}) translateY(${props.theme.styles.gap}px);
|
|
8267
8286
|
`
|
|
8268
8287
|
},
|
|
8269
8288
|
bottom: {
|
|
8270
|
-
opened:
|
|
8289
|
+
opened: import_styled_components14.css`
|
|
8271
8290
|
transform: translateX(${props.align === "center" ? "-50%" : "0"});
|
|
8272
8291
|
`,
|
|
8273
|
-
closed:
|
|
8292
|
+
closed: import_styled_components14.css`
|
|
8274
8293
|
transform: translateX(${props.align === "center" ? "-50%" : "0"}) translateY(-${props.theme.styles.gap}px);
|
|
8275
8294
|
`
|
|
8276
8295
|
},
|
|
8277
8296
|
left: {
|
|
8278
|
-
opened:
|
|
8297
|
+
opened: import_styled_components14.css`
|
|
8279
8298
|
transform: translateY(${props.align === "center" ? "-50%" : "0"});
|
|
8280
8299
|
`,
|
|
8281
|
-
closed:
|
|
8300
|
+
closed: import_styled_components14.css`
|
|
8282
8301
|
transform: translateX(${props.theme.styles.gap}px) translateY(${props.align === "center" ? "-50%" : "0"});
|
|
8283
8302
|
`
|
|
8284
8303
|
},
|
|
8285
8304
|
right: {
|
|
8286
|
-
opened:
|
|
8305
|
+
opened: import_styled_components14.css`
|
|
8287
8306
|
transform: translateY(${props.align === "center" ? "-50%" : "0"});
|
|
8288
8307
|
`,
|
|
8289
|
-
closed:
|
|
8308
|
+
closed: import_styled_components14.css`
|
|
8290
8309
|
transform: translateX(-${props.theme.styles.gap}px) translateY(${props.align === "center" ? "-50%" : "0"});
|
|
8291
8310
|
`
|
|
8292
8311
|
}
|
|
8293
8312
|
});
|
|
8294
|
-
var TooltipContainer =
|
|
8313
|
+
var TooltipContainer = import_styled_components14.default.div.withConfig({
|
|
8295
8314
|
shouldForwardProp: (prop) => !["theme", "position", "align", "withArrow", "arrowSize", "isOpen", "gap"].includes(prop)
|
|
8296
8315
|
})`
|
|
8297
8316
|
position: absolute;
|