@brightlocal/ui-components 2.0.0 → 2.0.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Machine-readable registry of all components in the BrightLocal Design System",
5
5
  "components": [
6
6
  {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react");function o(e,n,r){process.env.NODE_ENV==="development"&&i.useEffect(()=>{const t=requestAnimationFrame(()=>{e()&&console.warn(`[BrightLocal DS] ${n}`)});return()=>cancelAnimationFrame(t)},r)}exports.useDevWarning=o;
@@ -0,0 +1,12 @@
1
+ import { useEffect as t } from "react";
2
+ function a(e, n, r) {
3
+ process.env.NODE_ENV === "development" && t(() => {
4
+ const o = requestAnimationFrame(() => {
5
+ e() && console.warn(`[BrightLocal DS] ${n}`);
6
+ });
7
+ return () => cancelAnimationFrame(o);
8
+ }, r);
9
+ }
10
+ export {
11
+ a as useDevWarning
12
+ };
package/dist/select.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),k=require("react"),q=require("@radix-ui/react-select"),d=require("@brightlocal/icons"),C=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils"),D=require("@brightlocal/ui-components/lib/use-dev-warning");function p(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const I=p(k),o=p(q);function f({children:e,...r}){return t.jsx(o.Root,{"data-slot":"select",...r,children:e})}f.displayName="Select";function b(e){return t.jsx(o.Group,{"data-slot":"select-group",...e})}b.displayName="SelectGroup";function g(e){return t.jsx(o.Value,{"data-slot":"select-value",...e})}g.displayName="SelectValue";const _=C.cva(["relative flex w-full h-9 items-center justify-between gap-2","px-3 py-2","border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color]","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","[&>span]:block [&>span]:truncate","data-[placeholder]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"]);function x({className:e,children:r,placeholder:a,dataHook:s,error:i,...l}){const c=i||l["aria-invalid"]===!0||l["aria-invalid"]==="true",j=l["aria-required"]===!0||l["aria-required"]==="true",w=l["aria-label"]||a||"Select an option",N=c?"border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive":"";return t.jsxs(o.Trigger,{...l,"aria-invalid":c?"true":void 0,"aria-label":w,"aria-required":j?"true":void 0,className:n.cn(_(),N,e),"data-hook":s,"data-slot":"select-trigger",children:[r,t.jsx(o.Icon,{asChild:!0,children:t.jsx(d.ChevronDown,{className:"text-muted-foreground"})})]})}x.displayName="SelectTrigger";function v({className:e,children:r,position:a="popper",...s}){const i=I.useRef(null);D.useDevWarning(()=>i.current?i.current.querySelectorAll('[data-slot="select-item"]').length>=100:!1,`Select contains many items. For large lists (100+), consider using <Combobox> which supports search and filtering.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),k=require("react"),q=require("@radix-ui/react-select"),d=require("@brightlocal/icons"),C=require("class-variance-authority"),n=require("@brightlocal/ui-components/lib/utils"),D=require("./lib/use-dev-warning.cjs");function p(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>e[a]})}}return r.default=e,Object.freeze(r)}const I=p(k),o=p(q);function f({children:e,...r}){return t.jsx(o.Root,{"data-slot":"select",...r,children:e})}f.displayName="Select";function b(e){return t.jsx(o.Group,{"data-slot":"select-group",...e})}b.displayName="SelectGroup";function g(e){return t.jsx(o.Value,{"data-slot":"select-value",...e})}g.displayName="SelectValue";const _=C.cva(["relative flex w-full h-9 items-center justify-between gap-2","px-3 py-2","border border-border rounded-sm outline-none transition-[border-color,box-shadow,background-color]","bg-neutral-50 border-neutral-300","dark:bg-white/5 dark:border-white/15","text-sm font-normal font-sans text-foreground","[&>span]:block [&>span]:truncate","data-[placeholder]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"]);function x({className:e,children:r,placeholder:a,dataHook:s,error:i,...l}){const c=i||l["aria-invalid"]===!0||l["aria-invalid"]==="true",j=l["aria-required"]===!0||l["aria-required"]==="true",w=l["aria-label"]||a||"Select an option",N=c?"border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive":"";return t.jsxs(o.Trigger,{...l,"aria-invalid":c?"true":void 0,"aria-label":w,"aria-required":j?"true":void 0,className:n.cn(_(),N,e),"data-hook":s,"data-slot":"select-trigger",children:[r,t.jsx(o.Icon,{asChild:!0,children:t.jsx(d.ChevronDown,{className:"text-muted-foreground"})})]})}x.displayName="SelectTrigger";function v({className:e,children:r,position:a="popper",...s}){const i=I.useRef(null);D.useDevWarning(()=>i.current?i.current.querySelectorAll('[data-slot="select-item"]').length>=100:!1,`Select contains many items. For large lists (100+), consider using <Combobox> which supports search and filtering.
2
2
  Import: import { Combobox } from "@brightlocal/ui-components/combobox"`,[r]);const l=n.cn("relative z-50 overflow-hidden","min-w-[8rem]","rounded-md border border-border bg-popover shadow-md","text-popover-foreground","max-h-[var(--radix-select-content-available-height)]","origin-[var(--radix-select-content-transform-origin)]","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2","data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2","data-[side=top]:slide-in-from-bottom-2"),c=a==="popper"&&n.cn("data-[side=bottom]:translate-y-1","data-[side=left]:-translate-x-1","data-[side=right]:translate-x-1","data-[side=top]:-translate-y-1");return t.jsx(o.Portal,{children:t.jsxs(o.Content,{className:n.cn(l,c,e),"data-slot":"select-content",position:a,...s,children:[t.jsx(u,{}),t.jsx(o.Viewport,{ref:i,className:n.cn("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),t.jsx(m,{})]})})}v.displayName="SelectContent";function S({className:e,...r}){return t.jsx(o.Label,{className:n.cn("text-muted-foreground px-2 py-1.5 text-xs font-medium",e),"data-slot":"select-label",...r})}S.displayName="SelectLabel";function h({className:e,children:r,...a}){const s=n.cn("relative flex w-full cursor-default select-none items-center gap-2","rounded py-1.5 pl-2 pr-8","text-sm font-normal leading-5 text-popover-foreground","focus:bg-accent focus:text-accent-foreground","hover:bg-accent/50 hover:text-accent-foreground","outline-none focus:outline-none","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0");return t.jsxs(o.Item,{className:n.cn(s,e),"data-slot":"select-item",...a,children:[t.jsx("span",{className:"absolute right-2 flex size-4 items-center justify-center",children:t.jsx(o.ItemIndicator,{children:t.jsx(d.Check,{})})}),t.jsx(o.ItemText,{children:r})]})}h.displayName="SelectItem";function y({className:e,...r}){return t.jsx(o.Separator,{className:n.cn("bg-border pointer-events-none -mx-1 my-1 h-px",e),"data-slot":"select-separator",...r})}y.displayName="SelectSeparator";function u({className:e,...r}){return t.jsx(o.ScrollUpButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-up-button",...r,children:t.jsx(d.ChevronUp,{})})}u.displayName="SelectScrollUpButton";function m({className:e,...r}){return t.jsx(o.ScrollDownButton,{className:n.cn("flex cursor-default items-center justify-center py-1",e),"data-slot":"select-scroll-down-button",...r,children:t.jsx(d.ChevronDown,{})})}m.displayName="SelectScrollDownButton";exports.Select=f;exports.SelectContent=v;exports.SelectGroup=b;exports.SelectItem=h;exports.SelectLabel=S;exports.SelectScrollDownButton=m;exports.SelectScrollUpButton=u;exports.SelectSeparator=y;exports.SelectTrigger=x;exports.SelectValue=g;
package/dist/select.js CHANGED
@@ -4,7 +4,7 @@ import * as o from "@radix-ui/react-select";
4
4
  import { Check as h, ChevronDown as u, ChevronUp as S } from "@brightlocal/icons";
5
5
  import { cva as x } from "class-variance-authority";
6
6
  import { cn as a } from "@brightlocal/ui-components/lib/utils";
7
- import { useDevWarning as y } from "@brightlocal/ui-components/lib/use-dev-warning";
7
+ import { useDevWarning as y } from "./lib/use-dev-warning.js";
8
8
  function w({ children: e, ...r }) {
9
9
  return /* @__PURE__ */ t(o.Root, { "data-slot": "select", ...r, children: e });
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -33,14 +33,14 @@
33
33
  "import": "./dist/hooks/*.js",
34
34
  "require": "./dist/hooks/*.cjs"
35
35
  },
36
- "./lib/*": {
36
+ "./lib/utils": {
37
37
  "source": {
38
- "types": "./src/lib/*.ts",
39
- "import": "./src/lib/*.ts"
38
+ "types": "./src/lib/utils.ts",
39
+ "import": "./src/lib/utils.ts"
40
40
  },
41
- "types": "./dist/lib/*.d.ts",
42
- "import": "./dist/lib/*.js",
43
- "require": "./dist/lib/*.cjs"
41
+ "types": "./dist/lib/utils.d.ts",
42
+ "import": "./dist/lib/utils.js",
43
+ "require": "./dist/lib/utils.cjs"
44
44
  },
45
45
  "./blocks/*": {
46
46
  "source": {
@@ -6,7 +6,7 @@ import { Check, ChevronDown, ChevronUp } from "@brightlocal/icons";
6
6
  import { cva } from "class-variance-authority";
7
7
 
8
8
  import { cn } from "@brightlocal/ui-components/lib/utils";
9
- import { useDevWarning } from "@brightlocal/ui-components/lib/use-dev-warning";
9
+ import { useDevWarning } from "../lib/use-dev-warning";
10
10
 
11
11
  // ============================================================================
12
12
  // Types