@ceed/ads 0.0.90 → 0.0.92
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/CurrencyInput/CurrencyInput.d.ts +17 -2
- package/dist/index.js +16 -22
- package/framer/index.js +16 -22
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { MotionProps } from "framer-motion";
|
|
2
3
|
interface CurrencyInputProps {
|
|
3
4
|
currency?: "usd" | "krw";
|
|
4
|
-
max?: number;
|
|
5
|
+
max?: number | string;
|
|
5
6
|
value?: number;
|
|
6
7
|
onChange?: (event: {
|
|
7
8
|
target: {
|
|
@@ -16,5 +17,19 @@ interface CurrencyInputProps {
|
|
|
16
17
|
error?: boolean;
|
|
17
18
|
helperText?: React.ReactNode;
|
|
18
19
|
}
|
|
19
|
-
declare const CurrencyInput: React.ForwardRefExoticComponent<CurrencyInputProps &
|
|
20
|
+
declare const CurrencyInput: React.ForwardRefExoticComponent<Omit<CurrencyInputProps & {
|
|
21
|
+
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
22
|
+
} & Pick<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "autoFocus" | "id" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "onClick" | "disabled" | "type" | "required" | "autoComplete" | "readOnly" | "value" | "name" | "placeholder"> & {
|
|
23
|
+
className?: string | undefined;
|
|
24
|
+
color?: import("@mui/types").OverridableStringUnion<import("@mui/joy").ColorPaletteProp, import("@mui/joy").InputPropsColorOverrides> | undefined;
|
|
25
|
+
endDecorator?: React.ReactNode;
|
|
26
|
+
error?: boolean | undefined;
|
|
27
|
+
fullWidth?: boolean | undefined;
|
|
28
|
+
startDecorator?: React.ReactNode;
|
|
29
|
+
size?: import("@mui/types").OverridableStringUnion<"sm" | "md" | "lg", import("@mui/joy").InputPropsSizeOverrides> | undefined;
|
|
30
|
+
sx?: import("@mui/joy/styles/types").SxProps | undefined;
|
|
31
|
+
variant?: import("@mui/types").OverridableStringUnion<import("@mui/joy").VariantProp, import("@mui/joy").InputPropsVariantOverrides> | undefined;
|
|
32
|
+
} & import("@mui/joy").InputSlotsAndSlotProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
33
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
34
|
+
}, "color" | "defaultValue" | "autoFocus" | "className" | "id" | "onFocus" | "onBlur" | "onChange" | "onKeyDown" | "onKeyUp" | "onClick" | "variant" | "sx" | "disabled" | "size" | "endDecorator" | "startDecorator" | "component" | "type" | "error" | "required" | "autoComplete" | "readOnly" | "value" | "name" | "placeholder" | "fullWidth" | keyof import("@mui/joy").InputSlotsAndSlotProps> & MotionProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
20
35
|
export { CurrencyInput };
|
package/dist/index.js
CHANGED
|
@@ -172,25 +172,25 @@ var Stack_default = Stack;
|
|
|
172
172
|
// src/components/Alert/Alert.tsx
|
|
173
173
|
var MotionAlert = motion4(JoyAlert);
|
|
174
174
|
function Alert(props) {
|
|
175
|
-
const { title, content, actions, color = "primary",
|
|
175
|
+
const { title, content, actions, color = "primary", ...innerProps } = props;
|
|
176
|
+
const innerVariant = props.variant === "outlined" ? void 0 : props.variant;
|
|
176
177
|
return /* @__PURE__ */ React3.createElement(
|
|
177
178
|
MotionAlert,
|
|
178
179
|
{
|
|
179
180
|
...innerProps,
|
|
180
181
|
color,
|
|
181
|
-
variant,
|
|
182
182
|
endDecorator: actions
|
|
183
183
|
},
|
|
184
184
|
/* @__PURE__ */ React3.createElement(Stack_default, null, title && /* @__PURE__ */ React3.createElement(
|
|
185
185
|
Typography_default,
|
|
186
186
|
{
|
|
187
187
|
color,
|
|
188
|
-
variant,
|
|
188
|
+
variant: innerVariant,
|
|
189
189
|
level: "title-md",
|
|
190
190
|
fontWeight: 600
|
|
191
191
|
},
|
|
192
192
|
title
|
|
193
|
-
), /* @__PURE__ */ React3.createElement(Typography_default, { color, variant, level: "body-md" }, content))
|
|
193
|
+
), /* @__PURE__ */ React3.createElement(Typography_default, { color, variant: innerVariant, level: "body-md" }, content))
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
196
|
Alert.displayName = "Alert";
|
|
@@ -1241,12 +1241,6 @@ function getCurrencySymbol(currencyCode) {
|
|
|
1241
1241
|
}).format(0);
|
|
1242
1242
|
return formatted.replace(/[\d\s.,]/g, "");
|
|
1243
1243
|
}
|
|
1244
|
-
function formatValueString(amount, currency = "usd") {
|
|
1245
|
-
const formatter = new IntlMessageFormat(
|
|
1246
|
-
`{amount, number, ::currency/${currency} unit-width-narrow}`
|
|
1247
|
-
);
|
|
1248
|
-
return formatter.format({ amount }).toString();
|
|
1249
|
-
}
|
|
1250
1244
|
var TextMaskAdapter = React14.forwardRef(
|
|
1251
1245
|
function TextMaskAdapter2(props, ref) {
|
|
1252
1246
|
const { onChange, currency, ...innerProps } = props;
|
|
@@ -1269,7 +1263,7 @@ var TextMaskAdapter = React14.forwardRef(
|
|
|
1269
1263
|
}
|
|
1270
1264
|
});
|
|
1271
1265
|
},
|
|
1272
|
-
value:
|
|
1266
|
+
value: value.toString(),
|
|
1273
1267
|
unmask: true,
|
|
1274
1268
|
blocks: {
|
|
1275
1269
|
num: {
|
|
@@ -1301,13 +1295,13 @@ var CurrencyInput = React14.forwardRef(
|
|
|
1301
1295
|
...innerProps
|
|
1302
1296
|
} = props;
|
|
1303
1297
|
const [isOverLimit, setIsOverLimit] = useState3(
|
|
1304
|
-
!!props.value && props.value > max
|
|
1298
|
+
!!props.value && props.value > Number(max)
|
|
1305
1299
|
);
|
|
1306
1300
|
const handleChange = useCallback3(
|
|
1307
1301
|
(event) => {
|
|
1308
1302
|
const amount = Number(event.target.value);
|
|
1309
1303
|
onChange?.({ ...event, target: { name, value: amount } });
|
|
1310
|
-
if (amount > max) {
|
|
1304
|
+
if (amount > Number(max)) {
|
|
1311
1305
|
setIsOverLimit(true);
|
|
1312
1306
|
} else {
|
|
1313
1307
|
setIsOverLimit(false);
|
|
@@ -1919,7 +1913,7 @@ var CalendarSheet = styled6(Sheet_default, {
|
|
|
1919
1913
|
boxShadow: theme.shadow.md,
|
|
1920
1914
|
borderRadius: theme.radius.md
|
|
1921
1915
|
}));
|
|
1922
|
-
var
|
|
1916
|
+
var formatValueString = (date) => {
|
|
1923
1917
|
let day = `${date.getDate()}`;
|
|
1924
1918
|
let month = `${date.getMonth() + 1}`;
|
|
1925
1919
|
const year = date.getFullYear();
|
|
@@ -1959,7 +1953,7 @@ var TextMaskAdapter3 = React17.forwardRef(
|
|
|
1959
1953
|
to: 9999
|
|
1960
1954
|
}
|
|
1961
1955
|
},
|
|
1962
|
-
format:
|
|
1956
|
+
format: formatValueString,
|
|
1963
1957
|
parse: (str) => {
|
|
1964
1958
|
const yearMonthDay = str.split("/");
|
|
1965
1959
|
return new Date(
|
|
@@ -2043,7 +2037,7 @@ var DatePicker = forwardRef4(
|
|
|
2043
2037
|
{
|
|
2044
2038
|
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
2045
2039
|
onChange: ([date]) => {
|
|
2046
|
-
setValue(
|
|
2040
|
+
setValue(formatValueString(date));
|
|
2047
2041
|
setAnchorEl(null);
|
|
2048
2042
|
},
|
|
2049
2043
|
minDate: minDate ? new Date(minDate) : void 0,
|
|
@@ -2114,7 +2108,7 @@ var CalendarSheet2 = styled7(Sheet_default, {
|
|
|
2114
2108
|
boxShadow: theme.shadow.md,
|
|
2115
2109
|
borderRadius: theme.radius.md
|
|
2116
2110
|
}));
|
|
2117
|
-
var
|
|
2111
|
+
var formatValueString2 = ([date1, date2]) => {
|
|
2118
2112
|
const getStr = (date) => {
|
|
2119
2113
|
let day = `${date.getDate()}`;
|
|
2120
2114
|
let month = `${date.getMonth() + 1}`;
|
|
@@ -2175,7 +2169,7 @@ var TextMaskAdapter5 = React18.forwardRef(
|
|
|
2175
2169
|
to: 9999
|
|
2176
2170
|
}
|
|
2177
2171
|
},
|
|
2178
|
-
format:
|
|
2172
|
+
format: formatValueString2,
|
|
2179
2173
|
parse: parseDate,
|
|
2180
2174
|
autofix: "pad",
|
|
2181
2175
|
overwrite: true,
|
|
@@ -2222,7 +2216,7 @@ var DateRangePicker = forwardRef5(
|
|
|
2222
2216
|
([date1, date2]) => {
|
|
2223
2217
|
if (!date1 || !date2)
|
|
2224
2218
|
return;
|
|
2225
|
-
setValue(
|
|
2219
|
+
setValue(formatValueString2([date1, date2]));
|
|
2226
2220
|
setAnchorEl(null);
|
|
2227
2221
|
},
|
|
2228
2222
|
[setValue, setAnchorEl]
|
|
@@ -2439,7 +2433,7 @@ var CalendarSheet3 = styled12(Sheet_default, {
|
|
|
2439
2433
|
boxShadow: theme.shadow.md,
|
|
2440
2434
|
borderRadius: theme.radius.md
|
|
2441
2435
|
}));
|
|
2442
|
-
var
|
|
2436
|
+
var formatValueString3 = ([date1, date2]) => {
|
|
2443
2437
|
const getStr = (date) => {
|
|
2444
2438
|
let month = `${date.getMonth() + 1}`;
|
|
2445
2439
|
const year = date.getFullYear();
|
|
@@ -2483,7 +2477,7 @@ var TextMaskAdapter7 = React23.forwardRef(
|
|
|
2483
2477
|
to: 9999
|
|
2484
2478
|
}
|
|
2485
2479
|
},
|
|
2486
|
-
format:
|
|
2480
|
+
format: formatValueString3,
|
|
2487
2481
|
parse: parseDate2,
|
|
2488
2482
|
autofix: "pad",
|
|
2489
2483
|
overwrite: true,
|
|
@@ -2530,7 +2524,7 @@ var MonthRangePicker = forwardRef6(
|
|
|
2530
2524
|
([date1, date2]) => {
|
|
2531
2525
|
if (!date1 || !date2)
|
|
2532
2526
|
return;
|
|
2533
|
-
setValue(
|
|
2527
|
+
setValue(formatValueString3([date1, date2]));
|
|
2534
2528
|
setAnchorEl(null);
|
|
2535
2529
|
},
|
|
2536
2530
|
[setValue, setAnchorEl]
|
package/framer/index.js
CHANGED
|
@@ -34896,25 +34896,25 @@ var Stack_default2 = Stack2;
|
|
|
34896
34896
|
// src/components/Alert/Alert.tsx
|
|
34897
34897
|
var MotionAlert = motion4(Alert_default);
|
|
34898
34898
|
function Alert3(props) {
|
|
34899
|
-
const _a2 = props, { title, content, actions, color: color2 = "primary"
|
|
34899
|
+
const _a2 = props, { title, content, actions, color: color2 = "primary" } = _a2, innerProps = __objRest(_a2, ["title", "content", "actions", "color"]);
|
|
34900
|
+
const innerVariant = props.variant === "outlined" ? void 0 : props.variant;
|
|
34900
34901
|
return /* @__PURE__ */ jsx2(
|
|
34901
34902
|
MotionAlert,
|
|
34902
34903
|
__spreadProps(__spreadValues({}, innerProps), {
|
|
34903
34904
|
color: color2,
|
|
34904
|
-
variant,
|
|
34905
34905
|
endDecorator: actions,
|
|
34906
34906
|
children: /* @__PURE__ */ jsxs2(Stack_default2, { children: [
|
|
34907
34907
|
title && /* @__PURE__ */ jsx2(
|
|
34908
34908
|
Typography_default2,
|
|
34909
34909
|
{
|
|
34910
34910
|
color: color2,
|
|
34911
|
-
variant,
|
|
34911
|
+
variant: innerVariant,
|
|
34912
34912
|
level: "title-md",
|
|
34913
34913
|
fontWeight: 600,
|
|
34914
34914
|
children: title
|
|
34915
34915
|
}
|
|
34916
34916
|
),
|
|
34917
|
-
/* @__PURE__ */ jsx2(Typography_default2, { color: color2, variant, level: "body-md", children: content })
|
|
34917
|
+
/* @__PURE__ */ jsx2(Typography_default2, { color: color2, variant: innerVariant, level: "body-md", children: content })
|
|
34918
34918
|
] })
|
|
34919
34919
|
})
|
|
34920
34920
|
);
|
|
@@ -43878,12 +43878,6 @@ function getCurrencySymbol(currencyCode) {
|
|
|
43878
43878
|
}).format(0);
|
|
43879
43879
|
return formatted.replace(/[\d\s.,]/g, "");
|
|
43880
43880
|
}
|
|
43881
|
-
function formatValueString(amount, currency = "usd") {
|
|
43882
|
-
const formatter = new IntlMessageFormat(
|
|
43883
|
-
`{amount, number, ::currency/${currency} unit-width-narrow}`
|
|
43884
|
-
);
|
|
43885
|
-
return formatter.format({ amount }).toString();
|
|
43886
|
-
}
|
|
43887
43881
|
var TextMaskAdapter = React179.forwardRef(
|
|
43888
43882
|
function TextMaskAdapter2(props, ref) {
|
|
43889
43883
|
const _a2 = props, { onChange, currency } = _a2, innerProps = __objRest(_a2, ["onChange", "currency"]);
|
|
@@ -43905,7 +43899,7 @@ var TextMaskAdapter = React179.forwardRef(
|
|
|
43905
43899
|
}
|
|
43906
43900
|
});
|
|
43907
43901
|
},
|
|
43908
|
-
value:
|
|
43902
|
+
value: value.toString(),
|
|
43909
43903
|
unmask: true,
|
|
43910
43904
|
blocks: {
|
|
43911
43905
|
num: {
|
|
@@ -43946,13 +43940,13 @@ var CurrencyInput = React179.forwardRef(
|
|
|
43946
43940
|
"disabled"
|
|
43947
43941
|
]);
|
|
43948
43942
|
const [isOverLimit, setIsOverLimit] = useState26(
|
|
43949
|
-
!!props.value && props.value > max2
|
|
43943
|
+
!!props.value && props.value > Number(max2)
|
|
43950
43944
|
);
|
|
43951
43945
|
const handleChange = useCallback27(
|
|
43952
43946
|
(event) => {
|
|
43953
43947
|
const amount = Number(event.target.value);
|
|
43954
43948
|
onChange == null ? void 0 : onChange(__spreadProps(__spreadValues({}, event), { target: { name, value: amount } }));
|
|
43955
|
-
if (amount > max2) {
|
|
43949
|
+
if (amount > Number(max2)) {
|
|
43956
43950
|
setIsOverLimit(true);
|
|
43957
43951
|
} else {
|
|
43958
43952
|
setIsOverLimit(false);
|
|
@@ -44645,7 +44639,7 @@ var CalendarSheet = styled_default2(Sheet_default2, {
|
|
|
44645
44639
|
boxShadow: theme.shadow.md,
|
|
44646
44640
|
borderRadius: theme.radius.md
|
|
44647
44641
|
}));
|
|
44648
|
-
var
|
|
44642
|
+
var formatValueString = (date) => {
|
|
44649
44643
|
let day = `${date.getDate()}`;
|
|
44650
44644
|
let month = `${date.getMonth() + 1}`;
|
|
44651
44645
|
const year = date.getFullYear();
|
|
@@ -44684,7 +44678,7 @@ var TextMaskAdapter3 = React181.forwardRef(
|
|
|
44684
44678
|
to: 9999
|
|
44685
44679
|
}
|
|
44686
44680
|
},
|
|
44687
|
-
format:
|
|
44681
|
+
format: formatValueString,
|
|
44688
44682
|
parse: (str) => {
|
|
44689
44683
|
const yearMonthDay = str.split("/");
|
|
44690
44684
|
return new Date(
|
|
@@ -44770,7 +44764,7 @@ var DatePicker = forwardRef85(
|
|
|
44770
44764
|
{
|
|
44771
44765
|
value: !Number.isNaN(new Date(value).getTime()) ? [new Date(value), void 0] : void 0,
|
|
44772
44766
|
onChange: ([date]) => {
|
|
44773
|
-
setValue(
|
|
44767
|
+
setValue(formatValueString(date));
|
|
44774
44768
|
setAnchorEl(null);
|
|
44775
44769
|
},
|
|
44776
44770
|
minDate: minDate ? new Date(minDate) : void 0,
|
|
@@ -44843,7 +44837,7 @@ var CalendarSheet2 = styled_default2(Sheet_default2, {
|
|
|
44843
44837
|
boxShadow: theme.shadow.md,
|
|
44844
44838
|
borderRadius: theme.radius.md
|
|
44845
44839
|
}));
|
|
44846
|
-
var
|
|
44840
|
+
var formatValueString2 = ([date1, date2]) => {
|
|
44847
44841
|
const getStr = (date) => {
|
|
44848
44842
|
let day = `${date.getDate()}`;
|
|
44849
44843
|
let month = `${date.getMonth() + 1}`;
|
|
@@ -44903,7 +44897,7 @@ var TextMaskAdapter5 = React182.forwardRef(
|
|
|
44903
44897
|
to: 9999
|
|
44904
44898
|
}
|
|
44905
44899
|
},
|
|
44906
|
-
format:
|
|
44900
|
+
format: formatValueString2,
|
|
44907
44901
|
parse: parseDate,
|
|
44908
44902
|
autofix: "pad",
|
|
44909
44903
|
overwrite: true,
|
|
@@ -44950,7 +44944,7 @@ var DateRangePicker = forwardRef86(
|
|
|
44950
44944
|
([date1, date2]) => {
|
|
44951
44945
|
if (!date1 || !date2)
|
|
44952
44946
|
return;
|
|
44953
|
-
setValue(
|
|
44947
|
+
setValue(formatValueString2([date1, date2]));
|
|
44954
44948
|
setAnchorEl(null);
|
|
44955
44949
|
},
|
|
44956
44950
|
[setValue, setAnchorEl]
|
|
@@ -45160,7 +45154,7 @@ var CalendarSheet3 = styled_default2(Sheet_default2, {
|
|
|
45160
45154
|
boxShadow: theme.shadow.md,
|
|
45161
45155
|
borderRadius: theme.radius.md
|
|
45162
45156
|
}));
|
|
45163
|
-
var
|
|
45157
|
+
var formatValueString3 = ([date1, date2]) => {
|
|
45164
45158
|
const getStr = (date) => {
|
|
45165
45159
|
let month = `${date.getMonth() + 1}`;
|
|
45166
45160
|
const year = date.getFullYear();
|
|
@@ -45203,7 +45197,7 @@ var TextMaskAdapter7 = React183.forwardRef(
|
|
|
45203
45197
|
to: 9999
|
|
45204
45198
|
}
|
|
45205
45199
|
},
|
|
45206
|
-
format:
|
|
45200
|
+
format: formatValueString3,
|
|
45207
45201
|
parse: parseDate2,
|
|
45208
45202
|
autofix: "pad",
|
|
45209
45203
|
overwrite: true,
|
|
@@ -45250,7 +45244,7 @@ var MonthRangePicker = forwardRef87(
|
|
|
45250
45244
|
([date1, date2]) => {
|
|
45251
45245
|
if (!date1 || !date2)
|
|
45252
45246
|
return;
|
|
45253
|
-
setValue(
|
|
45247
|
+
setValue(formatValueString3([date1, date2]));
|
|
45254
45248
|
setAnchorEl(null);
|
|
45255
45249
|
},
|
|
45256
45250
|
[setValue, setAnchorEl]
|