@kvdbil/components 17.7.0 → 17.9.0

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.
@@ -20,6 +20,7 @@
20
20
  background-color 0.3s ease,
21
21
  border 0.3s ease;
22
22
  box-sizing: border-box;
23
+ width: ${({fullWidth:e})=>e?"100%":"auto"};
23
24
 
24
25
  ${e=>!e.isDisabled&&e.isClickable&&` &:hover {\n border-color: ${i.getHoverBorderColor(e)};\n background-color: ${i.getHoverBackgroundColor(e)};\n color: ${i.getHoverColor(e)};\n } &:active {\n background-color: ${i.getActiveBackgroundColor(e)};\n border-color: ${i.getActiveBorderColor(e)};\n color: ${i.getActiveColor(e)};\n }`}
25
26
  `,s=l.default.span`
@@ -63,4 +64,4 @@
63
64
  &:hover:before {
64
65
  opacity: 1;
65
66
  }
66
- `,g=({color:r="primary",children:i,component:t,isDisabled:l,onClick:a,size:g="regular",prefix:u,onDelete:p,variant:b="solid",role:x,...f})=>{const v=!(!a||l),h=!(!p||l),m=!!u,y=e=>{e.stopPropagation(),p?.(e)};return e.jsx(n,{...f,role:x??(v?"button":void 0),onClick:v?a:void 0,tabIndex:v?0:void 0,as:t??(v?"button":"div"),color:r,isDisabled:l,size:g,isClickable:v,isDeletable:h,variant:b,hasPrefix:m,"aria-disabled":l,children:e.jsxs(s,{children:[u&&e.jsx(d,{className:"prefix",children:u}),i,p&&e.jsx(c,{role:"button","aria-label":"Remove","aria-disabled":l,onClick:h?y:void 0,color:r,variant:b,isClickable:v,isDisabled:l,isDeletable:!0,size:"regular",tabIndex:h?0:void 0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&h&&(e.preventDefault(),y(e))},children:e.jsx(o.default,{})})]})})};exports.Chip=g,exports.default=g;
67
+ `,g=({color:r="primary",children:i,component:t,isDisabled:l,onClick:a,size:g="regular",prefix:u,onDelete:p,variant:b="solid",role:x,...f})=>{const h=!(!a||l),v=!(!p||l),m=!!u,y=e=>{e.stopPropagation(),p?.(e)};return e.jsx(n,{...f,role:x??(h?"button":void 0),onClick:h?a:void 0,tabIndex:h?0:void 0,as:t??(h?"button":"div"),color:r,isDisabled:l,size:g,isClickable:h,isDeletable:v,variant:b,hasPrefix:m,"aria-disabled":l,children:e.jsxs(s,{children:[u&&e.jsx(d,{className:"prefix",children:u}),i,p&&e.jsx(c,{role:"button","aria-label":"Remove","aria-disabled":l,onClick:v?y:void 0,color:r,variant:b,isClickable:h,isDisabled:l,isDeletable:!0,size:"regular",tabIndex:v?0:void 0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&v&&(e.preventDefault(),y(e))},children:e.jsx(o.default,{})})]})})};exports.Chip=g,exports.default=g;
@@ -1,6 +1,6 @@
1
- import{jsx as l,jsxs as k}from"react/jsx-runtime";import a from"styled-components";import C from"../../icons/components/CloseIcon.js";import{getFontSize as $,getCursorType as b,getBackgroundColor as D,getColor as z,getBorderColor as B,getHoverBorderColor as H,getHoverBackgroundColor as j,getHoverColor as w,getActiveBackgroundColor as m,getActiveBorderColor as A,getActiveColor as F,getSufixHoverBackgroundColor as I}from"./styles.js";import"../../utils/utils.js";const P={small:"2px 16px",regular:"3px 16px",large:"7px 16px"},S=a.div`
1
+ import{jsx as l,jsxs as $}from"react/jsx-runtime";import a from"styled-components";import k from"../../icons/components/CloseIcon.js";import{getFontSize as C,getCursorType as b,getBackgroundColor as D,getColor as z,getBorderColor as B,getHoverBorderColor as w,getHoverBackgroundColor as H,getHoverColor as j,getActiveBackgroundColor as m,getActiveBorderColor as A,getActiveColor as W,getSufixHoverBackgroundColor as F}from"./styles.js";import"../../utils/utils.js";const I={small:"2px 16px",regular:"3px 16px",large:"7px 16px"},P=a.div`
2
2
  font-family: ${({theme:e})=>e.typography.fontBaseFamily};
3
- font-size: ${({size:e})=>$(e)};
3
+ font-size: ${({size:e})=>C(e)};
4
4
  font-weight: ${({theme:e})=>e.typography.fontBaseBoldWeight};
5
5
  line-height: 1.25;
6
6
  letter-spacing: 0.1px;
@@ -14,29 +14,30 @@ import{jsx as l,jsxs as k}from"react/jsx-runtime";import a from"styled-component
14
14
  border-style: solid;
15
15
  border-color: ${B};
16
16
  border-radius: 1.293rem;
17
- padding: ${({size:e,isDeletable:n})=>n?"0 0.5rem 0 1rem":P[e]};
17
+ padding: ${({size:e,isDeletable:n})=>n?"0 0.5rem 0 1rem":I[e]};
18
18
  transition:
19
19
  color 0.3s ease,
20
20
  background-color 0.3s ease,
21
21
  border 0.3s ease;
22
22
  box-sizing: border-box;
23
+ width: ${({fullWidth:e})=>e?"100%":"auto"};
23
24
 
24
25
  ${e=>!e.isDisabled&&e.isClickable&&` &:hover {
25
- border-color: ${H(e)};
26
- background-color: ${j(e)};
27
- color: ${w(e)};
26
+ border-color: ${w(e)};
27
+ background-color: ${H(e)};
28
+ color: ${j(e)};
28
29
  } &:active {
29
30
  background-color: ${m(e)};
30
31
  border-color: ${A(e)};
31
- color: ${F(e)};
32
+ color: ${W(e)};
32
33
  }`}
33
- `,T=a.span`
34
+ `,S=a.span`
34
35
  display: flex;
35
36
  align-items: center;
36
37
  justify-content: center;
37
38
  text-align: center;
38
39
  line-height: 1.5;
39
- `,W=a.span`
40
+ `,T=a.span`
40
41
  margin-right: 0.625rem;
41
42
  display: flex;
42
43
  align-items: center;
@@ -59,7 +60,7 @@ import{jsx as l,jsxs as k}from"react/jsx-runtime";import a from"styled-component
59
60
  width: 80%;
60
61
  border-radius: 50%;
61
62
  z-index: -1;
62
- background-color: ${I};
63
+ background-color: ${F};
63
64
  opacity: 0;
64
65
  }
65
66
 
@@ -71,4 +72,4 @@ import{jsx as l,jsxs as k}from"react/jsx-runtime";import a from"styled-component
71
72
  &:hover:before {
72
73
  opacity: 1;
73
74
  }
74
- `,u=({color:e="primary",children:n,component:f,isDisabled:r,onClick:d,size:h="regular",prefix:s,onDelete:c,variant:g="solid",role:x,...v})=>{const i=!!(d&&!r),t=!!(c&&!r),y=!!s,p=o=>{o.stopPropagation(),c?.(o)};return l(S,{...v,role:x??(i?"button":void 0),onClick:i?d:void 0,tabIndex:i?0:void 0,as:f??(i?"button":"div"),color:e,isDisabled:r,size:h,isClickable:i,isDeletable:t,variant:g,hasPrefix:y,"aria-disabled":r,children:k(T,{children:[s&&l(W,{className:"prefix",children:s}),n,c&&l(E,{role:"button","aria-label":"Remove","aria-disabled":r,onClick:t?p:void 0,color:e,variant:g,isClickable:i,isDisabled:r,isDeletable:!0,size:"regular",tabIndex:t?0:void 0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&t&&(o.preventDefault(),p(o))},children:l(C,{})})]})})};export{u as Chip,u as default};
75
+ `,u=({color:e="primary",children:n,component:h,isDisabled:r,onClick:d,size:f="regular",prefix:s,onDelete:c,variant:g="solid",role:x,...v})=>{const i=!!(d&&!r),t=!!(c&&!r),y=!!s,p=o=>{o.stopPropagation(),c?.(o)};return l(P,{...v,role:x??(i?"button":void 0),onClick:i?d:void 0,tabIndex:i?0:void 0,as:h??(i?"button":"div"),color:e,isDisabled:r,size:f,isClickable:i,isDeletable:t,variant:g,hasPrefix:y,"aria-disabled":r,children:$(S,{children:[s&&l(T,{className:"prefix",children:s}),n,c&&l(E,{role:"button","aria-label":"Remove","aria-disabled":r,onClick:t?p:void 0,color:e,variant:g,isClickable:i,isDisabled:r,isDeletable:!0,size:"regular",tabIndex:t?0:void 0,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&t&&(o.preventDefault(),p(o))},children:l(k,{})})]})})};export{u as Chip,u as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "17.7.0",
3
+ "version": "17.9.0",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -70,7 +70,7 @@
70
70
  "@testing-library/react-hooks": "^8.0.1",
71
71
  "@testing-library/user-event": "^14.5.2",
72
72
  "@types/jest": "^29.5.12",
73
- "@types/node": "24.9.1",
73
+ "@types/node": "24.10.1",
74
74
  "@types/react": "^18.3.8",
75
75
  "@types/react-collapse": "^5.0.4",
76
76
  "@types/react-dom": "^18.3.0",
@@ -82,7 +82,7 @@
82
82
  "babel-plugin-styled-components": "^2.1.4",
83
83
  "cross-env": "10.1.0",
84
84
  "date-fns": "^4.1.0",
85
- "esbuild": "^0.25.0",
85
+ "esbuild": "^0.27.0",
86
86
  "eslint": "^9.32.0",
87
87
  "eslint-config-prettier": "^10.0.1",
88
88
  "eslint-plugin-mdx": "^3.1.5",
package/package.json.tmp CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kvdbil/components",
3
- "version": "17.7.0",
3
+ "version": "17.9.0",
4
4
  "sideEffects": false,
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -69,7 +69,7 @@
69
69
  "@testing-library/react-hooks": "^8.0.1",
70
70
  "@testing-library/user-event": "^14.5.2",
71
71
  "@types/jest": "^29.5.12",
72
- "@types/node": "24.9.1",
72
+ "@types/node": "24.10.1",
73
73
  "@types/react": "^18.3.8",
74
74
  "@types/react-collapse": "^5.0.4",
75
75
  "@types/react-dom": "^18.3.0",
@@ -81,7 +81,7 @@
81
81
  "babel-plugin-styled-components": "^2.1.4",
82
82
  "cross-env": "10.1.0",
83
83
  "date-fns": "^4.1.0",
84
- "esbuild": "^0.25.0",
84
+ "esbuild": "^0.27.0",
85
85
  "eslint": "^9.32.0",
86
86
  "eslint-config-prettier": "^10.0.1",
87
87
  "eslint-plugin-mdx": "^3.1.5",
@@ -13,6 +13,7 @@ export interface ChipProps extends Omit<ComponentPropsWithoutRef<'div'>, 'prefix
13
13
  size?: Size;
14
14
  prefix?: ReactNode;
15
15
  variant?: Variant;
16
+ fullWidth?: boolean;
16
17
  }
17
18
  export interface ItemProps {
18
19
  color: ChipColor;
@@ -26,6 +27,7 @@ export interface ItemProps {
26
27
  theme: DefaultTheme;
27
28
  tabIndex?: number;
28
29
  onClick?: (e: MouseEvent) => void;
30
+ fullWidth?: boolean;
29
31
  }
30
32
  export declare const Chip: ({ color, children, component, isDisabled, onClick, size, prefix, onDelete, variant, role, ...props }: ChipProps) => import("react/jsx-runtime").JSX.Element;
31
33
  export default Chip;