@brightlocal/ui-components 0.2.0 → 0.3.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.
Files changed (78) hide show
  1. package/dist/alert.cjs +1 -1
  2. package/dist/alert.d.ts +10 -1
  3. package/dist/alert.d.ts.map +1 -1
  4. package/dist/alert.js +6 -2
  5. package/dist/card.cjs +1 -1
  6. package/dist/card.d.ts +6 -2
  7. package/dist/card.d.ts.map +1 -1
  8. package/dist/card.js +89 -73
  9. package/dist/centred-layout.cjs +1 -1
  10. package/dist/centred-layout.d.ts +49 -25
  11. package/dist/centred-layout.d.ts.map +1 -1
  12. package/dist/centred-layout.js +57 -32
  13. package/dist/checkbox.d.ts.map +1 -1
  14. package/dist/chip.cjs +1 -0
  15. package/dist/chip.d.ts +61 -0
  16. package/dist/chip.d.ts.map +1 -0
  17. package/dist/chip.js +165 -0
  18. package/dist/combobox.cjs +1 -1
  19. package/dist/combobox.d.ts.map +1 -1
  20. package/dist/combobox.js +5 -2
  21. package/dist/date-picker.cjs +1 -1
  22. package/dist/date-picker.d.ts +89 -52
  23. package/dist/date-picker.d.ts.map +1 -1
  24. package/dist/date-picker.js +228 -210
  25. package/dist/dropdown-menu.d.ts.map +1 -1
  26. package/dist/header.cjs +1 -0
  27. package/dist/header.d.ts +42 -0
  28. package/dist/header.d.ts.map +1 -0
  29. package/dist/header.js +22 -0
  30. package/dist/index.cjs +1 -1
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +426 -396
  34. package/dist/input-chip.cjs +1 -0
  35. package/dist/input-chip.d.ts +117 -0
  36. package/dist/input-chip.d.ts.map +1 -0
  37. package/dist/input-chip.js +284 -0
  38. package/dist/input-group.d.ts.map +1 -1
  39. package/dist/input-otp.cjs +1 -1
  40. package/dist/input-otp.d.ts +43 -36
  41. package/dist/input-otp.d.ts.map +1 -1
  42. package/dist/input-otp.js +140 -119
  43. package/dist/input-password.cjs +1 -1
  44. package/dist/input-password.d.ts +147 -19
  45. package/dist/input-password.d.ts.map +1 -1
  46. package/dist/input-password.js +197 -92
  47. package/dist/input.cjs +1 -1
  48. package/dist/input.js +1 -1
  49. package/dist/progress.cjs +1 -1
  50. package/dist/progress.d.ts +10 -0
  51. package/dist/progress.d.ts.map +1 -1
  52. package/dist/progress.js +45 -36
  53. package/dist/select.d.ts.map +1 -1
  54. package/dist/slider.cjs +1 -1
  55. package/dist/slider.d.ts +31 -3
  56. package/dist/slider.d.ts.map +1 -1
  57. package/dist/slider.js +53 -43
  58. package/dist/textarea.d.ts.map +1 -1
  59. package/package.json +1 -1
  60. package/src/components/alert.tsx +10 -1
  61. package/src/components/card.tsx +66 -38
  62. package/src/components/centred-layout.tsx +115 -38
  63. package/src/components/checkbox.tsx +2 -2
  64. package/src/components/chip.tsx +249 -0
  65. package/src/components/combobox.tsx +17 -13
  66. package/src/components/date-picker.tsx +410 -266
  67. package/src/components/dropdown-menu.tsx +6 -1
  68. package/src/components/header.tsx +69 -0
  69. package/src/components/input-chip.tsx +548 -0
  70. package/src/components/input-group.tsx +4 -1
  71. package/src/components/input-otp.tsx +159 -91
  72. package/src/components/input-password.tsx +469 -129
  73. package/src/components/input.tsx +1 -1
  74. package/src/components/progress.tsx +21 -2
  75. package/src/components/select.tsx +1 -3
  76. package/src/components/slider.tsx +85 -15
  77. package/src/components/textarea.tsx +4 -1
  78. package/src/index.ts +3 -0
package/dist/alert.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("react"),v=require("class-variance-authority"),o=require("@brightlocal/icons"),g=require("@brightlocal/ui-components/lib/utils");function j(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const n=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,n.get?n:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const u=j(f),m=v.cva("relative w-full rounded-lg px-4 py-3 text-sm flex gap-3 items-start [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:translate-y-0.5",{variants:{variant:{default:"bg-neutral-100 text-neutral-900 [&>svg]:text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100 dark:[&>svg]:text-neutral-100",success:"bg-green-200 text-green-900 [&>svg]:text-green-900 dark:bg-green-950 dark:text-green-200 dark:[&>svg]:text-green-200",info:"bg-cyan-200 text-cyan-900 [&>svg]:text-cyan-900 dark:bg-cyan-900 dark:text-cyan-200 dark:[&>svg]:text-cyan-200",destructive:"bg-red-300 text-red-950 [&>svg]:text-red-950 dark:bg-red-950 dark:text-red-300 dark:[&>svg]:text-red-300",warning:"bg-orange-200 text-amber-900 [&>svg]:text-amber-900 dark:bg-amber-900 dark:text-orange-200 dark:[&>svg]:text-orange-200"}},defaultVariants:{variant:"default"}}),i=u.forwardRef(({className:t,variant:r,...a},n)=>e.jsx("div",{ref:n,className:g.cn(m({variant:r}),t),"data-slot":"alert","data-tracking-el":`alert-${r}`,role:"alert",...a}));i.displayName="Alert";const d=u.forwardRef(({className:t,...r},a)=>e.jsx("div",{ref:a,className:g.cn("overflow-hidden leading-5 font-medium text-ellipsis whitespace-nowrap",t),"data-slot":"alert-title",...r}));d.displayName="AlertTitle";const x=u.forwardRef(({className:t,...r},a)=>e.jsx("div",{ref:a,className:g.cn("text-sm leading-5 [&_p]:leading-5",t),"data-slot":"alert-description",...r}));x.displayName="AlertDescription";function k({title:t,description:r,action:a,className:n,dataHook:s,trackingEl:l,trackingLabel:c}){return e.jsxs(i,{className:n,"data-hook":s,"data-tracking-el":l,"data-tracking-label":c,variant:"success",children:[e.jsx(o.CircleCheck,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(d,{children:t}),e.jsx(x,{children:r})]}),a&&e.jsx("div",{className:"self-center",children:a})]})}function h({title:t,description:r,action:a,className:n,dataHook:s,trackingEl:l,trackingLabel:c}){return e.jsxs(i,{className:n,"data-hook":s,"data-tracking-el":l,"data-tracking-label":c,variant:"info",children:[e.jsx(o.Info,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(d,{children:t}),e.jsx(x,{children:r})]}),a&&e.jsx("div",{className:"self-center",children:a})]})}function b({title:t,description:r,action:a,className:n,dataHook:s,trackingEl:l,trackingLabel:c}){return e.jsxs(i,{className:n,"data-hook":s,"data-tracking-el":l,"data-tracking-label":c,variant:"destructive",children:[e.jsx(o.CircleX,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(d,{children:t}),e.jsx(x,{children:r})]}),a&&e.jsx("div",{className:"self-center",children:a})]})}function p({title:t,description:r,action:a,className:n,dataHook:s,trackingEl:l,trackingLabel:c}){return e.jsxs(i,{className:n,"data-hook":s,"data-tracking-el":l,"data-tracking-label":c,variant:"warning",children:[e.jsx(o.TriangleAlert,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(d,{children:t}),e.jsx(x,{children:r})]}),a&&e.jsx("div",{className:"self-center",children:a})]})}exports.AlertDestructive=b;exports.AlertInfo=h;exports.AlertSuccess=k;exports.AlertWarning=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("react"),j=require("class-variance-authority"),o=require("@brightlocal/icons"),g=require("@brightlocal/ui-components/lib/utils");function m(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const u=m(v),f=j.cva("relative w-full rounded-lg px-4 py-3 text-sm flex gap-3 items-start [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:translate-y-0.5",{variants:{variant:{default:"bg-neutral-100 text-neutral-900 [&>svg]:text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100 dark:[&>svg]:text-neutral-100",success:"bg-green-200 text-green-900 [&>svg]:text-green-900 dark:bg-green-950 dark:text-green-200 dark:[&>svg]:text-green-200",info:"bg-cyan-200 text-cyan-900 [&>svg]:text-cyan-900 dark:bg-cyan-900 dark:text-cyan-200 dark:[&>svg]:text-cyan-200",destructive:"bg-red-300 text-red-950 [&>svg]:text-red-950 dark:bg-red-950 dark:text-red-300 dark:[&>svg]:text-red-300",warning:"bg-orange-200 text-amber-900 [&>svg]:text-amber-900 dark:bg-amber-900 dark:text-orange-200 dark:[&>svg]:text-orange-200"}},defaultVariants:{variant:"default"}}),c=u.forwardRef(({className:t,variant:a,...r},n)=>e.jsx("div",{ref:n,className:g.cn(f({variant:a}),t),"data-slot":"alert","data-tracking-el":`alert-${a}`,role:"alert",...r}));c.displayName="Alert";const d=u.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:g.cn("overflow-hidden leading-5 font-medium text-ellipsis whitespace-nowrap",t),"data-slot":"alert-title",...a}));d.displayName="AlertTitle";const x=u.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:g.cn("text-sm leading-5 [&_p]:leading-5",t),"data-slot":"alert-description",...a}));x.displayName="AlertDescription";function k({title:t,description:a,action:r,className:n,dataHook:s,trackingEl:l,trackingLabel:i}){return e.jsxs(c,{className:n,"data-hook":s,"data-tracking-el":l,"data-tracking-label":i,variant:"success",children:[e.jsx(o.CircleCheck,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(d,{children:t}),e.jsx(x,{children:a})]}),r&&e.jsx("div",{className:"self-center",children:r})]})}function h({title:t,description:a,action:r,className:n,dataHook:s,trackingEl:l,trackingLabel:i}){return e.jsxs(c,{className:n,"data-hook":s,"data-tracking-el":l,"data-tracking-label":i,variant:"info",children:[e.jsx(o.Info,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(d,{children:t}),e.jsx(x,{children:a})]}),r&&e.jsx("div",{className:"self-center",children:r})]})}function b({title:t,description:a,action:r,className:n,dataHook:s,trackingEl:l,trackingLabel:i}){return e.jsxs(c,{className:n,"data-hook":s,"data-tracking-el":l,"data-tracking-label":i,variant:"destructive",children:[e.jsx(o.CircleX,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(d,{children:t}),e.jsx(x,{children:a})]}),r&&e.jsx("div",{className:"self-center",children:r})]})}function p({title:t,description:a,action:r,className:n,dataHook:s,trackingEl:l,trackingLabel:i}){return e.jsxs(c,{className:n,"data-hook":s,"data-tracking-el":l,"data-tracking-label":i,variant:"warning",children:[e.jsx(o.TriangleAlert,{}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(d,{children:t}),e.jsx(x,{children:a})]}),r&&e.jsx("div",{className:"self-center",children:r})]})}exports.Alert=c;exports.AlertDescription=x;exports.AlertDestructive=b;exports.AlertInfo=h;exports.AlertSuccess=k;exports.AlertTitle=d;exports.AlertWarning=p;exports.alertVariants=f;
package/dist/alert.d.ts CHANGED
@@ -1,4 +1,13 @@
1
+ import { VariantProps } from 'class-variance-authority';
1
2
  import * as React from "react";
3
+ declare const alertVariants: (props?: ({
4
+ variant?: "default" | "success" | "info" | "destructive" | "warning" | null | undefined;
5
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
6
+ declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
7
+ variant?: "default" | "success" | "info" | "destructive" | "warning" | null | undefined;
8
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
10
+ declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
2
11
  interface AlertContentProps {
3
12
  /**
4
13
  * Optional title for the alert
@@ -33,5 +42,5 @@ declare function AlertSuccess({ title, description, action, className, dataHook,
33
42
  declare function AlertInfo({ title, description, action, className, dataHook, trackingEl, trackingLabel, }: AlertContentProps): import("react/jsx-runtime").JSX.Element;
34
43
  declare function AlertDestructive({ title, description, action, className, dataHook, trackingEl, trackingLabel, }: AlertContentProps): import("react/jsx-runtime").JSX.Element;
35
44
  declare function AlertWarning({ title, description, action, className, dataHook, trackingEl, trackingLabel, }: AlertContentProps): import("react/jsx-runtime").JSX.Element;
36
- export { AlertSuccess, AlertInfo, AlertDestructive, AlertWarning };
45
+ export { Alert, AlertTitle, AlertDescription, alertVariants, AlertSuccess, AlertInfo, AlertDestructive, AlertWarning, };
37
46
  //# sourceMappingURL=alert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwE/B,UAAU,iBAAiB;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAiBnB;AAED,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QA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;AAED,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAiBnB;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAiBnB;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAiBnB;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,GACb,CAAC"}
package/dist/alert.js CHANGED
@@ -1,4 +1,4 @@
1
- import { jsxs as n, jsx as e } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
2
  import * as f from "react";
3
3
  import { cva as m } from "class-variance-authority";
4
4
  import { CircleCheck as v, Info as k, CircleX as h, TriangleAlert as u } from "@brightlocal/icons";
@@ -167,8 +167,12 @@ function D({
167
167
  );
168
168
  }
169
169
  export {
170
+ c as Alert,
171
+ o as AlertDescription,
170
172
  C as AlertDestructive,
171
173
  R as AlertInfo,
172
174
  A as AlertSuccess,
173
- D as AlertWarning
175
+ g as AlertTitle,
176
+ D as AlertWarning,
177
+ p as alertVariants
174
178
  };
package/dist/card.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),b=require("class-variance-authority"),d=require("@brightlocal/ui-components/lib/utils");function y(a){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>a[t]})}}return r.default=a,Object.freeze(r)}const o=y(x),N=b.cva(["flex","flex-col","gap-8","rounded-[14px]","py-8","transition-colors"],{variants:{variant:{default:["bg-card","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-transparent","text-foreground","border","border-border"]}},defaultVariants:{variant:"default"}}),n=o.forwardRef(({className:a,variant:r="default",dataHook:t,trackingEl:s,trackingLabel:m,...C},g)=>e.jsx("div",{ref:g,className:d.cn(N({variant:r}),a),"data-hook":t,"data-slot":"card","data-tracking-el":s||`card-${r}`,"data-tracking-label":m,...C}));n.displayName="Card";const c=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-8 has-data-[slot=card-action]:grid-cols-[1fr_auto]",a),"data-slot":"card-header",...r}));c.displayName="CardHeader";const i=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("heading-sm",a),"data-slot":"card-title",...r}));i.displayName="CardTitle";const l=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("text-muted-foreground text-sm leading-normal font-normal",a),"data-slot":"card-description",...r}));l.displayName="CardDescription";const f=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),"data-slot":"card-action",...r}));f.displayName="CardAction";const u=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("px-8",a),"data-slot":"card-content",...r}));u.displayName="CardContent";const p=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("flex items-center px-8",a),"data-slot":"card-footer",...r}));p.displayName="CardFooter";exports.Card=n;exports.CardAction=f;exports.CardContent=u;exports.CardDescription=l;exports.CardFooter=p;exports.CardHeader=c;exports.CardTitle=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),y=require("react"),N=require("class-variance-authority"),d=require("@brightlocal/ui-components/lib/utils");function h(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const e=h(y),n=e.createContext({flush:!1}),v=N.cva(["flex","flex-col","gap-8","rounded-[14px]","py-8","transition-colors"],{variants:{variant:{default:["bg-card","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-transparent","text-foreground","border","border-border"],"transparent-flush":["bg-transparent","text-foreground"]}},defaultVariants:{variant:"default"}}),c=e.forwardRef(({className:t,variant:a="default",dataHook:r,trackingEl:o,trackingLabel:m,children:x,...g},b)=>{const j=a==="transparent-flush";return s.jsx(n.Provider,{value:{flush:j},children:s.jsx("div",{ref:b,className:d.cn(v({variant:a}),t),"data-hook":r,"data-slot":"card","data-tracking-el":o||`card-${a}`,"data-tracking-label":m,...g,children:x})})});c.displayName="Card";const i=e.forwardRef(({className:t,...a},r)=>{const{flush:o}=e.useContext(n);return s.jsx("div",{ref:r,className:d.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",!o&&"px-8",t),"data-slot":"card-header",...a})});i.displayName="CardHeader";const l=e.forwardRef(({className:t,...a},r)=>s.jsx("div",{ref:r,className:d.cn("heading-sm",t),"data-slot":"card-title",...a}));l.displayName="CardTitle";const u=e.forwardRef(({className:t,...a},r)=>s.jsx("div",{ref:r,className:d.cn("text-muted-foreground text-sm leading-normal font-normal",t),"data-slot":"card-description",...a}));u.displayName="CardDescription";const f=e.forwardRef(({className:t,...a},r)=>s.jsx("div",{ref:r,className:d.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),"data-slot":"card-action",...a}));f.displayName="CardAction";const p=e.forwardRef(({className:t,...a},r)=>{const{flush:o}=e.useContext(n);return s.jsx("div",{ref:r,className:d.cn(!o&&"px-8",t),"data-slot":"card-content",...a})});p.displayName="CardContent";const C=e.forwardRef(({className:t,...a},r)=>{const{flush:o}=e.useContext(n);return s.jsx("div",{ref:r,className:d.cn("flex items-center",!o&&"px-8",t),"data-slot":"card-footer",...a})});C.displayName="CardFooter";exports.Card=c;exports.CardAction=f;exports.CardContent=p;exports.CardDescription=u;exports.CardFooter=C;exports.CardHeader=i;exports.CardTitle=l;
package/dist/card.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  import * as React from "react";
2
+ /**
3
+ * Card variant type
4
+ */
5
+ type CardVariant = "default" | "transparent" | "border" | "transparent-flush";
2
6
  /**
3
7
  * Props for the Card component
4
8
  */
@@ -7,7 +11,7 @@ type CardProps = React.ComponentProps<"div"> & {
7
11
  * Visual style variant of the card
8
12
  * @default "default"
9
13
  */
10
- variant?: "default" | "transparent" | "border";
14
+ variant?: CardVariant;
11
15
  /**
12
16
  * Data hook for automated testing (required)
13
17
  */
@@ -64,5 +68,5 @@ declare const CardContent: React.ForwardRefExoticComponent<Omit<CardSubComponent
64
68
  */
65
69
  declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
66
70
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
67
- export type { CardProps, CardSubComponentProps };
71
+ export type { CardProps, CardSubComponentProps, CardVariant };
68
72
  //# sourceMappingURL=card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+B/B;;GAEG;AACH,KAAK,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,QAAQ,CAAC;IAC/C;;OAEG;IACH,QAAQ,EAA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EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,IAAI,+FA+BT,CAAC;AAIF;;GAEG;AACH,KAAK,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IACzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAgBf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,SAAS,2GASd,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,eAAe,2GAYpB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAYf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,WAAW,2GAYhB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAYf,CAAC;AAGF,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,GACZ,CAAC;AAEF,YAAY,EAAE,SAAS,EAAE,qBAAqB,EAAE,WAAW,EAAE,CAAC"}
package/dist/card.js CHANGED
@@ -1,8 +1,8 @@
1
- import { jsx as d } from "react/jsx-runtime";
1
+ import { jsx as o } from "react/jsx-runtime";
2
2
  import * as e from "react";
3
- import { cva as l } from "class-variance-authority";
4
- import { cn as o } from "@brightlocal/ui-components/lib/utils";
5
- const f = l(
3
+ import { cva as m } from "class-variance-authority";
4
+ import { cn as s } from "@brightlocal/ui-components/lib/utils";
5
+ const n = e.createContext({ flush: !1 }), p = m(
6
6
  ["flex", "flex-col", "gap-8", "rounded-[14px]", "py-8", "transition-colors"],
7
7
  {
8
8
  variants: {
@@ -19,68 +19,78 @@ const f = l(
19
19
  "text-foreground",
20
20
  "border",
21
21
  "border-border"
22
- ]
22
+ ],
23
+ "transparent-flush": ["bg-transparent", "text-foreground"]
23
24
  }
24
25
  },
25
26
  defaultVariants: {
26
27
  variant: "default"
27
28
  }
28
29
  }
29
- ), m = e.forwardRef(
30
+ ), C = e.forwardRef(
30
31
  ({
31
32
  className: r,
32
33
  variant: a = "default",
33
34
  dataHook: t,
34
- trackingEl: s,
35
- trackingLabel: n,
35
+ trackingEl: d,
36
+ trackingLabel: c,
37
+ children: l,
36
38
  ...i
37
- }, c) => /* @__PURE__ */ d(
38
- "div",
39
- {
40
- ref: c,
41
- className: o(f({ variant: a }), r),
42
- "data-hook": t,
43
- "data-slot": "card",
44
- "data-tracking-el": s || `card-${a}`,
45
- "data-tracking-label": n,
46
- ...i
47
- }
48
- )
39
+ }, f) => {
40
+ const u = a === "transparent-flush";
41
+ return /* @__PURE__ */ o(n.Provider, { value: { flush: u }, children: /* @__PURE__ */ o(
42
+ "div",
43
+ {
44
+ ref: f,
45
+ className: s(p({ variant: a }), r),
46
+ "data-hook": t,
47
+ "data-slot": "card",
48
+ "data-tracking-el": d || `card-${a}`,
49
+ "data-tracking-label": c,
50
+ ...i,
51
+ children: l
52
+ }
53
+ ) });
54
+ }
49
55
  );
50
- m.displayName = "Card";
51
- const p = e.forwardRef(
52
- ({ className: r, ...a }, t) => /* @__PURE__ */ d(
53
- "div",
54
- {
55
- ref: t,
56
- className: o(
57
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-8 has-data-[slot=card-action]:grid-cols-[1fr_auto]",
58
- r
59
- ),
60
- "data-slot": "card-header",
61
- ...a
62
- }
63
- )
56
+ C.displayName = "Card";
57
+ const x = e.forwardRef(
58
+ ({ className: r, ...a }, t) => {
59
+ const { flush: d } = e.useContext(n);
60
+ return /* @__PURE__ */ o(
61
+ "div",
62
+ {
63
+ ref: t,
64
+ className: s(
65
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 has-data-[slot=card-action]:grid-cols-[1fr_auto]",
66
+ !d && "px-8",
67
+ r
68
+ ),
69
+ "data-slot": "card-header",
70
+ ...a
71
+ }
72
+ );
73
+ }
64
74
  );
65
- p.displayName = "CardHeader";
75
+ x.displayName = "CardHeader";
66
76
  const g = e.forwardRef(
67
- ({ className: r, ...a }, t) => /* @__PURE__ */ d(
77
+ ({ className: r, ...a }, t) => /* @__PURE__ */ o(
68
78
  "div",
69
79
  {
70
80
  ref: t,
71
- className: o("heading-sm", r),
81
+ className: s("heading-sm", r),
72
82
  "data-slot": "card-title",
73
83
  ...a
74
84
  }
75
85
  )
76
86
  );
77
87
  g.displayName = "CardTitle";
78
- const u = e.forwardRef(
79
- ({ className: r, ...a }, t) => /* @__PURE__ */ d(
88
+ const N = e.forwardRef(
89
+ ({ className: r, ...a }, t) => /* @__PURE__ */ o(
80
90
  "div",
81
91
  {
82
92
  ref: t,
83
- className: o(
93
+ className: s(
84
94
  "text-muted-foreground text-sm leading-normal font-normal",
85
95
  r
86
96
  ),
@@ -89,13 +99,13 @@ const u = e.forwardRef(
89
99
  }
90
100
  )
91
101
  );
92
- u.displayName = "CardDescription";
93
- const C = e.forwardRef(
94
- ({ className: r, ...a }, t) => /* @__PURE__ */ d(
102
+ N.displayName = "CardDescription";
103
+ const h = e.forwardRef(
104
+ ({ className: r, ...a }, t) => /* @__PURE__ */ o(
95
105
  "div",
96
106
  {
97
107
  ref: t,
98
- className: o(
108
+ className: s(
99
109
  "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
100
110
  r
101
111
  ),
@@ -104,37 +114,43 @@ const C = e.forwardRef(
104
114
  }
105
115
  )
106
116
  );
107
- C.displayName = "CardAction";
108
- const x = e.forwardRef(
109
- ({ className: r, ...a }, t) => /* @__PURE__ */ d(
110
- "div",
111
- {
112
- ref: t,
113
- className: o("px-8", r),
114
- "data-slot": "card-content",
115
- ...a
116
- }
117
- )
117
+ h.displayName = "CardAction";
118
+ const b = e.forwardRef(
119
+ ({ className: r, ...a }, t) => {
120
+ const { flush: d } = e.useContext(n);
121
+ return /* @__PURE__ */ o(
122
+ "div",
123
+ {
124
+ ref: t,
125
+ className: s(!d && "px-8", r),
126
+ "data-slot": "card-content",
127
+ ...a
128
+ }
129
+ );
130
+ }
118
131
  );
119
- x.displayName = "CardContent";
120
- const N = e.forwardRef(
121
- ({ className: r, ...a }, t) => /* @__PURE__ */ d(
122
- "div",
123
- {
124
- ref: t,
125
- className: o("flex items-center px-8", r),
126
- "data-slot": "card-footer",
127
- ...a
128
- }
129
- )
132
+ b.displayName = "CardContent";
133
+ const v = e.forwardRef(
134
+ ({ className: r, ...a }, t) => {
135
+ const { flush: d } = e.useContext(n);
136
+ return /* @__PURE__ */ o(
137
+ "div",
138
+ {
139
+ ref: t,
140
+ className: s("flex items-center", !d && "px-8", r),
141
+ "data-slot": "card-footer",
142
+ ...a
143
+ }
144
+ );
145
+ }
130
146
  );
131
- N.displayName = "CardFooter";
147
+ v.displayName = "CardFooter";
132
148
  export {
133
- m as Card,
134
- C as CardAction,
135
- x as CardContent,
136
- u as CardDescription,
137
- N as CardFooter,
138
- p as CardHeader,
149
+ C as Card,
150
+ h as CardAction,
151
+ b as CardContent,
152
+ N as CardDescription,
153
+ v as CardFooter,
154
+ x as CardHeader,
139
155
  g as CardTitle
140
156
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),m=require("react"),y=require("@brightlocal/ui-components/lib/utils");function b(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return a.default=t,Object.freeze(a)}const x=b(m),n=x.forwardRef(({className:t,breakpoint:a="xl",maxWidth:e,children:r,dataHook:o,trackingEl:c,trackingLabel:l,...s},u)=>{const i={xl:"max-w-7xl",lg:"max-w-5xl",md:"max-w-3xl",sm:"max-w-2xl"},d=e!==void 0?{maxWidth:typeof e=="number"?`${e}px`:e}:void 0;return f.jsx("div",{ref:u,className:y.cn("bg-background flex min-h-screen items-center justify-center p-6",!e&&i[a],t),"data-hook":o,"data-slot":"centred-layout","data-tracking-el":c,"data-tracking-label":l,style:d,...s,children:r})});n.displayName="CentredLayout";exports.CentredLayout=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),p=require("react"),o=require("@brightlocal/ui-components/lib/utils");function g(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const c=g(p),s=c.forwardRef(({className:t,maxWidth:e,children:r,dataHook:n,trackingEl:d,trackingLabel:i,...f},y)=>{const m=e!==void 0?{maxWidth:typeof e=="number"?`${e}px`:e}:void 0;return a.jsx("div",{ref:y,className:o.cn("bg-background flex min-h-screen flex-col items-center justify-center gap-4 p-6",!e&&"max-w-7xl",t),"data-hook":n,"data-slot":"centred-layout","data-tracking-el":d,"data-tracking-label":i,style:m,...f,children:r})});s.displayName="CentredLayout";const l=c.forwardRef(({className:t,children:e,...r},n)=>a.jsx("div",{ref:n,className:o.cn("flex w-full items-center justify-center lg:justify-start",t),"data-slot":"centred-layout-header",...r,children:e}));l.displayName="CentredLayoutHeader";const u=c.forwardRef(({className:t,children:e,...r},n)=>a.jsx("div",{ref:n,className:o.cn("flex flex-1 flex-col items-center justify-center",t),"data-slot":"centred-layout-content",...r,children:e}));u.displayName="CentredLayoutContent";exports.CentredLayout=s;exports.CentredLayoutContent=u;exports.CentredLayoutHeader=l;
@@ -1,25 +1,33 @@
1
1
  import * as React from "react";
2
2
  /**
3
- * CentredLayout provides a responsive centered container with max-width constraints
4
- * based on different breakpoint sizes.
3
+ * CentredLayout provides a responsive centered container with max-width constraint.
5
4
  *
6
- * Breakpoints align with Tailwind's default breakpoints:
7
- * - XL: 1280px (max-w-7xl)
8
- * - LG: 1024px (max-w-5xl)
9
- * - MD: 768px (max-w-3xl)
10
- * - SM: 640px (max-w-2xl)
5
+ * Spacing tokens used:
6
+ * - Padding: p-6 (spacing.6 = 24px) all around
7
+ * - Header to content gap: gap-4 (spacing.4 = 16px)
8
+ * - Max width: max-w-7xl (1280px) by default
11
9
  *
12
- * The component centers content horizontally and applies consistent padding
13
- * across all breakpoints.
14
- */
15
- /**
16
- * Breakpoint variants for CentredLayout
17
- * - xl: Extra large breakpoint (1280px max-width)
18
- * - lg: Large breakpoint (1024px max-width)
19
- * - md: Medium breakpoint (768px max-width)
20
- * - sm: Small breakpoint (640px max-width)
10
+ * The component centers content horizontally and vertically.
11
+ *
12
+ * @example
13
+ * // Basic usage
14
+ * <CentredLayout dataHook="my-layout">
15
+ * <CentredLayoutContent>
16
+ * <Card>...</Card>
17
+ * </CentredLayoutContent>
18
+ * </CentredLayout>
19
+ *
20
+ * @example
21
+ * // With Header
22
+ * <CentredLayout dataHook="my-layout">
23
+ * <CentredLayoutHeader>
24
+ * <Header dataHook="my-header"><Logo /></Header>
25
+ * </CentredLayoutHeader>
26
+ * <CentredLayoutContent>
27
+ * <Card>...</Card>
28
+ * </CentredLayoutContent>
29
+ * </CentredLayout>
21
30
  */
22
- export type CentredLayoutBreakpoint = "xl" | "lg" | "md" | "sm";
23
31
  interface CentredLayoutProps extends React.ComponentProps<"div"> {
24
32
  /**
25
33
  * Data hook for automated testing (required)
@@ -34,12 +42,7 @@ interface CentredLayoutProps extends React.ComponentProps<"div"> {
34
42
  */
35
43
  trackingLabel?: string;
36
44
  /**
37
- * Breakpoint size variant
38
- * @default "xl"
39
- */
40
- breakpoint?: CentredLayoutBreakpoint;
41
- /**
42
- * Custom max-width value (overrides breakpoint)
45
+ * Custom max-width value (overrides default 1280px)
43
46
  */
44
47
  maxWidth?: string | number;
45
48
  }
@@ -47,6 +50,27 @@ interface CentredLayoutProps extends React.ComponentProps<"div"> {
47
50
  * CentredLayout component for centering content with responsive max-width constraints.
48
51
  */
49
52
  declare const CentredLayout: React.ForwardRefExoticComponent<Omit<CentredLayoutProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
50
- export { CentredLayout };
51
- export type { CentredLayoutProps };
53
+ interface CentredLayoutHeaderProps extends React.ComponentProps<"div"> {
54
+ /**
55
+ * Header content (e.g., Header component with Logo)
56
+ */
57
+ children: React.ReactNode;
58
+ }
59
+ /**
60
+ * CentredLayoutHeader component for rendering header content at the top of CentredLayout.
61
+ * Content is centered on mobile/tablet, left-aligned from lg breakpoint onwards.
62
+ */
63
+ declare const CentredLayoutHeader: React.ForwardRefExoticComponent<Omit<CentredLayoutHeaderProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
64
+ interface CentredLayoutContentProps extends React.ComponentProps<"div"> {
65
+ /**
66
+ * Main content to render inside the centered layout
67
+ */
68
+ children: React.ReactNode;
69
+ }
70
+ /**
71
+ * CentredLayoutContent component for rendering the main content area of CentredLayout.
72
+ */
73
+ declare const CentredLayoutContent: React.ForwardRefExoticComponent<Omit<CentredLayoutContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
74
+ export { CentredLayout, CentredLayoutHeader, CentredLayoutContent };
75
+ export type { CentredLayoutProps, CentredLayoutHeaderProps, CentredLayoutContentProps, };
52
76
  //# sourceMappingURL=centred-layout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"centred-layout.d.ts","sourceRoot":"","sources":["../../src/components/centred-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B;;;;;;;;;;;;GAYG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhE,UAAU,kBAAmB,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IAC9D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;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AoB,EAAE,CAAC;AAEpE,YAAY,EACV,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,GAC1B,CAAC"}
@@ -1,46 +1,71 @@
1
- import { jsx as x } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import { cn as p } from "@brightlocal/ui-components/lib/utils";
4
- const f = i.forwardRef(
1
+ import { jsx as o } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { cn as l } from "@brightlocal/ui-components/lib/utils";
4
+ const u = n.forwardRef(
5
5
  ({
6
- className: a,
7
- breakpoint: e = "xl",
8
- maxWidth: t,
9
- children: o,
6
+ className: t,
7
+ maxWidth: e,
8
+ children: a,
10
9
  dataHook: r,
11
- trackingEl: l,
12
- trackingLabel: n,
13
- ...s
14
- }, m) => {
15
- const c = {
16
- xl: "max-w-7xl",
17
- lg: "max-w-5xl",
18
- md: "max-w-3xl",
19
- sm: "max-w-2xl"
20
- }, d = t !== void 0 ? {
21
- maxWidth: typeof t == "number" ? `${t}px` : t
10
+ trackingEl: d,
11
+ trackingLabel: s,
12
+ ...c
13
+ }, f) => {
14
+ const i = e !== void 0 ? {
15
+ maxWidth: typeof e == "number" ? `${e}px` : e
22
16
  } : void 0;
23
- return /* @__PURE__ */ x(
17
+ return /* @__PURE__ */ o(
24
18
  "div",
25
19
  {
26
- ref: m,
27
- className: p(
28
- "bg-background flex min-h-screen items-center justify-center p-6",
29
- !t && c[e],
30
- a
20
+ ref: f,
21
+ className: l(
22
+ // Base styles with p-6 padding (container-padding-x token) and gap-4 for header/content spacing
23
+ "bg-background flex min-h-screen flex-col items-center justify-center gap-4 p-6",
24
+ !e && "max-w-7xl",
25
+ t
31
26
  ),
32
27
  "data-hook": r,
33
28
  "data-slot": "centred-layout",
34
- "data-tracking-el": l,
35
- "data-tracking-label": n,
36
- style: d,
37
- ...s,
38
- children: o
29
+ "data-tracking-el": d,
30
+ "data-tracking-label": s,
31
+ style: i,
32
+ ...c,
33
+ children: a
39
34
  }
40
35
  );
41
36
  }
42
37
  );
43
- f.displayName = "CentredLayout";
38
+ u.displayName = "CentredLayout";
39
+ const y = n.forwardRef(({ className: t, children: e, ...a }, r) => /* @__PURE__ */ o(
40
+ "div",
41
+ {
42
+ ref: r,
43
+ className: l(
44
+ "flex w-full items-center justify-center lg:justify-start",
45
+ t
46
+ ),
47
+ "data-slot": "centred-layout-header",
48
+ ...a,
49
+ children: e
50
+ }
51
+ ));
52
+ y.displayName = "CentredLayoutHeader";
53
+ const m = n.forwardRef(({ className: t, children: e, ...a }, r) => /* @__PURE__ */ o(
54
+ "div",
55
+ {
56
+ ref: r,
57
+ className: l(
58
+ "flex flex-1 flex-col items-center justify-center",
59
+ t
60
+ ),
61
+ "data-slot": "centred-layout-content",
62
+ ...a,
63
+ children: e
64
+ }
65
+ ));
66
+ m.displayName = "CentredLayoutContent";
44
67
  export {
45
- f as CentredLayout
68
+ u as CentredLayout,
69
+ m as CentredLayoutContent,
70
+ y as CentredLayoutHeader
46
71
  };
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,gBAAgB;;8EA4BrB,CAAC;AAEF,MAAM,WAAW,aACf,SACA,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,EACrE,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACrC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,QAAQ,sGAuCb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/components/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,QAAA,MAAM,gBAAgB;;8EA4BrB,CAAC;AAEF,MAAM,WAAW,aACf,SACE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,iBAAiB,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,EACrE,YAAY,CAAC,OAAO,gBAAgB,CAAC;IACvC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,QAAQ,sGAuCb,CAAC;AAIF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/chip.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),O=require("react"),g=require("class-variance-authority"),h=require("@brightlocal/icons"),d=require("@brightlocal/ui-components/lib/utils"),o=require("@brightlocal/ui-components/tooltip");function R(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>a[n]})}}return t.default=a,Object.freeze(t)}const r=R(O),x=g.cva(["inline-flex","items-center","justify-center","gap-0.5","rounded-full","font-medium","whitespace-nowrap","shrink-0","select-none","bg-secondary","text-foreground","transition-[color,background-color,box-shadow]","duration-150","ease-in-out","hover:bg-secondary/80","focus:outline-none","focus-visible:shadow-default","disabled:pointer-events-none","disabled:opacity-50","aria-disabled:pointer-events-none","aria-disabled:opacity-50"],{variants:{size:{md:["h-7","pl-2.5","pr-1","text-xs"],lg:["h-8","pl-4","pr-2","text-base"]}},defaultVariants:{size:"md"}}),m=g.cva(["inline-flex","items-center","justify-center","rounded-full","cursor-pointer","text-muted-foreground","hover:text-foreground","outline-none","focus-visible:text-foreground","disabled:pointer-events-none","disabled:opacity-50"],{variants:{size:{md:["size-6"],lg:["size-6"]}},defaultVariants:{size:"md"}}),v=r.forwardRef(({className:a,children:t,size:n="md",loading:i=!1,disabled:j=!1,onRemove:y,dataHook:u,trackingEl:l,trackingLabel:w,maxWidth:T=200,...z},C)=>{const p=j||i,f=16,s=r.useRef(null),[k,N]=r.useState(!1);r.useEffect(()=>{const c=()=>{s.current&&N(s.current.scrollWidth>s.current.clientWidth)};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[t]);const b=e.jsx("span",{ref:s,className:"truncate","data-slot":"chip-label",style:{maxWidth:T},children:t});return e.jsxs("div",{ref:C,"aria-disabled":p?"true":void 0,className:d.cn(x({size:n}),a),"data-hook":u,"data-slot":"chip","data-tracking-el":l,"data-tracking-label":w,...z,children:[k?e.jsx(o.TooltipProvider,{children:e.jsxs(o.Tooltip,{children:[e.jsx(o.TooltipTrigger,{asChild:!0,children:b}),e.jsx(o.TooltipContent,{dataHook:`${u}-tooltip`,sideOffset:8,children:t})]})}):b,i?e.jsx("span",{"aria-label":"Loading",className:d.cn(m({size:n})),"data-slot":"chip-loading",role:"status",children:e.jsx(h.LoaderCircle,{className:"animate-spin motion-reduce:animate-none",size:f})}):e.jsx("button",{"aria-label":`Remove ${typeof t=="string"?t:"chip"}`,className:d.cn(m({size:n})),"data-slot":"chip-delete","data-tracking-el":l?`${l}-delete`:void 0,disabled:p,tabIndex:-1,type:"button",onClick:y,children:e.jsx(h.X,{size:f})})]})});v.displayName="Chip";exports.Chip=v;exports.chipVariants=x;
package/dist/chip.d.ts ADDED
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Chip size options
4
+ */
5
+ type ChipSize = "md" | "lg";
6
+ declare const chipVariants: (props?: ({
7
+ size?: "lg" | "md" | null | undefined;
8
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
9
+ /**
10
+ * Props for the Chip component
11
+ */
12
+ interface ChipProps extends Omit<React.ComponentProps<"div">, "children"> {
13
+ /**
14
+ * Chip content (text label)
15
+ */
16
+ children: React.ReactNode;
17
+ /**
18
+ * Size variant of the chip
19
+ * @default "md"
20
+ */
21
+ size?: ChipSize;
22
+ /**
23
+ * Show loading spinner instead of delete button
24
+ * @default false
25
+ */
26
+ loading?: boolean;
27
+ /**
28
+ * Disable the chip and its delete button
29
+ * @default false
30
+ */
31
+ disabled?: boolean;
32
+ /**
33
+ * Callback when delete button is clicked
34
+ */
35
+ onRemove?: (event: React.MouseEvent<HTMLButtonElement>) => void;
36
+ /**
37
+ * Data hook for automated testing (required)
38
+ */
39
+ dataHook: string;
40
+ /**
41
+ * Tracking element identifier for analytics
42
+ */
43
+ trackingEl?: string;
44
+ /**
45
+ * Tracking label for analytics context
46
+ */
47
+ trackingLabel?: string;
48
+ /**
49
+ * Maximum width of the chip label before truncation
50
+ * @default 200
51
+ */
52
+ maxWidth?: number;
53
+ }
54
+ /**
55
+ * Chip component for displaying removable tags or selections.
56
+ * Used for filter selections, tag lists, and multi-select values.
57
+ */
58
+ declare const Chip: React.ForwardRefExoticComponent<Omit<ChipProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
59
+ export { Chip, chipVariants };
60
+ export type { ChipProps, ChipSize };
61
+ //# sourceMappingURL=chip.d.ts.map