@janbox/storefront-ui 2.0.9 → 2.0.11

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.
Files changed (60) hide show
  1. package/dist/constants/index.d.ts +0 -4
  2. package/dist/constants/index.d.ts.map +1 -1
  3. package/dist/constants/index.js +0 -7
  4. package/dist/hooks/index.d.ts +0 -1
  5. package/dist/hooks/index.d.ts.map +1 -1
  6. package/dist/hooks/index.js +0 -2
  7. package/dist/hooks/use-formatter/index.d.ts.map +1 -1
  8. package/dist/hooks/use-formatter/index.js +8 -8
  9. package/dist/i18n/index.d.ts +8 -0
  10. package/dist/i18n/index.d.ts.map +1 -0
  11. package/dist/i18n/index.js +26 -0
  12. package/dist/i18n/locales/en.json.d.ts +6 -0
  13. package/dist/i18n/locales/en.json.js +8 -0
  14. package/dist/i18n/locales/vi.json.d.ts +5 -0
  15. package/dist/i18n/locales/vi.json.js +8 -0
  16. package/dist/index.js +2 -0
  17. package/dist/lib/avatar/avatar.d.ts +3 -0
  18. package/dist/lib/avatar/avatar.d.ts.map +1 -0
  19. package/dist/lib/avatar/avatar.js +121 -0
  20. package/dist/lib/avatar/helpers.d.ts +6 -0
  21. package/dist/lib/avatar/helpers.d.ts.map +1 -0
  22. package/dist/lib/avatar/helpers.js +36 -0
  23. package/dist/lib/avatar/index.d.ts +3 -0
  24. package/dist/lib/avatar/index.d.ts.map +1 -0
  25. package/dist/lib/avatar/types.d.ts +19 -0
  26. package/dist/lib/avatar/types.d.ts.map +1 -0
  27. package/dist/lib/count-up/count-up.d.ts.map +1 -1
  28. package/dist/lib/count-up/count-up.js +3 -3
  29. package/dist/lib/index.d.ts +1 -0
  30. package/dist/lib/index.d.ts.map +1 -1
  31. package/dist/lib/input-number/input-number.d.ts.map +1 -1
  32. package/dist/lib/input-number/input-number.js +8 -3
  33. package/dist/lib/link/link.d.ts +1 -1
  34. package/dist/lib/link/link.d.ts.map +1 -1
  35. package/dist/lib/link/link.js +4 -5
  36. package/dist/lib/price-label/price-label.d.ts.map +1 -1
  37. package/dist/lib/price-label/price-label.js +11 -6
  38. package/dist/lib/price-label/types.d.ts +1 -0
  39. package/dist/lib/price-label/types.d.ts.map +1 -1
  40. package/dist/lib/textarea/textarea.d.ts.map +1 -1
  41. package/dist/lib/textarea/textarea.js +89 -47
  42. package/dist/locales/en/ui__translation.json +2 -1
  43. package/dist/locales/vi/ui__translation.json +2 -1
  44. package/dist/style.css +1 -64
  45. package/dist/theme/provider.d.ts +2 -1
  46. package/dist/theme/provider.d.ts.map +1 -1
  47. package/dist/theme/provider.js +3 -2
  48. package/dist/utils/index.d.ts +1 -0
  49. package/dist/utils/index.d.ts.map +1 -1
  50. package/dist/utils/index.js +2 -0
  51. package/dist/utils/stylesheet.d.ts +7 -0
  52. package/dist/utils/stylesheet.d.ts.map +1 -1
  53. package/dist/utils/stylesheet.js +25 -1
  54. package/package.json +1 -3
  55. package/dist/hooks/use-hover-line-effect/index.d.ts +0 -12
  56. package/dist/hooks/use-hover-line-effect/index.d.ts.map +0 -1
  57. package/dist/hooks/use-hover-line-effect/index.js +0 -19
  58. package/dist/hooks/use-hover-line-effect/use-hover-line-effect.module.scss.js +0 -8
  59. package/dist/lib/input-number/input-number.module.scss.js +0 -8
  60. package/dist/lib/textarea/textarea.module.scss.js +0 -14
@@ -1,5 +1,4 @@
1
1
  import { default as IMAGE_PLACEHOLDER } from '../assets/svg/image-placeholder.svg?url';
2
- export declare const USER_COMPONENT_LOCALE_NAMESPACE = "user-component";
3
2
  export declare enum HTMLDatasetAttributes {
4
3
  DATA_TEST_ID = "data-testid",
5
4
  ARIA_DISABLED = "aria-disabled",
@@ -18,7 +17,4 @@ export declare enum Booleanish {
18
17
  True = "true",
19
18
  False = "false"
20
19
  }
21
- export declare enum LocaleNamespaces {
22
- Translation = "ui__translation"
23
- }
24
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yCAAyC,CAAC;AAExE,eAAO,MAAM,+BAA+B,mBAAmB,CAAC;AAEhE,oBAAY,qBAAqB;IAC/B,YAAY,gBAAgB;IAC5B,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;CAClC;AAED,oBAAY,WAAW;IACrB,aAAa,kBAAkB;CAChC;AAED,eAAO,MAAM,YAAY,oHAA0G,CAAC;AAIpI,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,KAAK,SAAgC,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAED,oBAAY,gBAAgB;IAC1B,WAAW,oBAAoB;CAChC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yCAAyC,CAAC;AAExE,oBAAY,qBAAqB;IAC/B,YAAY,gBAAgB;IAC5B,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;CAClC;AAED,oBAAY,WAAW;IACrB,aAAa,kBAAkB;CAChC;AAED,eAAO,MAAM,YAAY,oHAA0G,CAAC;AAIpI,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,KAAK,SAAgC,CAAC;AAEnD,OAAO,EAAE,iBAAiB,EAAE,CAAC;AAE7B,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,KAAK,UAAU;CAChB"}
@@ -1,5 +1,4 @@
1
1
  import { default as default2 } from "../assets/svg/image-placeholder.svg.js";
2
- const USER_COMPONENT_LOCALE_NAMESPACE = "user-component";
3
2
  var HTMLDatasetAttributes = /* @__PURE__ */ ((HTMLDatasetAttributes2) => {
4
3
  HTMLDatasetAttributes2["DATA_TEST_ID"] = "data-testid";
5
4
  HTMLDatasetAttributes2["ARIA_DISABLED"] = "aria-disabled";
@@ -20,18 +19,12 @@ var Booleanish = /* @__PURE__ */ ((Booleanish2) => {
20
19
  Booleanish2["False"] = "false";
21
20
  return Booleanish2;
22
21
  })(Booleanish || {});
23
- var LocaleNamespaces = /* @__PURE__ */ ((LocaleNamespaces2) => {
24
- LocaleNamespaces2["Translation"] = "ui__translation";
25
- return LocaleNamespaces2;
26
- })(LocaleNamespaces || {});
27
22
  export {
28
23
  Booleanish,
29
24
  FALLBACK_SVG,
30
25
  HTMLClasses,
31
26
  HTMLDatasetAttributes,
32
27
  default2 as IMAGE_PLACEHOLDER,
33
- LocaleNamespaces,
34
28
  TYPING_DEBOUNCE,
35
- USER_COMPONENT_LOCALE_NAMESPACE,
36
29
  isSSR
37
30
  };
@@ -1,5 +1,4 @@
1
1
  export * from './use-window-screen';
2
- export * from './use-hover-line-effect';
3
2
  export * from './use-ripple-effect';
4
3
  export * from './use-controllable-state';
5
4
  export * from './use-countdown-timer';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { useWindowScreen } from "./use-window-screen/index.js";
2
- import { useHoverLineEffect } from "./use-hover-line-effect/index.js";
3
2
  import { useRippleEffect } from "./use-ripple-effect/index.js";
4
3
  import { useControllableState } from "./use-controllable-state.js";
5
4
  import { useCountdownTimer } from "./use-countdown-timer.js";
@@ -14,7 +13,6 @@ export {
14
13
  useDeepCompareEffect,
15
14
  useFirstMountState,
16
15
  useFormatter,
17
- useHoverLineEffect,
18
16
  useQueryParams,
19
17
  useRippleEffect,
20
18
  useUpdateEffect,
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-formatter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,qBAAqB,EAErB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAIjB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC,eAAO,MAAM,YAAY;0BAIb,MAAM,YAAY,OAAO,CAAC,mBAAmB,CAAC;4BAO9C,IAAI,GAAG,MAAM,GAAG,MAAM,WAAW,WAAW,CAAC,qBAAqB,EAAE,KAAK,CAAC;yBAU1E,MAAM,WAAW,WAAW,CAAC,kBAAkB,EAAE,KAAK,CAAC;CAclE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-formatter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAElB,qBAAqB,EAErB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAGjB,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,eAAO,MAAM,YAAY;0BAIb,MAAM,YAAY,OAAO,CAAC,mBAAmB,CAAC;4BAO9C,IAAI,GAAG,MAAM,GAAG,MAAM,WAAW,WAAW,CAAC,qBAAqB,EAAE,KAAK,CAAC;yBAU1E,MAAM,WAAW,WAAW,CAAC,kBAAkB,EAAE,KAAK,CAAC;CAclE,CAAC"}
@@ -1,28 +1,28 @@
1
1
  import { formatNumber, formatDateTime, formatPrice } from "../../utils/index.js";
2
2
  import { useCallback, useMemo } from "react";
3
- import { useTranslation } from "react-i18next";
3
+ import { useTranslation } from "../../i18n/index.js";
4
4
  const useFormatter = () => {
5
- const { i18n } = useTranslation();
5
+ const { locale } = useTranslation();
6
6
  const formatNumberFn = useCallback(
7
7
  (value, options) => {
8
- return formatNumber(value, { lng: i18n.language, ...options });
8
+ return formatNumber(value, { lng: locale, ...options });
9
9
  },
10
- [i18n.language]
10
+ [locale]
11
11
  );
12
12
  const formatDateTimeFn = useCallback(
13
13
  (value, options) => {
14
14
  return formatDateTime(value, {
15
15
  ...options,
16
- lng: options.lng ?? i18n.language
16
+ lng: options.lng ?? locale
17
17
  });
18
18
  },
19
- [i18n.language]
19
+ [locale]
20
20
  );
21
21
  const formatPriceFn = useCallback(
22
22
  (value, options) => {
23
- return formatPrice(value, { ...options, lng: options.lng ?? i18n.language });
23
+ return formatPrice(value, { ...options, lng: options.lng ?? locale });
24
24
  },
25
- [i18n.language]
25
+ [locale]
26
26
  );
27
27
  return useMemo(
28
28
  () => ({
@@ -0,0 +1,8 @@
1
+ import { default as en } from './locales/en.json';
2
+ export declare const FALLBACK_LOCALE = "en";
3
+ export declare const LocaleContext: import('react').Context<string>;
4
+ export declare const useTranslation: () => {
5
+ t: (key: keyof typeof en) => string;
6
+ locale: string;
7
+ };
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/i18n/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAQnC,eAAO,MAAM,eAAe,OAAO,CAAC;AAEpC,eAAO,MAAM,aAAa,iCAAiC,CAAC;AAE5D,eAAO,MAAM,cAAc;aAKZ,MAAM,OAAO,EAAE;;CAI7B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { useContext, useMemo, createContext } from "react";
2
+ import en from "./locales/en.json.js";
3
+ import vi from "./locales/vi.json.js";
4
+ const translations = {
5
+ en,
6
+ vi
7
+ };
8
+ const FALLBACK_LOCALE = "en";
9
+ const LocaleContext = createContext(FALLBACK_LOCALE);
10
+ const useTranslation = () => {
11
+ const locale = useContext(LocaleContext);
12
+ return useMemo(() => {
13
+ return {
14
+ t: (key) => {
15
+ var _a, _b;
16
+ return ((_a = translations[locale]) == null ? void 0 : _a[key]) ?? ((_b = translations.en) == null ? void 0 : _b[key]) ?? key;
17
+ },
18
+ locale
19
+ };
20
+ }, [locale]);
21
+ };
22
+ export {
23
+ FALLBACK_LOCALE,
24
+ LocaleContext,
25
+ useTranslation
26
+ };
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ "updating": "Updating"
3
+ }
4
+ ;
5
+
6
+ export default _default;
@@ -0,0 +1,8 @@
1
+ const updating = "Updating";
2
+ const en = {
3
+ updating
4
+ };
5
+ export {
6
+ en as default,
7
+ updating
8
+ };
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ "updating": "Đang cập nhật"
3
+ };
4
+
5
+ export default _default;
@@ -0,0 +1,8 @@
1
+ const updating = "Đang cập nhật";
2
+ const vi = {
3
+ updating
4
+ };
5
+ export {
6
+ vi as default,
7
+ updating
8
+ };
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ import { AccordionGroupContext, getAccordionGroupDataAttributes, getAccordionGro
7
7
  import { AccordionGroupDataAttributes } from "./lib/accordion/accordion-group/types.js";
8
8
  import { AccordionSummary } from "./lib/accordion/accordion-summary/accordion-summary.js";
9
9
  import { AccordionSummaryVariant } from "./lib/accordion/accordion-summary/types.js";
10
+ import { Avatar } from "./lib/avatar/avatar.js";
10
11
  import { Badge } from "./lib/badge/badge.js";
11
12
  import { BlockSkeleton } from "./lib/loading/block-skeleton/block-skeleton.js";
12
13
  import { Box } from "./lib/box/box.js";
@@ -150,6 +151,7 @@ export {
150
151
  AccordionGroupDataAttributes,
151
152
  AccordionSummary,
152
153
  AccordionSummaryVariant,
154
+ Avatar,
153
155
  Badge,
154
156
  BlockSkeleton,
155
157
  Box,
@@ -0,0 +1,3 @@
1
+ import { AvatarProps } from './types';
2
+ export declare const Avatar: ({ ref, ..._props }: AvatarProps) => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/lib/avatar/avatar.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAyB,MAAM,SAAS,CAAC;AAQ7D,eAAO,MAAM,MAAM,uBAAwB,WAAW,4CAqFrD,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { getAvatarProps, getInitials, getAvatarStatusColor } from "./helpers.js";
4
+ import { isNil } from "lodash-es";
5
+ import { getColorVar } from "../../theme/palette.js";
6
+ import { useUpdateEffect } from "../../hooks/use-update-effect/index.js";
7
+ import { Primitive } from "../primitive/primitive.js";
8
+ const Avatar = ({ ref, ..._props }) => {
9
+ var _a, _b, _c;
10
+ const { src, name, color = "primary", size = 40, status, sm, md, lg, ...rest } = getAvatarProps(_props);
11
+ const [avatarSrc, setAvatarSrc] = useState(src);
12
+ useUpdateEffect(() => {
13
+ setAvatarSrc(src);
14
+ }, [src]);
15
+ return /* @__PURE__ */ jsxs(
16
+ Primitive,
17
+ {
18
+ ref,
19
+ ...rest,
20
+ sx: {
21
+ position: "relative",
22
+ ...createStyle({ size }),
23
+ ...rest.sx,
24
+ sm: {
25
+ ...createStyle(sm),
26
+ ...(_a = rest.sx) == null ? void 0 : _a.sm
27
+ },
28
+ md: {
29
+ ...createStyle(md),
30
+ ...(_b = rest.sx) == null ? void 0 : _b.md
31
+ },
32
+ lg: {
33
+ ...createStyle(lg),
34
+ ...(_c = rest.sx) == null ? void 0 : _c.lg
35
+ }
36
+ },
37
+ children: [
38
+ avatarSrc ? /* @__PURE__ */ jsx(
39
+ Primitive,
40
+ {
41
+ src,
42
+ alt: name ?? "",
43
+ onError: () => setAvatarSrc(void 0),
44
+ sx: {
45
+ position: "absolute",
46
+ inset: 0,
47
+ objectFit: "inherit",
48
+ borderRadius: "inherit"
49
+ },
50
+ as: "img"
51
+ }
52
+ ) : /* @__PURE__ */ jsx(
53
+ Primitive,
54
+ {
55
+ sx: {
56
+ position: "absolute",
57
+ inset: 0,
58
+ display: "flex",
59
+ alignItems: "center",
60
+ justifyContent: "center",
61
+ backgroundColor: getColorVar(`${color}.600`),
62
+ color: getColorVar("white"),
63
+ fontWeight: 600,
64
+ lineHeight: 1,
65
+ borderRadius: "inherit",
66
+ ...createInitialsStyle({ size }),
67
+ sm: createInitialsStyle(sm),
68
+ md: createInitialsStyle(md),
69
+ lg: createInitialsStyle(lg)
70
+ },
71
+ children: getInitials(name)
72
+ }
73
+ ),
74
+ status && /* @__PURE__ */ jsx(
75
+ Primitive,
76
+ {
77
+ as: "span",
78
+ sx: {
79
+ position: "absolute",
80
+ bottom: 0,
81
+ right: 0,
82
+ borderRadius: "50%",
83
+ backgroundColor: getAvatarStatusColor(status),
84
+ borderWidth: 2,
85
+ borderColor: getColorVar("white"),
86
+ ...createStatusStyle({ size }),
87
+ sm: createStatusStyle(sm),
88
+ md: createStatusStyle(md),
89
+ lg: createStatusStyle(lg)
90
+ }
91
+ }
92
+ )
93
+ ]
94
+ }
95
+ );
96
+ };
97
+ const createStyle = ({ size } = {}) => {
98
+ return {
99
+ width: size,
100
+ height: size,
101
+ minWidth: size,
102
+ minHeight: size
103
+ };
104
+ };
105
+ const createStatusStyle = ({ size } = {}) => {
106
+ if (isNil(size)) return {};
107
+ const dotSize = Math.round(size * 0.28);
108
+ return {
109
+ width: dotSize,
110
+ height: dotSize
111
+ };
112
+ };
113
+ const createInitialsStyle = ({ size } = {}) => {
114
+ if (isNil(size)) return {};
115
+ return {
116
+ fontSize: Math.round(size * 0.4)
117
+ };
118
+ };
119
+ export {
120
+ Avatar
121
+ };
@@ -0,0 +1,6 @@
1
+ import { AvatarProps, AvatarStatus } from './types';
2
+ export declare const getAvatarProps: (props: AvatarProps) => AvatarProps;
3
+ /** Resolve dimension from named size or custom number */
4
+ export declare const getInitials: (name?: string) => string;
5
+ export declare const getAvatarStatusColor: (status: AvatarStatus) => string | undefined;
6
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/avatar/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAYpD,eAAO,MAAM,cAAc,UAAW,WAAW,KAAG,WAEnD,CAAC;AAEF,yDAAyD;AAEzD,eAAO,MAAM,WAAW,2BAIvB,CAAC;AAEF,eAAO,MAAM,oBAAoB,WAAY,YAAY,uBAaxD,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { mergeComponentProps } from "../../utils/index.js";
2
+ import "lodash-es";
3
+ import { getColorVar } from "../../theme/palette.js";
4
+ const defaultProps = {
5
+ size: 40,
6
+ sx: {
7
+ borderRadius: "50%"
8
+ }
9
+ };
10
+ const getAvatarProps = (props) => {
11
+ return mergeComponentProps(defaultProps, props);
12
+ };
13
+ const getInitials = (name = "") => {
14
+ const parts = name.trim().split(/\s+/);
15
+ if (parts.length === 1) return parts[0].charAt(0).toUpperCase();
16
+ return (parts[0].charAt(0) + parts[parts.length - 1].charAt(0)).toUpperCase();
17
+ };
18
+ const getAvatarStatusColor = (status) => {
19
+ switch (status) {
20
+ case "online":
21
+ return getColorVar("green.600");
22
+ case "offline":
23
+ return getColorVar("neutral.600");
24
+ case "busy":
25
+ return getColorVar("red.600");
26
+ case "away":
27
+ return getColorVar("orange.600");
28
+ default:
29
+ return;
30
+ }
31
+ };
32
+ export {
33
+ getAvatarProps,
34
+ getAvatarStatusColor,
35
+ getInitials
36
+ };
@@ -0,0 +1,3 @@
1
+ export * from './types';
2
+ export * from './avatar';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/avatar/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { JSX } from 'react';
2
+ import { ColorVariant, PropsWithSx, ShallowMerge, ToResponsiveProps } from '../../types';
3
+ export type AvatarStatus = 'online' | 'offline' | 'busy' | 'away';
4
+ export type AvatarResponsiveProps = {
5
+ size?: number;
6
+ };
7
+ type AvatarHTMLProps = JSX.IntrinsicElements['div'];
8
+ export type AvatarProps = PropsWithSx<ShallowMerge<AvatarHTMLProps, ToResponsiveProps<AvatarResponsiveProps> & {
9
+ /** URL of the avatar image */
10
+ src?: string;
11
+ /** User's name — used for initials fallback and alt/aria-label */
12
+ name?: string;
13
+ /** Shape of the avatar */
14
+ /** Online status indicator */
15
+ status?: AvatarStatus;
16
+ color?: ColorVariant;
17
+ }>>;
18
+ export {};
19
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/avatar/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAErF,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAElE,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,eAAe,GAAG,GAAG,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAEpD,MAAM,MAAM,WAAW,GAAG,WAAW,CACnC,YAAY,CACV,eAAe,EACf,iBAAiB,CAAC,qBAAqB,CAAC,GAAG;IACzC,8BAA8B;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,8BAA8B;IAC9B,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB,CACF,CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"count-up.d.ts","sourceRoot":"","sources":["../../../src/lib/count-up/count-up.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,eAAO,MAAM,OAAO,+DAAwE,YAAY,4CAiCvG,CAAC"}
1
+ {"version":3,"file":"count-up.d.ts","sourceRoot":"","sources":["../../../src/lib/count-up/count-up.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAKvC,eAAO,MAAM,OAAO,+DAAwE,YAAY,4CAiCvG,CAAC"}
@@ -2,12 +2,12 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useRef, useEffect } from "react";
3
3
  import { useMergeRefs } from "@floating-ui/react";
4
4
  import { useMotionValue, useInView, useTransform, animate, motion } from "motion/react";
5
- import { useTranslation } from "react-i18next";
6
5
  import { formatNumber } from "../../utils/index.js";
6
+ import { useTranslation } from "../../i18n/index.js";
7
7
  import { getDecimalDigits } from "../../utils/common.js";
8
8
  const CountUp = ({ from = 0, to, duration = 2, formatNumberOptions, ref, ...props }) => {
9
9
  const rootRef = useRef(null);
10
- const { i18n } = useTranslation();
10
+ const { locale } = useTranslation();
11
11
  const mergedRef = useMergeRefs([ref, rootRef]);
12
12
  const maximumFractionDigits = Math.max(getDecimalDigits(from), getDecimalDigits(to));
13
13
  const count = useMotionValue(from);
@@ -15,7 +15,7 @@ const CountUp = ({ from = 0, to, duration = 2, formatNumberOptions, ref, ...prop
15
15
  const rounded = useTransform(
16
16
  count,
17
17
  (latest) => formatNumber(latest, {
18
- lng: i18n.language,
18
+ lng: locale,
19
19
  ...formatNumberOptions,
20
20
  maximumFractionDigits
21
21
  })
@@ -58,4 +58,5 @@ export * from './lightbox';
58
58
  export * from './cascader';
59
59
  export * from './primitive';
60
60
  export * from './price-label';
61
+ export * from './avatar';
61
62
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B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B,CAAC"}
1
+ {"version":3,"file":"input-number.d.ts","sourceRoot":"","sources":["../../../src/lib/input-number/input-number.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAW3C,eAAO,MAAM,WAAW,sGAYrB,gBAAgB,4CA0HlB,CAAC"}
@@ -2,10 +2,8 @@ import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import { useRef } from "react";
3
3
  import { useMergeRefs } from "@floating-ui/react";
4
4
  import { isNil } from "lodash-es";
5
- import classes from "./input-number.module.scss.js";
6
5
  import { Input } from "../input/input.js";
7
6
  import { useControllableState } from "../../hooks/use-controllable-state.js";
8
- import { cn } from "../../utils/stylesheet.js";
9
7
  import MinusIcon from "../../assets/svg/minus.svg.js";
10
8
  import PlusIcon from "../../assets/svg/plus.svg.js";
11
9
  import { IconButton } from "../icon-button/icon-button.js";
@@ -94,7 +92,14 @@ const InputNumber = ({
94
92
  value: valueAsString,
95
93
  onChange,
96
94
  transform: transformFn,
97
- className: cn(classes.input_number__input, className),
95
+ className,
96
+ sx: {
97
+ "&::-webkit-outer-spin-button, &::-webkit-inner-spin-button": {
98
+ WebkitAppearance: "none",
99
+ margin: 0,
100
+ ...props.sx
101
+ }
102
+ },
98
103
  onKeyDown,
99
104
  suffix: suffix ?? /* @__PURE__ */ jsx(Fragment, { children: step > 0 && /* @__PURE__ */ jsx(
100
105
  IconButton,
@@ -1,3 +1,3 @@
1
1
  import { LinkProps } from './types';
2
- export declare const Link: ({ children, ref, ..._props }: LinkProps) => import("@emotion/react/jsx-runtime").JSX.Element;
2
+ export declare const Link: ({ children, ref, ..._props }: LinkProps) => import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/lib/link/link.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAuB,MAAM,SAAS,CAAC;AAQzD,eAAO,MAAM,IAAI,iCAAkC,SAAS,qDAuD3D,CAAC"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/lib/link/link.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAuB,MAAM,SAAS,CAAC;AAOzD,eAAO,MAAM,IAAI,iCAAkC,SAAS,4CAoD3D,CAAC"}
@@ -1,16 +1,16 @@
1
- import { jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { ClassNames } from "@emotion/react";
3
3
  import { isNil } from "lodash-es";
4
4
  import { Link as Link$1 } from "react-router";
5
5
  import { getLinkProps } from "./helpers.js";
6
- import { useHoverLineEffect } from "../../hooks/use-hover-line-effect/index.js";
7
6
  import { Booleanish } from "../../constants/index.js";
7
+ import "react";
8
8
  import { mediaQuery } from "../../theme/screens.js";
9
9
  import "../../theme/palette.js";
10
10
  import { getTypographyVar } from "../../theme/typography.js";
11
+ import { createUnderlineEffect } from "../../utils/stylesheet.js";
11
12
  const Link = ({ children, ref, ..._props }) => {
12
13
  const { sx, textVariant, sm, md, lg, to, underline = false, className, ...rest } = getLinkProps(_props);
13
- const hoverLineEffectProps = useHoverLineEffect({ enabled: underline });
14
14
  const onClick = (e) => {
15
15
  var _a;
16
16
  if (e.currentTarget.getAttribute("aria-disabled") === Booleanish.True) {
@@ -25,14 +25,13 @@ const Link = ({ children, ref, ..._props }) => {
25
25
  Link$1,
26
26
  {
27
27
  to: to ?? "#",
28
- ...hoverLineEffectProps,
29
28
  className: cx(
30
29
  className,
31
- hoverLineEffectProps.className,
32
30
  css({
33
31
  '&[aria-disabled="true"]': {
34
32
  pointerEvents: "none"
35
33
  },
34
+ ...underline ? createUnderlineEffect() : {},
36
35
  ...createStyle({ textVariant }),
37
36
  ...sx,
38
37
  [mediaQuery("sm")]: {
@@ -1 +1 @@
1
- {"version":3,"file":"price-label.d.ts","sourceRoot":"","sources":["../../../src/lib/price-label/price-label.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA8C,eAAe,EAAE,MAAM,SAAS,CAAC;AAQtF,eAAO,MAAM,UAAU,WAAY,eAAe,4CAwEjD,CAAC"}
1
+ {"version":3,"file":"price-label.d.ts","sourceRoot":"","sources":["../../../src/lib/price-label/price-label.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA8C,eAAe,EAAE,MAAM,SAAS,CAAC;AAOtF,eAAO,MAAM,UAAU,WAAY,eAAe,4CAoFjD,CAAC"}
@@ -1,8 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { getPriceLabelProps } from "./helpers.js";
3
- import { isNil, isNumber } from "lodash-es";
4
- import { useTranslation } from "react-i18next";
5
- import { LocaleNamespaces } from "../../constants/index.js";
3
+ import { isNumber, isNil } from "lodash-es";
4
+ import { useTranslation } from "../../i18n/index.js";
6
5
  import { useFormatter } from "../../hooks/use-formatter/index.js";
7
6
  import { getColorVar } from "../../theme/palette.js";
8
7
  import { getSmallerTypographyVariants, getTypographyVar } from "../../theme/typography.js";
@@ -18,8 +17,14 @@ const PriceLabel = (_props) => {
18
17
  sm,
19
18
  md,
20
19
  lg,
20
+ showEqual = false,
21
21
  ...rest
22
22
  } = getPriceLabelProps(_props);
23
+ const isPriceEqual = price.currency && price.currency === (exchangePrice == null ? void 0 : exchangePrice.currency) && isNumber(price.value) && price.value === (exchangePrice == null ? void 0 : exchangePrice.value);
24
+ const isShowExchangePrice = (() => {
25
+ if (!exchangePrice) return false;
26
+ return showEqual ? true : !isPriceEqual;
27
+ })();
23
28
  return /* @__PURE__ */ jsxs(
24
29
  Primitive,
25
30
  {
@@ -53,7 +58,7 @@ const PriceLabel = (_props) => {
53
58
  )
54
59
  }
55
60
  ),
56
- exchangePrice && /* @__PURE__ */ jsxs(Fragment, { children: [
61
+ isShowExchangePrice && /* @__PURE__ */ jsxs(Fragment, { children: [
57
62
  orientation === "vertical" ? /* @__PURE__ */ jsx("br", {}) : /* @__PURE__ */ jsx(Fragment, { children: " " }),
58
63
  /* @__PURE__ */ jsx(
59
64
  Primitive,
@@ -78,7 +83,7 @@ const PriceLabel = (_props) => {
78
83
  price: {
79
84
  prefix: "(",
80
85
  suffix: ")",
81
- placeholder: isNil(exchangePrice.value),
86
+ placeholder: isNil(exchangePrice == null ? void 0 : exchangePrice.value),
82
87
  ...exchangePrice
83
88
  }
84
89
  }
@@ -91,7 +96,7 @@ const PriceLabel = (_props) => {
91
96
  );
92
97
  };
93
98
  const PriceRenderer = ({ price }) => {
94
- const { t } = useTranslation(LocaleNamespaces.Translation);
99
+ const { t } = useTranslation();
95
100
  const { formatPrice, formatNumber } = useFormatter();
96
101
  const { currency, value, isPending, prefix = "", suffix = "", placeholder } = price;
97
102
  if (currency && isNumber(value)) {
@@ -18,6 +18,7 @@ type PriceLabelExtendedProps = ToResponsiveProps<PriceLabelResponsiveProps> & {
18
18
  exchangePrice?: PriceLabelEntry;
19
19
  color?: ColorVariant;
20
20
  orientation?: 'horizontal' | 'vertical';
21
+ showEqual?: boolean;
21
22
  };
22
23
  export type PriceLabelProps = ShallowMerge<PrimitiveProps<JSX.IntrinsicElements['span']>, PriceLabelExtendedProps>;
23
24
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/price-label/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CA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C,EAAE,eAAe,CAAC;IAChC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,EAAE,uBAAuB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/lib/textarea/textarea.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAA2B,MAAM,SAAS,CAAC;AAUjE,eAAO,MAAM,QAAQ,uBAAwB,aAAa,4CAuHzD,CAAC"}
1
+ {"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../src/lib/textarea/textarea.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAA2B,MAAM,SAAS,CAAC;AAQjE,eAAO,MAAM,QAAQ,uBAAwB,aAAa,4CA8JzD,CAAC"}
@@ -3,11 +3,9 @@ import { useRef, useState } from "react";
3
3
  import { useMergeRefs } from "@floating-ui/react";
4
4
  import { isString } from "lodash-es";
5
5
  import { getTextareaProps } from "./helpers.js";
6
- import classes from "./textarea.module.scss.js";
7
- import { getSizeVariantState } from "../../utils/index.js";
8
- import { cn } from "../../utils/stylesheet.js";
9
- import "../../theme/palette.js";
6
+ import { getColorVar } from "../../theme/palette.js";
10
7
  import { getTypographyVar } from "../../theme/typography.js";
8
+ import { getSizeVariantState } from "../../utils/index.js";
11
9
  import { Primitive } from "../primitive/primitive.js";
12
10
  import { FormHelperText } from "../form-helper-text/form-helper-text.js";
13
11
  const Textarea = ({ ref, ..._props }) => {
@@ -75,52 +73,96 @@ const Textarea = ({ ref, ..._props }) => {
75
73
  setTypingValue(void 0);
76
74
  }, debounce);
77
75
  };
78
- return /* @__PURE__ */ jsxs(Primitive, { ...containerProps, className: cn(classes.textarea__container, containerProps == null ? void 0 : containerProps.className), children: [
79
- /* @__PURE__ */ jsx(
80
- Primitive,
81
- {
82
- ...mainProps,
83
- sx: {
84
- display: "flex",
85
- paddingTop: 4,
86
- paddingBottom: 4,
87
- ...createStyle({ size }),
88
- ...mainProps == null ? void 0 : mainProps.sx,
89
- sm: {
90
- ...createStyle(sm),
91
- ...(_a = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _a.sm
92
- },
93
- md: {
94
- ...createStyle(md),
95
- ...(_b = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _b.md
96
- },
97
- lg: {
98
- ...createStyle(lg),
99
- ...(_c = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _c.lg
100
- }
101
- },
102
- className: cn(classes.textarea__main, mainProps == null ? void 0 : mainProps.className),
103
- children: /* @__PURE__ */ jsx(
76
+ return /* @__PURE__ */ jsxs(
77
+ Primitive,
78
+ {
79
+ ...containerProps,
80
+ sx: {
81
+ position: "relative",
82
+ width: "100%",
83
+ ...containerProps == null ? void 0 : containerProps.sx
84
+ },
85
+ className: containerProps == null ? void 0 : containerProps.className,
86
+ children: [
87
+ /* @__PURE__ */ jsx(
104
88
  Primitive,
105
89
  {
106
- "aria-invalid": error,
107
- className: cn(
108
- classes.textarea__control,
109
- className
110
- ),
111
- ...rest,
112
- value: typingValue ?? value,
113
- ref: mergedRefs,
114
- onChange,
115
- onBlur,
116
- onFocus,
117
- as: "textarea"
90
+ ...mainProps,
91
+ sx: {
92
+ width: "100%",
93
+ borderWidth: 1,
94
+ borderStyle: "solid",
95
+ borderRadius: "0.5rem",
96
+ display: "flex",
97
+ paddingTop: 4,
98
+ paddingBottom: 4,
99
+ "&:has(textarea[aria-invalid])": {
100
+ borderColor: getColorVar("red.600")
101
+ },
102
+ "&:hover": {
103
+ borderColor: getColorVar("primary.300")
104
+ },
105
+ "&:has(textarea:focus)": {
106
+ outline: "none",
107
+ borderColor: getColorVar("primary.600"),
108
+ boxShadow: `0 1px 3px 0 ${getColorVar("primary.300")}, 0 1px 2px -1px ${getColorVar("primary.300")}`
109
+ },
110
+ "&:has(textarea:read-only)": {
111
+ cursor: "default",
112
+ pointerEvents: "none"
113
+ },
114
+ "&:has(textarea:disabled)": {
115
+ backgroundColor: getColorVar("neutral.300"),
116
+ color: getColorVar("neutral.500"),
117
+ borderColor: getColorVar("neutral.300"),
118
+ pointerEvents: "none"
119
+ },
120
+ ...createStyle({ size }),
121
+ ...mainProps == null ? void 0 : mainProps.sx,
122
+ sm: {
123
+ ...createStyle(sm),
124
+ ...(_a = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _a.sm
125
+ },
126
+ md: {
127
+ ...createStyle(md),
128
+ ...(_b = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _b.md
129
+ },
130
+ lg: {
131
+ ...createStyle(lg),
132
+ ...(_c = mainProps == null ? void 0 : mainProps.sx) == null ? void 0 : _c.lg
133
+ }
134
+ },
135
+ className: mainProps == null ? void 0 : mainProps.className,
136
+ children: /* @__PURE__ */ jsx(
137
+ Primitive,
138
+ {
139
+ "aria-invalid": error,
140
+ sx: {
141
+ width: "100%",
142
+ backgroundColor: "transparent",
143
+ "&:focus": {
144
+ outline: "none"
145
+ },
146
+ "&::placeholder": {
147
+ color: getColorVar("neutral.400")
148
+ }
149
+ },
150
+ className,
151
+ ...rest,
152
+ value: typingValue ?? value,
153
+ ref: mergedRefs,
154
+ onChange,
155
+ onBlur,
156
+ onFocus,
157
+ as: "textarea"
158
+ }
159
+ )
118
160
  }
119
- )
120
- }
121
- ),
122
- /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
123
- ] });
161
+ ),
162
+ /* @__PURE__ */ jsx(FormHelperText, { error, children: helperText })
163
+ ]
164
+ }
165
+ );
124
166
  };
125
167
  const createStyle = ({ size } = {}) => {
126
168
  const { inputPaddingX, textVariant } = getSizeVariantState(size);
@@ -1,3 +1,4 @@
1
1
  {
2
- "apply": "Apply"
2
+ "apply": "Apply",
3
+ "updating": "Updating"
3
4
  }
@@ -1,3 +1,4 @@
1
1
  {
2
- "apply": "Áp dụng"
2
+ "apply": "Áp dụng",
3
+ "updating": "Đang cập nhật"
3
4
  }
package/dist/style.css CHANGED
@@ -1,22 +1,4 @@
1
- ._hover_line_effect_dv0bz_1 {
2
- position: relative;
3
- }
4
- ._hover_line_effect_dv0bz_1::after {
5
- content: "";
6
- position: absolute;
7
- bottom: 0;
8
- left: 0;
9
- right: 0;
10
- transform: scaleX(0);
11
- transition-property: transform;
12
- transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
13
- background-color: var(--hover-line-color);
14
- height: var(--hover-line-height);
15
- transition-duration: var(--hover-line-duration);
16
- }
17
- ._hover_line_effect_dv0bz_1:hover::after {
18
- transform: scaleX(1);
19
- }@keyframes _ripple_1jvqm_7 {
1
+ @keyframes _ripple_1jvqm_7 {
20
2
  to {
21
3
  transform: scale(1);
22
4
  opacity: 0;
@@ -847,9 +829,6 @@
847
829
  }
848
830
  ._input_range_1yrkm_1:hover {
849
831
  border-color: var(--color-primary-300);
850
- }._input_number__input_2xvhv_1::-webkit-outer-spin-button, ._input_number__input_2xvhv_1::-webkit-inner-spin-button {
851
- -webkit-appearance: none;
852
- margin: 0;
853
832
  }._switch__container_19zrg_1 {
854
833
  display: flex;
855
834
  align-items: center;
@@ -936,46 +915,4 @@
936
915
  ._switch__main_19zrg_24:has(._switch__input_19zrg_12:disabled)::after {
937
916
  background-color: var(--color-neutral-400);
938
917
  border-color: var(--color-neutral-400);
939
- }._textarea__container_bs49u_1 {
940
- position: relative;
941
- width: 100%;
942
- }
943
-
944
- ._textarea__main_bs49u_6 {
945
- width: 100%;
946
- border-width: 1px;
947
- border-style: solid;
948
- border-radius: 0.5rem;
949
- }
950
- ._textarea__main_bs49u_6:has(textarea[aria-invalid]) {
951
- border-color: var(--color-red-600);
952
- }
953
- ._textarea__main_bs49u_6:hover {
954
- border-color: var(--color-primary-300);
955
- }
956
- ._textarea__main_bs49u_6:has(textarea:focus) {
957
- outline: none;
958
- border-color: var(--color-primary-600);
959
- box-shadow: 0 1px 3px 0 var(--color-primary-300), 0 1px 2px -1px var(--color-primary-300);
960
- }
961
- ._textarea__main_bs49u_6:has(textarea:read-only) {
962
- cursor: default;
963
- pointer-events: none;
964
- }
965
- ._textarea__main_bs49u_6:has(textarea:disabled) {
966
- background-color: var(--color-neutral-300);
967
- color: var(--color-neutral-500);
968
- border-color: var(--color-neutral-300);
969
- pointer-events: none;
970
- }
971
-
972
- ._textarea__control_bs49u_34 {
973
- width: 100%;
974
- background-color: transparent;
975
- }
976
- ._textarea__control_bs49u_34:focus {
977
- outline: none;
978
- }
979
- ._textarea__control_bs49u_34::placeholder {
980
- color: var(--color-neutral-400);
981
918
  }
@@ -2,6 +2,7 @@ import { Theme } from '@emotion/react';
2
2
  import { PropsWithChildren } from 'react';
3
3
  export type ThemeProviderProps = PropsWithChildren<{
4
4
  theme: Theme;
5
+ locale?: string;
5
6
  }>;
6
- export declare const ThemeProvider: ({ theme, children }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const ThemeProvider: ({ theme, locale, children }: ThemeProviderProps) => import("react/jsx-runtime").JSX.Element;
7
8
  //# sourceMappingURL=provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/theme/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAwD,MAAM,gBAAgB,CAAC;AACrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAO1C,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IACjD,KAAK,EAAE,KAAK,CAAC;CACd,CAAC,CAAC;AAEH,eAAO,MAAM,aAAa,wBAAyB,kBAAkB,4CAOpE,CAAC"}
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/theme/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAwD,MAAM,gBAAgB,CAAC;AACrG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAQ/C,MAAM,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;IACjD,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAEH,eAAO,MAAM,aAAa,gCAAmD,kBAAkB,4CAO9F,CAAC"}
@@ -4,10 +4,11 @@ import { getColorVar } from "./palette.js";
4
4
  import { flatten } from "flat";
5
5
  import { flatMap } from "lodash-es";
6
6
  import { getTypographyVar } from "./typography.js";
7
- const ThemeProvider = ({ theme, children }) => {
7
+ import { LocaleContext, FALLBACK_LOCALE } from "../i18n/index.js";
8
+ const ThemeProvider = ({ theme, locale = FALLBACK_LOCALE, children }) => {
8
9
  return /* @__PURE__ */ jsxs(ThemeProvider$1, { theme, children: [
9
10
  /* @__PURE__ */ jsx(Global, { styles: createGlobalStyle(theme) }),
10
- children
11
+ /* @__PURE__ */ jsx(LocaleContext.Provider, { value: locale, children })
11
12
  ] });
12
13
  };
13
14
  const createGlobalStyle = ({ palette, typography }) => {
@@ -4,6 +4,7 @@ import { SizeVariant, ColorVariant, ToResponsiveProps } from '../types';
4
4
  import { Get, Paths, SetRequired } from 'type-fest';
5
5
  export * from './common';
6
6
  export * from './query-params';
7
+ export { createUnderlineEffect } from './stylesheet';
7
8
  export declare const getColorShadesByVariant: (variant?: ColorVariant) => {
8
9
  main: string;
9
10
  contrastText: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,YAAY,EAAE,MAAM,OAAO,CAAC;AAI5F,OAAO,EAAe,MAAM,EAAqB,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,GAAG,EAAE,KAAK,E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G,gBAiCxD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,2BAC/D,iBAAiB,CAAC,CAAC,CAAC,SACrB,CAAC,UACA,MAAM,YACJ;IACR,SAAS,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC;CACpC,KACA,CAgBF,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,GAAG;IAC3D,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,MAAM,uBAAuB,mBAAmB,WASnF,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,GAAG;IACnF,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,WAAW,UAAW,MAAM,uBAAuB,kBAAkB,WAWjF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,GAAG;IAC/D,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,IAAI,GAAG,MAAM,GAAG,MAAM,uBAAuB,qBAAqB,WAyBvG,CAAC"}
@@ -4,6 +4,7 @@ import { getSmallerScreens } from "../theme/screens.js";
4
4
  import { getColorVar } from "../theme/palette.js";
5
5
  import { ensureArray, ensureBoolean, getDecimalDigits, getEnumValues, matchSearch, normalizeSearchText, omitEmpty, parseNumber, parseSvgString } from "./common.js";
6
6
  import { ArrayParamParser, BooleanParamParser, DateParamParser, EnumParamParser, NumberParamParser, StringParamParser, simplifyQueryParams } from "./query-params.js";
7
+ import { createUnderlineEffect } from "./stylesheet.js";
7
8
  const getColorShadesByVariant = (variant) => {
8
9
  switch (variant) {
9
10
  case "primary":
@@ -220,6 +221,7 @@ export {
220
221
  EnumParamParser,
221
222
  NumberParamParser,
222
223
  StringParamParser,
224
+ createUnderlineEffect,
223
225
  ensureArray,
224
226
  ensureBoolean,
225
227
  flattenChildren,
@@ -2,4 +2,11 @@ import { PropsWithSx, StyledCSS } from '../types';
2
2
  import { ClassValue } from 'clsx';
3
3
  export declare const cn: (...classes: ClassValue[]) => string;
4
4
  export declare const createSxInterpolation: (sx?: PropsWithSx["sx"]) => StyledCSS[];
5
+ type CreateUnderlineEffectOptions = {
6
+ color?: string;
7
+ duration?: number;
8
+ height?: string | number;
9
+ };
10
+ export declare const createUnderlineEffect: (options?: CreateUnderlineEffectOptions) => StyledCSS;
11
+ export {};
5
12
  //# sourceMappingURL=stylesheet.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../src/utils/stylesheet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,eAAgB,UAAU,EAAE,WAAqB,CAAC;AAEjE,eAAO,MAAM,qBAAqB,QAAQ,WAAW,CAAC,IAAI,CAAC,KAAQ,SAAS,EAW3E,CAAC"}
1
+ {"version":3,"file":"stylesheet.d.ts","sourceRoot":"","sources":["../../src/utils/stylesheet.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAExC,eAAO,MAAM,EAAE,eAAgB,UAAU,EAAE,WAAqB,CAAC;AAEjE,eAAO,MAAM,qBAAqB,QAAQ,WAAW,CAAC,IAAI,CAAC,KAAQ,SAAS,EAW3E,CAAC;AAEF,KAAK,4BAA4B,GAAG;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,qBAAqB,aAAa,4BAA4B,KAAQ,SAsBlF,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { isNumber } from "lodash-es";
1
2
  import { mediaQuery } from "../theme/screens.js";
2
3
  import "../theme/palette.js";
3
4
  import { clsx } from "clsx";
@@ -13,7 +14,30 @@ const createSxInterpolation = (sx = {}) => {
13
14
  }
14
15
  ];
15
16
  };
17
+ const createUnderlineEffect = (options = {}) => {
18
+ const { color = "currentColor", duration = 300, height = 1 } = options;
19
+ return {
20
+ position: "relative",
21
+ "&::after": {
22
+ content: '""',
23
+ position: "absolute",
24
+ bottom: 0,
25
+ left: 0,
26
+ right: 0,
27
+ transform: "scaleX(0)",
28
+ transitionProperty: "transform",
29
+ transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
30
+ backgroundColor: color,
31
+ height: isNumber(height) ? `${height}px` : height,
32
+ transitionDuration: `${duration}ms`
33
+ },
34
+ "&:hover::after": {
35
+ transform: "scaleX(1)"
36
+ }
37
+ };
38
+ };
16
39
  export {
17
40
  cn,
18
- createSxInterpolation
41
+ createSxInterpolation,
42
+ createUnderlineEffect
19
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@janbox/storefront-ui",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Storefront UI component library for Janbox",
5
5
  "author": "Janbox",
6
6
  "keywords": [
@@ -56,7 +56,6 @@
56
56
  "@emotion/react": "*",
57
57
  "react": ">=19.0.0",
58
58
  "react-dom": ">=19.0.0",
59
- "react-i18next": "*",
60
59
  "react-router": ">=7.0.0"
61
60
  },
62
61
  "dependencies": {
@@ -99,7 +98,6 @@
99
98
  "eslint-plugin-react-hooks": "^7.0.1",
100
99
  "eslint-plugin-unused-imports": "^4.4.1",
101
100
  "globals": "^17.4.0",
102
- "i18next": "^25.8.13",
103
101
  "prettier": "^3.8.1",
104
102
  "sass-embedded": "^1.97.3",
105
103
  "storybook": "^10.2.14",
@@ -1,12 +0,0 @@
1
- type UseHoverLineEffectOptions = {
2
- color?: string;
3
- duration?: number;
4
- height?: string | number;
5
- enabled?: boolean;
6
- };
7
- export declare const useHoverLineEffect: (options?: UseHoverLineEffectOptions) => {
8
- className: string;
9
- style: React.CSSProperties;
10
- };
11
- export {};
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-hover-line-effect/index.ts"],"names":[],"mappings":"AAMA,KAAK,yBAAyB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,kBAAkB,aAAa,yBAAyB;;WAYpD,KAAK,CAAC,aAAa;CAGnC,CAAC"}
@@ -1,19 +0,0 @@
1
- import { useMemo } from "react";
2
- import { isNumber } from "lodash-es";
3
- import classes from "./use-hover-line-effect.module.scss.js";
4
- const useHoverLineEffect = (options = {}) => {
5
- const { color = "currentColor", duration = 300, height = 1, enabled = true } = options;
6
- return useMemo(() => {
7
- return {
8
- className: enabled ? classes.hover_line_effect : "",
9
- style: enabled ? {
10
- "--hover-line-color": color,
11
- "--hover-line-duration": `${duration}ms`,
12
- "--hover-line-height": isNumber(height) ? `${height}px` : height
13
- } : {}
14
- };
15
- }, [color, duration, enabled, height]);
16
- };
17
- export {
18
- useHoverLineEffect
19
- };
@@ -1,8 +0,0 @@
1
- const hover_line_effect = "_hover_line_effect_dv0bz_1";
2
- const classes = {
3
- hover_line_effect
4
- };
5
- export {
6
- classes as default,
7
- hover_line_effect
8
- };
@@ -1,8 +0,0 @@
1
- const input_number__input = "_input_number__input_2xvhv_1";
2
- const classes = {
3
- input_number__input
4
- };
5
- export {
6
- classes as default,
7
- input_number__input
8
- };
@@ -1,14 +0,0 @@
1
- const textarea__container = "_textarea__container_bs49u_1";
2
- const textarea__main = "_textarea__main_bs49u_6";
3
- const textarea__control = "_textarea__control_bs49u_34";
4
- const classes = {
5
- textarea__container,
6
- textarea__main,
7
- textarea__control
8
- };
9
- export {
10
- classes as default,
11
- textarea__container,
12
- textarea__control,
13
- textarea__main
14
- };