@baton8/general-components 3.1.0-alpha.4 → 3.1.0-alpha.5

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.
@@ -21,7 +21,7 @@ export declare const Badge: import("react").ForwardRefExoticComponent<import("..
21
21
  * 見た目のバリアント。
22
22
  * @defaultValue `"solid"`
23
23
  */
24
- variant?: "solid" | "light" | "outline" | undefined;
24
+ variant?: "outline" | "solid" | "light" | undefined;
25
25
  /**
26
26
  * サイズ。
27
27
  * @defaultValue `"medium"`
@@ -42,7 +42,7 @@ export declare const GeneralIcon: import("react").ForwardRefExoticComponent<impo
42
42
  * アイコンの反転。
43
43
  * @defaultValue `"none"`
44
44
  */
45
- flip?: "both" | "none" | "horizontal" | "vertical" | undefined;
45
+ flip?: "none" | "both" | "horizontal" | "vertical" | undefined;
46
46
  /**
47
47
  * アイコンの回転角度。
48
48
  * @defaultValue `0`
@@ -53,6 +53,8 @@ export declare const Input: import("react").ForwardRefExoticComponent<import("..
53
53
  type?: "date" | "time" | "search" | "month" | "text" | "tel" | "url" | "email" | "datetime-local" | "week" | undefined;
54
54
  /** */
55
55
  inputMode?: "search" | "numeric" | "decimal" | "text" | "none" | "tel" | "url" | "email" | undefined;
56
+ /** */
57
+ placeholder?: string | undefined;
56
58
  /**
57
59
  * @defaultValue `"off"`
58
60
  */
@@ -23,7 +23,7 @@ export declare const Textarea: import("react").ForwardRefExoticComponent<import(
23
23
  * リサイズ可能な方向。
24
24
  * @defaultValue `"vertical"`
25
25
  */
26
- resize?: "both" | "none" | "horizontal" | "vertical" | undefined;
26
+ resize?: "none" | "both" | "horizontal" | "vertical" | undefined;
27
27
  /** */
28
28
  inputMode?: "search" | "numeric" | "decimal" | "text" | "none" | "tel" | "url" | "email" | undefined;
29
29
  /**
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { MouseEvent, ReactNode } from "react";
2
2
  /**
3
3
  * @group React コンポーネント
4
4
  * @category React コンポーネント
@@ -11,6 +11,10 @@ export declare const StepperItem: import("react").ForwardRefExoticComponent<impo
11
11
  /** */
12
12
  scheme?: "primary" | "secondary" | "blue" | "red" | "green" | "pink" | "yellow" | "purple" | "orange" | "gray" | "gold" | "silver" | "bronze" | undefined;
13
13
  /** */
14
+ href?: string | undefined;
15
+ /** */
16
+ onClick?: ((event: MouseEvent<HTMLElement>) => unknown) | undefined;
17
+ /** */
14
18
  children?: ReactNode;
15
19
  /** */
16
20
  className?: string | undefined;
package/dist/index.js CHANGED
@@ -888,6 +888,9 @@
888
888
  box-sizing: content-box;
889
889
  flex-grow: 1;
890
890
  flex-shrink: 1;
891
+ &::placeholder {
892
+ color: ${x("gray",5)};
893
+ }
891
894
  &:disabled {
892
895
  cursor: inherit;
893
896
  }
@@ -906,7 +909,7 @@
906
909
  color: ${x("gray",5)};
907
910
  flex-grow: 0;
908
911
  flex-shrink: 0;
909
- `},Ir=(0,r.forwardRef)(((o,t)=>{var n,i,{value:a,name:l,size:c="medium",isCompact:d=!1,type:b="text",inputMode:p,autoComplete:u="off",autoFocus:f,isError:m,isRequired:y,isDisabled:g,onSet:h,onChange:O,onBlur:v,children:x,className:j,inputClassName:w,inputId:$}=o,q=function(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(o[t[n]]=e[t[n]])}return o}(o,["value","name","size","isCompact","type","inputMode","autoComplete","autoFocus","isError","isRequired","isDisabled","onSet","onChange","onBlur","children","className","inputClassName","inputId"]);const k=(0,r.useContext)(Ve),N=null!==(n=null!=m?m:null==k?void 0:k.isError)&&void 0!==n&&n,P=null!==(i=null!=g?g:null==k?void 0:k.isDisabled)&&void 0!==i&&i,S=(0,r.useCallback)((e=>{const r=e.target.value;null==h||h(r),null==O||O(e)}),[h,O]),C=Se(x),z=C.find((e=>e.type===Pr)),I=C.find((e=>e.type===Cr));return(0,e.jsx)("label",{className:j,css:zr.root,"data-qlib-size":c,"data-qlib-compact":d,"data-qlib-disabled":P,"data-qlib-error":N,children:(0,e.jsxs)("div",{css:zr.inputContainer,children:[z,(0,e.jsx)("input",Object.assign({css:zr.input,className:w,id:$,ref:t,value:a,name:l,type:b,inputMode:p,autoComplete:u,autoFocus:f,required:y,disabled:P,onChange:null!=h||null!=O?S:void 0,onBlur:v,"aria-invalid":N},q)),Er(b)&&(0,e.jsx)("div",{css:zr.builtinAddon,children:(0,e.jsx)(gr,{icon:"time"===b?s.faClock:s.faCalendar})}),I]})})}));Ir.displayName="Input";const Er=e=>"date"===e||"time"===e||"datetime-local"===e||"month"===e||"week"===e;const Dr=e=>a.css`
912
+ `},Ir=(0,r.forwardRef)(((o,t)=>{var n,i,{value:a,name:l,size:c="medium",isCompact:d=!1,type:b="text",inputMode:p,placeholder:u,autoComplete:f="off",autoFocus:m,isError:y,isRequired:g,isDisabled:h,onSet:O,onChange:v,onBlur:x,children:j,className:w,inputClassName:$,inputId:q}=o,k=function(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(o[t[n]]=e[t[n]])}return o}(o,["value","name","size","isCompact","type","inputMode","placeholder","autoComplete","autoFocus","isError","isRequired","isDisabled","onSet","onChange","onBlur","children","className","inputClassName","inputId"]);const N=(0,r.useContext)(Ve),P=null!==(n=null!=y?y:null==N?void 0:N.isError)&&void 0!==n&&n,S=null!==(i=null!=h?h:null==N?void 0:N.isDisabled)&&void 0!==i&&i,C=(0,r.useCallback)((e=>{const r=e.target.value;null==O||O(r),null==v||v(e)}),[O,v]),z=Se(j),I=z.find((e=>e.type===Pr)),E=z.find((e=>e.type===Cr));return(0,e.jsx)("label",{className:w,css:zr.root,"data-qlib-size":c,"data-qlib-compact":d,"data-qlib-disabled":S,"data-qlib-error":P,children:(0,e.jsxs)("div",{css:zr.inputContainer,children:[I,(0,e.jsx)("input",Object.assign({css:zr.input,className:$,id:q,ref:t,value:a,name:l,type:b,inputMode:p,placeholder:u,autoComplete:f,autoFocus:m,required:g,disabled:S,onChange:null!=O||null!=v?C:void 0,onBlur:x,"aria-invalid":P},k)),Er(b)&&(0,e.jsx)("div",{css:zr.builtinAddon,children:(0,e.jsx)(gr,{icon:"time"===b?s.faClock:s.faCalendar})}),E]})})}));Ir.displayName="Input";const Er=e=>"date"===e||"time"===e||"datetime-local"===e||"month"===e||"week"===e;const Dr=e=>a.css`
910
913
  // 文字サイズ
911
914
  &[data-qlib-size="small"] {
912
915
  --qlib-font-size: ${$(3)};
@@ -2339,14 +2342,21 @@
2339
2342
  stroke: ${x(e,5)};
2340
2343
  }
2341
2344
  }
2342
- `},Ui=(0,r.forwardRef)(((r,o)=>{var{rank:t,scheme:n="primary",useMedalColors:i=!0,className:a}=r,l=function(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(o[t[n]]=e[t[n]])}return o}(r,["rank","scheme","useMedalColors","className"]);const{trans:s,transNumber:c}=D("rankView"),d=i?t<=1?"gold":t<=2?"silver":t<=3?"bronze":"normal":"normal";return(0,e.jsx)("span",Object.assign({css:Yi.root,className:a,ref:o},l,{children:(0,e.jsxs)("svg",{css:Yi.icon(n),viewBox:"0 0 576 512","aria-label":s("label",{rank:t}),"data-qlib-type":d,children:[(0,e.jsx)("path",{d:"M309 106c11.4-7 19-19.7 19-34c0-22.1-17.9-40-40-40s-40 17.9-40 40c0 14.4 7.6 27 19 34L209.7 220.6c-9.1 18.2-32.7 23.4-48.6 10.7L72 160c5-6.7 8-15 8-24c0-22.1-17.9-40-40-40S0 113.9 0 136s17.9 40 40 40c.2 0 .5 0 .7 0L86.4 427.4c5.5 30.4 32 52.6 63 52.6H426.6c30.9 0 57.4-22.1 63-52.6L535.3 176c.2 0 .5 0 .7 0c22.1 0 40-17.9 40-40s-17.9-40-40-40s-40 17.9-40 40c0 9 3 17.3 8 24l-89.1 71.3c-15.9 12.7-39.5 7.5-48.6-10.7L309 106z"}),(0,e.jsx)("text",{x:"50%",y:"62%",fontSize:"320",textAnchor:"middle",dominantBaseline:"central","aria-hidden":!0,children:c(t)}),(0,e.jsx)("text",{x:"50%",y:"62%",fontSize:"320",textAnchor:"middle",dominantBaseline:"central","aria-hidden":!0,children:c(t)})]})}))}));Ui.displayName="RankView";const _i=(0,r.createContext)({activeIndex:-1,count:0}),Gi=_i.Provider,Ki=(0,r.createContext)({index:0}),Qi=Ki.Provider;var Wi=function(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(o[t[n]]=e[t[n]])}return o};const Ji=e=>a.css`
2345
+ `},Ui=(0,r.forwardRef)(((r,o)=>{var{rank:t,scheme:n="primary",useMedalColors:i=!0,className:a}=r,l=function(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(o[t[n]]=e[t[n]])}return o}(r,["rank","scheme","useMedalColors","className"]);const{trans:s,transNumber:c}=D("rankView"),d=i?t<=1?"gold":t<=2?"silver":t<=3?"bronze":"normal":"normal";return(0,e.jsx)("span",Object.assign({css:Yi.root,className:a,ref:o},l,{children:(0,e.jsxs)("svg",{css:Yi.icon(n),viewBox:"0 0 576 512","aria-label":s("label",{rank:t}),"data-qlib-type":d,children:[(0,e.jsx)("path",{d:"M309 106c11.4-7 19-19.7 19-34c0-22.1-17.9-40-40-40s-40 17.9-40 40c0 14.4 7.6 27 19 34L209.7 220.6c-9.1 18.2-32.7 23.4-48.6 10.7L72 160c5-6.7 8-15 8-24c0-22.1-17.9-40-40-40S0 113.9 0 136s17.9 40 40 40c.2 0 .5 0 .7 0L86.4 427.4c5.5 30.4 32 52.6 63 52.6H426.6c30.9 0 57.4-22.1 63-52.6L535.3 176c.2 0 .5 0 .7 0c22.1 0 40-17.9 40-40s-17.9-40-40-40s-40 17.9-40 40c0 9 3 17.3 8 24l-89.1 71.3c-15.9 12.7-39.5 7.5-48.6-10.7L309 106z"}),(0,e.jsx)("text",{x:"50%",y:"62%",fontSize:"320",textAnchor:"middle",dominantBaseline:"central","aria-hidden":!0,children:c(t)}),(0,e.jsx)("text",{x:"50%",y:"62%",fontSize:"320",textAnchor:"middle",dominantBaseline:"central","aria-hidden":!0,children:c(t)})]})}))}));Ui.displayName="RankView";const _i=(0,r.createContext)({activeIndex:-1,count:0}),Gi=_i.Provider,Ki=(0,r.createContext)({index:0}),Qi=Ki.Provider;var Wi=function(e,r){var o={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.indexOf(t)<0&&(o[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(t=Object.getOwnPropertySymbols(e);n<t.length;n++)r.indexOf(t[n])<0&&Object.prototype.propertyIsEnumerable.call(e,t[n])&&(o[t[n]]=e[t[n]])}return o};const Ji={root:e=>a.css`
2343
2346
  --qlib-highlight-color: ${x(e,5)};
2347
+ list-style: none;
2348
+ flex-grow: 0;
2349
+ flex-shrink: 0;
2350
+ `,inner:a.css`
2344
2351
  column-gap: ${$(2)};
2345
2352
  display: flex;
2346
2353
  flex-direction: column;
2347
2354
  flex-grow: 0;
2348
2355
  flex-shrink: 0;
2349
- `,Zi=(0,r.forwardRef)(((o,t)=>{var{scheme:n="primary",children:i,className:a}=o;const l=Wi(o,["scheme","children","className"]),{index:s}=l,c=Wi(l,["index"]),d=(0,r.useMemo)((()=>({index:s})),[s]);return(0,e.jsx)("li",Object.assign({css:Ji(n),className:a,ref:t},c,{children:(0,e.jsx)(Qi,{value:d,children:i})}))}));Zi.displayName="StepperItem";const Xi={root:a.css`
2356
+ &[data-clickable="true"] {
2357
+ cursor: pointer;
2358
+ }
2359
+ `},Zi=(0,r.forwardRef)(((o,t)=>{var{scheme:n="primary",href:i,onClick:a,children:l,className:s}=o;const c=Wi(o,["scheme","href","onClick","children","className"]),{index:d}=c,b=Wi(c,["index"]),p=(0,r.useMemo)((()=>({index:d})),[d]);return(0,e.jsx)("li",Object.assign({css:Ji.root(n),className:s,ref:t},b,{children:(0,e.jsx)(Qi,{value:p,children:null!=i?(0,e.jsx)("a",{css:Ji.inner,href:i,onClick:a,"data-clickable":!0,children:l}):null!=a?(0,e.jsx)("button",{css:Ji.inner,onClick:a,"data-clickable":!0,children:l}):(0,e.jsx)("div",{css:Ji.inner,children:l})})}))}));Zi.displayName="StepperItem";const Xi={root:a.css`
2350
2360
  column-gap: ${$(4)};
2351
2361
  row-gap: ${$(4)};
2352
2362
  display: flex;
@@ -2380,7 +2390,7 @@
2380
2390
  &[data-status="completed"] {
2381
2391
  border-color: var(--qlib-highlight-color);
2382
2392
  background-color: ${x("white")};
2383
- color: ${x("primary",5)};
2393
+ color: var(--qlib-highlight-color);
2384
2394
  }
2385
2395
  &[data-status="active"] {
2386
2396
  border-color: var(--qlib-highlight-color);