@cfxjs/sirius-next-common 0.2.7 → 0.2.9

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.
@@ -13,6 +13,7 @@ import "../../chunk-YEUH2K6Z.js";
13
13
  import "../../chunk-DQGLZCIG.js";
14
14
 
15
15
  // src/components/SearchInput/index.tsx
16
+ import { useRef } from "react";
16
17
  import clsx from "clsx";
17
18
  import { jsx, jsxs } from "react/jsx-runtime";
18
19
  var Arrow = (props) => /* @__PURE__ */ jsx(
@@ -81,8 +82,9 @@ var SearchInput = ({
81
82
  onKeyDown,
82
83
  ...props
83
84
  }) => {
85
+ const inputRef = useRef(null);
84
86
  return /* @__PURE__ */ jsxs("div", { className: clsx("flex items-center w-fit", wrapperClassName), children: [
85
- !inSearch && searchTips && /* @__PURE__ */ jsx("div", { className: "flex-center h-full mr-3px shrink-0", children: /* @__PURE__ */ jsx(InfoIconWithTooltip, { info: searchTips, size: 18 }) }),
87
+ !inSearch && searchTips && /* @__PURE__ */ jsx("div", { className: "flex-center h-full mr-8px shrink-0", children: /* @__PURE__ */ jsx(InfoIconWithTooltip, { info: searchTips, size: 18 }) }),
86
88
  /* @__PURE__ */ jsxs(
87
89
  "div",
88
90
  {
@@ -113,10 +115,11 @@ var SearchInput = ({
113
115
  onKeyDown?.(e);
114
116
  },
115
117
  className: "outline-none border-none flex-1 w-0",
118
+ ref: inputRef,
116
119
  ...props
117
120
  }
118
121
  ),
119
- !!current && !!total && /* @__PURE__ */ jsxs("div", { className: "shrink-0", children: [
122
+ !!current && !!total && /* @__PURE__ */ jsxs("div", { className: "shrink-0 color-#9B9EAC", children: [
120
123
  current,
121
124
  "/",
122
125
  total
@@ -127,7 +130,10 @@ var SearchInput = ({
127
130
  /* @__PURE__ */ jsx(
128
131
  "div",
129
132
  {
130
- onClick: findNext,
133
+ onClick: () => {
134
+ findNext();
135
+ inputRef.current?.focus();
136
+ },
131
137
  className: "border-l-#BDBDBD border-l-1px border-l-solid w-26px h-26px flex-center cursor-pointer",
132
138
  children: /* @__PURE__ */ jsx(Arrow, {})
133
139
  }
@@ -135,7 +141,10 @@ var SearchInput = ({
135
141
  /* @__PURE__ */ jsx(
136
142
  "div",
137
143
  {
138
- onClick: findPrevious,
144
+ onClick: () => {
145
+ findPrevious();
146
+ inputRef.current?.focus();
147
+ },
139
148
  className: "border-l-#BDBDBD border-l-1px border-l-solid w-26px h-26px flex-center cursor-pointer",
140
149
  children: /* @__PURE__ */ jsx(Arrow, { className: "rotate-180" })
141
150
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/SearchInput/index.tsx"],"sourcesContent":["import { ComponentProps } from 'react';\nimport { InfoIconWithTooltip } from '../InfoIconWithTooltip';\nimport clsx from 'clsx';\n\nconst Arrow: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"6\"\n viewBox=\"0 0 10 6\"\n fill=\"none\"\n {...props}\n >\n <path\n d=\"M0.75 0.75L4.78922 4.75L8.82843 0.75\"\n stroke=\"#74798C\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nconst Close: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n >\n <path\n d=\"M7.91671 2.08331L2.08337 7.91665\"\n stroke=\"#74798C\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M2.08337 2.08331L7.91671 7.91665\"\n stroke=\"#74798C\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport const SearchInput: React.FC<\n ComponentProps<'input'> & {\n findNext: () => void;\n findPrevious: () => void;\n current: number | null;\n total: number | null;\n wrapperClassName?: string;\n searchTips?: string;\n inSearch?: boolean;\n exit?: () => void;\n }\n> = ({\n current,\n total,\n className,\n wrapperClassName,\n inSearch,\n searchTips,\n findNext,\n findPrevious,\n exit,\n onKeyDown,\n ...props\n}) => {\n return (\n <div className={clsx('flex items-center w-fit', wrapperClassName)}>\n {!inSearch && searchTips && (\n <div className=\"flex-center h-full mr-3px shrink-0\">\n <InfoIconWithTooltip info={searchTips} size={18} />\n </div>\n )}\n <div\n className={clsx(\n 'flex items-center flex-1 bg-#fff border-#BDBDBD border-1px border-solid rounded-4px',\n )}\n >\n <div\n className={clsx(\n 'px-5px w-160px h-26px flex items-center gap-5px',\n className,\n )}\n >\n <input\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === 'ArrowDown') {\n findNext();\n e.preventDefault();\n }\n if (e.key === 'ArrowUp') {\n findPrevious();\n e.preventDefault();\n }\n onKeyDown?.(e);\n }}\n className=\"outline-none border-none flex-1 w-0\"\n {...props}\n />\n {!!current && !!total && (\n <div className=\"shrink-0\">\n {current}/{total}\n </div>\n )}\n </div>\n <div\n onClick={findNext}\n className=\"border-l-#BDBDBD border-l-1px border-l-solid w-26px h-26px flex-center cursor-pointer\"\n >\n <Arrow />\n </div>\n <div\n onClick={findPrevious}\n className=\"border-l-#BDBDBD border-l-1px border-l-solid w-26px h-26px flex-center cursor-pointer\"\n >\n <Arrow className=\"rotate-180\" />\n </div>\n {inSearch && (\n <div\n onClick={exit}\n className=\"border-l-#BDBDBD border-l-1px border-l-solid w-26px h-26px flex-center cursor-pointer\"\n >\n <Close />\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAEA,OAAO,UAAU;AAWb,cAWF,YAXE;AATJ,IAAM,QAAiD,WACrD;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACJ,GAAG;AAAA,IAEJ;AAAA,MAAC;AAA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AA,sBACnB;AACA,kCAAY,CAAC;AAAA,oBACf;AAAA,oBACA,WAAU;AAAA,oBACT,GAAG;AAAA;AAAA,gBACN;AAAA,gBACC,CAAC,CAAC,WAAW,CAAC,CAAC,SACd,qBAAC,SAAI,WAAU,YACZ;AAAA;AAAA,kBAAQ;AAAA,kBAAE;AAAA,mBACb;AAAA;AAAA;AAAA,UAEJ;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,WAAU;AAAA,cAEV,8BAAC,SAAM;AAAA;AAAA,UACT;AAAA,UACA;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,WAAU;AAAA,cAEV,8BAAC,SAAM,WAAU,cAAa;AAAA;AAAA,UAChC;AAAA,UACC,YACC;AAAA,YAAC;AAAA;AAAA,cACC,SAAS;AAAA,cACT,WAAU;AAAA,cAEV,8BAAC,SAAM;AAAA;AAAA,UACT;AAAA;AAAA;AAAA,IAEJ;AAAA,KACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/components/SearchInput/index.tsx"],"sourcesContent":["import { ComponentProps, useRef } from 'react';\nimport { InfoIconWithTooltip } from '../InfoIconWithTooltip';\nimport clsx from 'clsx';\n\nconst Arrow: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"6\"\n viewBox=\"0 0 10 6\"\n fill=\"none\"\n {...props}\n >\n <path\n d=\"M0.75 0.75L4.78922 4.75L8.82843 0.75\"\n stroke=\"#74798C\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nconst Close: React.FC<React.SVGProps<SVGSVGElement>> = props => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"10\"\n height=\"10\"\n viewBox=\"0 0 10 10\"\n fill=\"none\"\n >\n <path\n d=\"M7.91671 2.08331L2.08337 7.91665\"\n stroke=\"#74798C\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M2.08337 2.08331L7.91671 7.91665\"\n stroke=\"#74798C\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n);\n\nexport const SearchInput: React.FC<\n ComponentProps<'input'> & {\n findNext: () => void;\n findPrevious: () => void;\n current: number | null;\n total: number | null;\n wrapperClassName?: string;\n searchTips?: string;\n inSearch?: boolean;\n exit?: () => void;\n }\n> = ({\n current,\n total,\n className,\n wrapperClassName,\n inSearch,\n searchTips,\n findNext,\n findPrevious,\n exit,\n onKeyDown,\n ...props\n}) => {\n const inputRef = useRef<HTMLInputElement>(null);\n return (\n <div className={clsx('flex items-center w-fit', wrapperClassName)}>\n {!inSearch && searchTips && (\n <div className=\"flex-center h-full mr-8px shrink-0\">\n <InfoIconWithTooltip info={searchTips} size={18} />\n </div>\n )}\n <div\n className={clsx(\n 'flex items-center flex-1 bg-#fff border-#BDBDBD border-1px border-solid rounded-4px',\n )}\n >\n <div\n className={clsx(\n 'px-5px w-160px h-26px flex items-center gap-5px',\n className,\n )}\n >\n <input\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === 'ArrowDown') {\n findNext();\n e.preventDefault();\n }\n if (e.key === 'ArrowUp') {\n findPrevious();\n e.preventDefault();\n }\n onKeyDown?.(e);\n }}\n className=\"outline-none border-none flex-1 w-0\"\n ref={inputRef}\n {...props}\n />\n {!!current && !!total && (\n <div className=\"shrink-0 color-#9B9EAC\">\n {current}/{total}\n </div>\n )}\n </div>\n <div\n onClick={() => {\n findNext();\n // focus on input to make it easier to use keyboard\n inputRef.current?.focus();\n }}\n className=\"border-l-#BDBDBD border-l-1px border-l-solid w-26px h-26px flex-center cursor-pointer\"\n >\n <Arrow />\n </div>\n <div\n onClick={() => {\n findPrevious();\n // focus on input to make it easier to use keyboard\n inputRef.current?.focus();\n }}\n className=\"border-l-#BDBDBD border-l-1px border-l-solid w-26px h-26px flex-center cursor-pointer\"\n >\n <Arrow className=\"rotate-180\" />\n </div>\n {inSearch && (\n <div\n onClick={exit}\n className=\"border-l-#BDBDBD border-l-1px border-l-solid w-26px h-26px flex-center cursor-pointer\"\n >\n <Close />\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAyB,cAAc;AAEvC,OAAO,UAAU;AAWb,cAWF,YAXE;AATJ,IAAM,QAAiD,WACrD;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IACJ,GAAG;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC,GAAE;AAAA,QACF,QAAO;AAAA,QACP,aAAY;AAAA,QACZ,eAAc;AAAA,QACd,gBAAe;AAAA;AAAA,IACjB;AAAA;AACF;AAGF,IAAM,QAAiD,WACrD;AAAA,EAAC;AAAA;AAAA,IACC,OAAM;AAAA,IACN,OAAM;AAAA,IACN,QAAO;AAAA,IACP,SAAQ;AAAA,IACR,MAAK;AAAA,IAEL;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA;AAAA,MACjB;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA,UACZ,eAAc;AAAA,UACd,gBAAe;AAAA;AAAA,MACjB;AAAA;AAAA;AACF;AAGK,IAAM,cAWT,CAAC;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,QAAM,WAAW,OAAyB,IAAI;AAC9C,SACE,qBAAC,SAAI,WAAW,KAAK,2BAA2B,gBAAgB,GAC7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/dist/uno.css CHANGED
@@ -82,8 +82,8 @@
82
82
  .mr-0\.2857rem{margin-right:0.2857rem;}
83
83
  .mr-10px{margin-right:10px;}
84
84
  .mr-2\.93rem{margin-right:2.93rem;}
85
- .mr-3px{margin-right:3px;}
86
85
  .mr-4px{margin-right:4px;}
86
+ .mr-8px{margin-right:8px;}
87
87
  .mt-\[-0\.2857rem\]{margin-top:-0.2857rem;}
88
88
  .mt-\[-10px\]{margin-top:-10px;}
89
89
  .mt-\[-12px\]{margin-top:-12px;}
@@ -443,6 +443,7 @@
443
443
  .text-\[\#74798C\],
444
444
  .text-\#74798c{--un-text-opacity:1;color:rgb(116 121 140 / var(--un-text-opacity));}
445
445
  .text-\[\#777791\]{--un-text-opacity:1;color:rgb(119 119 145 / var(--un-text-opacity));}
446
+ .color-\#9B9EAC,
446
447
  .text-\[\#9b9eac\]{--un-text-opacity:1;color:rgb(155 158 172 / var(--un-text-opacity));}
447
448
  .text-\[\#FA5D5D\]{--un-text-opacity:1;color:rgb(250 93 93 / var(--un-text-opacity));}
448
449
  .text-\[var\(--theme-color-gray2\)\]{color:var(--theme-color-gray2);}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfxjs/sirius-next-common",
3
- "version": "0.2.7",
3
+ "version": "0.2.9",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist/**"
@@ -75,9 +75,9 @@
75
75
  "typescript": "^5.4.2",
76
76
  "unocss": "0.58.6",
77
77
  "vitest": "3.2.3",
78
- "@cfxjs/sirius-next-eslint-config": "0.0.0",
79
78
  "@cfxjs/sirius-next-i18n": "0.2.6",
80
- "@cfxjs/sirius-next-typescript-config": "0.0.0"
79
+ "@cfxjs/sirius-next-typescript-config": "0.0.0",
80
+ "@cfxjs/sirius-next-eslint-config": "0.0.0"
81
81
  },
82
82
  "publishConfig": {
83
83
  "access": "public"