@brightlocal/ui-components 2.10.0 → 2.12.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 +3 -1
- package/component-meta.json +200 -17
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +42 -25
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts +16 -4
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +57 -53
- package/dist/blocks/input-list.cjs +2 -2
- package/dist/blocks/input-list.d.ts +7 -1
- package/dist/blocks/input-list.d.ts.map +1 -1
- package/dist/blocks/input-list.js +82 -81
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +19 -10
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +173 -169
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +14 -2
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +37 -37
- package/dist/button.cjs +1 -1
- package/dist/button.js +25 -25
- package/dist/callout.cjs +1 -1
- package/dist/callout.d.ts +3 -3
- package/dist/callout.d.ts.map +1 -1
- package/dist/callout.js +2 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +10 -1
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +85 -82
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +37 -4
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +213 -163
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +11 -0
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +43 -38
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +12 -2
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +235 -230
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +106 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +385 -120
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +10 -0
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +96 -96
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +7 -2
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +38 -30
- package/dist/drawer.d.ts +2 -2
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +5 -0
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +15 -7
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +10 -10
- 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 +406 -395
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.d.ts +8 -5
- package/dist/input-chip.d.ts.map +1 -1
- package/dist/input-chip.js +164 -170
- package/dist/input-group.d.ts +1 -1
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +10 -0
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +108 -106
- package/dist/link.cjs +1 -1
- package/dist/link.d.ts +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +36 -37
- package/dist/list.d.ts +1 -1
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +6 -1
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +25 -22
- package/dist/map.cjs +1 -0
- package/dist/map.d.ts +207 -0
- package/dist/map.d.ts.map +1 -0
- package/dist/map.js +256 -0
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +29 -3
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +26 -25
- package/dist/rating.cjs +1 -1
- package/dist/rating.d.ts +6 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/rating.js +27 -19
- package/dist/resizable.d.ts +1 -1
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +7 -1
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +52 -51
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +16 -4
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +38 -35
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +6 -1
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +42 -41
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +5 -0
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +13 -11
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +32 -30
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +4 -0
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +101 -52
- package/dist/text-reveal-motion.cjs +1 -1
- package/dist/text-reveal-motion.d.ts +5 -0
- package/dist/text-reveal-motion.d.ts.map +1 -1
- package/dist/text-reveal-motion.js +111 -110
- package/dist/typography.cjs +1 -1
- package/dist/typography.d.ts +1 -2
- package/dist/typography.d.ts.map +1 -1
- package/dist/typography.js +49 -50
- package/package.json +4 -5
- package/src/blocks/data-table.tsx +26 -9
- package/src/blocks/input-list.tsx +12 -1
- package/src/blocks/sidebar.tsx +61 -44
- package/src/components/badge.tsx +22 -5
- package/src/components/breadcrumb.tsx +43 -26
- package/src/components/button.tsx +13 -13
- package/src/components/callout.tsx +5 -4
- package/src/components/card.tsx +35 -19
- package/src/components/carousel.tsx +134 -13
- package/src/components/chip.tsx +22 -2
- package/src/components/combobox.tsx +18 -3
- package/src/components/command.tsx +644 -17
- package/src/components/date-picker.tsx +17 -3
- package/src/components/dialog.tsx +17 -4
- package/src/components/drawer.tsx +2 -2
- package/src/components/global-layout.tsx +15 -2
- package/src/components/input-chip.tsx +114 -66
- package/src/components/input-password.tsx +73 -49
- package/src/components/link.tsx +29 -17
- package/src/components/logo.tsx +10 -2
- package/src/components/map.tsx +597 -0
- package/src/components/pagination.tsx +44 -11
- package/src/components/rating.tsx +20 -2
- package/src/components/select.tsx +9 -1
- package/src/components/separator.tsx +40 -25
- package/src/components/sheet.tsx +28 -20
- package/src/components/skeleton.tsx +13 -2
- package/src/components/sonner.tsx +9 -3
- package/src/components/tabs.tsx +118 -22
- package/src/components/text-reveal-motion.tsx +7 -1
- package/src/components/typography.tsx +6 -7
- package/src/hooks/use-breakpoint.ts +2 -3
- package/src/index.ts +1 -0
package/dist/input-chip.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 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-150","ease-in-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.d.ts
CHANGED
|
@@ -104,14 +104,17 @@ export interface InputChipItemsProps {
|
|
|
104
104
|
className?: string;
|
|
105
105
|
/** Data hook prefix for chips */
|
|
106
106
|
dataHookPrefix?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Accessible label for each chip item.
|
|
109
|
+
* Supports `{item}` placeholder for interpolation.
|
|
110
|
+
* @default "{item}, press Delete to remove"
|
|
111
|
+
*/
|
|
112
|
+
itemAriaLabel?: string;
|
|
107
113
|
}
|
|
108
114
|
/**
|
|
109
115
|
* Auto-renders chips from the InputChip value array.
|
|
110
116
|
* Must be used within an InputChip component.
|
|
111
117
|
*/
|
|
112
|
-
declare function InputChipItems({ className, dataHookPrefix, }: InputChipItemsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
113
|
-
|
|
114
|
-
error?: boolean | null | undefined;
|
|
115
|
-
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
116
|
-
export { InputChip, InputChipInput, InputChipItems, inputChipVariants, inputChipInputVariants, useInputChipContext, };
|
|
118
|
+
declare function InputChipItems({ className, dataHookPrefix, itemAriaLabel, }: InputChipItemsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
119
|
+
export { InputChip, InputChipInput, InputChipItems, useInputChipContext };
|
|
117
120
|
//# sourceMappingURL=input-chip.d.ts.map
|
package/dist/input-chip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-chip.d.ts","sourceRoot":"","sources":["../../src/components/input-chip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AASlE,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,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C,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;GAGG;AACH,QAAA,MAAM,cAAc,4FA6EnB,CAAC;AAOF,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,iBAAS,cAAc,CAAC,EACtB,SAAS,EACT,cAAuB,EACvB,aAAa,GACd,EAAE,mBAAmB,kDAoJrB;AAMD,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,CAAC"}
|
package/dist/input-chip.js
CHANGED
|
@@ -1,77 +1,89 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Chip as
|
|
6
|
-
const
|
|
7
|
-
null
|
|
8
|
-
);
|
|
1
|
+
import { jsx as x, jsxs as M } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { cva as P } from "class-variance-authority";
|
|
4
|
+
import { cn as E } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
import { Chip as j } from "@brightlocal/ui-components/chip";
|
|
6
|
+
const A = n.createContext(null), B = n.createContext(null), K = n.createContext(null);
|
|
9
7
|
function F() {
|
|
10
|
-
const
|
|
11
|
-
if (!
|
|
8
|
+
const u = n.useContext(A);
|
|
9
|
+
if (!u)
|
|
10
|
+
throw new Error("InputChip components must be used within an <InputChip>");
|
|
11
|
+
return u;
|
|
12
|
+
}
|
|
13
|
+
function $() {
|
|
14
|
+
const u = n.useContext(B);
|
|
15
|
+
if (!u)
|
|
12
16
|
throw new Error("InputChip components must be used within an <InputChip>");
|
|
13
|
-
return
|
|
17
|
+
return u;
|
|
18
|
+
}
|
|
19
|
+
function N() {
|
|
20
|
+
const u = n.useContext(K);
|
|
21
|
+
if (!u)
|
|
22
|
+
throw new Error("InputChip components must be used within an <InputChip>");
|
|
23
|
+
return u;
|
|
24
|
+
}
|
|
25
|
+
function G() {
|
|
26
|
+
const u = F(), { value: b, disabled: d } = $(), { inputValue: o, focusedChipIndex: c } = N();
|
|
27
|
+
return {
|
|
28
|
+
...u,
|
|
29
|
+
value: b,
|
|
30
|
+
disabled: d,
|
|
31
|
+
inputValue: o,
|
|
32
|
+
focusedChipIndex: c
|
|
33
|
+
};
|
|
14
34
|
}
|
|
15
|
-
function
|
|
16
|
-
value:
|
|
17
|
-
defaultValue:
|
|
18
|
-
onValueChange:
|
|
19
|
-
disabled:
|
|
20
|
-
allowDuplicates:
|
|
21
|
-
children:
|
|
35
|
+
function J({
|
|
36
|
+
value: u,
|
|
37
|
+
defaultValue: b = [],
|
|
38
|
+
onValueChange: d,
|
|
39
|
+
disabled: o = !1,
|
|
40
|
+
allowDuplicates: c = !1,
|
|
41
|
+
children: s
|
|
22
42
|
}) {
|
|
23
|
-
const [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
43
|
+
const [p, a] = n.useState(b), [v, l] = n.useState(""), [C, I] = n.useState(-1), k = n.useRef(null), t = n.useRef([]), e = u !== void 0, r = e ? u : p, f = n.useRef(r), g = n.useRef(d), R = n.useRef(o);
|
|
44
|
+
n.useLayoutEffect(() => {
|
|
45
|
+
f.current = r, g.current = d, R.current = o;
|
|
46
|
+
}), n.useEffect(() => {
|
|
47
|
+
t.current.length > r.length && (t.current.length = r.length), C >= r.length && I(-1);
|
|
48
|
+
}, [r.length, C]);
|
|
49
|
+
const i = n.useCallback(
|
|
50
|
+
(w) => {
|
|
51
|
+
e || a(w), g.current?.(w);
|
|
30
52
|
},
|
|
31
|
-
[
|
|
32
|
-
), y =
|
|
33
|
-
(
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
53
|
+
[e]
|
|
54
|
+
), y = n.useCallback(
|
|
55
|
+
(w) => {
|
|
56
|
+
if (R.current) return;
|
|
57
|
+
const V = w.trim();
|
|
58
|
+
V && (c || !f.current.includes(V)) && (i([...f.current, V]), l(""));
|
|
37
59
|
},
|
|
38
|
-
[
|
|
39
|
-
),
|
|
40
|
-
(
|
|
41
|
-
|
|
60
|
+
[c, i]
|
|
61
|
+
), D = n.useCallback(
|
|
62
|
+
(w) => {
|
|
63
|
+
R.current || i(f.current.filter((V, L) => L !== w));
|
|
42
64
|
},
|
|
43
|
-
[
|
|
44
|
-
),
|
|
65
|
+
[i]
|
|
66
|
+
), h = n.useMemo(
|
|
45
67
|
() => ({
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
inputValue: u,
|
|
49
|
-
setInputValue: m,
|
|
50
|
-
disabled: l,
|
|
68
|
+
onValueChange: i,
|
|
69
|
+
setInputValue: l,
|
|
51
70
|
addItem: y,
|
|
52
|
-
removeItem:
|
|
53
|
-
inputRef:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
chipRefs: e
|
|
71
|
+
removeItem: D,
|
|
72
|
+
inputRef: k,
|
|
73
|
+
setFocusedChipIndex: I,
|
|
74
|
+
chipRefs: t
|
|
57
75
|
}),
|
|
58
|
-
[
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
k,
|
|
66
|
-
t,
|
|
67
|
-
d,
|
|
68
|
-
v,
|
|
69
|
-
e
|
|
70
|
-
]
|
|
76
|
+
[i, y, D]
|
|
77
|
+
), m = n.useMemo(
|
|
78
|
+
() => ({ value: r, disabled: o }),
|
|
79
|
+
[r, o]
|
|
80
|
+
), S = n.useMemo(
|
|
81
|
+
() => ({ inputValue: v, focusedChipIndex: C }),
|
|
82
|
+
[v, C]
|
|
71
83
|
);
|
|
72
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ x(A.Provider, { value: h, children: /* @__PURE__ */ x(B.Provider, { value: m, children: /* @__PURE__ */ x(K.Provider, { value: S, children: s }) }) });
|
|
73
85
|
}
|
|
74
|
-
const
|
|
86
|
+
const H = P(
|
|
75
87
|
[
|
|
76
88
|
// Layout
|
|
77
89
|
"relative flex w-full flex-wrap items-center gap-1",
|
|
@@ -102,7 +114,7 @@ const A = $(
|
|
|
102
114
|
error: !1
|
|
103
115
|
}
|
|
104
116
|
}
|
|
105
|
-
),
|
|
117
|
+
), T = [
|
|
106
118
|
// Reset and base
|
|
107
119
|
"flex-1 min-w-20",
|
|
108
120
|
"bg-transparent",
|
|
@@ -116,70 +128,61 @@ const A = $(
|
|
|
116
128
|
"focus:outline-none focus-visible:outline-none",
|
|
117
129
|
// Disabled
|
|
118
130
|
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
119
|
-
],
|
|
131
|
+
], W = n.forwardRef(
|
|
120
132
|
({
|
|
121
|
-
className:
|
|
122
|
-
error:
|
|
123
|
-
dataHook:
|
|
124
|
-
trackingEl:
|
|
125
|
-
trackingLabel:
|
|
126
|
-
placeholder:
|
|
127
|
-
inputId:
|
|
128
|
-
"aria-label":
|
|
129
|
-
"aria-labelledby":
|
|
130
|
-
children:
|
|
131
|
-
...
|
|
132
|
-
},
|
|
133
|
-
const {
|
|
134
|
-
value
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
setFocusedChipIndex: k,
|
|
141
|
-
chipRefs: R
|
|
142
|
-
} = F(), b = (i) => {
|
|
143
|
-
a(i.target.value);
|
|
144
|
-
}, C = (i) => {
|
|
145
|
-
if (i.key === "Enter" && e.trim() && (i.preventDefault(), g(e)), i.key === "ArrowLeft" && !e && t.length > 0) {
|
|
146
|
-
i.preventDefault();
|
|
147
|
-
const w = t.length - 1;
|
|
148
|
-
k(w), R.current[w]?.focus();
|
|
133
|
+
className: u,
|
|
134
|
+
error: b = !1,
|
|
135
|
+
dataHook: d,
|
|
136
|
+
trackingEl: o,
|
|
137
|
+
trackingLabel: c,
|
|
138
|
+
placeholder: s,
|
|
139
|
+
inputId: p,
|
|
140
|
+
"aria-label": a,
|
|
141
|
+
"aria-labelledby": v,
|
|
142
|
+
children: l,
|
|
143
|
+
...C
|
|
144
|
+
}, I) => {
|
|
145
|
+
const { setInputValue: k, addItem: t, inputRef: e, setFocusedChipIndex: r, chipRefs: f } = F(), { value: g, disabled: R } = $(), { inputValue: i } = N(), y = (h) => {
|
|
146
|
+
k(h.target.value);
|
|
147
|
+
}, D = (h) => {
|
|
148
|
+
if (h.key === "Enter" && i.trim() && (h.preventDefault(), t(i)), h.key === "ArrowLeft" && !i && g.length > 0) {
|
|
149
|
+
h.preventDefault();
|
|
150
|
+
const m = g.length - 1;
|
|
151
|
+
r(m), f.current[m]?.focus();
|
|
149
152
|
}
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
153
|
+
if (h.key === "Backspace" && !i && g.length > 0) {
|
|
154
|
+
h.preventDefault();
|
|
155
|
+
const m = g.length - 1;
|
|
156
|
+
r(m), f.current[m]?.focus();
|
|
154
157
|
}
|
|
155
158
|
};
|
|
156
|
-
return /* @__PURE__ */
|
|
159
|
+
return /* @__PURE__ */ M(
|
|
157
160
|
"div",
|
|
158
161
|
{
|
|
159
|
-
ref:
|
|
160
|
-
className:
|
|
161
|
-
"data-hook":
|
|
162
|
+
ref: I,
|
|
163
|
+
className: E(H({ error: b }), u),
|
|
164
|
+
"data-hook": d,
|
|
162
165
|
"data-slot": "input-chip",
|
|
163
|
-
"data-tracking-el":
|
|
164
|
-
"data-tracking-label":
|
|
165
|
-
...
|
|
166
|
+
"data-tracking-el": o,
|
|
167
|
+
"data-tracking-label": c,
|
|
168
|
+
...C,
|
|
166
169
|
children: [
|
|
167
|
-
|
|
168
|
-
/* @__PURE__ */
|
|
170
|
+
l,
|
|
171
|
+
/* @__PURE__ */ x(
|
|
169
172
|
"input",
|
|
170
173
|
{
|
|
171
|
-
ref:
|
|
172
|
-
"aria-label":
|
|
173
|
-
"aria-labelledby":
|
|
174
|
-
className:
|
|
174
|
+
ref: e,
|
|
175
|
+
"aria-label": a,
|
|
176
|
+
"aria-labelledby": v,
|
|
177
|
+
className: E(T),
|
|
175
178
|
"data-slot": "input-chip-input",
|
|
176
|
-
disabled:
|
|
177
|
-
id:
|
|
178
|
-
placeholder:
|
|
179
|
+
disabled: R,
|
|
180
|
+
id: p,
|
|
181
|
+
placeholder: s,
|
|
179
182
|
type: "text",
|
|
180
|
-
value:
|
|
181
|
-
onChange:
|
|
182
|
-
onKeyDown:
|
|
183
|
+
value: i,
|
|
184
|
+
onChange: y,
|
|
185
|
+
onKeyDown: D
|
|
183
186
|
}
|
|
184
187
|
)
|
|
185
188
|
]
|
|
@@ -187,91 +190,82 @@ const A = $(
|
|
|
187
190
|
);
|
|
188
191
|
}
|
|
189
192
|
);
|
|
190
|
-
|
|
191
|
-
function
|
|
192
|
-
className:
|
|
193
|
-
dataHookPrefix:
|
|
193
|
+
W.displayName = "InputChipInput";
|
|
194
|
+
function O({
|
|
195
|
+
className: u,
|
|
196
|
+
dataHookPrefix: b = "chip",
|
|
197
|
+
itemAriaLabel: d
|
|
194
198
|
}) {
|
|
195
|
-
const {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
setFocusedChipIndex: o,
|
|
201
|
-
chipRefs: c
|
|
202
|
-
} = F(), u = r.useRef(null);
|
|
203
|
-
r.useEffect(() => {
|
|
204
|
-
if (u.current !== null) {
|
|
205
|
-
if (u.current === "input")
|
|
206
|
-
h.current?.focus();
|
|
199
|
+
const { removeItem: o, inputRef: c, setFocusedChipIndex: s, chipRefs: p } = F(), { value: a, disabled: v } = $(), l = n.useRef(null);
|
|
200
|
+
n.useEffect(() => {
|
|
201
|
+
if (l.current !== null) {
|
|
202
|
+
if (l.current === "input")
|
|
203
|
+
c.current?.focus();
|
|
207
204
|
else {
|
|
208
|
-
const t =
|
|
209
|
-
t >= 0 && t <
|
|
205
|
+
const t = l.current;
|
|
206
|
+
t >= 0 && t < a.length ? p.current[t]?.focus() : a.length > 0 ? p.current[a.length - 1]?.focus() : c.current?.focus();
|
|
210
207
|
}
|
|
211
|
-
|
|
208
|
+
l.current = null;
|
|
212
209
|
}
|
|
213
|
-
}, [
|
|
214
|
-
const
|
|
215
|
-
if (!
|
|
210
|
+
}, [a.length, c, p]);
|
|
211
|
+
const C = (t, e) => {
|
|
212
|
+
if (!v)
|
|
216
213
|
switch (t.key) {
|
|
217
214
|
case "ArrowLeft":
|
|
218
|
-
t.preventDefault(), e > 0 && (
|
|
215
|
+
t.preventDefault(), e > 0 && (s(e - 1), p.current[e - 1]?.focus());
|
|
219
216
|
break;
|
|
220
217
|
case "ArrowRight":
|
|
221
|
-
t.preventDefault(), e <
|
|
218
|
+
t.preventDefault(), e < a.length - 1 ? (s(e + 1), p.current[e + 1]?.focus()) : (s(-1), c.current?.focus());
|
|
222
219
|
break;
|
|
223
220
|
case "Backspace":
|
|
224
221
|
case "Delete": {
|
|
225
222
|
t.preventDefault();
|
|
226
|
-
const
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
-
else if (e >=
|
|
230
|
-
const
|
|
231
|
-
|
|
223
|
+
const r = a.length - 1;
|
|
224
|
+
if (r === 0)
|
|
225
|
+
s(-1), l.current = "input", o(e);
|
|
226
|
+
else if (e >= r) {
|
|
227
|
+
const f = r - 1;
|
|
228
|
+
s(f), l.current = f, o(e);
|
|
232
229
|
} else
|
|
233
|
-
|
|
230
|
+
s(e), l.current = e, o(e);
|
|
234
231
|
break;
|
|
235
232
|
}
|
|
236
233
|
case "Home":
|
|
237
|
-
t.preventDefault(),
|
|
234
|
+
t.preventDefault(), a.length > 0 && (s(0), p.current[0]?.focus());
|
|
238
235
|
break;
|
|
239
236
|
case "End":
|
|
240
|
-
t.preventDefault(),
|
|
237
|
+
t.preventDefault(), s(-1), c.current?.focus();
|
|
241
238
|
break;
|
|
242
239
|
}
|
|
243
|
-
},
|
|
244
|
-
|
|
245
|
-
},
|
|
240
|
+
}, I = (t) => {
|
|
241
|
+
s(t);
|
|
242
|
+
}, k = (t) => {
|
|
246
243
|
const e = t.relatedTarget;
|
|
247
|
-
e && (e.closest('[data-slot="chip"]') !== null || e.dataset.slot === "input-chip-input") ||
|
|
244
|
+
e && (e.closest('[data-slot="chip"]') !== null || e.dataset.slot === "input-chip-input") || s(-1);
|
|
248
245
|
};
|
|
249
|
-
return
|
|
250
|
-
|
|
246
|
+
return a.length === 0 ? null : /* @__PURE__ */ x("div", { className: E("contents", u), "data-slot": "input-chip-items", children: a.map((t, e) => /* @__PURE__ */ x(
|
|
247
|
+
j,
|
|
251
248
|
{
|
|
252
|
-
ref: (
|
|
253
|
-
|
|
249
|
+
ref: (r) => {
|
|
250
|
+
p.current[e] = r;
|
|
254
251
|
},
|
|
255
|
-
"aria-label": `${t}, press Delete to remove`,
|
|
256
|
-
dataHook: `${
|
|
257
|
-
disabled:
|
|
252
|
+
"aria-label": d ? d.replace("{item}", t) : `${t}, press Delete to remove`,
|
|
253
|
+
dataHook: `${b}-${e}`,
|
|
254
|
+
disabled: v,
|
|
258
255
|
role: "group",
|
|
259
256
|
tabIndex: -1,
|
|
260
|
-
onBlur:
|
|
261
|
-
onFocus: () =>
|
|
262
|
-
onKeyDown: (
|
|
263
|
-
onRemove: () =>
|
|
257
|
+
onBlur: k,
|
|
258
|
+
onFocus: () => I(e),
|
|
259
|
+
onKeyDown: (r) => C(r, e),
|
|
260
|
+
onRemove: () => o(e),
|
|
264
261
|
children: t
|
|
265
262
|
},
|
|
266
263
|
`${t}-${e}`
|
|
267
264
|
)) });
|
|
268
265
|
}
|
|
269
|
-
const M = A;
|
|
270
266
|
export {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
M as inputChipVariants,
|
|
276
|
-
F as useInputChipContext
|
|
267
|
+
J as InputChip,
|
|
268
|
+
W as InputChipInput,
|
|
269
|
+
O as InputChipItems,
|
|
270
|
+
G as useInputChipContext
|
|
277
271
|
};
|
package/dist/input-group.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ interface InputGroupAddonProps extends React.HTMLAttributes<HTMLDivElement>, Var
|
|
|
34
34
|
declare const InputGroupAddon: React.ForwardRefExoticComponent<InputGroupAddonProps & React.RefAttributes<HTMLDivElement>>;
|
|
35
35
|
declare const inputGroupButtonVariants: (props?: ({
|
|
36
36
|
variant?: "default" | "ghost" | null | undefined;
|
|
37
|
-
size?: "default" | "
|
|
37
|
+
size?: "default" | "icon" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
38
38
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
39
39
|
interface InputGroupButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof inputGroupButtonVariants> {
|
|
40
40
|
asChild?: boolean;
|
package/dist/input-password.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),D=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),D=require("react"),j=require("@brightlocal/icons"),M=require("@brightlocal/ui-components/progress"),y=require("@brightlocal/ui-components/lib/utils"),w=require("@brightlocal/ui-components/input-group");function $(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const n=$(D),O={meter:{label:"Meter",value:0,color:"bg-green-500"},weak:{label:"Weak",value:25,color:"bg-green-500"},ok:{label:"Ok",value:50,color:"bg-green-500"},good:{label:"Good",value:75,color:"bg-green-500"},great:{label:"Great",value:100,color:"bg-green-500"}};function L(e){if(!e||e.length===0)return"meter";if(e.length<12)return"weak";let t=0;return e.length>=16&&(t+=1),/[a-z]/.test(e)&&(t+=1),/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[^a-zA-Z0-9]/.test(e)&&(t+=1),t<=1?"ok":t<=3?"good":"great"}const _=n.createContext(null);function k(){const e=n.useContext(_);if(!e)throw new Error("InputPassword compound components must be used within InputPasswordRoot");return e}function q({children:e,dataHook:t,trackingEl:o,trackingLabel:r,disabled:u,value:a,onChange:l,onStrengthChange:i,strengthLevels:g,calculateStrength:p,error:c,id:h,className:f}){const[m,b]=n.useState(!1),[S,v]=n.useState(""),[P,x]=n.useState("meter"),F=n.useId(),E=h||F,I=a!==void 0?a:S,N=g??O,T=p??L,R=n.useCallback(d=>{a===void 0&&v(d),l?.(d)},[a,l]),G=n.useCallback(()=>{b(d=>!d)},[]);n.useEffect(()=>{const d=setTimeout(()=>{const C=T(I);x(C),i?.(C)},180);return()=>clearTimeout(d)},[I,T,i]);const z=n.useMemo(()=>({showPassword:m,setShowPassword:b,toggleVisibility:G,password:I,setPassword:R,strength:P,strengthLevels:N,disabled:u,dataHook:t,trackingEl:o,trackingLabel:r,inputId:E,error:c}),[m,G,I,R,P,N,u,t,o,r,E,c]);return s.jsx(_.Provider,{value:z,children:s.jsx("div",{className:y.cn("w-full",f),"data-hook":t,"data-slot":"input-password",children:e})})}q.displayName="InputPasswordRoot";const H=n.forwardRef(({className:e,groupClassName:t,onChange:o,showLabel:r,hideLabel:u,...a},l)=>{const{showPassword:i,toggleVisibility:g,password:p,setPassword:c,disabled:h,dataHook:f,trackingEl:m,trackingLabel:b,inputId:S,error:v}=k(),P=x=>{c(x.target.value),o?.(x)};return s.jsxs(w.InputGroup,{className:t,dataHook:f,error:v,children:[s.jsx(w.InputGroupInput,{ref:l,className:e,disabled:h,id:S,trackingEl:m,trackingLabel:b,type:i?"text":"password",value:p,onChange:P,...a}),s.jsx(w.InputGroupAddon,{align:"inline-end",children:s.jsx(w.InputGroupButton,{"aria-label":i?u??"Hide password":r??"Show password","data-hook":`${f}-toggle`,disabled:h,size:"icon-sm",variant:"ghost",onClick:g,children:i?s.jsx(j.EyeOff,{}):s.jsx(j.Eye,{})})})]})});H.displayName="InputPasswordField";const V=n.forwardRef(({className:e,showLabel:t,hideLabel:o,size:r="icon",variant:u="ghost",...a},l)=>{const{showPassword:i,toggleVisibility:g,disabled:p,dataHook:c}=k();return s.jsx(w.InputGroupButton,{ref:l,"aria-label":i?o??"Hide password":t??"Show password",className:e,"data-hook":`${c}-toggle`,disabled:p,size:r,variant:u,onClick:g,...a,children:i?s.jsx(j.EyeOff,{}):s.jsx(j.Eye,{})})});V.displayName="InputPasswordToggle";function A({className:e,showLabel:t=!0}){const{strength:o,strengthLevels:r,dataHook:u,disabled:a}=k(),l=r[o]??{label:o,value:0,color:"bg-muted"};return s.jsx("div",{className:y.cn("mt-1 space-y-2",e),children:s.jsxs("div",{className:y.cn("flex items-center gap-2",a&&"opacity-50"),children:[s.jsx(M.Progress,{className:"h-2 flex-1",dataHook:`${u}-strength-progress`,indicatorClassName:l.color,value:l.value}),t&&s.jsx("span",{className:"text-foreground w-10 shrink-0 text-right text-sm font-medium whitespace-nowrap","data-hook":`${u}-strength-label`,children:l.label})]})})}A.displayName="InputPasswordStrength";exports.DEFAULT_STRENGTH_LEVELS=O;exports.InputPasswordField=H;exports.InputPasswordRoot=q;exports.InputPasswordStrength=A;exports.InputPasswordToggle=V;exports.calculatePasswordStrength=L;
|
package/dist/input-password.d.ts
CHANGED
|
@@ -122,6 +122,16 @@ export interface InputPasswordFieldProps extends Omit<React.ComponentProps<typeo
|
|
|
122
122
|
* Additional class name for the InputGroup wrapper
|
|
123
123
|
*/
|
|
124
124
|
groupClassName?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Accessible label for the toggle button when password is hidden.
|
|
127
|
+
* @default "Show password"
|
|
128
|
+
*/
|
|
129
|
+
showLabel?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Accessible label for the toggle button when password is visible.
|
|
132
|
+
* @default "Hide password"
|
|
133
|
+
*/
|
|
134
|
+
hideLabel?: string;
|
|
125
135
|
}
|
|
126
136
|
/**
|
|
127
137
|
* InputPasswordField - The password input field with toggle button
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-password.d.ts","sourceRoot":"","sources":["../../src/components/input-password.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"input-password.d.ts","sourceRoot":"","sources":["../../src/components/input-password.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAEL,eAAe,EAEf,gBAAgB,EACjB,MAAM,wCAAwC,CAAC;AAMhD;;GAEG;AACH,KAAK,uBAAuB,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1E;;GAEG;AACH,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,QAAA,MAAM,uBAAuB,EAAE,MAAM,CACnC,uBAAuB,EACvB,mBAAmB,CAOpB,CAAC;AAEF;;;GAGG;AACH,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,uBAAuB,CAyB5E;AAkDD,MAAM,WAAW,sBAAsB,CACrC,CAAC,SAAS,MAAM,GAAG,uBAAuB;IAE1C;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE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