@tipp/ui 1.6.26 → 1.6.27
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/app/index.cjs +425 -429
- package/dist/app/index.cjs.map +1 -1
- package/dist/app/index.js +50 -50
- package/dist/app/platform/coach-question-list.cjs +82 -86
- package/dist/app/platform/coach-question-list.cjs.map +1 -1
- package/dist/app/platform/coach-question-list.js +33 -33
- package/dist/app/platform/contents-card.cjs +66 -70
- package/dist/app/platform/contents-card.cjs.map +1 -1
- package/dist/app/platform/contents-card.js +33 -33
- package/dist/app/platform/curriculum-card.js +5 -5
- package/dist/app/platform/edit-coaching-time.cjs +154 -158
- package/dist/app/platform/edit-coaching-time.cjs.map +1 -1
- package/dist/app/platform/edit-coaching-time.js +37 -37
- package/dist/app/platform/edit-service-type.cjs +141 -145
- package/dist/app/platform/edit-service-type.cjs.map +1 -1
- package/dist/app/platform/edit-service-type.js +37 -37
- package/dist/app/platform/goal-manage-card-edit.cjs +150 -154
- package/dist/app/platform/goal-manage-card-edit.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-edit.js +37 -37
- package/dist/app/platform/goal-manage-card-read.cjs +124 -128
- package/dist/app/platform/goal-manage-card-read.cjs.map +1 -1
- package/dist/app/platform/goal-manage-card-read.js +33 -33
- package/dist/app/platform/on-offline-radio-card.cjs +130 -134
- package/dist/app/platform/on-offline-radio-card.cjs.map +1 -1
- package/dist/app/platform/on-offline-radio-card.js +36 -36
- package/dist/app/platform/report-card.cjs +85 -89
- package/dist/app/platform/report-card.cjs.map +1 -1
- package/dist/app/platform/report-card.js +33 -33
- package/dist/app/platform/reservation-card.cjs +187 -191
- package/dist/app/platform/reservation-card.cjs.map +1 -1
- package/dist/app/platform/reservation-card.js +37 -37
- package/dist/app/platform/session-card.cjs +209 -213
- package/dist/app/platform/session-card.cjs.map +1 -1
- package/dist/app/platform/session-card.js +39 -39
- package/dist/app/platform/session-review-simple-read.cjs +85 -89
- package/dist/app/platform/session-review-simple-read.cjs.map +1 -1
- package/dist/app/platform/session-review-simple-read.js +33 -33
- package/dist/app/platform/userInfos/coaching-customer-info/index.cjs +116 -120
- package/dist/app/platform/userInfos/coaching-customer-info/index.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/index.js +35 -35
- package/dist/app/platform/userInfos/coaching-customer-info/large.cjs +93 -97
- package/dist/app/platform/userInfos/coaching-customer-info/large.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/large.js +33 -33
- package/dist/app/platform/userInfos/coaching-customer-info/medium.cjs +96 -100
- package/dist/app/platform/userInfos/coaching-customer-info/medium.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/medium.js +33 -33
- package/dist/app/platform/userInfos/coaching-customer-info/small.cjs +82 -86
- package/dist/app/platform/userInfos/coaching-customer-info/small.cjs.map +1 -1
- package/dist/app/platform/userInfos/coaching-customer-info/small.js +32 -32
- package/dist/app/platform/userInfos/session-user-info-detail.cjs +92 -96
- package/dist/app/platform/userInfos/session-user-info-detail.cjs.map +1 -1
- package/dist/app/platform/userInfos/session-user-info-detail.js +32 -32
- package/dist/app/platform/userInfos/utils.cjs +84 -88
- package/dist/app/platform/userInfos/utils.cjs.map +1 -1
- package/dist/app/platform/userInfos/utils.js +32 -32
- package/dist/atoms/dialog.cjs +1 -1
- package/dist/atoms/dialog.cjs.map +1 -1
- package/dist/atoms/dialog.js +1 -1
- package/dist/atoms/ellipsis-tooltip.cjs +42 -101
- package/dist/atoms/ellipsis-tooltip.cjs.map +1 -1
- package/dist/atoms/ellipsis-tooltip.js +3 -4
- package/dist/atoms/index.cjs +145 -169
- package/dist/atoms/index.cjs.map +1 -1
- package/dist/atoms/index.d.cts +1 -5
- package/dist/atoms/index.d.ts +1 -5
- package/dist/atoms/index.js +69 -75
- package/dist/atoms/pagination.js +3 -3
- package/dist/atoms/scroll-area.cjs +1 -2
- package/dist/atoms/scroll-area.cjs.map +1 -1
- package/dist/atoms/scroll-area.d.cts +1 -10
- package/dist/atoms/scroll-area.d.ts +1 -10
- package/dist/atoms/scroll-area.js +1 -1
- package/dist/atoms/tooltip.cjs +3 -67
- package/dist/atoms/tooltip.cjs.map +1 -1
- package/dist/atoms/tooltip.d.cts +1 -9
- package/dist/atoms/tooltip.d.ts +1 -9
- package/dist/atoms/tooltip.js +3 -9
- package/dist/charts/index.js +3 -3
- package/dist/chunk-4ZLXDFP3.js +145 -0
- package/dist/chunk-4ZLXDFP3.js.map +1 -0
- package/dist/chunk-7QGUMO7V.js +54 -0
- package/dist/chunk-7QGUMO7V.js.map +1 -0
- package/dist/chunk-L75KKLZS.js +106 -0
- package/dist/chunk-L75KKLZS.js.map +1 -0
- package/dist/chunk-UAUXUQWQ.js +174 -0
- package/dist/chunk-UAUXUQWQ.js.map +1 -0
- package/dist/chunk-WKQZJK7O.js +357 -0
- package/dist/chunk-WKQZJK7O.js.map +1 -0
- package/dist/icon.js +9 -9
- package/dist/icons/index.js +9 -9
- package/dist/index.cjs +642 -666
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.js +101 -107
- package/dist/molecules/date-picker/date-picker-button.cjs +96 -100
- package/dist/molecules/date-picker/date-picker-button.cjs.map +1 -1
- package/dist/molecules/date-picker/date-picker-button.js +32 -32
- package/dist/molecules/date-picker/index.js +3 -3
- package/dist/molecules/expand-table/index.cjs +134 -138
- package/dist/molecules/expand-table/index.cjs.map +1 -1
- package/dist/molecules/expand-table/index.js +33 -33
- package/dist/molecules/expand-table/row.cjs +91 -95
- package/dist/molecules/expand-table/row.cjs.map +1 -1
- package/dist/molecules/expand-table/row.js +32 -32
- package/dist/molecules/index.cjs +314 -319
- package/dist/molecules/index.cjs.map +1 -1
- package/dist/molecules/index.js +36 -36
- package/dist/molecules/learning-post.js +2 -2
- package/dist/molecules/navigation.cjs +82 -86
- package/dist/molecules/navigation.cjs.map +1 -1
- package/dist/molecules/navigation.js +32 -32
- package/dist/molecules/radio-button-card.cjs +86 -90
- package/dist/molecules/radio-button-card.cjs.map +1 -1
- package/dist/molecules/radio-button-card.js +32 -32
- package/dist/molecules/stepper.js +5 -5
- package/dist/molecules/tag-selector.cjs +97 -102
- package/dist/molecules/tag-selector.cjs.map +1 -1
- package/dist/molecules/tag-selector.js +33 -33
- package/dist/molecules/time-select.cjs +84 -88
- package/dist/molecules/time-select.cjs.map +1 -1
- package/dist/molecules/time-select.js +32 -32
- package/package.json +1 -1
- package/src/atoms/dialog.tsx +1 -1
- package/src/atoms/ellipsis-tooltip.tsx +20 -39
- package/src/atoms/scroll-area.tsx +1 -8
- package/src/atoms/tooltip.tsx +1 -72
|
@@ -62,7 +62,7 @@ __export(tag_selector_exports, {
|
|
|
62
62
|
TagSelector: () => TagSelector
|
|
63
63
|
});
|
|
64
64
|
module.exports = __toCommonJS(tag_selector_exports);
|
|
65
|
-
var
|
|
65
|
+
var import_react20 = require("react");
|
|
66
66
|
var import_react_icons4 = require("@radix-ui/react-icons");
|
|
67
67
|
|
|
68
68
|
// src/atoms/popover.tsx
|
|
@@ -420,7 +420,6 @@ EndCallIcon.displayName = "EndCallIcon";
|
|
|
420
420
|
|
|
421
421
|
// src/atoms/scroll-area.tsx
|
|
422
422
|
var import_themes5 = require("@radix-ui/themes");
|
|
423
|
-
var ScrollArea = import_themes5.ScrollArea;
|
|
424
423
|
|
|
425
424
|
// src/atoms/grid.tsx
|
|
426
425
|
var import_themes6 = require("@radix-ui/themes");
|
|
@@ -854,41 +853,37 @@ Root4.displayName = "TextField.Root";
|
|
|
854
853
|
var TextField = { Root: Root4, Slot: import_themes47.TextField.Slot };
|
|
855
854
|
|
|
856
855
|
// src/atoms/tooltip.tsx
|
|
857
|
-
var
|
|
858
|
-
var import_react_tooltip = require("@radix-ui/react-tooltip");
|
|
859
|
-
var import_react_popover = require("@radix-ui/react-popover");
|
|
860
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
861
|
-
var TouchContext = (0, import_react15.createContext)(void 0);
|
|
856
|
+
var import_themes48 = require("@radix-ui/themes");
|
|
862
857
|
|
|
863
858
|
// src/atoms/collapse.tsx
|
|
864
|
-
var
|
|
865
|
-
var
|
|
859
|
+
var import_react15 = require("react");
|
|
860
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
866
861
|
|
|
867
862
|
// src/atoms/spinner.tsx
|
|
868
|
-
var
|
|
863
|
+
var import_themes49 = require("@radix-ui/themes");
|
|
869
864
|
|
|
870
865
|
// src/atoms/pagination.tsx
|
|
871
|
-
var
|
|
872
|
-
var
|
|
866
|
+
var import_react16 = require("react");
|
|
867
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
873
868
|
|
|
874
869
|
// src/atoms/field-error-wrapper.tsx
|
|
875
|
-
var
|
|
870
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
876
871
|
|
|
877
872
|
// src/atoms/ellipsis-tooltip.tsx
|
|
878
|
-
var
|
|
879
|
-
var
|
|
873
|
+
var import_react17 = require("react");
|
|
874
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
880
875
|
|
|
881
876
|
// src/atoms/drawer.tsx
|
|
882
877
|
var Dialog = __toESM(require("@radix-ui/react-dialog"), 1);
|
|
883
|
-
var
|
|
878
|
+
var import_themes50 = require("@radix-ui/themes");
|
|
884
879
|
|
|
885
880
|
// src/icons/close-panel-arrow.tsx
|
|
886
881
|
var React15 = __toESM(require("react"), 1);
|
|
887
|
-
var
|
|
882
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
888
883
|
var ClosePanelArrowIcon = React15.forwardRef(
|
|
889
884
|
(_a, forwardedRef) => {
|
|
890
885
|
var _b = _a, { color = "currentColor" } = _b, props = __objRest(_b, ["color"]);
|
|
891
|
-
return /* @__PURE__ */ (0,
|
|
886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
892
887
|
"svg",
|
|
893
888
|
__spreadProps(__spreadValues({
|
|
894
889
|
fill: "none",
|
|
@@ -899,7 +894,7 @@ var ClosePanelArrowIcon = React15.forwardRef(
|
|
|
899
894
|
}, props), {
|
|
900
895
|
ref: forwardedRef,
|
|
901
896
|
children: [
|
|
902
|
-
/* @__PURE__ */ (0,
|
|
897
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
903
898
|
"path",
|
|
904
899
|
{
|
|
905
900
|
clipRule: "evenodd",
|
|
@@ -908,7 +903,7 @@ var ClosePanelArrowIcon = React15.forwardRef(
|
|
|
908
903
|
fillRule: "evenodd"
|
|
909
904
|
}
|
|
910
905
|
),
|
|
911
|
-
/* @__PURE__ */ (0,
|
|
906
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
912
907
|
"path",
|
|
913
908
|
{
|
|
914
909
|
clipRule: "evenodd",
|
|
@@ -925,22 +920,22 @@ var ClosePanelArrowIcon = React15.forwardRef(
|
|
|
925
920
|
ClosePanelArrowIcon.displayName = "ArrowDownIcon";
|
|
926
921
|
|
|
927
922
|
// src/atoms/drawer.tsx
|
|
928
|
-
var
|
|
923
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
929
924
|
|
|
930
925
|
// src/atoms/toast.tsx
|
|
931
926
|
var import_react_icons3 = require("@radix-ui/react-icons");
|
|
932
927
|
var import_react_toastify = require("react-toastify");
|
|
933
928
|
var import_react_toastify2 = require("react-toastify");
|
|
934
|
-
var
|
|
929
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
935
930
|
|
|
936
931
|
// src/molecules/form/form.tsx
|
|
937
932
|
var RadixForm = __toESM(require("@radix-ui/react-form"), 1);
|
|
938
|
-
var
|
|
939
|
-
var
|
|
940
|
-
var Root7 = (0,
|
|
933
|
+
var import_react18 = require("react");
|
|
934
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
935
|
+
var Root7 = (0, import_react18.forwardRef)(
|
|
941
936
|
(_a, ref) => {
|
|
942
937
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
943
|
-
return /* @__PURE__ */ (0,
|
|
938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
944
939
|
RadixForm.Root,
|
|
945
940
|
__spreadProps(__spreadValues({}, rest), {
|
|
946
941
|
className: `FormRoot ${className || ""}`,
|
|
@@ -951,33 +946,33 @@ var Root7 = (0, import_react19.forwardRef)(
|
|
|
951
946
|
}
|
|
952
947
|
);
|
|
953
948
|
Root7.displayName = "FORM_ROOT";
|
|
954
|
-
var FieldContext = (0,
|
|
949
|
+
var FieldContext = (0, import_react18.createContext)({
|
|
955
950
|
name: ""
|
|
956
951
|
});
|
|
957
|
-
var Field2 = (0,
|
|
952
|
+
var Field2 = (0, import_react18.forwardRef)(
|
|
958
953
|
(_a, ref) => {
|
|
959
954
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
960
|
-
return /* @__PURE__ */ (0,
|
|
955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
961
956
|
RadixForm.Field,
|
|
962
957
|
__spreadProps(__spreadValues({}, rest), {
|
|
963
958
|
className: `FormField ${className || ""}`,
|
|
964
959
|
ref,
|
|
965
|
-
children: /* @__PURE__ */ (0,
|
|
960
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FieldContext.Provider, { value: rest, children })
|
|
966
961
|
})
|
|
967
962
|
);
|
|
968
963
|
}
|
|
969
964
|
);
|
|
970
965
|
Field2.displayName = "FORM_FIELD";
|
|
971
966
|
function HeadingLabel(props) {
|
|
972
|
-
return /* @__PURE__ */ (0,
|
|
967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Heading2, __spreadProps(__spreadValues({ variant: "heading5" }, props), { children: props.children }));
|
|
973
968
|
}
|
|
974
969
|
function CaptionLabel(props) {
|
|
975
|
-
return /* @__PURE__ */ (0,
|
|
970
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Typo, __spreadProps(__spreadValues({ color: "gray", variant: "caption" }, props), { children: props.children }));
|
|
976
971
|
}
|
|
977
|
-
var Label2 = (0,
|
|
972
|
+
var Label2 = (0, import_react18.forwardRef)(
|
|
978
973
|
(_a, ref) => {
|
|
979
974
|
var _b = _a, { children, className, variant } = _b, rest = __objRest(_b, ["children", "className", "variant"]);
|
|
980
|
-
const Comp = (0,
|
|
975
|
+
const Comp = (0, import_react18.useMemo)(() => {
|
|
981
976
|
switch (variant) {
|
|
982
977
|
case "title":
|
|
983
978
|
return HeadingLabel;
|
|
@@ -988,42 +983,42 @@ var Label2 = (0, import_react19.forwardRef)(
|
|
|
988
983
|
return Typo;
|
|
989
984
|
}
|
|
990
985
|
}, [variant]);
|
|
991
|
-
const fieldProps = (0,
|
|
992
|
-
return /* @__PURE__ */ (0,
|
|
986
|
+
const fieldProps = (0, import_react18.useContext)(FieldContext);
|
|
987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
993
988
|
RadixForm.Label,
|
|
994
989
|
__spreadProps(__spreadValues({}, rest), {
|
|
995
990
|
asChild: true,
|
|
996
991
|
className: `FormLabel ${className || ""}`,
|
|
997
992
|
ref,
|
|
998
|
-
children: /* @__PURE__ */ (0,
|
|
993
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Comp, { children: [
|
|
999
994
|
children,
|
|
1000
|
-
fieldProps.required ? /* @__PURE__ */ (0,
|
|
995
|
+
fieldProps.required ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Typo, { as: "span", color: "tomato", children: ` *` }) : null
|
|
1001
996
|
] })
|
|
1002
997
|
})
|
|
1003
998
|
);
|
|
1004
999
|
}
|
|
1005
1000
|
);
|
|
1006
1001
|
Label2.displayName = "FORM_Label";
|
|
1007
|
-
var Message2 = (0,
|
|
1002
|
+
var Message2 = (0, import_react18.forwardRef)(
|
|
1008
1003
|
(_a, ref) => {
|
|
1009
1004
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
1010
|
-
return /* @__PURE__ */ (0,
|
|
1005
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1011
1006
|
RadixForm.Message,
|
|
1012
1007
|
__spreadProps(__spreadValues({}, rest), {
|
|
1013
1008
|
asChild: true,
|
|
1014
1009
|
className: `FormMessage ${className || ""}`,
|
|
1015
1010
|
ref,
|
|
1016
|
-
children: /* @__PURE__ */ (0,
|
|
1011
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Typo, { color: "red", children })
|
|
1017
1012
|
})
|
|
1018
1013
|
);
|
|
1019
1014
|
}
|
|
1020
1015
|
);
|
|
1021
1016
|
Message2.displayName = "FORM_Message";
|
|
1022
|
-
var Control2 = (0,
|
|
1017
|
+
var Control2 = (0, import_react18.forwardRef)(
|
|
1023
1018
|
(_a, ref) => {
|
|
1024
1019
|
var _b = _a, { className } = _b, rest = __objRest(_b, ["className"]);
|
|
1025
|
-
const fieldProps = (0,
|
|
1026
|
-
return /* @__PURE__ */ (0,
|
|
1020
|
+
const fieldProps = (0, import_react18.useContext)(FieldContext);
|
|
1021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1027
1022
|
RadixForm.Control,
|
|
1028
1023
|
__spreadProps(__spreadValues({}, rest), {
|
|
1029
1024
|
className: `FormControl ${className || ""}`,
|
|
@@ -1036,43 +1031,43 @@ var Control2 = (0, import_react19.forwardRef)(
|
|
|
1036
1031
|
Control2.displayName = "FORM_Control";
|
|
1037
1032
|
|
|
1038
1033
|
// src/atoms/auto-sizing-input.tsx
|
|
1039
|
-
var
|
|
1040
|
-
var
|
|
1041
|
-
var AutoSizingInput = (0,
|
|
1034
|
+
var import_react19 = require("react");
|
|
1035
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1036
|
+
var AutoSizingInput = (0, import_react19.forwardRef)(
|
|
1042
1037
|
(_a, ref) => {
|
|
1043
1038
|
var _b = _a, { value: _value, onChangeValue, onChange } = _b, rest = __objRest(_b, ["value", "onChangeValue", "onChange"]);
|
|
1044
|
-
const [value, setValue] = (0,
|
|
1045
|
-
const [width, setWidth] = (0,
|
|
1046
|
-
const span = (0,
|
|
1047
|
-
(0,
|
|
1039
|
+
const [value, setValue] = (0, import_react19.useState)(_value);
|
|
1040
|
+
const [width, setWidth] = (0, import_react19.useState)(0);
|
|
1041
|
+
const span = (0, import_react19.useRef)(null);
|
|
1042
|
+
(0, import_react19.useEffect)(() => {
|
|
1048
1043
|
span.current && setWidth(span.current.offsetWidth);
|
|
1049
1044
|
}, [value]);
|
|
1050
|
-
const changeHandler = (0,
|
|
1045
|
+
const changeHandler = (0, import_react19.useCallback)(
|
|
1051
1046
|
(evt) => {
|
|
1052
1047
|
onChange == null ? void 0 : onChange(evt);
|
|
1053
1048
|
setValue(evt.target.value);
|
|
1054
1049
|
},
|
|
1055
1050
|
[onChange]
|
|
1056
1051
|
);
|
|
1057
|
-
(0,
|
|
1052
|
+
(0, import_react19.useEffect)(() => {
|
|
1058
1053
|
setValue(_value || "");
|
|
1059
1054
|
}, [_value]);
|
|
1060
|
-
(0,
|
|
1055
|
+
(0, import_react19.useEffect)(() => {
|
|
1061
1056
|
onChangeValue == null ? void 0 : onChangeValue(value || "");
|
|
1062
1057
|
}, [value, onChangeValue]);
|
|
1063
|
-
return /* @__PURE__ */ (0,
|
|
1064
|
-
/* @__PURE__ */ (0,
|
|
1065
|
-
/* @__PURE__ */ (0,
|
|
1058
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "auto-sizing-input wrapper", style: { width: width + 24 }, children: [
|
|
1059
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("input", __spreadValues({ onChange: changeHandler, ref, value }, rest)),
|
|
1060
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { "aria-hidden": "true", ref: span, children: value })
|
|
1066
1061
|
] });
|
|
1067
1062
|
}
|
|
1068
1063
|
);
|
|
1069
1064
|
AutoSizingInput.displayName = "AutoSizingInput";
|
|
1070
1065
|
|
|
1071
1066
|
// src/atoms/bullet-text.tsx
|
|
1072
|
-
var
|
|
1067
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1073
1068
|
|
|
1074
1069
|
// src/molecules/tag-selector.tsx
|
|
1075
|
-
var
|
|
1070
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1076
1071
|
var OPTION_HEIGHT = 32;
|
|
1077
1072
|
var DefaultDropdownContainer = (props) => {
|
|
1078
1073
|
return props.children;
|
|
@@ -1090,22 +1085,22 @@ function TagSelector(props) {
|
|
|
1090
1085
|
open: propsOpen,
|
|
1091
1086
|
dropdownItemRender
|
|
1092
1087
|
} = props;
|
|
1093
|
-
const [_selected, _setSelected] = (0,
|
|
1088
|
+
const [_selected, _setSelected] = (0, import_react20.useState)(props.selected || []);
|
|
1094
1089
|
const selected = props.selected || _selected;
|
|
1095
1090
|
const setSelected = props.onChange || _setSelected;
|
|
1096
|
-
const [value, setValue] = (0,
|
|
1097
|
-
const [focusIndex, setFocusIndex] = (0,
|
|
1098
|
-
const [open, setOpen] = (0,
|
|
1099
|
-
const [focus, setFocus] = (0,
|
|
1100
|
-
const fieldRef = (0,
|
|
1101
|
-
const scrollRef = (0,
|
|
1102
|
-
const closeRef = (0,
|
|
1103
|
-
const onFocus = (0,
|
|
1091
|
+
const [value, setValue] = (0, import_react20.useState)("");
|
|
1092
|
+
const [focusIndex, setFocusIndex] = (0, import_react20.useState)(null);
|
|
1093
|
+
const [open, setOpen] = (0, import_react20.useState)(false);
|
|
1094
|
+
const [focus, setFocus] = (0, import_react20.useState)(false);
|
|
1095
|
+
const fieldRef = (0, import_react20.useRef)(null);
|
|
1096
|
+
const scrollRef = (0, import_react20.useRef)(null);
|
|
1097
|
+
const closeRef = (0, import_react20.useRef)();
|
|
1098
|
+
const onFocus = (0, import_react20.useCallback)(() => {
|
|
1104
1099
|
clearTimeout(closeRef.current);
|
|
1105
1100
|
setFocus(true);
|
|
1106
1101
|
setOpen(true);
|
|
1107
1102
|
}, []);
|
|
1108
|
-
const onBlur = (0,
|
|
1103
|
+
const onBlur = (0, import_react20.useCallback)(() => {
|
|
1109
1104
|
closeRef.current = setTimeout(() => {
|
|
1110
1105
|
setFocus(false);
|
|
1111
1106
|
setOpen(false);
|
|
@@ -1114,18 +1109,18 @@ function TagSelector(props) {
|
|
|
1114
1109
|
}, 100);
|
|
1115
1110
|
}, 300);
|
|
1116
1111
|
}, []);
|
|
1117
|
-
const onChangeValue = (0,
|
|
1112
|
+
const onChangeValue = (0, import_react20.useCallback)(
|
|
1118
1113
|
(e) => {
|
|
1119
1114
|
setValue(e.target.value);
|
|
1120
1115
|
},
|
|
1121
1116
|
[]
|
|
1122
1117
|
);
|
|
1123
|
-
const filteredOptions = (0,
|
|
1118
|
+
const filteredOptions = (0, import_react20.useMemo)(() => {
|
|
1124
1119
|
return options.filter((option) => {
|
|
1125
1120
|
return option.name.includes(value);
|
|
1126
1121
|
});
|
|
1127
1122
|
}, [options, value]);
|
|
1128
|
-
const selectedItem = (0,
|
|
1123
|
+
const selectedItem = (0, import_react20.useMemo)(() => {
|
|
1129
1124
|
const result = [];
|
|
1130
1125
|
selected.forEach((id) => {
|
|
1131
1126
|
const maybeItem = options.find((option) => option.id === id);
|
|
@@ -1134,13 +1129,13 @@ function TagSelector(props) {
|
|
|
1134
1129
|
});
|
|
1135
1130
|
return result;
|
|
1136
1131
|
}, [options, selected]);
|
|
1137
|
-
const onDelete = (0,
|
|
1132
|
+
const onDelete = (0, import_react20.useCallback)(
|
|
1138
1133
|
(id) => {
|
|
1139
1134
|
setSelected(selected.filter((el) => el !== id));
|
|
1140
1135
|
},
|
|
1141
1136
|
[selected, setSelected]
|
|
1142
1137
|
);
|
|
1143
|
-
const onSelect = (0,
|
|
1138
|
+
const onSelect = (0, import_react20.useCallback)(
|
|
1144
1139
|
(id) => {
|
|
1145
1140
|
if (maxCount && selected.length + 1 > maxCount)
|
|
1146
1141
|
return;
|
|
@@ -1148,7 +1143,7 @@ function TagSelector(props) {
|
|
|
1148
1143
|
},
|
|
1149
1144
|
[maxCount, selected, setSelected]
|
|
1150
1145
|
);
|
|
1151
|
-
const toggleItem = (0,
|
|
1146
|
+
const toggleItem = (0, import_react20.useCallback)(
|
|
1152
1147
|
(id) => {
|
|
1153
1148
|
if (selected.includes(id)) {
|
|
1154
1149
|
onDelete(id);
|
|
@@ -1158,7 +1153,7 @@ function TagSelector(props) {
|
|
|
1158
1153
|
},
|
|
1159
1154
|
[onDelete, onSelect, selected]
|
|
1160
1155
|
);
|
|
1161
|
-
const setScroll = (0,
|
|
1156
|
+
const setScroll = (0, import_react20.useCallback)((index) => {
|
|
1162
1157
|
if (scrollRef.current) {
|
|
1163
1158
|
const scrollTop = scrollRef.current.scrollTop;
|
|
1164
1159
|
const clientHeight = scrollRef.current.clientHeight;
|
|
@@ -1170,7 +1165,7 @@ function TagSelector(props) {
|
|
|
1170
1165
|
}
|
|
1171
1166
|
}
|
|
1172
1167
|
}, []);
|
|
1173
|
-
const handleKeyDown = (0,
|
|
1168
|
+
const handleKeyDown = (0, import_react20.useCallback)(
|
|
1174
1169
|
(e) => {
|
|
1175
1170
|
var _a;
|
|
1176
1171
|
const key = e.key;
|
|
@@ -1222,7 +1217,7 @@ function TagSelector(props) {
|
|
|
1222
1217
|
selected
|
|
1223
1218
|
]
|
|
1224
1219
|
);
|
|
1225
|
-
const placeholderVisible = (0,
|
|
1220
|
+
const placeholderVisible = (0, import_react20.useMemo)(() => {
|
|
1226
1221
|
if (selectedItem.length)
|
|
1227
1222
|
return false;
|
|
1228
1223
|
if (value)
|
|
@@ -1231,13 +1226,13 @@ function TagSelector(props) {
|
|
|
1231
1226
|
return false;
|
|
1232
1227
|
return true;
|
|
1233
1228
|
}, [focus, selectedItem.length, value]);
|
|
1234
|
-
(0,
|
|
1229
|
+
(0, import_react20.useEffect)(() => {
|
|
1235
1230
|
setFocusIndex(null);
|
|
1236
1231
|
}, [open]);
|
|
1237
|
-
(0,
|
|
1232
|
+
(0, import_react20.useEffect)(() => {
|
|
1238
1233
|
setFocusIndex(0);
|
|
1239
1234
|
}, [filteredOptions]);
|
|
1240
|
-
const badgeSize = (0,
|
|
1235
|
+
const badgeSize = (0, import_react20.useMemo)(() => {
|
|
1241
1236
|
switch (size) {
|
|
1242
1237
|
case "large":
|
|
1243
1238
|
return "large";
|
|
@@ -1247,7 +1242,7 @@ function TagSelector(props) {
|
|
|
1247
1242
|
return "small";
|
|
1248
1243
|
}
|
|
1249
1244
|
}, [size]);
|
|
1250
|
-
const placeholderVariant = (0,
|
|
1245
|
+
const placeholderVariant = (0, import_react20.useMemo)(() => {
|
|
1251
1246
|
switch (size) {
|
|
1252
1247
|
case "large":
|
|
1253
1248
|
return "subtitle";
|
|
@@ -1259,11 +1254,11 @@ function TagSelector(props) {
|
|
|
1259
1254
|
const focusClassName = focus ? " focused" : "";
|
|
1260
1255
|
const readOnlyClassName = readOnly ? " read-only" : "";
|
|
1261
1256
|
const errorClassName = error ? " error" : "";
|
|
1262
|
-
const readonlyContent = /* @__PURE__ */ (0,
|
|
1263
|
-
return tagRender ? tagRender(item) : /* @__PURE__ */ (0,
|
|
1257
|
+
const readonlyContent = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_themes2.Flex, { gap: "1", children: selectedItem.map((item) => {
|
|
1258
|
+
return tagRender ? tagRender(item) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Badge, { size: badgeSize, children: item.name }, item.id);
|
|
1264
1259
|
}) });
|
|
1265
|
-
const editContent = /* @__PURE__ */ (0,
|
|
1266
|
-
/* @__PURE__ */ (0,
|
|
1260
|
+
const editContent = /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
1261
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1267
1262
|
import_themes2.Flex,
|
|
1268
1263
|
{
|
|
1269
1264
|
align: "center",
|
|
@@ -1275,22 +1270,22 @@ function TagSelector(props) {
|
|
|
1275
1270
|
selectedItem.map((item) => {
|
|
1276
1271
|
return tagRender ? tagRender(item, () => {
|
|
1277
1272
|
onDelete(item.id);
|
|
1278
|
-
}) : /* @__PURE__ */ (0,
|
|
1273
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(Badge, { size: badgeSize, children: [
|
|
1279
1274
|
item.name,
|
|
1280
|
-
/* @__PURE__ */ (0,
|
|
1275
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1281
1276
|
Button,
|
|
1282
1277
|
{
|
|
1283
1278
|
onClick: () => {
|
|
1284
1279
|
onDelete(item.id);
|
|
1285
1280
|
},
|
|
1286
1281
|
variant: "transparent",
|
|
1287
|
-
children: /* @__PURE__ */ (0,
|
|
1282
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_icons4.Cross1Icon, {})
|
|
1288
1283
|
}
|
|
1289
1284
|
)
|
|
1290
1285
|
] }, item.id);
|
|
1291
1286
|
}),
|
|
1292
|
-
placeholderVisible ? /* @__PURE__ */ (0,
|
|
1293
|
-
/* @__PURE__ */ (0,
|
|
1287
|
+
placeholderVisible ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Typo, { color: "gray", variant: placeholderVariant, children: placeholder }) : null,
|
|
1288
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1294
1289
|
AutoSizingInput,
|
|
1295
1290
|
{
|
|
1296
1291
|
onBlur,
|
|
@@ -1304,10 +1299,10 @@ function TagSelector(props) {
|
|
|
1304
1299
|
]
|
|
1305
1300
|
}
|
|
1306
1301
|
),
|
|
1307
|
-
focus ? /* @__PURE__ */ (0,
|
|
1302
|
+
focus ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_icons4.MagnifyingGlassIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_icons4.ChevronRightIcon, {})
|
|
1308
1303
|
] });
|
|
1309
|
-
return /* @__PURE__ */ (0,
|
|
1310
|
-
/* @__PURE__ */ (0,
|
|
1304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_themes.Popover.Root, { open: Boolean(filteredOptions.length) && propsOpen || open, children: [
|
|
1305
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_themes.Popover.Trigger, { style: { position: "relative" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1311
1306
|
import_themes6.Grid,
|
|
1312
1307
|
{
|
|
1313
1308
|
align: "center",
|
|
@@ -1321,31 +1316,31 @@ function TagSelector(props) {
|
|
|
1321
1316
|
children: readOnly ? readonlyContent : editContent
|
|
1322
1317
|
}
|
|
1323
1318
|
) }),
|
|
1324
|
-
/* @__PURE__ */ (0,
|
|
1319
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1325
1320
|
import_themes.Popover.Content,
|
|
1326
1321
|
{
|
|
1327
1322
|
onOpenAutoFocus: preventDefault,
|
|
1328
1323
|
onTouchMove: stopPropagationTouch,
|
|
1329
1324
|
onWheel: stopPropagationWheel,
|
|
1330
1325
|
sticky: "always",
|
|
1331
|
-
children: /* @__PURE__ */ (0,
|
|
1326
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1332
1327
|
DropdownContainer,
|
|
1333
1328
|
{
|
|
1334
1329
|
currentItem: filteredOptions[focusIndex || 0],
|
|
1335
1330
|
items: filteredOptions,
|
|
1336
|
-
children: /* @__PURE__ */ (0,
|
|
1337
|
-
ScrollArea,
|
|
1331
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1332
|
+
import_themes5.ScrollArea,
|
|
1338
1333
|
{
|
|
1339
1334
|
ref: scrollRef,
|
|
1340
1335
|
scrollbars: "vertical",
|
|
1341
1336
|
style: { height: OPTION_HEIGHT * 8 },
|
|
1342
1337
|
type: "auto",
|
|
1343
|
-
children: /* @__PURE__ */ (0,
|
|
1338
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_themes2.Flex, { direction: "column", children: filteredOptions.map((item, i) => {
|
|
1344
1339
|
const isSelected = Boolean(
|
|
1345
1340
|
selected.find((el) => el === item.id)
|
|
1346
1341
|
);
|
|
1347
1342
|
const isFocus = i === focusIndex;
|
|
1348
|
-
return /* @__PURE__ */ (0,
|
|
1343
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1349
1344
|
Button,
|
|
1350
1345
|
{
|
|
1351
1346
|
className: `tag-selector-button ${isFocus ? "focused" : ""}`,
|
|
@@ -1358,9 +1353,9 @@ function TagSelector(props) {
|
|
|
1358
1353
|
setFocusIndex(i);
|
|
1359
1354
|
},
|
|
1360
1355
|
variant: isSelected ? "soft" : "outline",
|
|
1361
|
-
children: /* @__PURE__ */ (0,
|
|
1356
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_themes2.Flex, { justify: "between", width: "100%", children: [
|
|
1362
1357
|
dropdownItemRender ? dropdownItemRender(item) : item.name,
|
|
1363
|
-
isSelected ? /* @__PURE__ */ (0,
|
|
1358
|
+
isSelected ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_icons.CheckIcon, {}) : null
|
|
1364
1359
|
] })
|
|
1365
1360
|
},
|
|
1366
1361
|
item.id
|