@brightlocal/ui-components 2.24.0 → 2.25.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.
- package/README.md +2 -1
- package/component-meta.json +93 -79
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.js +2 -2
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.js +17 -17
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +9 -9
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +43 -46
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.js +14 -14
- package/dist/brand-illustration-motif.cjs +1 -1
- package/dist/brand-illustration-motif.js +11 -11
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +10 -10
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.js +12 -12
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +7 -7
- package/dist/chip.cjs +1 -1
- package/dist/chip.js +7 -7
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/data-table.d.ts +29 -0
- package/dist/data-table.d.ts.map +1 -1
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.js +61 -61
- package/dist/field.cjs +1 -1
- package/dist/field.js +1 -1
- package/dist/height-transition.cjs +1 -0
- package/dist/height-transition.d.ts +44 -0
- package/dist/height-transition.d.ts.map +1 -0
- package/dist/height-transition.js +63 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +326 -324
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +2 -2
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.js +15 -15
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/lib/motion.cjs +1 -0
- package/dist/lib/motion.d.ts +70 -0
- package/dist/lib/motion.d.ts.map +1 -0
- package/dist/lib/motion.js +25 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +12 -4
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +17 -16
- package/dist/list.cjs +1 -1
- package/dist/list.js +10 -10
- package/dist/loading.cjs +1 -1
- package/dist/loading.d.ts.map +1 -1
- package/dist/loading.js +45 -47
- package/dist/map.cjs +1 -1
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +2 -2
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.js +5 -5
- package/dist/navigation-menu.cjs +1 -1
- package/dist/navigation-menu.js +13 -13
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +21 -25
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +12 -12
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.js +11 -11
- package/dist/select.cjs +1 -1
- package/dist/select.js +12 -12
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +54 -50
- package/dist/slider.cjs +1 -1
- package/dist/slider.js +13 -13
- package/dist/stepper.cjs +1 -1
- package/dist/stepper.js +4 -4
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +5 -5
- package/dist/table.cjs +1 -1
- package/dist/table.js +2 -2
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/text-reveal-motion.js +77 -79
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +11 -11
- package/dist/toggle.cjs +1 -1
- package/dist/toggle.js +5 -5
- package/package.json +10 -13
- package/src/blocks/input-list.tsx +3 -6
- package/src/blocks/sidebar.tsx +14 -14
- package/src/components/accordion.tsx +2 -2
- package/src/components/alert-dialog.tsx +2 -2
- package/src/components/badge.tsx +1 -1
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/breadcrumb.tsx +1 -1
- package/src/components/button.tsx +2 -2
- package/src/components/card.tsx +1 -1
- package/src/components/carousel.tsx +1 -1
- package/src/components/checkbox.tsx +1 -1
- package/src/components/chip.tsx +2 -2
- package/src/components/combobox.tsx +1 -1
- package/src/components/data-table.tsx +29 -0
- package/src/components/dialog.tsx +3 -3
- package/src/components/field.tsx +1 -1
- package/src/components/height-transition.tsx +164 -0
- package/src/components/input-chip.tsx +2 -2
- package/src/components/input-group.tsx +2 -2
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input.tsx +1 -1
- package/src/components/link.tsx +4 -3
- package/src/components/list.tsx +1 -1
- package/src/components/loading.tsx +2 -15
- package/src/components/map.tsx +3 -2
- package/src/components/menubar.tsx +5 -5
- package/src/components/navigation-menu.tsx +6 -6
- package/src/components/pagination.tsx +1 -1
- package/src/components/progress.tsx +2 -10
- package/src/components/radio-group.tsx +1 -1
- package/src/components/scroll-area.tsx +2 -2
- package/src/components/select.tsx +1 -1
- package/src/components/sheet.tsx +9 -5
- package/src/components/slider.tsx +1 -1
- package/src/components/stepper.tsx +4 -4
- package/src/components/switch.tsx +2 -2
- package/src/components/table.tsx +2 -2
- package/src/components/tabs.tsx +1 -1
- package/src/components/text-reveal-motion.tsx +3 -8
- package/src/components/textarea.tsx +1 -1
- package/src/components/toggle.tsx +1 -1
- package/src/index.ts +1 -0
- package/src/lib/motion.ts +75 -0
- package/src/lib/utils.ts +14 -2
package/dist/input-chip.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),$=require("react"),B=require("class-variance-authority"),j=require("@brightlocal/ui-components/lib/utils"),K=require("@brightlocal/ui-components/chip");function T(r){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const o in r)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(r,o);Object.defineProperty(f,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}return f.default=r,Object.freeze(f)}const n=T($),F=n.createContext(null),O=n.createContext(null),P=n.createContext(null);function E(){const r=n.useContext(F);if(!r)throw new Error("InputChip components must be used within an <InputChip>");return r}function S(){const r=n.useContext(O);if(!r)throw new Error("InputChip components must be used within an <InputChip>");return r}function q(){const r=n.useContext(P);if(!r)throw new Error("InputChip components must be used within an <InputChip>");return r}function _(){const r=E(),{value:f,disabled:o}=S(),{inputValue:s,focusedChipIndex:l}=q();return{...r,value:f,disabled:o,inputValue:s,focusedChipIndex:l}}function L({value:r,defaultValue:f=[],onValueChange:o,disabled:s=!1,allowDuplicates:l=!1,children:c}){const[h,a]=n.useState(f),[g,i]=n.useState(""),[b,w]=n.useState(-1),y=n.useRef(null),t=n.useRef([]),e=r!==void 0,u=e?r:h,d=n.useRef(u),I=n.useRef(o),R=n.useRef(s);n.useLayoutEffect(()=>{d.current=u,I.current=o,R.current=s}),n.useEffect(()=>{t.current.length>u.length&&(t.current.length=u.length),b>=u.length&&w(-1)},[u.length,b]);const p=n.useCallback(x=>{e||a(x),I.current?.(x)},[e]),k=n.useCallback(x=>{if(R.current)return;const V=x.trim();V&&(l||!d.current.includes(V))&&(p([...d.current,V]),i(""))},[l,p]),D=n.useCallback(x=>{R.current||p(d.current.filter((V,N)=>N!==x))},[p]),C=n.useMemo(()=>({onValueChange:p,setInputValue:i,addItem:k,removeItem:D,inputRef:y,setFocusedChipIndex:w,chipRefs:t}),[p,k,D]),v=n.useMemo(()=>({value:u,disabled:s}),[u,s]),M=n.useMemo(()=>({inputValue:g,focusedChipIndex:b}),[g,b]);return m.jsx(F.Provider,{value:C,children:m.jsx(O.Provider,{value:v,children:m.jsx(P.Provider,{value:M,children:c})})})}const H=B.cva(["relative flex w-full flex-wrap items-center gap-1","min-h-9 rounded-sm border border-input bg-background","px-3 py-2","has-[:focus-visible]:border-ring has-[:focus-visible]:bg-background","has-[:focus-visible]:shadow-default","has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50","transition-[color,box-shadow,border-color]","duration-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react/jsx-runtime"),$=require("react"),B=require("class-variance-authority"),j=require("@brightlocal/ui-components/lib/utils"),K=require("@brightlocal/ui-components/chip");function T(r){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const o in r)if(o!=="default"){const s=Object.getOwnPropertyDescriptor(r,o);Object.defineProperty(f,o,s.get?s:{enumerable:!0,get:()=>r[o]})}}return f.default=r,Object.freeze(f)}const n=T($),F=n.createContext(null),O=n.createContext(null),P=n.createContext(null);function E(){const r=n.useContext(F);if(!r)throw new Error("InputChip components must be used within an <InputChip>");return r}function S(){const r=n.useContext(O);if(!r)throw new Error("InputChip components must be used within an <InputChip>");return r}function q(){const r=n.useContext(P);if(!r)throw new Error("InputChip components must be used within an <InputChip>");return r}function _(){const r=E(),{value:f,disabled:o}=S(),{inputValue:s,focusedChipIndex:l}=q();return{...r,value:f,disabled:o,inputValue:s,focusedChipIndex:l}}function L({value:r,defaultValue:f=[],onValueChange:o,disabled:s=!1,allowDuplicates:l=!1,children:c}){const[h,a]=n.useState(f),[g,i]=n.useState(""),[b,w]=n.useState(-1),y=n.useRef(null),t=n.useRef([]),e=r!==void 0,u=e?r:h,d=n.useRef(u),I=n.useRef(o),R=n.useRef(s);n.useLayoutEffect(()=>{d.current=u,I.current=o,R.current=s}),n.useEffect(()=>{t.current.length>u.length&&(t.current.length=u.length),b>=u.length&&w(-1)},[u.length,b]);const p=n.useCallback(x=>{e||a(x),I.current?.(x)},[e]),k=n.useCallback(x=>{if(R.current)return;const V=x.trim();V&&(l||!d.current.includes(V))&&(p([...d.current,V]),i(""))},[l,p]),D=n.useCallback(x=>{R.current||p(d.current.filter((V,N)=>N!==x))},[p]),C=n.useMemo(()=>({onValueChange:p,setInputValue:i,addItem:k,removeItem:D,inputRef:y,setFocusedChipIndex:w,chipRefs:t}),[p,k,D]),v=n.useMemo(()=>({value:u,disabled:s}),[u,s]),M=n.useMemo(()=>({inputValue:g,focusedChipIndex:b}),[g,b]);return m.jsx(F.Provider,{value:C,children:m.jsx(O.Provider,{value:v,children:m.jsx(P.Provider,{value:M,children:c})})})}const H=B.cva(["relative flex w-full flex-wrap items-center gap-1","min-h-9 rounded-sm border border-input bg-background","px-3 py-2","has-[:focus-visible]:border-ring has-[:focus-visible]:bg-background","has-[:focus-visible]:shadow-default","has-[:disabled]:cursor-not-allowed has-[:disabled]:opacity-50","transition-[color,box-shadow,border-color]","duration-fast","ease-out"],{variants:{error:{true:["border-destructive-40","has-[:focus-visible]:border-destructive-40 has-[:focus-visible]:shadow-destructive"],false:""}},defaultVariants:{error:!1}}),W=["flex-1 min-w-20","bg-transparent","border-0 outline-none","text-base font-sans","text-foreground","placeholder:text-muted-foreground","focus:outline-none focus-visible:outline-none","disabled:cursor-not-allowed disabled:opacity-50"],A=n.forwardRef(({className:r,error:f=!1,dataHook:o,trackingEl:s,trackingLabel:l,placeholder:c,inputId:h,"aria-label":a,"aria-labelledby":g,children:i,...b},w)=>{const{setInputValue:y,addItem:t,inputRef:e,setFocusedChipIndex:u,chipRefs:d}=E(),{value:I,disabled:R}=S(),{inputValue:p}=q(),k=C=>{y(C.target.value)},D=C=>{if(C.key==="Enter"&&p.trim()&&(C.preventDefault(),t(p)),C.key==="ArrowLeft"&&!p&&I.length>0){C.preventDefault();const v=I.length-1;u(v),d.current[v]?.focus()}if(C.key==="Backspace"&&!p&&I.length>0){C.preventDefault();const v=I.length-1;u(v),d.current[v]?.focus()}};return m.jsxs("div",{ref:w,className:j.cn(H({error:f}),r),"data-hook":o,"data-slot":"input-chip","data-tracking-el":s,"data-tracking-label":l,...b,children:[i,m.jsx("input",{ref:e,"aria-label":a,"aria-labelledby":g,className:j.cn(W),"data-slot":"input-chip-input",disabled:R,id:h,placeholder:c,type:"text",value:p,onChange:k,onKeyDown:D})]})});A.displayName="InputChipInput";function z({className:r,dataHookPrefix:f="chip",itemAriaLabel:o}){const{removeItem:s,inputRef:l,setFocusedChipIndex:c,chipRefs:h}=E(),{value:a,disabled:g}=S(),i=n.useRef(null);n.useEffect(()=>{if(i.current!==null){if(i.current==="input")l.current?.focus();else{const t=i.current;t>=0&&t<a.length?h.current[t]?.focus():a.length>0?h.current[a.length-1]?.focus():l.current?.focus()}i.current=null}},[a.length,l,h]);const b=(t,e)=>{if(!g)switch(t.key){case"ArrowLeft":t.preventDefault(),e>0&&(c(e-1),h.current[e-1]?.focus());break;case"ArrowRight":t.preventDefault(),e<a.length-1?(c(e+1),h.current[e+1]?.focus()):(c(-1),l.current?.focus());break;case"Backspace":case"Delete":{t.preventDefault();const u=a.length-1;if(u===0)c(-1),i.current="input",s(e);else if(e>=u){const d=u-1;c(d),i.current=d,s(e)}else c(e),i.current=e,s(e);break}case"Home":t.preventDefault(),a.length>0&&(c(0),h.current[0]?.focus());break;case"End":t.preventDefault(),c(-1),l.current?.focus();break}},w=t=>{c(t)},y=t=>{const e=t.relatedTarget;e&&(e.closest('[data-slot="chip"]')!==null||e.dataset.slot==="input-chip-input")||c(-1)};return a.length===0?null:m.jsx("div",{className:j.cn("contents",r),"data-slot":"input-chip-items",children:a.map((t,e)=>m.jsx(K.Chip,{ref:u=>{h.current[e]=u},"aria-label":o?o.replace("{item}",t):`${t}, press Delete to remove`,dataHook:`${f}-${e}`,disabled:g,role:"group",tabIndex:-1,onBlur:y,onFocus:()=>w(e),onKeyDown:u=>b(u,e),onRemove:()=>s(e),children:t},`${t}-${e}`))})}exports.InputChip=L;exports.InputChipInput=A;exports.InputChipItems=z;exports.useInputChipContext=_;
|
package/dist/input-chip.js
CHANGED
package/dist/input-group.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),h=require("react"),x=require("@radix-ui/react-slot"),l=require("class-variance-authority"),a=require("@brightlocal/ui-components/lib/utils"),G=require("./input.cjs");function I(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const u=I(h),c=l.cva("relative flex w-full items-center rounded-sm border border-input bg-background transition-[color,background-color,border-color,box-shadow] duration-fast ease-out has-[input:focus-visible]:border-ring has-[input:focus-visible]:shadow-default has-[:disabled]:opacity-50",{variants:{size:{default:"h-9",sm:"h-8",lg:"h-10"},error:{true:["border-destructive-40","has-[input:focus-visible]:border-destructive-40 has-[input:focus-visible]:shadow-destructive"],false:""}},defaultVariants:{size:"default",error:!1}}),p=u.forwardRef(({className:t,size:n,error:e,dataHook:o,trackingEl:s,trackingLabel:i,...d},m)=>r.jsx("div",{ref:m,className:a.cn(c({size:n,error:e}),t),"data-hook":o,"data-slot":"input-group","data-tracking-el":s,"data-tracking-label":i,...d}));p.displayName="InputGroup";const f=u.forwardRef(({className:t,...n},e)=>r.jsx(G.Input,{ref:e,className:a.cn("border-0 focus-visible:border-0 focus-visible:shadow-[none]","h-full",t),dataHook:"input-group-input",...n}));f.displayName="InputGroupInput";const w=l.cva("flex shrink-0 items-center text-muted-foreground",{variants:{align:{"inline-start":"","inline-end":"ml-auto","block-start":"self-start","block-end":"self-end"}},defaultVariants:{align:"inline-start"}}),b=u.forwardRef(({className:t,align:n,...e},o)=>r.jsx("div",{ref:o,className:a.cn(w({align:n}),t),"data-slot":"input-group-addon",...e}));b.displayName="InputGroupAddon";const g=l.cva(["inline-flex items-center justify-center gap-2","text-sm font-medium transition-colors duration-fast ease-out","outline-none focus-visible:shadow-default rounded-sm","disabled:pointer-events-none disabled:opacity-50","text-muted-foreground hover:text-foreground","[&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{variant:{default:"hover:bg-accent",ghost:""},size:{default:"h-9 px-3",sm:"h-8 px-2",lg:"h-10 px-4",icon:"h-9 w-9","icon-xs":"h-6 w-6","icon-sm":"h-8 w-8","icon-lg":"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),v=u.forwardRef(({className:t,variant:n,size:e,asChild:o=!1,...s},i)=>{const d=o?x.Slot:"button";return r.jsx(d,{ref:i,className:a.cn(g({variant:n,size:e,className:t})),"data-slot":"input-group-button",type:o?void 0:"button",...s})});v.displayName="InputGroupButton";exports.InputGroup=p;exports.InputGroupAddon=b;exports.InputGroupButton=v;exports.InputGroupInput=f;exports.inputGroupButtonVariants=g;exports.inputGroupVariants=c;
|
package/dist/input-group.js
CHANGED
|
@@ -5,7 +5,7 @@ import { cva as d } from "class-variance-authority";
|
|
|
5
5
|
import { cn as s } from "@brightlocal/ui-components/lib/utils";
|
|
6
6
|
import { Input as c } from "./input.js";
|
|
7
7
|
const m = d(
|
|
8
|
-
"relative flex w-full items-center rounded-sm border border-input bg-background transition-
|
|
8
|
+
"relative flex w-full items-center rounded-sm border border-input bg-background transition-[color,background-color,border-color,box-shadow] duration-fast ease-out has-[input:focus-visible]:border-ring has-[input:focus-visible]:shadow-default has-[:disabled]:opacity-50",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
size: {
|
|
@@ -27,11 +27,11 @@ const m = d(
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
), b = a.forwardRef(
|
|
30
|
-
({ className: t, size:
|
|
30
|
+
({ className: t, size: o, error: e, dataHook: r, trackingEl: i, trackingLabel: u, ...l }, p) => /* @__PURE__ */ n(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
33
|
ref: p,
|
|
34
|
-
className: s(m({ size:
|
|
34
|
+
className: s(m({ size: o, error: e }), t),
|
|
35
35
|
"data-hook": r,
|
|
36
36
|
"data-slot": "input-group",
|
|
37
37
|
"data-tracking-el": i,
|
|
@@ -41,10 +41,10 @@ const m = d(
|
|
|
41
41
|
)
|
|
42
42
|
);
|
|
43
43
|
b.displayName = "InputGroup";
|
|
44
|
-
const
|
|
44
|
+
const h = a.forwardRef(({ className: t, ...o }, e) => /* @__PURE__ */ n(
|
|
45
45
|
c,
|
|
46
46
|
{
|
|
47
|
-
ref:
|
|
47
|
+
ref: e,
|
|
48
48
|
className: s(
|
|
49
49
|
// Override border and focus styles since InputGroup handles them
|
|
50
50
|
"border-0 focus-visible:border-0 focus-visible:shadow-[none]",
|
|
@@ -52,11 +52,11 @@ const v = a.forwardRef(({ className: t, ...e }, o) => /* @__PURE__ */ n(
|
|
|
52
52
|
t
|
|
53
53
|
),
|
|
54
54
|
dataHook: "input-group-input",
|
|
55
|
-
...
|
|
55
|
+
...o
|
|
56
56
|
}
|
|
57
57
|
));
|
|
58
|
-
|
|
59
|
-
const
|
|
58
|
+
h.displayName = "InputGroupInput";
|
|
59
|
+
const v = d(
|
|
60
60
|
"flex shrink-0 items-center text-muted-foreground",
|
|
61
61
|
{
|
|
62
62
|
variants: {
|
|
@@ -72,13 +72,13 @@ const h = d(
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
), g = a.forwardRef(
|
|
75
|
-
({ className: t, align:
|
|
75
|
+
({ className: t, align: o, ...e }, r) => /* @__PURE__ */ n(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
78
|
ref: r,
|
|
79
|
-
className: s(
|
|
79
|
+
className: s(v({ align: o }), t),
|
|
80
80
|
"data-slot": "input-group-addon",
|
|
81
|
-
...
|
|
81
|
+
...e
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
);
|
|
@@ -86,7 +86,7 @@ g.displayName = "InputGroupAddon";
|
|
|
86
86
|
const w = d(
|
|
87
87
|
[
|
|
88
88
|
"inline-flex items-center justify-center gap-2",
|
|
89
|
-
"text-sm font-medium transition-colors",
|
|
89
|
+
"text-sm font-medium transition-colors duration-fast ease-out",
|
|
90
90
|
"outline-none focus-visible:shadow-default rounded-sm",
|
|
91
91
|
"disabled:pointer-events-none disabled:opacity-50",
|
|
92
92
|
"text-muted-foreground hover:text-foreground",
|
|
@@ -113,11 +113,11 @@ const w = d(
|
|
|
113
113
|
size: "default"
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
-
), x = a.forwardRef(({ className: t, variant:
|
|
116
|
+
), x = a.forwardRef(({ className: t, variant: o, size: e, asChild: r = !1, ...i }, u) => /* @__PURE__ */ n(
|
|
117
117
|
r ? f : "button",
|
|
118
118
|
{
|
|
119
119
|
ref: u,
|
|
120
|
-
className: s(w({ variant:
|
|
120
|
+
className: s(w({ variant: o, size: e, className: t })),
|
|
121
121
|
"data-slot": "input-group-button",
|
|
122
122
|
type: r ? void 0 : "button",
|
|
123
123
|
...i
|
|
@@ -128,7 +128,7 @@ export {
|
|
|
128
128
|
b as InputGroup,
|
|
129
129
|
g as InputGroupAddon,
|
|
130
130
|
x as InputGroupButton,
|
|
131
|
-
|
|
131
|
+
h as InputGroupInput,
|
|
132
132
|
w as inputGroupButtonVariants,
|
|
133
133
|
m as inputGroupVariants
|
|
134
134
|
};
|
package/dist/input-otp.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("react"),l=require("input-otp"),_=require("@brightlocal/icons"),x=require("@brightlocal/ui-components/lib/utils");function y(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const i=y(S),g=i.createContext(null);function v(){const t=i.useContext(g);if(!t)throw new Error("InputOTP components must be used within an <InputOTP>");return t}const p=i.forwardRef(({dataHook:t,trackingEl:n,trackingLabel:o,containerClassName:r,error:a,disabled:u,children:s,...c},m)=>{const O=i.useMemo(()=>({error:a,disabled:u}),[a,u]);return e.jsx(g.Provider,{value:O,children:e.jsx(l.OTPInput,{ref:m,"aria-invalid":a?"true":void 0,className:"disabled:cursor-not-allowed",containerClassName:x.cn("group flex items-center gap-2 has-disabled:opacity-50 w-fit",r),"data-hook":t,"data-slot":"input-otp","data-tracking-el":n,"data-tracking-label":o,disabled:u,...c,children:s})})});p.displayName="InputOTP";function f({className:t,...n}){return e.jsx("div",{className:x.cn("flex items-center rounded-md shadow-xs",t),"data-slot":"input-otp-group",...n})}function d({index:t,className:n,...o}){const{error:r}=v(),a=i.useContext(l.OTPInputContext),{char:u,hasFakeCaret:s,isActive:c}=a?.slots[t]??{};return e.jsxs("div",{className:x.cn("relative flex h-9 w-9 items-center justify-center","border-input bg-background border-y border-r","text-foreground text-base font-normal transition-[border-color,box-shadow] outline-none","first:rounded-l-md first:border-l last:rounded-r-md","data-[active=true]:border-ring data-[active=true]:z-10","data-[active=true]:shadow-default",r&&"border-destructive-40",r&&"data-[active=true]:border-destructive-40 data-[active=true]:shadow-destructive","dark:bg-input/30",n),"data-active":c,"data-error":r,"data-slot":"input-otp-slot",...o,children:[u,s&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function P({...t}){return e.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:e.jsx(_.Minus,{})})}const h=i.forwardRef(({maxLength:t=6,...n},o)=>e.jsx(p,{ref:o,inputMode:"numeric",maxLength:t,pasteTransformer:r=>r.replace(/\D+/g,"").slice(0,t),pattern:l.REGEXP_ONLY_DIGITS,...n,children:e.jsx(f,{children:Array.from({length:t},(r,a)=>e.jsx(d,{index:a},a))})}));h.displayName="InputOTPDigitsOnly";const T=i.forwardRef(({maxLength:t=4,...n},o)=>e.jsx(p,{ref:o,containerClassName:"gap-2",maxLength:t,...n,children:Array.from({length:t},(r,a)=>e.jsx(d,{className:"rounded-md border-l shadow-xs",index:a},a))}));T.displayName="InputOTPWithSpacing";const j=i.forwardRef(({maxLength:t=6,...n},o)=>{const r=Math.ceil(t/2),a=t-r;return e.jsxs(p,{ref:o,maxLength:t,...n,children:[e.jsx(f,{children:Array.from({length:r},(u,s)=>e.jsx(d,{index:s},s))}),e.jsx(P,{}),e.jsx(f,{children:Array.from({length:a},(u,s)=>e.jsx(d,{index:s+r},s+r))})]})});j.displayName="InputOTPSimple";const b=i.forwardRef(({maxLength:t=6,...n},o)=>{const a=Math.ceil(t/2);return e.jsx(p,{ref:o,maxLength:t,...n,children:Array.from({length:a},(u,s)=>{const c=s*2,O=Math.min(c+2,t)-c;return e.jsxs(i.Fragment,{children:[s>0&&e.jsx(P,{}),e.jsx(f,{children:Array.from({length:O},(N,I)=>e.jsx(d,{index:c+I},c+I))})]},s)})})});b.displayName="InputOTPWithSeparator";Object.defineProperty(exports,"REGEXP_ONLY_CHARS",{enumerable:!0,get:()=>l.REGEXP_ONLY_CHARS});Object.defineProperty(exports,"REGEXP_ONLY_DIGITS",{enumerable:!0,get:()=>l.REGEXP_ONLY_DIGITS});Object.defineProperty(exports,"REGEXP_ONLY_DIGITS_AND_CHARS",{enumerable:!0,get:()=>l.REGEXP_ONLY_DIGITS_AND_CHARS});exports.InputOTP=p;exports.InputOTPDigitsOnly=h;exports.InputOTPGroup=f;exports.InputOTPSeparator=P;exports.InputOTPSimple=j;exports.InputOTPSlot=d;exports.InputOTPWithSeparator=b;exports.InputOTPWithSpacing=T;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("react"),l=require("input-otp"),_=require("@brightlocal/icons"),x=require("@brightlocal/ui-components/lib/utils");function y(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const i=y(S),g=i.createContext(null);function v(){const t=i.useContext(g);if(!t)throw new Error("InputOTP components must be used within an <InputOTP>");return t}const p=i.forwardRef(({dataHook:t,trackingEl:n,trackingLabel:o,containerClassName:r,error:a,disabled:u,children:s,...c},m)=>{const O=i.useMemo(()=>({error:a,disabled:u}),[a,u]);return e.jsx(g.Provider,{value:O,children:e.jsx(l.OTPInput,{ref:m,"aria-invalid":a?"true":void 0,className:"disabled:cursor-not-allowed",containerClassName:x.cn("group flex items-center gap-2 has-disabled:opacity-50 w-fit",r),"data-hook":t,"data-slot":"input-otp","data-tracking-el":n,"data-tracking-label":o,disabled:u,...c,children:s})})});p.displayName="InputOTP";function f({className:t,...n}){return e.jsx("div",{className:x.cn("flex items-center rounded-md shadow-xs",t),"data-slot":"input-otp-group",...n})}function d({index:t,className:n,...o}){const{error:r}=v(),a=i.useContext(l.OTPInputContext),{char:u,hasFakeCaret:s,isActive:c}=a?.slots[t]??{};return e.jsxs("div",{className:x.cn("relative flex h-9 w-9 items-center justify-center","border-input bg-background border-y border-r","text-foreground duration-fast text-base font-normal transition-[border-color,box-shadow] ease-out outline-none","first:rounded-l-md first:border-l last:rounded-r-md","data-[active=true]:border-ring data-[active=true]:z-10","data-[active=true]:shadow-default",r&&"border-destructive-40",r&&"data-[active=true]:border-destructive-40 data-[active=true]:shadow-destructive","dark:bg-input/30",n),"data-active":c,"data-error":r,"data-slot":"input-otp-slot",...o,children:[u,s&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function P({...t}){return e.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:e.jsx(_.Minus,{})})}const h=i.forwardRef(({maxLength:t=6,...n},o)=>e.jsx(p,{ref:o,inputMode:"numeric",maxLength:t,pasteTransformer:r=>r.replace(/\D+/g,"").slice(0,t),pattern:l.REGEXP_ONLY_DIGITS,...n,children:e.jsx(f,{children:Array.from({length:t},(r,a)=>e.jsx(d,{index:a},a))})}));h.displayName="InputOTPDigitsOnly";const T=i.forwardRef(({maxLength:t=4,...n},o)=>e.jsx(p,{ref:o,containerClassName:"gap-2",maxLength:t,...n,children:Array.from({length:t},(r,a)=>e.jsx(d,{className:"rounded-md border-l shadow-xs",index:a},a))}));T.displayName="InputOTPWithSpacing";const j=i.forwardRef(({maxLength:t=6,...n},o)=>{const r=Math.ceil(t/2),a=t-r;return e.jsxs(p,{ref:o,maxLength:t,...n,children:[e.jsx(f,{children:Array.from({length:r},(u,s)=>e.jsx(d,{index:s},s))}),e.jsx(P,{}),e.jsx(f,{children:Array.from({length:a},(u,s)=>e.jsx(d,{index:s+r},s+r))})]})});j.displayName="InputOTPSimple";const b=i.forwardRef(({maxLength:t=6,...n},o)=>{const a=Math.ceil(t/2);return e.jsx(p,{ref:o,maxLength:t,...n,children:Array.from({length:a},(u,s)=>{const c=s*2,O=Math.min(c+2,t)-c;return e.jsxs(i.Fragment,{children:[s>0&&e.jsx(P,{}),e.jsx(f,{children:Array.from({length:O},(N,I)=>e.jsx(d,{index:c+I},c+I))})]},s)})})});b.displayName="InputOTPWithSeparator";Object.defineProperty(exports,"REGEXP_ONLY_CHARS",{enumerable:!0,get:()=>l.REGEXP_ONLY_CHARS});Object.defineProperty(exports,"REGEXP_ONLY_DIGITS",{enumerable:!0,get:()=>l.REGEXP_ONLY_DIGITS});Object.defineProperty(exports,"REGEXP_ONLY_DIGITS_AND_CHARS",{enumerable:!0,get:()=>l.REGEXP_ONLY_DIGITS_AND_CHARS});exports.InputOTP=p;exports.InputOTPDigitsOnly=h;exports.InputOTPGroup=f;exports.InputOTPSeparator=P;exports.InputOTPSimple=j;exports.InputOTPSlot=d;exports.InputOTPWithSeparator=b;exports.InputOTPWithSpacing=T;
|
package/dist/input-otp.js
CHANGED
|
@@ -69,7 +69,7 @@ function c({ index: t, className: o, ...i }) {
|
|
|
69
69
|
// Base styles
|
|
70
70
|
"relative flex h-9 w-9 items-center justify-center",
|
|
71
71
|
"border-input bg-background border-y border-r",
|
|
72
|
-
"text-foreground text-base font-normal transition-[border-color,box-shadow] outline-none",
|
|
72
|
+
"text-foreground duration-fast text-base font-normal transition-[border-color,box-shadow] ease-out outline-none",
|
|
73
73
|
"first:rounded-l-md first:border-l last:rounded-r-md",
|
|
74
74
|
// Focus state
|
|
75
75
|
"data-[active=true]:border-ring data-[active=true]:z-10",
|
package/dist/input.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),b=require("react"),p=require("class-variance-authority"),v=require("@brightlocal/ui-components/lib/utils");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const h=g(b),n=p.cva(["flex w-full min-w-0 h-9","border border-input bg-background rounded-sm","outline-none transition-[border-color,box-shadow,background-color]","text-base font-sans","text-foreground","overflow-hidden text-ellipsis","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground","placeholder:overflow-hidden placeholder:text-ellipsis","items-center px-3","[&::-webkit-calendar-picker-indicator]:hidden"],{variants:{hasIcon:{true:"pl-9",false:""},hasSecondaryIcon:{true:"pr-9",false:""}},defaultVariants:{hasIcon:!1,hasSecondaryIcon:!1}}),s=h.forwardRef(({className:e,hasIcon:r=!1,hasSecondaryIcon:t=!1,dataHook:a,error:l,trackingEl:c,trackingLabel:d,...o},u)=>{const i=l||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return f.jsx("input",{ref:u,"aria-invalid":i?"true":void 0,className:v.cn(n({hasIcon:r,hasSecondaryIcon:t}),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":a,"data-slot":"input","data-tracking-el":c,"data-tracking-label":d,...o})});s.displayName="Input";exports.Input=s;exports.inputVariants=n;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),b=require("react"),p=require("class-variance-authority"),v=require("@brightlocal/ui-components/lib/utils");function g(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const h=g(b),n=p.cva(["flex w-full min-w-0 h-9","border border-input bg-background rounded-sm","outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out","text-base font-sans","text-foreground","overflow-hidden text-ellipsis","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground","placeholder:overflow-hidden placeholder:text-ellipsis","items-center px-3","[&::-webkit-calendar-picker-indicator]:hidden"],{variants:{hasIcon:{true:"pl-9",false:""},hasSecondaryIcon:{true:"pr-9",false:""}},defaultVariants:{hasIcon:!1,hasSecondaryIcon:!1}}),s=h.forwardRef(({className:e,hasIcon:r=!1,hasSecondaryIcon:t=!1,dataHook:a,error:l,trackingEl:c,trackingLabel:d,...o},u)=>{const i=l||o["aria-invalid"]===!0||o["aria-invalid"]==="true";return f.jsx("input",{ref:u,"aria-invalid":i?"true":void 0,className:v.cn(n({hasIcon:r,hasSecondaryIcon:t}),i&&"border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",e),"data-hook":a,"data-slot":"input","data-tracking-el":c,"data-tracking-label":d,...o})});s.displayName="Input";exports.Input=s;exports.inputVariants=n;
|
package/dist/input.js
CHANGED
|
@@ -8,7 +8,7 @@ const p = f(
|
|
|
8
8
|
"flex w-full min-w-0 h-9",
|
|
9
9
|
// Appearance
|
|
10
10
|
"border border-input bg-background rounded-sm",
|
|
11
|
-
"outline-none transition-[border-color,box-shadow,background-color]",
|
|
11
|
+
"outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out",
|
|
12
12
|
// Typography
|
|
13
13
|
"text-base font-sans",
|
|
14
14
|
"text-foreground",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={type:"spring",stiffness:500,damping:45},n={stiffness:180,damping:24,mass:1},t={type:"spring",stiffness:80,damping:20,mass:1},S={type:"spring",stiffness:30,damping:9,mass:.5};exports.SPRING_GENTLE=t;exports.SPRING_SETTLE=S;exports.SPRING_SMOOTH=n;exports.SPRING_SNAPPY=s;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared motion values for JS-driven (framer-motion) animation — the JS-side
|
|
3
|
+
* counterpart of the CSS motion token scale (`--ds-motion-*` in
|
|
4
|
+
* `@brightlocal/tokens`).
|
|
5
|
+
*
|
|
6
|
+
* Engine policy (DS-806): CSS is the default for predetermined state
|
|
7
|
+
* transitions and preset keyframes. framer-motion is allowed when animation
|
|
8
|
+
* behaviour requires runtime orchestration — progress-driven or
|
|
9
|
+
* gesture-interruptible motion, spring physics, layout measurement, or
|
|
10
|
+
* sequencing tied to React state — and every framer component must consume
|
|
11
|
+
* `usePrefersReducedMotion()` (the global CSS kill-switch cannot see
|
|
12
|
+
* JS-driven values).
|
|
13
|
+
*
|
|
14
|
+
* New framer code must use one of these presets. Introducing a new spring
|
|
15
|
+
* config means adding it here, which keeps drift reviewable.
|
|
16
|
+
*/
|
|
17
|
+
export { SETTLE_REST_DELTA } from './spring-settle';
|
|
18
|
+
/**
|
|
19
|
+
* Duration scale in milliseconds — mirrors --ds-motion-duration-fast/base/slow.
|
|
20
|
+
* fast: state changes (hover/focus color, shadow, opacity) + exits;
|
|
21
|
+
* press feedback is faster still (instant or ≤100ms)
|
|
22
|
+
* base: standard reveals + on-screen movement
|
|
23
|
+
* slow: large surfaces; the productive-motion ceiling
|
|
24
|
+
*/
|
|
25
|
+
export declare const MOTION_DURATION_FAST_MS = 150;
|
|
26
|
+
export declare const MOTION_DURATION_BASE_MS = 200;
|
|
27
|
+
export declare const MOTION_DURATION_SLOW_MS = 300;
|
|
28
|
+
/**
|
|
29
|
+
* Quick and controlled, no overshoot — list reorders and other
|
|
30
|
+
* small-element layout moves.
|
|
31
|
+
*
|
|
32
|
+
* Damping 45 keeps it at/above critical damping (2 × √500 ≈ 44.7, mass 1),
|
|
33
|
+
* so the "no overshoot" description physically holds — at the previous 35
|
|
34
|
+
* the spring was underdamped (ζ ≈ 0.78) and could overshoot.
|
|
35
|
+
*/
|
|
36
|
+
export declare const SPRING_SNAPPY: {
|
|
37
|
+
readonly type: "spring";
|
|
38
|
+
readonly stiffness: 500;
|
|
39
|
+
readonly damping: 45;
|
|
40
|
+
};
|
|
41
|
+
/** Balanced — text and content reveals. */
|
|
42
|
+
export declare const SPRING_SMOOTH: {
|
|
43
|
+
readonly type: "spring";
|
|
44
|
+
readonly stiffness: 180;
|
|
45
|
+
readonly damping: 24;
|
|
46
|
+
readonly mass: 1;
|
|
47
|
+
};
|
|
48
|
+
/** Soft and value-tracking — progress bars and gauges. */
|
|
49
|
+
export declare const SPRING_GENTLE: {
|
|
50
|
+
readonly type: "spring";
|
|
51
|
+
readonly stiffness: 80;
|
|
52
|
+
readonly damping: 20;
|
|
53
|
+
readonly mass: 1;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Slow, non-overshooting morph driver for shape-progress springs (Loading,
|
|
57
|
+
* TextRevealMotion). Always pair with `SETTLE_REST_DELTA` (aim the spring at
|
|
58
|
+
* `1 + SETTLE_REST_DELTA` with `restDelta: SETTLE_REST_DELTA`) so the
|
|
59
|
+
* terminal snap lands off-screen.
|
|
60
|
+
*
|
|
61
|
+
* Precondition for the settle trick: damping ≥ 2 × √(stiffness × mass)
|
|
62
|
+
* (9 ≥ 2 × √(30 × 0.5) ≈ 7.75) — the spring must never overshoot.
|
|
63
|
+
*/
|
|
64
|
+
export declare const SPRING_SETTLE: {
|
|
65
|
+
readonly type: "spring";
|
|
66
|
+
readonly stiffness: 30;
|
|
67
|
+
readonly damping: 9;
|
|
68
|
+
readonly mass: 0.5;
|
|
69
|
+
};
|
|
70
|
+
//# sourceMappingURL=motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"motion.d.ts","sourceRoot":"","sources":["../../src/lib/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,2CAA2C;AAC3C,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,0DAA0D;AAC1D,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const s = {
|
|
2
|
+
type: "spring",
|
|
3
|
+
stiffness: 500,
|
|
4
|
+
damping: 45
|
|
5
|
+
}, n = {
|
|
6
|
+
stiffness: 180,
|
|
7
|
+
damping: 24,
|
|
8
|
+
mass: 1
|
|
9
|
+
}, t = {
|
|
10
|
+
type: "spring",
|
|
11
|
+
stiffness: 80,
|
|
12
|
+
damping: 20,
|
|
13
|
+
mass: 1
|
|
14
|
+
}, i = {
|
|
15
|
+
type: "spring",
|
|
16
|
+
stiffness: 30,
|
|
17
|
+
damping: 9,
|
|
18
|
+
mass: 0.5
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
t as SPRING_GENTLE,
|
|
22
|
+
i as SPRING_SETTLE,
|
|
23
|
+
n as SPRING_SMOOTH,
|
|
24
|
+
s as SPRING_SNAPPY
|
|
25
|
+
};
|
package/dist/lib/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("clsx"),a=require("tailwind-merge");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("clsx"),a=require("tailwind-merge"),o=a.extendTailwindMerge({extend:{classGroups:{duration:[{duration:["fast","base","slow"]}],ease:[{ease:["emphasized","overshoot"]}]}}});function s(...t){return o(e.clsx(t))}const d="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 duration-base ease-out data-[state=closed]:duration-fast data-[state=closed]:ease-in";exports.FLOATING_CONTENT_ANIMATION=d;exports.cn=s;
|
package/dist/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ClassValue } from 'clsx';
|
|
2
2
|
export declare function cn(...inputs: ClassValue[]): string;
|
|
3
|
-
export declare const FLOATING_CONTENT_ANIMATION = "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";
|
|
3
|
+
export declare const FLOATING_CONTENT_ANIMATION = "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 duration-base ease-out data-[state=closed]:duration-fast data-[state=closed]:ease-in";
|
|
4
4
|
//# sourceMappingURL=utils.d.ts.map
|
package/dist/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAe7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,eAAO,MAAM,0BAA0B,0aACkY,CAAC"}
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { clsx as a } from "clsx";
|
|
2
|
-
import {
|
|
2
|
+
import { extendTailwindMerge as e } from "tailwind-merge";
|
|
3
|
+
const o = e({
|
|
4
|
+
extend: {
|
|
5
|
+
classGroups: {
|
|
6
|
+
duration: [{ duration: ["fast", "base", "slow"] }],
|
|
7
|
+
ease: [{ ease: ["emphasized", "overshoot"] }]
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
});
|
|
3
11
|
function i(...t) {
|
|
4
|
-
return
|
|
12
|
+
return o(a(t));
|
|
5
13
|
}
|
|
6
|
-
const
|
|
14
|
+
const n = "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 duration-base ease-out data-[state=closed]:duration-fast data-[state=closed]:ease-in";
|
|
7
15
|
export {
|
|
8
|
-
|
|
16
|
+
n as FLOATING_CONTENT_ANIMATION,
|
|
9
17
|
i as cn
|
|
10
18
|
};
|
package/dist/link.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react"),y=require("@brightlocal/icons"),d=require("@radix-ui/react-slot"),m=require("class-variance-authority"),j=require("@brightlocal/ui-components/lib/utils");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const S=w(h),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),h=require("react"),y=require("@brightlocal/icons"),d=require("@radix-ui/react-slot"),m=require("class-variance-authority"),j=require("@brightlocal/ui-components/lib/utils");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const S=w(h),a=["justify-center","h-9","px-4","py-2","rounded-full","text-sm","font-semibold","no-underline","whitespace-nowrap","shrink-0","[&_svg]:pointer-events-none","[&_svg]:shrink-0","transition-[color,background-color,border-color,box-shadow]","duration-fast","ease-out","focus-visible:shadow-default"],q=m.cva(["inline-flex","items-center","gap-2","cursor-pointer","outline-none"],{variants:{variant:{inline:["rounded-sm","text-link","dark:text-link-dark","no-underline","hover:underline","hover:underline-offset-4","active:text-link/80","visited:text-link-visited","visited:dark:text-link-visited-dark","transition-[text-decoration,text-decoration-color,text-underline-offset,color]","duration-fast","ease-out","focus-visible:shadow-default"],filled:[...a,"bg-secondary","text-secondary-foreground","hover:bg-secondary/80"],outline:[...a,"border","border-input","border-solid","bg-background","text-foreground","hover:bg-accent","hover:text-accent-foreground","dark:bg-input/30","dark:border-input","dark:hover:bg-input/50","dark:hover:border-input"],ghost:[...a,"bg-transparent","text-foreground","hover:bg-accent"],icon:[...a,"w-9","px-0","bg-transparent","text-foreground","hover:bg-accent"]}},defaultVariants:{variant:"inline"}}),u=S.forwardRef(({className:e,variant:t="inline",dataHook:n,trackingEl:r,trackingLabel:f,asChild:b=!1,external:i=!1,showExternalIcon:g=!0,children:s,...k},p)=>{const x=i?{target:"_blank",rel:"noopener noreferrer"}:{},v=t==="inline"?"link-default":`link-${t}`,l={ref:p,className:j.cn(q({variant:t}),e),"data-hook":n,"data-slot":"link","data-tracking-el":r||v,"data-tracking-label":f,...x,...k},c=i&&g&&o.jsx(y.ExternalLink,{"aria-hidden":"true","data-slot":"external-icon"});return b?o.jsxs(d.Slot,{...l,children:[o.jsx(d.Slottable,{children:s}),c]}):o.jsxs("a",{...l,children:[s,c]})});u.displayName="Link";exports.Link=u;
|
package/dist/link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA0BlE,QAAA,MAAM,YAAY;;
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AA0BlE,QAAA,MAAM,YAAY;;8EAyEjB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,WAAW,GAAG,WAAW,CACnC,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,SAAS,CAAC,CAC7C,CAAC;AAEF,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC9E;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,QAAA,MAAM,IAAI,qFAwDT,CAAC;AAIF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/link.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import * as h from "react";
|
|
3
3
|
import { ExternalLink as v } from "@brightlocal/icons";
|
|
4
4
|
import { Slot as m, Slottable as w } from "@radix-ui/react-slot";
|
|
@@ -18,8 +18,8 @@ const e = [
|
|
|
18
18
|
"[&_svg]:pointer-events-none",
|
|
19
19
|
"[&_svg]:shrink-0",
|
|
20
20
|
"transition-[color,background-color,border-color,box-shadow]",
|
|
21
|
-
"duration-
|
|
22
|
-
"ease-
|
|
21
|
+
"duration-fast",
|
|
22
|
+
"ease-out",
|
|
23
23
|
"focus-visible:shadow-default"
|
|
24
24
|
], L = y(
|
|
25
25
|
// `gap-2` (spacing/2) keeps the icon–text gap consistent across all variants.
|
|
@@ -42,7 +42,8 @@ const e = [
|
|
|
42
42
|
"visited:dark:text-link-visited-dark",
|
|
43
43
|
// Transitions
|
|
44
44
|
"transition-[text-decoration,text-decoration-color,text-underline-offset,color]",
|
|
45
|
-
"duration-
|
|
45
|
+
"duration-fast",
|
|
46
|
+
"ease-out",
|
|
46
47
|
// Focus state
|
|
47
48
|
"focus-visible:shadow-default"
|
|
48
49
|
],
|
|
@@ -95,33 +96,33 @@ const e = [
|
|
|
95
96
|
}
|
|
96
97
|
), S = h.forwardRef(
|
|
97
98
|
({
|
|
98
|
-
className:
|
|
99
|
-
variant:
|
|
100
|
-
dataHook:
|
|
99
|
+
className: s,
|
|
100
|
+
variant: t = "inline",
|
|
101
|
+
dataHook: l,
|
|
101
102
|
trackingEl: c,
|
|
102
103
|
trackingLabel: u,
|
|
103
104
|
asChild: f = !1,
|
|
104
|
-
external:
|
|
105
|
+
external: r = !1,
|
|
105
106
|
showExternalIcon: k = !0,
|
|
106
107
|
children: n,
|
|
107
108
|
...b
|
|
108
109
|
}, p) => {
|
|
109
|
-
const g =
|
|
110
|
+
const g = r ? { target: "_blank", rel: "noopener noreferrer" } : {}, x = t === "inline" ? "link-default" : `link-${t}`, o = {
|
|
110
111
|
ref: p,
|
|
111
|
-
className: j(L({ variant:
|
|
112
|
-
"data-hook":
|
|
112
|
+
className: j(L({ variant: t }), s),
|
|
113
|
+
"data-hook": l,
|
|
113
114
|
"data-slot": "link",
|
|
114
115
|
"data-tracking-el": c || x,
|
|
115
116
|
"data-tracking-label": u,
|
|
116
117
|
...g,
|
|
117
118
|
...b
|
|
118
|
-
},
|
|
119
|
-
return f ? /* @__PURE__ */
|
|
119
|
+
}, a = r && k && /* @__PURE__ */ d(v, { "aria-hidden": "true", "data-slot": "external-icon" });
|
|
120
|
+
return f ? /* @__PURE__ */ i(m, { ...o, children: [
|
|
120
121
|
/* @__PURE__ */ d(w, { children: n }),
|
|
121
|
-
|
|
122
|
-
] }) : /* @__PURE__ */
|
|
122
|
+
a
|
|
123
|
+
] }) : /* @__PURE__ */ i("a", { ...o, children: [
|
|
123
124
|
n,
|
|
124
|
-
|
|
125
|
+
a
|
|
125
126
|
] });
|
|
126
127
|
}
|
|
127
128
|
);
|
package/dist/list.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("react"),w=require("@radix-ui/react-slot"),R=require("class-variance-authority"),o=require("@brightlocal/ui-components/lib/utils"),d=require("@brightlocal/ui-components/skeleton");function S(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const r=S(k),c=R.cva(["flex","items-center","gap-4","rounded-lg","py-2","pr-2","pl-4","transition-colors","duration-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("react"),w=require("@radix-ui/react-slot"),R=require("class-variance-authority"),o=require("@brightlocal/ui-components/lib/utils"),d=require("@brightlocal/ui-components/skeleton");function S(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const r=S(k),c=R.cva(["flex","items-center","gap-4","rounded-lg","py-2","pr-2","pl-4","transition-colors","duration-fast","ease-out"],{variants:{variant:{default:[],filled:["bg-card"],outline:["bg-background","border","border-border"],loading:["flex-col","gap-2","px-0","pt-0","pb-3"]}},defaultVariants:{variant:"filled"}}),m=r.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:n,...i},l)=>s.jsx("ul",{ref:l,className:o.cn("flex flex-col gap-2",e),"data-hook":a,"data-slot":"list","data-tracking-el":t,"data-tracking-label":n,...i}));m.displayName="List";const f=r.forwardRef(({asChild:e=!1,className:a,variant:t,dataHook:n,trackingEl:i,trackingLabel:l,children:N,...j},y)=>{const h=e?w.Slot:"li";return s.jsx(h,{ref:y,className:o.cn(c({variant:t}),a),"data-hook":n,"data-slot":"item","data-tracking-el":i,"data-tracking-label":l,...j,children:t==="loading"?s.jsxs(s.Fragment,{children:[s.jsx(d.Skeleton,{className:"h-4 w-full"}),s.jsx(d.Skeleton,{className:"h-4 w-full"})]}):N})});f.displayName="Item";const u=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("shrink-0",e),"data-slot":"item-media",...a}));u.displayName="ItemMedia";const p=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("flex flex-1 flex-col gap-1",e),"data-slot":"item-content",...a}));p.displayName="ItemContent";const g=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-foreground text-base leading-normal font-medium",e),"data-slot":"item-title",...a}));g.displayName="ItemTitle";const x=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-muted-foreground text-sm leading-normal font-normal",e),"data-slot":"item-description",...a}));x.displayName="ItemDescription";const b=r.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:o.cn("text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",e),"data-slot":"item-actions",...a}));b.displayName="ItemActions";const I=r.forwardRef(({className:e,dataHook:a,...t},n)=>s.jsx("li",{ref:n,className:o.cn("text-muted-foreground flex items-center py-2 pr-2 pl-4 text-base leading-none font-medium",e),"data-hook":a,"data-slot":"item-subheader",...t}));I.displayName="ItemSubheader";exports.Item=f;exports.ItemActions=b;exports.ItemContent=p;exports.ItemDescription=x;exports.ItemMedia=u;exports.ItemSubheader=I;exports.ItemTitle=g;exports.List=m;exports.itemVariants=c;
|
package/dist/list.js
CHANGED
|
@@ -14,7 +14,7 @@ const N = x(
|
|
|
14
14
|
"pr-2",
|
|
15
15
|
"pl-4",
|
|
16
16
|
"transition-colors",
|
|
17
|
-
"duration-
|
|
17
|
+
"duration-fast",
|
|
18
18
|
"ease-out"
|
|
19
19
|
],
|
|
20
20
|
{
|
|
@@ -31,7 +31,7 @@ const N = x(
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
), b = l.forwardRef(
|
|
34
|
-
({ className: t, dataHook: a, trackingEl: e, trackingLabel:
|
|
34
|
+
({ className: t, dataHook: a, trackingEl: e, trackingLabel: s, ...i }, d) => /* @__PURE__ */ o(
|
|
35
35
|
"ul",
|
|
36
36
|
{
|
|
37
37
|
ref: d,
|
|
@@ -39,8 +39,8 @@ const N = x(
|
|
|
39
39
|
"data-hook": a,
|
|
40
40
|
"data-slot": "list",
|
|
41
41
|
"data-tracking-el": e,
|
|
42
|
-
"data-tracking-label":
|
|
43
|
-
...
|
|
42
|
+
"data-tracking-label": s,
|
|
43
|
+
...i
|
|
44
44
|
}
|
|
45
45
|
)
|
|
46
46
|
);
|
|
@@ -50,8 +50,8 @@ const I = l.forwardRef(
|
|
|
50
50
|
asChild: t = !1,
|
|
51
51
|
className: a,
|
|
52
52
|
variant: e,
|
|
53
|
-
dataHook:
|
|
54
|
-
trackingEl:
|
|
53
|
+
dataHook: s,
|
|
54
|
+
trackingEl: i,
|
|
55
55
|
trackingLabel: d,
|
|
56
56
|
children: n,
|
|
57
57
|
...f
|
|
@@ -60,9 +60,9 @@ const I = l.forwardRef(
|
|
|
60
60
|
{
|
|
61
61
|
ref: c,
|
|
62
62
|
className: r(N({ variant: e }), a),
|
|
63
|
-
"data-hook":
|
|
63
|
+
"data-hook": s,
|
|
64
64
|
"data-slot": "item",
|
|
65
|
-
"data-tracking-el":
|
|
65
|
+
"data-tracking-el": i,
|
|
66
66
|
"data-tracking-label": d,
|
|
67
67
|
...f,
|
|
68
68
|
children: e === "loading" ? /* @__PURE__ */ p(u, { children: [
|
|
@@ -143,10 +143,10 @@ const R = l.forwardRef(
|
|
|
143
143
|
);
|
|
144
144
|
R.displayName = "ItemActions";
|
|
145
145
|
const v = l.forwardRef(
|
|
146
|
-
({ className: t, dataHook: a, ...e },
|
|
146
|
+
({ className: t, dataHook: a, ...e }, s) => /* @__PURE__ */ o(
|
|
147
147
|
"li",
|
|
148
148
|
{
|
|
149
|
-
ref:
|
|
149
|
+
ref: s,
|
|
150
150
|
className: r(
|
|
151
151
|
"text-muted-foreground flex items-center py-2 pr-2 pl-4 text-base leading-none font-medium",
|
|
152
152
|
t
|
package/dist/loading.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var B=Object.create;var N=Object.defineProperty;var
|
|
1
|
+
"use strict";var B=Object.create;var N=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var U=(t,e,n,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of W(e))!F.call(t,l)&&l!==n&&N(t,l,{get:()=>e[l],enumerable:!(c=H(e,l))||c.enumerable});return t};var z=(t,e,n)=>(n=t!=null?B(Z(t)):{},U(e||!t||!t.__esModule?N(n,"default",{value:t,enumerable:!0}):n,t));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react/jsx-runtime"),i=require("react"),J=require("framer-motion"),K=require("@brightlocal/ui-components/lib/utils"),Q=require("./hooks/use-prefers-reduced-motion.cjs"),V=require("./lib/motion.cjs"),P=require("./lib/spring-settle.cjs");function X(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const c=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,c.get?c:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Y=X(i),j="M250 500C388.071 500 500 388.071 500 250C500 111.929 388.071 0 250 0C111.929 0 0 111.929 0 250C0 388.071 111.929 500 250 500Z",O="M492.425 259.355C332.265 293.145 293.145 332.265 259.355 492.425C257.225 502.525 242.775 502.525 240.645 492.425C206.855 332.265 167.735 293.145 7.575 259.355C-2.525 257.225 -2.525 242.775 7.575 240.645C167.735 206.855 206.855 167.735 240.645 7.575C242.775 -2.525 257.225 -2.525 259.355 7.575C293.145 167.735 332.265 206.855 492.425 240.645C502.525 242.775 502.525 257.225 492.425 259.355Z",G="M258.366 5.58795L296.379 97.3854C298.509 102.526 304.729 104.546 309.47 101.636L394.177 49.7215C401.057 45.5112 409.598 51.7117 407.708 59.5523L384.506 156.16C383.206 161.571 387.046 166.861 392.596 167.301L491.645 175.092C499.685 175.722 502.945 185.763 496.815 191.003L421.259 255.528C417.029 259.138 417.029 265.679 421.259 269.299L496.815 333.824C502.945 339.065 499.685 349.106 491.645 349.736L392.596 357.526C387.046 357.966 383.206 363.257 384.506 368.667L407.708 465.275C409.588 473.116 401.047 479.326 394.177 475.106L309.47 423.192C304.729 420.282 298.509 422.302 296.379 427.442L258.366 519.24C255.275 526.69 244.725 526.69 241.634 519.24L203.621 427.442C201.491 422.302 195.271 420.282 190.53 423.192L105.823 475.106C98.9428 479.316 90.4021 473.116 92.2922 465.275L115.494 368.667C116.794 363.257 112.954 357.966 107.403 357.526L8.35543 349.736C0.314784 349.106 -2.94548 339.065 3.18502 333.824L78.7411 269.299C82.9715 265.689 82.9715 259.148 78.7411 255.528L3.18502 191.003C-2.94548 185.763 0.314784 175.722 8.35543 175.092L107.403 167.301C112.954 166.861 116.794 161.571 115.494 156.16L92.2922 59.5523C90.4121 51.7117 98.9528 45.5012 105.823 49.7215L190.53 101.636C195.271 104.546 201.491 102.526 203.621 97.3854L241.634 5.58795C244.725 -1.86265 255.275 -1.86265 258.366 5.58795Z",tt=t=>t<0?0:t>1?1:t,g=[j,O,G,j,G,O],et=150,nt=360,q=56,M=.15,S=45,ot=-Math.PI/4,rt=.5,$=Y.forwardRef(({className:t,dataHook:e,loadingLabel:n,trackingEl:c,trackingLabel:l,...k},v)=>{const L=Q.usePrefersReducedMotion(),y=i.useId(),I=i.useMemo(()=>`loading-gradient-${y.replace(/:/g,"")}`,[y]),D=i.useRef(null),w=i.useRef(null),_=i.useRef(null);return i.useEffect(()=>{if(L)return;const u=_.current;if(!u)return;const a=u;let d,o=null;const b=M*.8+Math.random()*M*.4,C=M*.53+Math.random()*M*.27,R=Math.random()*Math.PI*2,h=Math.random()*Math.PI*2;let m=-1/0;function r(A){o===null&&(o=A);const p=(A-o)/1e3,s=ot+Math.sin(p*b+R)*rt+Math.sin(p*C+h)*.25;if(Math.abs(s-m)>.01){m=s;const E=Math.cos(s),T=Math.sin(s);a.setAttribute("x1",`${50+S*E}%`),a.setAttribute("y1",`${50+S*T}%`),a.setAttribute("x2",`${50-S*E}%`),a.setAttribute("y2",`${50-S*T}%`)}d=requestAnimationFrame(r)}return d=requestAnimationFrame(r),()=>cancelAnimationFrame(d)},[L]),i.useEffect(()=>{const u=D.current,a=w.current;if(!u||!a)return;const d=C=>{a.style.transform=`rotate(${C}deg)`,_.current?.setAttribute("gradientTransform",`rotate(${-C} 0.5 0.5)`)};if(L){u.setAttribute("d",g[0]),a.style.opacity="1",d(0);return}const o={cancelled:!1};async function b(){const{interpolate:C}=await import("flubber");if(o.cancelled)return;const R=[];for(let r=0;r<g.length;r++)R.push(C(g[r],g[(r+1)%g.length]));a.style.opacity="1";let h=0,m=0;for(;!o.cancelled;){const r=R[h];if(await new Promise(s=>setTimeout(s,et)),o.cancelled)break;const A=m,p=m+nt;await new Promise(s=>{if(o.cancelled){s();return}const E=J.animate(0,1+P.SETTLE_REST_DELTA,{...V.SPRING_SETTLE,restDelta:P.SETTLE_REST_DELTA,onUpdate:T=>{if(o.cancelled){E.stop(),s();return}const x=tt(T);u.setAttribute("d",r(x)),d(A+x*(p-A))},onComplete:()=>{o.cancelled||(u.setAttribute("d",r(1)),d(p)),s()}})}),m=p,h=(h+1)%g.length}}return b(),()=>{o.cancelled=!0}},[L]),f.jsxs("svg",{ref:v,"aria-label":n??"Loading",className:K.cn("shrink-0",t),"data-hook":e,"data-slot":"loading","data-tracking-el":c,"data-tracking-label":l,fill:"none",height:q,role:"img",style:{overflow:"visible"},viewBox:"-30 -30 560 560",width:q,xmlns:"http://www.w3.org/2000/svg",...k,children:[f.jsx("defs",{children:f.jsxs("linearGradient",{ref:_,id:I,x1:"81.8%",x2:"18.2%",y1:"18.2%",y2:"81.8%",children:[f.jsx("stop",{offset:"-60%",stopColor:"var(--loading-gradient-from)"}),f.jsx("stop",{offset:"120%",stopColor:"var(--loading-gradient-to)"})]})}),f.jsx("g",{ref:w,style:{opacity:0,transformOrigin:"250px 250px",willChange:"transform"},children:f.jsx("path",{ref:D,d:g[0],fill:`url(#${I})`})})]})});$.displayName="Loading";exports.Loading=$;
|
package/dist/loading.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/components/loading.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"loading.d.ts","sourceRoot":"","sources":["../../src/components/loading.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiE/B;;;GAGG;AACH,MAAM,WAAW,YAAa,SAAQ,IAAI,CACxC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,UAAU,CACX;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAMD;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,OAAO,oFA2NZ,CAAC;AAIF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|