akeneo-design-system 4.0.84 → 4.0.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -89,7 +89,7 @@ Once a component is created and ready to be exported, build the DSM library with
89
89
  make dsm-lib-build
90
90
  ```
91
91
 
92
- Then clean and run webpack to build the PIM front:
92
+ Then clean and run rspack to build the PIM front:
93
93
  ```shell
94
94
  make javascript-dev
95
95
  ```
@@ -1,22 +1,22 @@
1
- "use strict";var E=Object.defineProperty,L=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var p=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var d=(t,n,e)=>n in t?E(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e,I=(t,n)=>{for(var e in n||(n={}))m.call(n,e)&&d(t,e,n[e]);if(p)for(var e of p(n))v.call(n,e)&&d(t,e,n[e]);return t},y=(t,n)=>L(t,M(n));var $=(t,n)=>{var e={};for(var o in t)m.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&p)for(var o of p(t))n.indexOf(o)<0&&v.call(t,o)&&(e[o]=t[o]);return e};var l=require("react/jsx-runtime"),c=require("react"),k=require("styled-components"),W=require("../../../icons/ArrowDownIcon.js"),F=require("../../../icons/ArrowUpIcon.js"),H=require("../../../icons/LockIcon.js"),K=require("../../../shared/key.js"),i=require("../../../theme/theme.js"),V=require("../../../hooks/useShortcut.js");function C(t){return t&&t.__esModule?t:{default:t}}var G=C(c),s=C(k);const j=s.default.div`
1
+ "use strict";var W=Object.defineProperty,F=Object.defineProperties;var H=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var m=(e,o,t)=>o in e?W(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,k=(e,o)=>{for(var t in o||(o={}))w.call(o,t)&&m(e,t,o[t]);if(g)for(var t of g(o))$.call(o,t)&&m(e,t,o[t]);return e},C=(e,o)=>F(e,H(o));var D=(e,o)=>{var t={};for(var n in e)w.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&g)for(var n of g(e))o.indexOf(n)<0&&$.call(e,n)&&(t[n]=e[n]);return t};var s=require("react/jsx-runtime"),c=require("react"),j=require("styled-components"),G=require("../../../icons/ArrowDownIcon.js"),J=require("../../../icons/ArrowUpIcon.js"),P=require("../../../icons/LockIcon.js"),Q=require("../../../shared/key.js"),l=require("../../../theme/theme.js"),S=require("../../../hooks/useShortcut.js");function q(e){return e&&e.__esModule?e:{default:e}}var X=q(c),p=q(j);const _=p.default.div`
2
2
  position: relative;
3
3
  display: flex;
4
4
  flex-direction: column;
5
5
  width: 100%;
6
- `,q=s.default.input`
6
+ `,z=p.default.input`
7
7
  width: 100%;
8
8
  height: 40px;
9
- border: 1px solid ${({$invalid:t})=>t?i.getColor("red",100):i.getColor("grey",80)};
9
+ border: 1px solid ${({$invalid:e})=>e?l.getColor("red",100):l.getColor("grey",80)};
10
10
  border-radius: 2px;
11
- background: ${({$readOnly:t})=>t?i.getColor("grey",20):i.getColor("white")};
12
- color: ${({$readOnly:t})=>t?i.getColor("grey",100):i.getColor("grey",140)};
13
- font-size: ${i.getFontSize("default")};
11
+ background: ${({$readOnly:e})=>e?l.getColor("grey",20):l.getColor("white")};
12
+ color: ${({$readOnly:e})=>e?l.getColor("grey",100):l.getColor("grey",140)};
13
+ font-size: ${l.getFontSize("default")};
14
14
  line-height: 40px;
15
- padding: 0 ${({$readOnly:t})=>t?"35px":"15px"} 0 15px;
15
+ padding: 0 ${({$readOnly:e})=>e?"35px":"15px"} 0 15px;
16
16
  box-sizing: border-box;
17
17
  outline-style: none;
18
18
  appearance: textfield;
19
- ${({$readOnly:t})=>t&&k.css`
19
+ ${({$readOnly:e})=>e&&j.css`
20
20
  overflow: hidden;
21
21
  text-overflow: ellipsis;
22
22
  `}
@@ -27,14 +27,14 @@
27
27
  }
28
28
 
29
29
  &:focus {
30
- box-shadow: 0 0 0 2px ${i.getColor("blue",40)};
30
+ box-shadow: 0 0 0 2px ${l.getColor("blue",40)};
31
31
  }
32
32
 
33
33
  &::placeholder {
34
34
  opacity: 1;
35
- color: ${i.getColor("grey",100)};
35
+ color: ${l.getColor("grey",100)};
36
36
  }
37
- `,J=s.default(q).attrs({as:"div",inert:""})`
37
+ `,Y=p.default(z).attrs({as:"div",inert:""})`
38
38
  && {
39
39
  position: absolute;
40
40
  top: 0;
@@ -51,16 +51,16 @@
51
51
  mix-blend-mode: multiply;
52
52
  }
53
53
 
54
- ${j}:focus-within & {
54
+ ${_}:focus-within & {
55
55
  display: none;
56
56
  }
57
- `,P=s.default(H.LockIcon)`
57
+ `,Z=p.default(P.LockIcon)`
58
58
  position: absolute;
59
59
  right: 0;
60
60
  top: 0;
61
61
  margin: 12px;
62
- color: ${i.getColor("grey",100)};
63
- `,Q=s.default.div`
62
+ color: ${l.getColor("grey",100)};
63
+ `,V=p.default.div`
64
64
  position: absolute;
65
65
  right: 0;
66
66
  top: 0;
@@ -70,5 +70,6 @@
70
70
  height: 100%;
71
71
  justify-content: center;
72
72
  cursor: pointer;
73
- color: ${i.getColor("grey",100)};
74
- `,S=G.default.forwardRef((X,r)=>{var h=X,{invalid:t,onChange:n,readOnly:e,step:o,value:u,onSubmit:b,withIncrementIcons:_=!0,highlightable:z=!1}=h,x=$(h,["invalid","onChange","readOnly","step","value","onSubmit","withIncrementIcons","highlightable"]);const D=c.useRef(null);r=r!=null?r:D;const[N,A]=c.useState(!1),f=a=>{a.currentTarget.blur()},T=c.useCallback(a=>{A(a.currentTarget.validity.badInput),!e&&n&&n(a.currentTarget.value)},[e,n]),U=()=>{!e&&(b==null||b())};V.useShortcut(K.Key.Enter,U,r);const w=c.useCallback(()=>{r&&typeof r!="function"&&r.current&&!e&&n&&o!=="any"&&(r.current.stepUp(o),n(r.current.value))},[r,o,e,u,n]),B=c.useCallback(()=>{r&&typeof r!="function"&&r.current&&!e&&n&&o!=="any"&&(r.current.stepDown(o),n(r.current.value))},[r,o,e,u,n]),g=t||N&&u==="";return l.jsxs(j,{children:[l.jsx(q,y(I({ref:r,onChange:T,type:"number",readOnly:e,disabled:e,"aria-invalid":g,$invalid:g,$readOnly:e,autoComplete:"off",value:u,title:u,step:o},x),{onWheel:f})),z&&l.jsx(J,{"aria-hidden":!0,className:x.className,$readOnly:e,children:u}),e&&l.jsx(P,{size:16}),!e&&_&&o!=="any"&&l.jsxs(Q,{children:[l.jsx(F.ArrowUpIcon,{size:16,"data-testid":"increment-number-input",onClick:w}),l.jsx(W.ArrowDownIcon,{size:16,"data-testid":"decrement-number-input",onClick:B})]})]})});exports.NumberInput=S;
73
+ user-select: none;
74
+ color: ${l.getColor("grey",100)};
75
+ `,R=X.default.forwardRef((O,i)=>{var b=O,{invalid:e,onChange:o,readOnly:t,step:n,value:d,emptyValue:h,onSubmit:x,withIncrementIcons:A=!0,highlightable:N=!1}=b,a=D(b,["invalid","onChange","readOnly","step","value","emptyValue","onSubmit","withIncrementIcons","highlightable"]);const K=c.useRef(null);i=i!=null?i:K;const[T,U]=c.useState(!1),B=r=>{r.currentTarget.blur()},E=c.useCallback(r=>{U(r.currentTarget.validity.badInput),!t&&o&&o(r.currentTarget.value)},[t,o]),L=()=>{!t&&(x==null||x())};S.useShortcut(Q.Key.Enter,L,i);const v=c.useCallback(r=>{if(!i||typeof i=="function"||!i.current||t||!o||n==="any")return!1;const u=i.current;return u.value===""&&h!==void 0&&(u.value=`${h}`),r==="up"?u.stepUp(n):u.stepDown(n),o(u.value),!0},[i,n,t,o,h]),f=()=>v("up"),I=()=>v("down"),M=r=>{var u;h!==void 0&&r.currentTarget.value===""&&(r.key==="ArrowUp"&&f()&&r.preventDefault(),r.key==="ArrowDown"&&I()&&r.preventDefault()),(u=a.onKeyDown)==null||u.call(a,r)},y=e||T&&d==="";return s.jsxs(_,{children:[s.jsx(z,C(k({ref:i,onChange:E,type:"number",readOnly:t,disabled:t,"aria-invalid":y,$invalid:y,$readOnly:t,autoComplete:"off",value:d,title:d,step:n},a),{onKeyDown:M,onWheel:B})),N&&s.jsx(Y,{"aria-hidden":!0,className:a.className,$readOnly:t,children:d}),t&&s.jsx(Z,{size:16}),!t&&A&&n!=="any"&&s.jsxs(V,{children:[s.jsx(J.ArrowUpIcon,{size:16,"data-testid":"increment-number-input",onClick:f}),s.jsx(G.ArrowDownIcon,{size:16,"data-testid":"decrement-number-input",onClick:I})]})]})});exports.NumberInput=R;
package/lib/index.d.ts CHANGED
@@ -1144,6 +1144,7 @@ export declare type NumberInputProps = Override<Override<Omit<default_2.InputHTM
1144
1144
  min?: number;
1145
1145
  max?: number;
1146
1146
  step?: number | 'any';
1147
+ emptyValue?: number;
1147
1148
  invalid?: boolean;
1148
1149
  onSubmit?: () => void;
1149
1150
  withIncrementIcons?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "akeneo-design-system",
3
- "version": "4.0.84",
3
+ "version": "4.0.86",
4
4
  "description": "Akeneo design system",
5
5
  "repository": {
6
6
  "type": "git",