@oceanbase/design 1.0.0-alpha.6 → 1.0.0-alpha.7

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 (70) hide show
  1. package/dist/design.min.js +1 -1
  2. package/dist/static/Inter-Medium.ea234620.woff2 +0 -0
  3. package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
  4. package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
  5. package/es/alert/index.js +1 -4
  6. package/es/app/style/index.js +3 -6
  7. package/es/config-provider/index.js +3 -1
  8. package/es/descriptions/hooks/useItems.d.ts +6 -6
  9. package/es/descriptions/style/index.js +3 -1
  10. package/es/fonts/Inter-Medium.woff2 +0 -0
  11. package/es/fonts/Inter-Regular.woff2 +0 -0
  12. package/es/fonts/Inter-SemiBold.woff2 +0 -0
  13. package/es/form/FormItem.d.ts +1 -1
  14. package/es/form/style/index.js +3 -1
  15. package/es/input/Input.d.ts +2 -0
  16. package/es/input/Input.js +23 -7
  17. package/es/input/Password.js +17 -5
  18. package/es/input/Search.js +17 -5
  19. package/es/input/TextArea.js +17 -5
  20. package/es/input/style/index.d.ts +9 -0
  21. package/es/input/style/index.js +17 -0
  22. package/es/input-number/index.js +11 -4
  23. package/es/input-number/style/index.d.ts +9 -0
  24. package/es/input-number/style/index.js +22 -0
  25. package/es/locale/ja-JP.js +2 -2
  26. package/es/segmented/index.d.ts +1 -0
  27. package/es/segmented/index.js +15 -7
  28. package/es/segmented/style/index.js +1 -0
  29. package/es/style/global.d.ts +4 -1
  30. package/es/style/global.js +75 -19
  31. package/es/table/index.d.ts +2 -2
  32. package/es/table/style/index.js +5 -1
  33. package/es/theme/default.d.ts +1 -1
  34. package/es/theme/default.js +1 -1
  35. package/es/typography/style/index.js +3 -0
  36. package/lib/alert/index.js +1 -3
  37. package/lib/app/style/index.js +2 -4
  38. package/lib/config-provider/index.js +1 -1
  39. package/lib/descriptions/hooks/useItems.d.ts +6 -6
  40. package/lib/descriptions/style/index.js +3 -0
  41. package/lib/fonts/Inter-Medium.woff2 +0 -0
  42. package/lib/fonts/Inter-Regular.woff2 +0 -0
  43. package/lib/fonts/Inter-SemiBold.woff2 +0 -0
  44. package/lib/form/FormItem.d.ts +1 -1
  45. package/lib/form/style/index.js +4 -1
  46. package/lib/input/Input.d.ts +2 -0
  47. package/lib/input/Input.js +35 -12
  48. package/lib/input/Password.js +20 -3
  49. package/lib/input/Search.js +30 -11
  50. package/lib/input/TextArea.js +20 -3
  51. package/lib/input/style/index.d.ts +9 -0
  52. package/lib/input/style/index.js +46 -0
  53. package/lib/input-number/index.js +18 -3
  54. package/lib/input-number/style/index.d.ts +9 -0
  55. package/lib/input-number/style/index.js +51 -0
  56. package/lib/locale/ja-JP.js +2 -2
  57. package/lib/segmented/index.d.ts +1 -0
  58. package/lib/segmented/index.js +10 -3
  59. package/lib/segmented/style/index.js +1 -0
  60. package/lib/style/global.d.ts +4 -1
  61. package/lib/style/global.js +77 -10
  62. package/lib/table/index.d.ts +2 -2
  63. package/lib/table/style/index.js +5 -1
  64. package/lib/theme/default.d.ts +1 -1
  65. package/lib/theme/default.js +1 -1
  66. package/lib/typography/style/index.js +3 -0
  67. package/package.json +3 -2
  68. package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
  69. package/es/fonts/Inter.woff2 +0 -0
  70. package/lib/fonts/Inter.woff2 +0 -0
@@ -1,36 +1,69 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
4
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
5
  import React from 'react';
2
6
  import { useStyleRegister } from '@ant-design/cssinjs';
3
7
  import themeConfig from "../theme";
4
- import interFont from "../fonts/Inter.woff2";
5
- import consolasFont from "../fonts/Consolas.woff2";
6
- import helveticaNeueFont from "../fonts/HelveticaNeue.woff2";
8
+ import interRegular from "../fonts/Inter-Regular.woff2";
9
+ import interMedium from "../fonts/Inter-Medium.woff2";
10
+ import interSemibold from "../fonts/Inter-SemiBold.woff2";
11
+ import consolas from "../fonts/Consolas.woff2";
12
+ import helveticaNeue from "../fonts/HelveticaNeue.woff2";
7
13
  import 'antd/dist/reset.css';
8
14
  import { Fragment as _Fragment } from "react/jsx-runtime";
9
15
  import { jsx as _jsx } from "react/jsx-runtime";
10
- var genGlobalStyle = function genGlobalStyle(token) {
11
- return [
12
- // Priority: local font > self-hosting font > remote font
13
- {
16
+ var genGlobalStyle = function genGlobalStyle(token, prefixCls) {
17
+ var antCls = ".".concat(prefixCls);
18
+ var buttonComponentCls = "".concat(antCls, "-btn");
19
+ var typographyComponentCls = "".concat(antCls, "-typography");
20
+ var menuComponentCls = "".concat(antCls, "-menu");
21
+ return [{
14
22
  '@font-face': {
15
- fontFamily: "'Inter'",
16
- src: "local('Inter'), url(".concat(interFont, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2') format('woff2')"),
23
+ fontFamily: 'Inter',
24
+ fontStyle: 'lighter',
25
+ fontWeight: 300,
26
+ // load priority: local font > self-hosting font > remote font
27
+ src: "local('Inter'), url(".concat(interRegular, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2') format('woff2')"),
17
28
  fontDisplay: 'swap'
18
29
  }
19
30
  }, {
20
31
  '@font-face': {
21
- fontFamily: "'Consolas'",
22
- src: "local('Consolas'), url(".concat(consolasFont, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2') format('woff2')"),
32
+ fontFamily: 'Inter',
33
+ fontStyle: 'normal',
34
+ fontWeight: 400,
35
+ src: "local('Inter'), url(".concat(interMedium, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2') format('woff2')"),
23
36
  fontDisplay: 'swap'
24
37
  }
25
38
  }, {
26
39
  '@font-face': {
27
- fontFamily: "'Helvetica Neue'",
28
- src: "local('Helvetica Neue'), url(".concat(helveticaNeueFont, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2') format('woff2')"),
40
+ fontFamily: 'Inter',
41
+ fontStyle: 'medium',
42
+ fontWeight: 500,
43
+ src: "local('Inter'), url(".concat(interMedium, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2') format('woff2')"),
29
44
  fontDisplay: 'swap'
30
45
  }
31
- },
32
- // Global element styles
33
- {
46
+ }, {
47
+ '@font-face': {
48
+ fontFamily: 'Inter',
49
+ fontStyle: 'semibold',
50
+ fontWeight: 600,
51
+ src: "local('Inter'), url(".concat(interSemibold, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*2aG4RJIdUGYAAAAAAAAAAAAADmfOAQ/Inter.woff2') format('woff2')"),
52
+ fontDisplay: 'swap'
53
+ }
54
+ }, {
55
+ '@font-face': {
56
+ fontFamily: 'Consolas',
57
+ src: "local('Consolas'), url(".concat(consolas, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*R8bMTqAdGWgAAAAAAAAAAAAADmfOAQ/Consolas.woff2') format('woff2')"),
58
+ fontDisplay: 'swap'
59
+ }
60
+ }, {
61
+ '@font-face': {
62
+ fontFamily: 'Helvetica Neue',
63
+ src: "local('Helvetica Neue'), url(".concat(helveticaNeue, ") format('woff2'), url('https://mdn.alipayobjects.com/huamei_fhnyvh/afts/file/A*3EzqR6aYJMkAAAAAAAAAAAAADmfOAQ/HelveticaNeue.woff2') format('woff2')"),
64
+ fontDisplay: 'swap'
65
+ }
66
+ }, _defineProperty(_defineProperty(_defineProperty({
34
67
  'pre, code, kbd, samp': {
35
68
  fontFamily: token.fontFamilyCode
36
69
  },
@@ -39,10 +72,33 @@ var genGlobalStyle = function genGlobalStyle(token) {
39
72
  },
40
73
  '.rc-virtual-list-scrollbar-thumb': {
41
74
  background: "".concat(token.colorFillSecondary, " !important")
75
+ },
76
+ // link with href or data-aspm-param^="obcloud_openLink= show underline on hover
77
+ // except disabled and antd element
78
+ 'a[href], a[data-aspm-param^="obcloud_openLink="]': _defineProperty({}, "&:not([disabled]):not([class^=\"".concat(prefixCls, "-\"]):hover"), {
79
+ textDecoration: 'underline'
80
+ })
81
+ }, "".concat(buttonComponentCls).concat(buttonComponentCls, "-link:not(").concat(buttonComponentCls, "-disabled)"), {
82
+ '&[href], &[data-aspm-param^="obcloud_openLink="]': {
83
+ '&:hover': {
84
+ textDecoration: 'underline'
85
+ }
86
+ }
87
+ }), "".concat(typographyComponentCls, ":not(").concat(typographyComponentCls, "-disabled)"), {
88
+ '&[href], &[data-aspm-param^="obcloud_openLink="]': {
89
+ '&:hover': {
90
+ textDecoration: 'underline'
91
+ }
92
+ }
93
+ }), "".concat(menuComponentCls), _defineProperty({}, "".concat(menuComponentCls, "-item"), _defineProperty({}, "".concat(menuComponentCls, "-title-content"), {
94
+ 'a:hover': {
95
+ textDecoration: 'none'
42
96
  }
43
- }];
97
+ })))];
44
98
  };
45
- var GlobalStyle = function GlobalStyle() {
99
+ var GlobalStyle = function GlobalStyle(_ref2) {
100
+ var _ref2$prefixCls = _ref2.prefixCls,
101
+ prefixCls = _ref2$prefixCls === void 0 ? 'ant' : _ref2$prefixCls;
46
102
  var _themeConfig$useToken = themeConfig.useToken(),
47
103
  theme = _themeConfig$useToken.theme,
48
104
  token = _themeConfig$useToken.token;
@@ -54,7 +110,7 @@ var GlobalStyle = function GlobalStyle() {
54
110
  // Empty hashId for global styles
55
111
  order: -1000 // Inject before other styles
56
112
  }, function () {
57
- return genGlobalStyle(token);
113
+ return genGlobalStyle(token, prefixCls);
58
114
  });
59
115
  return wrapSSR( /*#__PURE__*/_jsx(_Fragment, {}));
60
116
  };
@@ -38,8 +38,8 @@ declare const _default: (<RecordType extends AnyObject = AnyObject>(props: Table
38
38
  SELECTION_ALL: "SELECT_ALL";
39
39
  SELECTION_INVERT: "SELECT_INVERT";
40
40
  SELECTION_NONE: "SELECT_NONE";
41
- Column: <RecordType extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType>) => null;
42
- ColumnGroup: <RecordType_1 extends import("antd/es/_util/type").AnyObject>(_: import("antd/es/table/ColumnGroup").ColumnGroupProps<RecordType_1>) => null;
41
+ Column: <RecordType_1 extends import("antd/es/_util/type").AnyObject>(_: import("antd").TableColumnProps<RecordType_1>) => null;
42
+ ColumnGroup: <RecordType_2 extends import("antd/es/_util/type").AnyObject>(_: import("antd/es/table/ColumnGroup").ColumnGroupProps<RecordType_2>) => null;
43
43
  Summary: typeof Summary;
44
44
  useStyle: (prefixCls: string) => {
45
45
  wrapSSR: (node: ReactNode) => ReactElement<any, string | React.JSXElementConstructor<any>>;
@@ -46,7 +46,11 @@ export var genTableStyle = function genTableStyle(token) {
46
46
  }, "& ~ td", {
47
47
  borderBottom: 'none'
48
48
  })), "tr > td", {
49
- transition: "background ".concat(token.motionDurationMid)
49
+ fontWeight: token.fontWeight,
50
+ transition: "background ".concat(token.motionDurationMid),
51
+ a: {
52
+ fontWeight: token.fontWeightStrong
53
+ }
50
54
  }), "".concat(componentCls, "-placeholder td"), {}), "".concat(componentCls, "-empty-wrapper"), {
51
55
  minHeight: calc(360).sub(calc(token.paddingSM).mul(2).equal()).equal(),
52
56
  display: 'flex',
@@ -1,5 +1,5 @@
1
1
  export declare const fontFamilyEn = "Inter, 'Noto sans', sans-serif, Roboto, 'Open Sans', 'Segoe UI', 'Helvetica Neue', 'Helvetica, Arial', 'Apple Color Emoji'";
2
- export declare const fontWeightWeakEn = 400;
2
+ export declare const fontWeightWeakEn = 300;
3
3
  export declare const fontWeightEn = 500;
4
4
  export declare const fontWeightStrongEn = 600;
5
5
  declare const _default: import("antd").ThemeConfig;
@@ -23,7 +23,7 @@ var borderRadius = 4;
23
23
  var borderRadiusMD = 6;
24
24
  var borderRadiusLG = 8;
25
25
  export var fontFamilyEn = "Inter, 'Noto sans', sans-serif, Roboto, 'Open Sans', 'Segoe UI', 'Helvetica Neue', 'Helvetica, Arial', 'Apple Color Emoji'";
26
- export var fontWeightWeakEn = 400;
26
+ export var fontWeightWeakEn = 300;
27
27
  export var fontWeightEn = 500;
28
28
  export var fontWeightStrongEn = 600;
29
29
  var defaultTheme = {
@@ -46,14 +46,17 @@ export var genTypographyStyle = function genTypographyStyle(token) {
46
46
  }
47
47
  }), "".concat(componentCls).concat(componentCls, "-edit-content"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-div&"), {
48
48
  insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
49
+ insetBlockStart: 0,
49
50
  marginTop: negativeMarginOffset,
50
51
  marginBottom: calc('1em').sub(marginOffset).equal()
51
52
  }), "".concat(componentCls, "-span&"), {
52
53
  insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
54
+ insetBlockStart: 0,
53
55
  marginTop: negativeMarginOffset,
54
56
  marginBottom: negativeMarginOffset
55
57
  }), "".concat(componentCls, "-h1&, ").concat(componentCls, "-h2&, ").concat(componentCls, "-h3&, ").concat(componentCls, "-h4&, ").concat(componentCls, "-h5&"), {
56
58
  insetInlineStart: calc(token.paddingSM).mul(-1).equal(),
59
+ insetBlockStart: 0,
57
60
  marginTop: "".concat(negativeMarginOffset, " !important"),
58
61
  marginBottom: "".concat(negativeMarginOffset, " !important")
59
62
  }));
@@ -39,7 +39,6 @@ var import_icons = require("@oceanbase/icons");
39
39
  var import_classnames = __toESM(require("classnames"));
40
40
  var import_config_provider = __toESM(require("../config-provider"));
41
41
  var import_style = __toESM(require("./style"));
42
- var import_theme = __toESM(require("../theme"));
43
42
  __reExport(alert_exports, require("antd/es/alert"), module.exports);
44
43
  var import_jsx_runtime = require("react/jsx-runtime");
45
44
  var iconMapOutlined = {
@@ -59,8 +58,7 @@ var Alert = ({
59
58
  className,
60
59
  ...restProps
61
60
  }) => {
62
- const { token } = import_theme.default.useToken();
63
- const type = banner && !typeProp ? "warning" : typeProp;
61
+ const type = (banner && !typeProp ? "warning" : typeProp) || "info";
64
62
  const { getPrefixCls } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
65
63
  const prefixCls = getPrefixCls("alert", customizePrefixCls);
66
64
  const { wrapSSR } = (0, import_style.default)(prefixCls);
@@ -25,10 +25,8 @@ __export(style_exports, {
25
25
  module.exports = __toCommonJS(style_exports);
26
26
  var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
27
  var genAppStyle = (token) => {
28
- const { componentCls } = token;
29
- return {
30
- [`${componentCls}`]: {}
31
- };
28
+ const { antCls, componentCls } = token;
29
+ return {};
32
30
  };
33
31
  var style_default = (prefixCls) => {
34
32
  const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("App", (token) => {
@@ -221,7 +221,7 @@ var ConfigProvider = ({
221
221
  injectStaticFunction: false
222
222
  },
223
223
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_cssinjs.StyleProvider, { ...mergedStyleProviderProps, children: [
224
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_global.default, {}),
224
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_global.default, { prefixCls: restProps.prefixCls }),
225
225
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_app.default, { component: false, ...appProps, children: [
226
226
  children,
227
227
  parentExtendedContext.injectStaticFunction && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_static_function.default, {})
@@ -5,17 +5,17 @@ export default function useItems(items?: DescriptionsItemType[], children?: Reac
5
5
  key?: React.Key;
6
6
  label?: React.ReactNode;
7
7
  span?: number | "filled" | {
8
- xxl?: number;
9
- xl?: number;
10
- lg?: number;
11
- md?: number;
12
- sm?: number;
13
8
  xs?: number;
9
+ sm?: number;
10
+ md?: number;
11
+ lg?: number;
12
+ xl?: number;
13
+ xxl?: number;
14
14
  };
15
15
  style?: React.CSSProperties;
16
- className?: string;
17
16
  classNames?: Partial<Record<"label" | "content", string>>;
18
17
  styles?: Partial<Record<"label" | "content", React.CSSProperties>>;
18
+ className?: string;
19
19
  labelStyle?: React.CSSProperties;
20
20
  contentStyle?: React.CSSProperties;
21
21
  }[];
@@ -68,6 +68,9 @@ var genDescriptionsStyle = (token) => {
68
68
  return {
69
69
  [`${componentCls}`]: {
70
70
  ...genVerticalStyle("default", token),
71
+ [`${componentCls}-item-label`]: {
72
+ fontWeight: token.fontWeightWeak
73
+ },
71
74
  [`${componentCls}-item-container`]: {
72
75
  [`${componentCls}-item-content`]: {
73
76
  paddingRight: 12,
Binary file
Binary file
Binary file
@@ -4,7 +4,7 @@ import type { FormItemProps as AntFormItemProps } from 'antd/es/form';
4
4
  import type { TooltipProps } from '../tooltip';
5
5
  declare const AntFormItem: (<Values = any>(props: AntFormItemProps<Values>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
6
6
  useStatus: () => {
7
- status?: "" | "warning" | "error" | "success" | "validating";
7
+ status?: "" | "success" | "warning" | "error" | "validating";
8
8
  errors: React.ReactNode[];
9
9
  warnings: React.ReactNode[];
10
10
  };
@@ -28,9 +28,12 @@ var genFormStyle = (token) => {
28
28
  const { componentCls, calc } = token;
29
29
  return {
30
30
  [componentCls]: {
31
- [`${componentCls}-item-extra`]: {
31
+ [`${componentCls}-item-explain, ${componentCls}-item-extra`]: {
32
32
  paddingTop: token.paddingXXS,
33
33
  fontSize: token.fontSizeSM
34
+ },
35
+ [`${componentCls}-item-explain + ${componentCls}-item-extra`]: {
36
+ paddingTop: 0
34
37
  }
35
38
  },
36
39
  [`${componentCls}${componentCls}-vertical`]: {
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { InputProps as AntInputProps, InputRef } from 'antd';
3
+ import type { ShowCountFormatter } from 'rc-input/es/interface';
3
4
  export * from 'antd/es/input/Input';
4
5
  export interface InputLocale {
5
6
  placeholder?: string;
@@ -7,5 +8,6 @@ export interface InputLocale {
7
8
  export interface InputProps extends AntInputProps {
8
9
  locale?: InputLocale;
9
10
  }
11
+ export declare const showCountFormatter: ShowCountFormatter;
10
12
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<InputRef>>;
11
13
  export default Input;
@@ -30,31 +30,54 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/input/Input.tsx
31
31
  var Input_exports = {};
32
32
  __export(Input_exports, {
33
- default: () => Input_default
33
+ default: () => Input_default,
34
+ showCountFormatter: () => showCountFormatter
34
35
  });
35
36
  module.exports = __toCommonJS(Input_exports);
36
37
  var import_react = require("react");
37
38
  var import_antd = require("antd");
38
39
  var import_config_provider = __toESM(require("../config-provider"));
39
40
  var import_en_US = __toESM(require("../locale/en-US"));
41
+ var import_style = __toESM(require("./style"));
40
42
  __reExport(Input_exports, require("antd/es/input/Input"), module.exports);
41
43
  var import_jsx_runtime = require("react/jsx-runtime");
42
- var Input = (0, import_react.forwardRef)(({ locale: customLocale, ...restProps }, ref) => {
43
- var _a, _b;
44
- const { locale: contextLocale } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
45
- const inputLocale = {
46
- placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
47
- ...import_en_US.default.Input,
48
- ...contextLocale == null ? void 0 : contextLocale.Input,
49
- ...customLocale
50
- };
51
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Input, { ref, placeholder: inputLocale.placeholder, ...restProps });
52
- });
44
+ var showCountFormatter = ({ count, maxLength }) => {
45
+ return `${count}/${maxLength}`;
46
+ };
47
+ var Input = (0, import_react.forwardRef)(
48
+ ({ prefixCls: customizePrefixCls, locale: customLocale, showCount, ...restProps }, ref) => {
49
+ var _a, _b;
50
+ const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
51
+ import_config_provider.default.ConfigContext
52
+ );
53
+ const inputLocale = {
54
+ placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
55
+ ...import_en_US.default.Input,
56
+ ...contextLocale == null ? void 0 : contextLocale.Input,
57
+ ...customLocale
58
+ };
59
+ const prefixCls = getPrefixCls("input", customizePrefixCls);
60
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
61
+ return wrapSSR(
62
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
63
+ import_antd.Input,
64
+ {
65
+ ref,
66
+ prefixCls: customizePrefixCls,
67
+ placeholder: inputLocale.placeholder,
68
+ showCount: showCount === true ? { formatter: showCountFormatter } : showCount,
69
+ ...restProps
70
+ }
71
+ )
72
+ );
73
+ }
74
+ );
53
75
  if (process.env.NODE_ENV !== "production") {
54
76
  Input.displayName = "Input";
55
77
  }
56
78
  var Input_default = Input;
57
79
  // Annotate the CommonJS export names for ESM import in node:
58
80
  0 && (module.exports = {
81
+ showCountFormatter,
59
82
  ...require("antd/es/input/Input")
60
83
  });
@@ -37,19 +37,36 @@ var import_react = require("react");
37
37
  var import_antd = require("antd");
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
39
  var import_en_US = __toESM(require("../locale/en-US"));
40
+ var import_Input = require("./Input");
41
+ var import_style = __toESM(require("./style"));
40
42
  __reExport(Password_exports, require("antd/es/input/Password"), module.exports);
41
43
  var import_jsx_runtime = require("react/jsx-runtime");
42
44
  var Password = (0, import_react.forwardRef)(
43
- ({ locale: customLocale, ...restProps }, ref) => {
45
+ ({ prefixCls: customizePrefixCls, locale: customLocale, showCount, ...restProps }, ref) => {
44
46
  var _a, _b;
45
- const { locale: contextLocale } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
47
+ const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
48
+ import_config_provider.default.ConfigContext
49
+ );
50
+ const prefixCls = getPrefixCls("input", customizePrefixCls);
51
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
46
52
  const inputLocale = {
47
53
  placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
48
54
  ...import_en_US.default.Input,
49
55
  ...contextLocale == null ? void 0 : contextLocale.Input,
50
56
  ...customLocale
51
57
  };
52
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Input.Password, { ref, placeholder: inputLocale.placeholder, ...restProps });
58
+ return wrapSSR(
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
+ import_antd.Input.Password,
61
+ {
62
+ ref,
63
+ prefixCls: customizePrefixCls,
64
+ placeholder: inputLocale.placeholder,
65
+ showCount: showCount === true ? { formatter: import_Input.showCountFormatter } : showCount,
66
+ ...restProps
67
+ }
68
+ )
69
+ );
53
70
  }
54
71
  );
55
72
  if (process.env.NODE_ENV !== "production") {
@@ -37,19 +37,38 @@ var import_react = require("react");
37
37
  var import_antd = require("antd");
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
39
  var import_en_US = __toESM(require("../locale/en-US"));
40
+ var import_Input = require("./Input");
41
+ var import_style = __toESM(require("./style"));
40
42
  __reExport(Search_exports, require("antd/es/input/Search"), module.exports);
41
43
  var import_jsx_runtime = require("react/jsx-runtime");
42
- var Search = (0, import_react.forwardRef)(({ locale: customLocale, ...restProps }, ref) => {
43
- var _a, _b;
44
- const { locale: contextLocale } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
45
- const inputLocale = {
46
- placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
47
- ...import_en_US.default.Input,
48
- ...contextLocale == null ? void 0 : contextLocale.Input,
49
- ...customLocale
50
- };
51
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Input.Search, { ref, placeholder: inputLocale.placeholder, ...restProps });
52
- });
44
+ var Search = (0, import_react.forwardRef)(
45
+ ({ prefixCls: customizePrefixCls, locale: customLocale, showCount, ...restProps }, ref) => {
46
+ var _a, _b;
47
+ const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
48
+ import_config_provider.default.ConfigContext
49
+ );
50
+ const prefixCls = getPrefixCls("input", customizePrefixCls);
51
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
52
+ const inputLocale = {
53
+ placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
54
+ ...import_en_US.default.Input,
55
+ ...contextLocale == null ? void 0 : contextLocale.Input,
56
+ ...customLocale
57
+ };
58
+ return wrapSSR(
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
+ import_antd.Input.Search,
61
+ {
62
+ ref,
63
+ prefixCls: customizePrefixCls,
64
+ placeholder: inputLocale.placeholder,
65
+ showCount: showCount === true ? { formatter: import_Input.showCountFormatter } : showCount,
66
+ ...restProps
67
+ }
68
+ )
69
+ );
70
+ }
71
+ );
53
72
  if (process.env.NODE_ENV !== "production") {
54
73
  Search.displayName = "Search";
55
74
  }
@@ -37,19 +37,36 @@ var import_react = require("react");
37
37
  var import_antd = require("antd");
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
39
  var import_en_US = __toESM(require("../locale/en-US"));
40
+ var import_Input = require("./Input");
41
+ var import_style = __toESM(require("./style"));
40
42
  __reExport(TextArea_exports, require("antd/es/input/TextArea"), module.exports);
41
43
  var import_jsx_runtime = require("react/jsx-runtime");
42
44
  var TextArea = (0, import_react.forwardRef)(
43
- ({ locale: customLocale, ...restProps }, ref) => {
45
+ ({ prefixCls: customizePrefixCls, locale: customLocale, showCount, ...restProps }, ref) => {
44
46
  var _a, _b;
45
- const { locale: contextLocale } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
47
+ const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
48
+ import_config_provider.default.ConfigContext
49
+ );
50
+ const prefixCls = getPrefixCls("input", customizePrefixCls);
51
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
46
52
  const inputLocale = {
47
53
  placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
48
54
  ...import_en_US.default.Input,
49
55
  ...contextLocale == null ? void 0 : contextLocale.Input,
50
56
  ...customLocale
51
57
  };
52
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Input.TextArea, { ref, placeholder: inputLocale.placeholder, ...restProps });
58
+ return wrapSSR(
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
60
+ import_antd.Input.TextArea,
61
+ {
62
+ ref,
63
+ prefixCls: customizePrefixCls,
64
+ placeholder: inputLocale.placeholder,
65
+ showCount: showCount === true ? { formatter: import_Input.showCountFormatter } : showCount,
66
+ ...restProps
67
+ }
68
+ )
69
+ );
53
70
  }
54
71
  );
55
72
  if (process.env.NODE_ENV !== "production") {
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from '../../theme/interface';
3
+ export type InputToken = FullToken<'Input'>;
4
+ export declare const genInputStyle: GenerateStyle<InputToken>;
5
+ declare const _default: (prefixCls: string) => {
6
+ wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ hashId: string;
8
+ };
9
+ export default _default;
@@ -0,0 +1,46 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/input/style/index.ts
20
+ var style_exports = {};
21
+ __export(style_exports, {
22
+ default: () => style_default,
23
+ genInputStyle: () => genInputStyle
24
+ });
25
+ module.exports = __toCommonJS(style_exports);
26
+ var import_genComponentStyleHook = require("../../_util/genComponentStyleHook");
27
+ var genInputStyle = (token) => {
28
+ const { componentCls } = token;
29
+ return {
30
+ [`${componentCls}-affix-wrapper`]: {
31
+ [`${componentCls}-suffix`]: {
32
+ fontSize: token.fontSizeSM
33
+ }
34
+ }
35
+ };
36
+ };
37
+ var style_default = (prefixCls) => {
38
+ const useStyle = (0, import_genComponentStyleHook.genComponentStyleHook)("Input", (token) => {
39
+ return [genInputStyle(token)];
40
+ });
41
+ return useStyle(prefixCls);
42
+ };
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ genInputStyle
46
+ });
@@ -37,19 +37,34 @@ var import_antd = require("antd");
37
37
  var import_react = __toESM(require("react"));
38
38
  var import_config_provider = __toESM(require("../config-provider"));
39
39
  var import_en_US = __toESM(require("../locale/en-US"));
40
+ var import_style = __toESM(require("./style"));
40
41
  __reExport(input_number_exports, require("antd/es/input-number"), module.exports);
41
42
  var import_jsx_runtime = require("react/jsx-runtime");
42
43
  var InternalInputNumber = import_react.default.forwardRef(
43
- ({ locale: customLocale, ...restProps }, ref) => {
44
+ ({ prefixCls: customizePrefixCls, locale: customLocale, ...restProps }, ref) => {
44
45
  var _a, _b;
45
- const { locale: contextLocale } = (0, import_react.useContext)(import_config_provider.default.ConfigContext);
46
+ const { getPrefixCls, locale: contextLocale } = (0, import_react.useContext)(
47
+ import_config_provider.default.ConfigContext
48
+ );
49
+ const prefixCls = getPrefixCls("input-number", customizePrefixCls);
50
+ const { wrapSSR } = (0, import_style.default)(prefixCls);
46
51
  const inputNumberLocale = {
47
52
  placeholder: ((_a = contextLocale == null ? void 0 : contextLocale.global) == null ? void 0 : _a.inputPlaceholder) || ((_b = import_en_US.default.global) == null ? void 0 : _b.inputPlaceholder),
48
53
  ...import_en_US.default.InputNumber,
49
54
  ...contextLocale == null ? void 0 : contextLocale.InputNumber,
50
55
  ...customLocale
51
56
  };
52
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.InputNumber, { ref, placeholder: inputNumberLocale.placeholder, ...restProps });
57
+ return wrapSSR(
58
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
59
+ import_antd.InputNumber,
60
+ {
61
+ ref,
62
+ prefixCls: customizePrefixCls,
63
+ placeholder: inputNumberLocale.placeholder,
64
+ ...restProps
65
+ }
66
+ )
67
+ );
53
68
  }
54
69
  );
55
70
  var InputNumber = InternalInputNumber;
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { FullToken, GenerateStyle } from '../../theme/interface';
3
+ export type InputNumberToken = FullToken<'InputNumber'>;
4
+ export declare const genInputStyle: GenerateStyle<InputNumberToken>;
5
+ declare const _default: (prefixCls: string) => {
6
+ wrapSSR: (node: import("react").ReactNode) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ hashId: string;
8
+ };
9
+ export default _default;