@brightlocal/ui-components 0.1.1 → 0.1.3
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/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +74 -4
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +100 -105
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +30 -10
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +129 -132
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +11 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +16 -20
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +43 -3
- package/dist/avatar.d.ts.map +1 -1
- package/dist/avatar.js +18 -16
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +24 -9
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +34 -32
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +209 -202
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +154 -154
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +63 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +97 -93
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +17 -45
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +49 -50
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +12 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -8
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +58 -18
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +60 -51
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +99 -9
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +142 -128
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +18 -2
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +46 -33
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +70 -7
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +71 -66
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +9 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +61 -82
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +65 -8
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +41 -55
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +29 -11
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +193 -159
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +115 -9
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +176 -152
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +188 -20
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +119 -121
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +75 -9
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +220 -81
- package/dist/description.cjs +1 -0
- package/dist/description.d.ts +37 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +25 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +73 -9
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +103 -112
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +92 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +67 -52
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +95 -11
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +146 -106
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +23 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +54 -53
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +27 -17
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +86 -79
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +36 -6
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +44 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +383 -387
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +21 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +51 -41
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +24 -25
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +38 -24
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +68 -136
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +20 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +31 -18
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +3 -0
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +12 -10
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +40 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -76
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +59 -4
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +42 -34
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +9 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +71 -59
- package/dist/radio-group.d.ts +40 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/rating.d.ts +4 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +65 -4
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +53 -36
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +46 -5
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +42 -38
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +30 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +64 -54
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +49 -2
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +48 -36
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +80 -9
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -113
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +24 -2
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +15 -9
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +18 -4
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +72 -66
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +4 -2
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +29 -28
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +3 -1
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +38 -36
- package/package.json +8 -2
- package/src/blocks/data-table.tsx +42 -32
- package/src/blocks/sidebar.tsx +4 -12
- package/src/components/accordion.tsx +163 -77
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +26 -13
- package/src/components/aspect-ratio.tsx +25 -16
- package/src/components/avatar.tsx +56 -8
- package/src/components/badge.tsx +65 -42
- package/src/components/breadcrumb.tsx +158 -82
- package/src/components/button.tsx +41 -62
- package/src/components/calendar.tsx +16 -2
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +67 -35
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +42 -78
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +242 -144
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +278 -81
- package/src/components/date-picker.tsx +281 -30
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +162 -86
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +36 -11
- package/src/components/global-layout.tsx +116 -77
- package/src/components/hover-card.tsx +54 -14
- package/src/components/input-group.tsx +56 -18
- package/src/components/input-password.tsx +3 -4
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/logo.tsx +3 -0
- package/src/components/menubar.tsx +58 -4
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +40 -0
- package/src/components/rating.tsx +4 -1
- package/src/components/resizable.tsx +119 -31
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +21 -1
- package/src/components/separator.tsx +97 -20
- package/src/components/sheet.tsx +180 -79
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +10 -7
- package/src/components/split-layout.tsx +4 -1
- package/src/components/table.tsx +1 -1
- package/src/components/toggle-group.tsx +4 -0
- package/src/index.ts +1 -1
- package/dist/input-base.cjs +0 -1
- package/dist/input-base.d.ts +0 -28
- package/dist/input-base.d.ts.map +0 -1
- package/dist/input-base.js +0 -56
- package/src/components/input-base.tsx +0 -86
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"),m=require("react"),h=require("@radix-ui/react-slot"),c=require("class-variance-authority"),a=require("@brightlocal/ui-components/lib/utils"),G=require("./input.cjs");function x(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 i=x(m),d=c.cva("relative flex w-full items-center overflow-hidden rounded-md border border-input bg-background transition-colors has-[:focus-visible]:border-ring has-[:focus-visible]:shadow-default has-[:disabled]:opacity-50",{variants:{size:{default:"h-9",sm:"h-8",lg:"h-10"}},defaultVariants:{size:"default"}}),p=i.forwardRef(({className:t,size:n,dataHook:e,trackingEl:o,trackingLabel:s,...u},l)=>r.jsx("div",{ref:l,className:a.cn(d({size:n}),t),"data-hook":e,"data-slot":"input-group","data-tracking-el":o,"data-tracking-label":s,...u}));p.displayName="InputGroup";const f=i.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 I=c.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"}}),g=i.forwardRef(({className:t,align:n,...e},o)=>r.jsx("div",{ref:o,className:a.cn(I({align:n}),t),"data-slot":"input-group-addon",...e}));g.displayName="InputGroupAddon";const b=c.cva(["inline-flex items-center justify-center gap-2","text-sm font-medium transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2","disabled:pointer-events-none disabled:opacity-50","text-muted-foreground hover:text-foreground","[&_svg]:pointer-events-none [&_svg]:size-4 [&_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=i.forwardRef(({className:t,variant:n,size:e,asChild:o=!1,...s},u)=>{const l=o?h.Slot:"button";return r.jsx(l,{ref:u,className:a.cn(b({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=g;exports.InputGroupButton=v;exports.InputGroupInput=f;exports.inputGroupButtonVariants=b;exports.inputGroupVariants=d;
|
package/dist/input-group.d.ts
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { InputProps } from './input';
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
declare const inputGroupVariants: (props?: ({
|
|
4
5
|
size?: "default" | "sm" | "lg" | null | undefined;
|
|
5
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
7
|
interface InputGroupProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof inputGroupVariants> {
|
|
8
|
+
/**
|
|
9
|
+
* Data hook for automated testing (REQUIRED)
|
|
10
|
+
*/
|
|
11
|
+
dataHook: string;
|
|
12
|
+
/**
|
|
13
|
+
* Tracking element identifier for analytics
|
|
14
|
+
*/
|
|
15
|
+
trackingEl?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Tracking label for analytics context
|
|
18
|
+
*/
|
|
19
|
+
trackingLabel?: string;
|
|
7
20
|
}
|
|
8
21
|
declare const InputGroup: React.ForwardRefExoticComponent<InputGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
|
|
22
|
+
type InputGroupInputProps = Omit<InputProps, "hasIcon" | "hasSecondaryIcon" | "dataHook">;
|
|
23
|
+
declare const InputGroupInput: React.ForwardRefExoticComponent<InputGroupInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
10
24
|
declare const inputGroupAddonVariants: (props?: ({
|
|
11
25
|
align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
|
|
12
26
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -19,8 +33,13 @@ declare const inputGroupButtonVariants: (props?: ({
|
|
|
19
33
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
20
34
|
interface InputGroupButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof inputGroupButtonVariants> {
|
|
21
35
|
asChild?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Size variant for the button.
|
|
38
|
+
* Options: "default" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg"
|
|
39
|
+
*/
|
|
40
|
+
size?: NonNullable<VariantProps<typeof inputGroupButtonVariants>["size"]>;
|
|
22
41
|
}
|
|
23
42
|
declare const InputGroupButton: React.ForwardRefExoticComponent<InputGroupButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
24
43
|
export { InputGroup, InputGroupInput, InputGroupAddon, InputGroupButton, inputGroupVariants, inputGroupButtonVariants, };
|
|
25
|
-
export type { InputGroupProps, InputGroupAddonProps, InputGroupButtonProps };
|
|
44
|
+
export type { InputGroupProps, InputGroupInputProps, InputGroupAddonProps, InputGroupButtonProps, };
|
|
26
45
|
//# sourceMappingURL=input-group.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/components/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/components/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAEjD,QAAA,MAAM,kBAAkB;;8EAcvB,CAAC;AAEF,UAAU,eACR,SACE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACzC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,QAAA,MAAM,UAAU,wFAcf,CAAC;AAGF,KAAK,oBAAoB,GAAG,IAAI,CAC9B,UAAU,EACV,SAAS,GAAG,kBAAkB,GAAG,UAAU,CAC5C,CAAC;AAEF,QAAA,MAAM,eAAe,+FAiBnB,CAAC;AAGH,QAAA,MAAM,uBAAuB;;8EAe5B,CAAC;AAEF,UAAU,oBACR,SACE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,YAAY,CAAC,OAAO,uBAAuB,CAAC;CAAG;AAEnD,QAAA,MAAM,eAAe,6FAWpB,CAAC;AAGF,QAAA,MAAM,wBAAwB;;;8EA8B7B,CAAC;AAEF,UAAU,qBACR,SACE,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,YAAY,CAAC,OAAO,wBAAwB,CAAC;IAC/C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;CAC3E;AAED,QAAA,MAAM,gBAAgB,iGAcpB,CAAC;AAGH,OAAO,EACL,UAAU,EACV,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,wBAAwB,GACzB,CAAC;AACF,YAAY,EACV,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,GACtB,CAAC"}
|
package/dist/input-group.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { Slot as
|
|
4
|
-
import { cva as
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { Slot as p } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as d } from "class-variance-authority";
|
|
5
5
|
import { cn as i } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
-
import {
|
|
7
|
-
const
|
|
6
|
+
import { Input as f } from "./input.js";
|
|
7
|
+
const c = d(
|
|
8
8
|
"relative flex w-full items-center overflow-hidden rounded-md border border-input bg-background transition-colors has-[:focus-visible]:border-ring has-[:focus-visible]:shadow-default has-[:disabled]:opacity-50",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
@@ -18,19 +18,23 @@ const f = a(
|
|
|
18
18
|
size: "default"
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
),
|
|
22
|
-
({ className: t, size: e, ...
|
|
21
|
+
), m = a.forwardRef(
|
|
22
|
+
({ className: t, size: o, dataHook: n, trackingEl: e, trackingLabel: s, ...u }, l) => /* @__PURE__ */ r(
|
|
23
23
|
"div",
|
|
24
24
|
{
|
|
25
|
-
ref:
|
|
26
|
-
className: i(
|
|
27
|
-
|
|
25
|
+
ref: l,
|
|
26
|
+
className: i(c({ size: o }), t),
|
|
27
|
+
"data-hook": n,
|
|
28
|
+
"data-slot": "input-group",
|
|
29
|
+
"data-tracking-el": e,
|
|
30
|
+
"data-tracking-label": s,
|
|
31
|
+
...u
|
|
28
32
|
}
|
|
29
33
|
)
|
|
30
34
|
);
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
35
|
+
m.displayName = "InputGroup";
|
|
36
|
+
const g = a.forwardRef(({ className: t, ...o }, n) => /* @__PURE__ */ r(
|
|
37
|
+
f,
|
|
34
38
|
{
|
|
35
39
|
ref: n,
|
|
36
40
|
className: i(
|
|
@@ -39,34 +43,39 @@ const m = s.forwardRef(({ className: t, ...e }, n) => /* @__PURE__ */ r(
|
|
|
39
43
|
"h-full",
|
|
40
44
|
t
|
|
41
45
|
),
|
|
42
|
-
|
|
46
|
+
dataHook: "input-group-input",
|
|
47
|
+
...o
|
|
43
48
|
}
|
|
44
49
|
));
|
|
45
|
-
|
|
46
|
-
const v =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
g.displayName = "InputGroupInput";
|
|
51
|
+
const v = d(
|
|
52
|
+
"flex shrink-0 items-center text-muted-foreground",
|
|
53
|
+
{
|
|
54
|
+
variants: {
|
|
55
|
+
align: {
|
|
56
|
+
"inline-start": "",
|
|
57
|
+
"inline-end": "ml-auto",
|
|
58
|
+
"block-start": "self-start",
|
|
59
|
+
"block-end": "self-end"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
defaultVariants: {
|
|
63
|
+
align: "inline-start"
|
|
53
64
|
}
|
|
54
|
-
},
|
|
55
|
-
defaultVariants: {
|
|
56
|
-
align: "inline-start"
|
|
57
65
|
}
|
|
58
|
-
|
|
59
|
-
({ className: t, align:
|
|
66
|
+
), b = a.forwardRef(
|
|
67
|
+
({ className: t, align: o, ...n }, e) => /* @__PURE__ */ r(
|
|
60
68
|
"div",
|
|
61
69
|
{
|
|
62
|
-
ref:
|
|
63
|
-
className: i(v({ align:
|
|
70
|
+
ref: e,
|
|
71
|
+
className: i(v({ align: o }), t),
|
|
72
|
+
"data-slot": "input-group-addon",
|
|
64
73
|
...n
|
|
65
74
|
}
|
|
66
75
|
)
|
|
67
76
|
);
|
|
68
77
|
b.displayName = "InputGroupAddon";
|
|
69
|
-
const h =
|
|
78
|
+
const h = d(
|
|
70
79
|
[
|
|
71
80
|
"inline-flex items-center justify-center gap-2",
|
|
72
81
|
"text-sm font-medium transition-colors",
|
|
@@ -96,21 +105,22 @@ const h = a(
|
|
|
96
105
|
size: "default"
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
|
-
),
|
|
100
|
-
|
|
108
|
+
), x = a.forwardRef(({ className: t, variant: o, size: n, asChild: e = !1, ...s }, u) => /* @__PURE__ */ r(
|
|
109
|
+
e ? p : "button",
|
|
101
110
|
{
|
|
102
|
-
ref:
|
|
103
|
-
className: i(h({ variant:
|
|
104
|
-
|
|
105
|
-
|
|
111
|
+
ref: u,
|
|
112
|
+
className: i(h({ variant: o, size: n, className: t })),
|
|
113
|
+
"data-slot": "input-group-button",
|
|
114
|
+
type: e ? void 0 : "button",
|
|
115
|
+
...s
|
|
106
116
|
}
|
|
107
117
|
));
|
|
108
|
-
|
|
118
|
+
x.displayName = "InputGroupButton";
|
|
109
119
|
export {
|
|
110
|
-
|
|
120
|
+
m as InputGroup,
|
|
111
121
|
b as InputGroupAddon,
|
|
112
|
-
|
|
113
|
-
|
|
122
|
+
x as InputGroupButton,
|
|
123
|
+
g as InputGroupInput,
|
|
114
124
|
h as inputGroupButtonVariants,
|
|
115
|
-
|
|
125
|
+
c as inputGroupVariants
|
|
116
126
|
};
|
package/dist/input-password.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),q=require("react"),h=require("lucide-react"),A=require("@brightlocal/ui-components/progress"),E=require("@brightlocal/ui-components/lib/utils"),l=require("@brightlocal/ui-components/input-group");function _(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),q=require("react"),h=require("lucide-react"),A=require("@brightlocal/ui-components/progress"),E=require("@brightlocal/ui-components/lib/utils"),l=require("@brightlocal/ui-components/input-group");function _(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const a=_(q),p={meter:{label:"Meter",value:0,color:"bg-muted"},weak:{label:"Weak",value:25,color:"bg-red-500"},ok:{label:"Ok",value:50,color:"bg-orange-500"},good:{label:"Good",value:75,color:"bg-green-500"},great:{label:"Great",value:100,color:"bg-green-600"}};function m(e){if(!e||e.length===0)return"meter";let t=0;return e.length>=8&&(t+=1),e.length>=12&&(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<=2?"weak":t<=3?"ok":t<=4?"good":"great"}const b=a.forwardRef(({className:e,showStrength:t=!0,onStrengthChange:n,dataHook:s,trackingEl:w,trackingLabel:S,onChange:x,value:i,id:j,...u},v)=>{const[c,P]=a.useState(!1),[I,y]=a.useState("meter"),[N,O]=a.useState(""),G=a.useId(),R=j||G,g=i!==void 0?String(i):N;a.useEffect(()=>{const o=setTimeout(()=>{const f=m(g);y(f),n?.(f)},180);return()=>clearTimeout(o)},[g,n]);const T=o=>{O(o.target.value),x?.(o)},k=()=>{P(o=>!o)},d=p[I];return r.jsxs("div",{className:"w-full",children:[r.jsxs(l.InputGroup,{className:e,dataHook:s,children:[r.jsx(l.InputGroupInput,{ref:v,id:R,trackingEl:w,trackingLabel:S,type:c?"text":"password",value:i,onChange:T,...u}),r.jsx(l.InputGroupAddon,{align:"inline-end",children:r.jsx(l.InputGroupButton,{"aria-label":c?"Hide password":"Show password","data-hook":s?`${s}-toggle`:void 0,disabled:u.disabled,size:"icon",variant:"ghost",onClick:k,children:c?r.jsx(h.EyeOff,{className:"h-4 w-4"}):r.jsx(h.Eye,{className:"h-4 w-4"})})})]}),t&&r.jsx("div",{className:"mt-1 space-y-2",children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(A.Progress,{className:E.cn("h-2 flex-1"),dataHook:s?`${s}-strength-progress`:"password-strength-progress",value:d.value}),r.jsx("span",{className:"text-foreground w-10 shrink-0 text-right text-sm font-medium whitespace-nowrap","data-hook":s?`${s}-strength-label`:void 0,children:d.label})]})})]})});b.displayName="InputPassword";exports.InputPassword=b;exports.PASSWORD_STRENGTH=p;exports.calculatePasswordStrength=m;
|
|
@@ -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;AAY/B,KAAK,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,EAAE,sBAAsB,CAMvE,CAAC;AAEF,UAAU,kBAAmB,SAAQ,IAAI,CACvC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAC7B,MAAM,CACP;IACC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACxD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAsBrE;AAED,QAAA,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"input-password.d.ts","sourceRoot":"","sources":["../../src/components/input-password.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,KAAK,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnE,UAAU,sBAAsB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,EAAE,sBAAsB,CAMvE,CAAC;AAEF,UAAU,kBAAmB,SAAQ,IAAI,CACvC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAC7B,MAAM,CACP;IACC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACxD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,CAsBrE;AAED,QAAA,MAAM,aAAa,0GAqGlB,CAAC;AAIF,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,CAAC;AACvE,YAAY,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/input-password.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
2
|
+
import * as o from "react";
|
|
3
3
|
import { EyeOff as A, Eye as E } from "lucide-react";
|
|
4
4
|
import { Progress as R } from "@brightlocal/ui-components/progress";
|
|
5
5
|
import { cn as T } from "@brightlocal/ui-components/lib/utils";
|
|
@@ -17,58 +17,57 @@ function j(t) {
|
|
|
17
17
|
let e = 0;
|
|
18
18
|
return t.length >= 8 && (e += 1), t.length >= 12 && (e += 1), /[a-z]/.test(t) && (e += 1), /[A-Z]/.test(t) && (e += 1), /[0-9]/.test(t) && (e += 1), /[^a-zA-Z0-9]/.test(t) && (e += 1), e <= 2 ? "weak" : e <= 3 ? "ok" : e <= 4 ? "good" : "great";
|
|
19
19
|
}
|
|
20
|
-
const W =
|
|
20
|
+
const W = o.forwardRef(
|
|
21
21
|
({
|
|
22
22
|
className: t,
|
|
23
23
|
showStrength: e = !0,
|
|
24
24
|
onStrengthChange: c,
|
|
25
25
|
dataHook: n,
|
|
26
|
-
trackingEl:
|
|
26
|
+
trackingEl: h,
|
|
27
27
|
trackingLabel: f,
|
|
28
28
|
onChange: p,
|
|
29
|
-
value:
|
|
29
|
+
value: l,
|
|
30
30
|
id: b,
|
|
31
31
|
...u
|
|
32
32
|
}, w) => {
|
|
33
|
-
const [
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
S(
|
|
33
|
+
const [a, v] = o.useState(!1), [I, S] = o.useState("meter"), [x, N] = o.useState(""), P = o.useId(), G = b || P, g = l !== void 0 ? String(l) : x;
|
|
34
|
+
o.useEffect(() => {
|
|
35
|
+
const s = setTimeout(() => {
|
|
36
|
+
const m = j(g);
|
|
37
|
+
S(m), c?.(m);
|
|
38
38
|
}, 180);
|
|
39
|
-
return () => clearTimeout(
|
|
39
|
+
return () => clearTimeout(s);
|
|
40
40
|
}, [g, c]);
|
|
41
|
-
const
|
|
42
|
-
N(
|
|
43
|
-
},
|
|
44
|
-
v((
|
|
41
|
+
const y = (s) => {
|
|
42
|
+
N(s.target.value), p?.(s);
|
|
43
|
+
}, k = () => {
|
|
44
|
+
v((s) => !s);
|
|
45
45
|
}, d = $[I];
|
|
46
46
|
return /* @__PURE__ */ i("div", { className: "w-full", children: [
|
|
47
|
-
/* @__PURE__ */ i(V, { className: t, children: [
|
|
47
|
+
/* @__PURE__ */ i(V, { className: t, dataHook: n, children: [
|
|
48
48
|
/* @__PURE__ */ r(
|
|
49
49
|
z,
|
|
50
50
|
{
|
|
51
51
|
ref: w,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
onChange: G,
|
|
52
|
+
id: G,
|
|
53
|
+
trackingEl: h,
|
|
54
|
+
trackingLabel: f,
|
|
55
|
+
type: a ? "text" : "password",
|
|
56
|
+
value: l,
|
|
57
|
+
onChange: y,
|
|
59
58
|
...u
|
|
60
59
|
}
|
|
61
60
|
),
|
|
62
61
|
/* @__PURE__ */ r(C, { align: "inline-end", children: /* @__PURE__ */ r(
|
|
63
62
|
O,
|
|
64
63
|
{
|
|
65
|
-
"aria-label":
|
|
64
|
+
"aria-label": a ? "Hide password" : "Show password",
|
|
66
65
|
"data-hook": n ? `${n}-toggle` : void 0,
|
|
67
66
|
disabled: u.disabled,
|
|
68
67
|
size: "icon",
|
|
69
68
|
variant: "ghost",
|
|
70
|
-
onClick:
|
|
71
|
-
children:
|
|
69
|
+
onClick: k,
|
|
70
|
+
children: a ? /* @__PURE__ */ r(A, { className: "h-4 w-4" }) : /* @__PURE__ */ r(E, { className: "h-4 w-4" })
|
|
72
71
|
}
|
|
73
72
|
) })
|
|
74
73
|
] }),
|
package/dist/input.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 u=require("react/jsx-runtime"),f=require("react"),b=require("class-variance-authority"),p=require("@brightlocal/ui-components/lib/utils");function v(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 g=v(f),i=b.cva(["flex w-full min-w-0 h-9","border border-input bg-background rounded-sm","outline-none transition-all","text-sm 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 pb-[1px] leading-5","[&::-webkit-calendar-picker-indicator]:hidden"],{variants:{hasIcon:{true:"pl-9",false:""},hasSecondaryIcon:{true:"pr-9",false:""}},defaultVariants:{hasIcon:!1,hasSecondaryIcon:!1}}),o=g.forwardRef(({className:e,hasIcon:r=!1,hasSecondaryIcon:t=!1,dataHook:a,trackingEl:s,trackingLabel:l,...n},c)=>{const d=n["aria-invalid"]===!0||n["aria-invalid"]==="true";return u.jsx("input",{ref:c,className:p.cn(i({hasIcon:r,hasSecondaryIcon:t}),d&&"border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive",e),"data-hook":a,"data-slot":"input","data-tracking-el":s,"data-tracking-label":l,...n})});o.displayName="Input";exports.Input=o;exports.inputVariants=i;
|
package/dist/input.d.ts
CHANGED
|
@@ -1,32 +1,46 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Shared input variant styles
|
|
5
|
+
* These can be reused across different input components
|
|
6
|
+
*/
|
|
7
|
+
export declare const inputVariants: (props?: ({
|
|
8
|
+
hasIcon?: boolean | null | undefined;
|
|
9
|
+
hasSecondaryIcon?: boolean | null | undefined;
|
|
10
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
11
|
+
/**
|
|
12
|
+
* Simple styled input element
|
|
13
|
+
*
|
|
14
|
+
* For inputs with label/description, compose with Field, FieldLabel, FieldDescription:
|
|
15
|
+
* ```tsx
|
|
16
|
+
* <Field>
|
|
17
|
+
* <FieldLabel htmlFor="email">Email</FieldLabel>
|
|
18
|
+
* <Input id="email" placeholder="Enter email" dataHook="email-input" />
|
|
19
|
+
* <FieldDescription>We'll never share your email</FieldDescription>
|
|
20
|
+
* </Field>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* For decorative icons, use InputGroup:
|
|
24
|
+
* ```tsx
|
|
25
|
+
* <InputGroup>
|
|
26
|
+
* <InputGroupAddon><SearchIcon /></InputGroupAddon>
|
|
27
|
+
* <InputGroupInput placeholder="Search..." />
|
|
28
|
+
* </InputGroup>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "size">, VariantProps<typeof inputVariants> {
|
|
7
32
|
/**
|
|
8
|
-
*
|
|
9
|
-
* If not provided, use aria-label for accessibility.
|
|
33
|
+
* Required data-hook attribute for automated testing
|
|
10
34
|
*/
|
|
11
|
-
label?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
link?: {
|
|
14
|
-
text: string & {
|
|
15
|
-
length: 1;
|
|
16
|
-
};
|
|
17
|
-
href?: string;
|
|
18
|
-
onClick?: () => void;
|
|
19
|
-
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
20
|
-
};
|
|
21
35
|
dataHook: string;
|
|
22
|
-
|
|
23
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Optional tracking element identifier for analytics
|
|
38
|
+
*/
|
|
24
39
|
trackingEl?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Optional tracking label for analytics context
|
|
42
|
+
*/
|
|
25
43
|
trackingLabel?: string;
|
|
26
|
-
icon?: React.ReactNode;
|
|
27
|
-
secondaryIcon?: React.ReactNode;
|
|
28
44
|
}
|
|
29
|
-
declare const Input: React.ForwardRefExoticComponent<
|
|
30
|
-
export { Input, InputLayout };
|
|
31
|
-
export type { InputProps };
|
|
45
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
32
46
|
//# sourceMappingURL=input.d.ts.map
|
package/dist/input.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;;GAGG;AACH,eAAO,MAAM,aAAa;;;8EAwCzB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,UACf,SACE,IAAI,CAAC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC,EACzD,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,KAAK,qFAkCjB,CAAC"}
|
package/dist/input.js
CHANGED
|
@@ -1,146 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import * as
|
|
3
|
-
import { cva as
|
|
4
|
-
import { cn as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import { cva as u } from "class-variance-authority";
|
|
4
|
+
import { cn as f } from "@brightlocal/ui-components/lib/utils";
|
|
5
|
+
const b = u(
|
|
6
|
+
[
|
|
7
|
+
// Layout & Size
|
|
8
|
+
"flex w-full min-w-0 h-9",
|
|
9
|
+
// Appearance
|
|
10
|
+
"border border-input bg-background rounded-sm",
|
|
11
|
+
"outline-none transition-all",
|
|
12
|
+
// Typography
|
|
13
|
+
"text-sm font-sans",
|
|
14
|
+
"text-foreground",
|
|
15
|
+
"overflow-hidden text-ellipsis",
|
|
16
|
+
// States - Focus
|
|
17
|
+
"focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background",
|
|
18
|
+
"focus-visible:shadow-default",
|
|
19
|
+
// States - Disabled
|
|
20
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
21
|
+
// Pseudo-elements
|
|
22
|
+
"placeholder:text-muted-foreground",
|
|
23
|
+
"placeholder:overflow-hidden placeholder:text-ellipsis",
|
|
24
|
+
// Text input alignment - uses design token for text/sm line-height (20px)
|
|
25
|
+
"items-center px-3 pb-[1px] leading-5",
|
|
26
|
+
// Hide default browser icons for date/time inputs
|
|
27
|
+
"[&::-webkit-calendar-picker-indicator]:hidden"
|
|
28
|
+
],
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
hasIcon: {
|
|
32
|
+
true: "pl-9",
|
|
33
|
+
false: ""
|
|
34
|
+
},
|
|
35
|
+
hasSecondaryIcon: {
|
|
36
|
+
true: "pr-9",
|
|
37
|
+
false: ""
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
defaultVariants: {
|
|
41
|
+
hasIcon: !1,
|
|
42
|
+
hasSecondaryIcon: !1
|
|
12
43
|
}
|
|
13
|
-
},
|
|
14
|
-
defaultVariants: {
|
|
15
|
-
state: "normal"
|
|
16
|
-
/* NORMAL */
|
|
17
44
|
}
|
|
18
|
-
|
|
19
|
-
"block text-sm font-normal leading-none text-muted-foreground font-sans mb-2",
|
|
20
|
-
"text-foreground hover:text-green-900",
|
|
21
|
-
"underline transition-colors cursor-pointer"
|
|
22
|
-
]), L = p.forwardRef(
|
|
45
|
+
), p = c.forwardRef(
|
|
23
46
|
({
|
|
24
|
-
className:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
trackingLabel: E,
|
|
36
|
-
id: $,
|
|
37
|
-
...i
|
|
38
|
-
}, w) => {
|
|
39
|
-
const R = p.useId(), f = $ || R, j = `${f}-description`, z = i["aria-invalid"] === !0 || i["aria-invalid"] === "true", b = /* @__PURE__ */ l("div", { className: "relative flex items-center", children: [
|
|
40
|
-
d && /* @__PURE__ */ t(
|
|
41
|
-
"div",
|
|
42
|
-
{
|
|
43
|
-
className: s(
|
|
44
|
-
"text-muted-foreground pointer-events-none absolute left-3 flex items-center",
|
|
45
|
-
i.disabled && "opacity-50"
|
|
46
|
-
),
|
|
47
|
-
children: d
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ t(
|
|
51
|
-
T,
|
|
52
|
-
{
|
|
53
|
-
ref: w,
|
|
54
|
-
"aria-label": o ? void 0 : i["aria-label"],
|
|
55
|
-
className: s(
|
|
56
|
-
z && "border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive",
|
|
57
|
-
v === "time" && "appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none",
|
|
58
|
-
n
|
|
59
|
-
),
|
|
60
|
-
"data-hook": e,
|
|
61
|
-
"data-tracking-el": I,
|
|
62
|
-
"data-tracking-label": E,
|
|
63
|
-
hasIcon: !!d,
|
|
64
|
-
hasSecondaryIcon: !!c,
|
|
65
|
-
id: f,
|
|
66
|
-
type: v,
|
|
67
|
-
...i
|
|
68
|
-
}
|
|
69
|
-
),
|
|
70
|
-
c && /* @__PURE__ */ t(
|
|
71
|
-
"div",
|
|
72
|
-
{
|
|
73
|
-
className: s(
|
|
74
|
-
"text-muted-foreground pointer-events-none absolute right-3 flex items-center",
|
|
75
|
-
i.disabled && "opacity-50"
|
|
76
|
-
),
|
|
77
|
-
children: c
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
] }), h = o && /* @__PURE__ */ t(
|
|
81
|
-
S,
|
|
82
|
-
{
|
|
83
|
-
className: s(m === "vertical" && "mb-2"),
|
|
84
|
-
"data-hook": e ? `${e}-label` : void 0,
|
|
85
|
-
htmlFor: f,
|
|
86
|
-
optional: k,
|
|
87
|
-
children: o
|
|
88
|
-
}
|
|
89
|
-
), x = u && /* @__PURE__ */ t(
|
|
90
|
-
"div",
|
|
47
|
+
className: a,
|
|
48
|
+
hasIcon: r = !1,
|
|
49
|
+
hasSecondaryIcon: t = !1,
|
|
50
|
+
dataHook: o,
|
|
51
|
+
trackingEl: i,
|
|
52
|
+
trackingLabel: s,
|
|
53
|
+
...e
|
|
54
|
+
}, d) => {
|
|
55
|
+
const n = e["aria-invalid"] === !0 || e["aria-invalid"] === "true";
|
|
56
|
+
return /* @__PURE__ */ l(
|
|
57
|
+
"input",
|
|
91
58
|
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
m === "horizontal" && "mt-2"
|
|
59
|
+
ref: d,
|
|
60
|
+
className: f(
|
|
61
|
+
b({ hasIcon: r, hasSecondaryIcon: t }),
|
|
62
|
+
n && "border-destructive dark:border-destructive focus-visible:border-destructive focus-visible:shadow-destructive",
|
|
63
|
+
a
|
|
98
64
|
),
|
|
99
|
-
"data-hook":
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"a",
|
|
105
|
-
{
|
|
106
|
-
className: g(),
|
|
107
|
-
"data-hook": e ? `${e}-link` : void 0,
|
|
108
|
-
href: r.href,
|
|
109
|
-
target: r.target,
|
|
110
|
-
...r.target === "_blank" && {
|
|
111
|
-
rel: "noopener noreferrer"
|
|
112
|
-
},
|
|
113
|
-
children: a
|
|
114
|
-
}
|
|
115
|
-
) : a ? /* @__PURE__ */ t(
|
|
116
|
-
"button",
|
|
117
|
-
{
|
|
118
|
-
"aria-label": a,
|
|
119
|
-
className: g(),
|
|
120
|
-
"data-hook": e ? `${e}-link` : void 0,
|
|
121
|
-
type: "button",
|
|
122
|
-
onClick: r?.onClick,
|
|
123
|
-
children: a
|
|
65
|
+
"data-hook": o,
|
|
66
|
+
"data-slot": "input",
|
|
67
|
+
"data-tracking-el": i,
|
|
68
|
+
"data-tracking-label": s,
|
|
69
|
+
...e
|
|
124
70
|
}
|
|
125
|
-
)
|
|
126
|
-
return m === "horizontal" ? /* @__PURE__ */ l("div", { className: "flex items-start gap-4", children: [
|
|
127
|
-
/* @__PURE__ */ t("div", { className: "flex h-9 flex-shrink-0 items-center", children: h }),
|
|
128
|
-
/* @__PURE__ */ l("div", { className: "flex-1", children: [
|
|
129
|
-
b,
|
|
130
|
-
x
|
|
131
|
-
] })
|
|
132
|
-
] }) : /* @__PURE__ */ l("div", { children: [
|
|
133
|
-
r ? /* @__PURE__ */ l("div", { className: "flex items-end justify-between", children: [
|
|
134
|
-
h,
|
|
135
|
-
C
|
|
136
|
-
] }) : h,
|
|
137
|
-
b,
|
|
138
|
-
x
|
|
139
|
-
] });
|
|
71
|
+
);
|
|
140
72
|
}
|
|
141
73
|
);
|
|
142
|
-
|
|
74
|
+
p.displayName = "Input";
|
|
143
75
|
export {
|
|
144
|
-
|
|
145
|
-
|
|
76
|
+
p as Input,
|
|
77
|
+
b as inputVariants
|
|
146
78
|
};
|