@brightlocal/ui-components 3.0.0 → 3.2.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 +7 -1
- package/component-meta.json +749 -53
- package/deprecations.json +114 -4
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +36 -0
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +74 -61
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +32 -3
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +61 -58
- package/dist/alert.cjs +1 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/alert.js +58 -57
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +9 -0
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +50 -30
- package/dist/banner.cjs +1 -0
- package/dist/banner.d.ts +81 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +176 -0
- package/dist/blocks/empty-state.cjs +1 -1
- package/dist/blocks/empty-state.d.ts +4 -3
- package/dist/blocks/empty-state.d.ts.map +1 -1
- package/dist/blocks/empty-state.js +50 -57
- package/dist/blocks/progress-state.d.ts +2 -2
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +17 -0
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +8 -2
- package/dist/brand-illustration-motif.d.ts +1 -1
- package/dist/button-group.cjs +1 -0
- package/dist/button-group.d.ts +36 -0
- package/dist/button-group.d.ts.map +1 -0
- package/dist/button-group.js +47 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +105 -7
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +198 -101
- package/dist/chart.cjs +3 -3
- package/dist/chart.d.ts +270 -24
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +497 -322
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +2 -1
- package/dist/chip.cjs +1 -1
- package/dist/chip.d.ts +38 -4
- package/dist/chip.d.ts.map +1 -1
- package/dist/chip.js +95 -81
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +2 -2
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +23 -1
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +251 -225
- package/dist/data-table.cjs +1 -1
- package/dist/data-table.d.ts +201 -23
- package/dist/data-table.d.ts.map +1 -1
- package/dist/data-table.js +712 -568
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +13 -5
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +54 -53
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +8 -1
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +79 -52
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +105 -13
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +146 -129
- package/dist/grid.d.ts +26 -3
- package/dist/grid.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.cjs +1 -1
- package/dist/hooks/use-breakpoint.d.ts +1 -1
- package/dist/hooks/use-breakpoint.d.ts.map +1 -1
- package/dist/hooks/use-breakpoint.js +1 -0
- package/dist/hooks/use-mobile.cjs +1 -0
- package/dist/hooks/use-mobile.js +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +594 -553
- package/dist/info-tooltip.cjs +1 -0
- package/dist/info-tooltip.d.ts +39 -0
- package/dist/info-tooltip.d.ts.map +1 -0
- package/dist/info-tooltip.js +41 -0
- package/dist/input-chip.cjs +1 -1
- package/dist/input-chip.js +1 -1
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +33 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +167 -54
- package/dist/input-otp.cjs +1 -1
- package/dist/input-otp.js +9 -9
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts +45 -15
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +31 -30
- package/dist/input.cjs +1 -1
- package/dist/input.js +10 -10
- package/dist/lib/block-illustration.cjs +1 -1
- package/dist/lib/block-illustration.d.ts +4 -1
- package/dist/lib/block-illustration.d.ts.map +1 -1
- package/dist/lib/block-illustration.js +12 -11
- package/dist/lib/empty-chip.cjs +1 -0
- package/dist/lib/empty-chip.d.ts +4 -0
- package/dist/lib/empty-chip.d.ts.map +1 -0
- package/dist/lib/empty-chip.js +13 -0
- package/dist/lib/utils.cjs +1 -1
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +4 -3
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/multi-select-filter.cjs +1 -0
- package/dist/multi-select-filter.d.ts +178 -0
- package/dist/multi-select-filter.d.ts.map +1 -0
- package/dist/multi-select-filter.js +463 -0
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.d.ts +3 -0
- package/dist/pagination.d.ts.map +1 -1
- package/dist/pagination.js +57 -57
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +123 -16
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +89 -75
- package/dist/rating.cjs +1 -1
- package/dist/rating.js +18 -18
- package/dist/relative-date.cjs +1 -0
- package/dist/relative-date.d.ts +65 -0
- package/dist/relative-date.d.ts.map +1 -0
- package/dist/relative-date.js +128 -0
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +15 -6
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +38 -36
- package/dist/select.cjs +2 -2
- package/dist/select.d.ts +24 -3
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +130 -110
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +78 -2
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +192 -85
- package/dist/single-select-filter.cjs +1 -0
- package/dist/single-select-filter.d.ts +81 -0
- package/dist/single-select-filter.d.ts.map +1 -0
- package/dist/single-select-filter.js +226 -0
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +22 -22
- package/dist/split-layout.cjs +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/split-layout.js +13 -13
- package/dist/table.cjs +1 -1
- package/dist/table.d.ts +45 -4
- package/dist/table.d.ts.map +1 -1
- package/dist/table.js +90 -73
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.d.ts +12 -1
- package/dist/tabs.d.ts.map +1 -1
- package/dist/tabs.js +148 -126
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/tooltip.cjs +1 -1
- package/dist/tooltip.d.ts +38 -36
- package/dist/tooltip.d.ts.map +1 -1
- package/dist/tooltip.js +262 -73
- package/dist/typography-heading.cjs +1 -1
- package/dist/typography-heading.d.ts +13 -0
- package/dist/typography-heading.d.ts.map +1 -1
- package/dist/typography-heading.js +32 -21
- package/dist/typography-text.cjs +1 -1
- package/dist/typography-text.d.ts +15 -2
- package/dist/typography-text.d.ts.map +1 -1
- package/dist/typography-text.js +35 -24
- package/dist/typography.d.ts +1 -1
- package/package.json +5 -6
- package/src/blocks/empty-state.tsx +17 -24
- package/src/blocks/progress-state.tsx +2 -2
- package/src/blocks/sidebar.tsx +26 -2
- package/src/components/accordion.tsx +82 -27
- package/src/components/alert-dialog.tsx +50 -5
- package/src/components/alert.tsx +16 -8
- package/src/components/badge.tsx +40 -3
- package/src/components/banner.tsx +288 -0
- package/src/components/brand-illustration-motif.tsx +1 -1
- package/src/components/button-group.tsx +112 -0
- package/src/components/button.tsx +1 -1
- package/src/components/card.tsx +249 -27
- package/src/components/chart.tsx +586 -53
- package/src/components/checkbox.tsx +1 -1
- package/src/components/chip.tsx +83 -10
- package/src/components/combobox.tsx +2 -2
- package/src/components/command.tsx +56 -4
- package/src/components/data-table.tsx +842 -199
- package/src/components/date-picker.tsx +18 -7
- package/src/components/field.tsx +81 -12
- package/src/components/global-layout.tsx +176 -38
- package/src/components/grid.tsx +34 -3
- package/src/components/info-tooltip.tsx +94 -0
- package/src/components/input-chip.tsx +1 -1
- package/src/components/input-group.tsx +246 -11
- package/src/components/input-otp.tsx +1 -1
- package/src/components/input-password.tsx +56 -22
- package/src/components/input.tsx +1 -1
- package/src/components/list.tsx +1 -1
- package/src/components/multi-select-filter.tsx +912 -0
- package/src/components/pagination.tsx +10 -3
- package/src/components/progress.tsx +190 -31
- package/src/components/rating.tsx +1 -1
- package/src/components/relative-date.tsx +230 -0
- package/src/components/scroll-area.tsx +23 -10
- package/src/components/select.tsx +65 -11
- package/src/components/sheet.tsx +240 -4
- package/src/components/single-select-filter.tsx +443 -0
- package/src/components/sonner.tsx +16 -5
- package/src/components/split-layout.tsx +2 -2
- package/src/components/table.tsx +71 -11
- package/src/components/tabs.tsx +93 -46
- package/src/components/textarea.tsx +1 -1
- package/src/components/tooltip.tsx +440 -68
- package/src/components/typography-heading.tsx +24 -0
- package/src/components/typography-text.tsx +27 -3
- package/src/components/typography.tsx +1 -1
- package/src/hooks/use-breakpoint.ts +2 -1
- package/src/index.ts +6 -0
- package/src/lib/block-illustration.tsx +5 -1
- package/src/lib/empty-chip.ts +24 -0
- package/src/lib/utils.ts +1 -0
package/dist/input-password.d.ts
CHANGED
|
@@ -8,12 +8,34 @@ type DefaultPasswordStrength = "meter" | "weak" | "ok" | "good" | "great";
|
|
|
8
8
|
* Configuration for a single strength level
|
|
9
9
|
*/
|
|
10
10
|
interface StrengthLevelConfig {
|
|
11
|
+
/** Text shown beside the bar for this level, e.g. `"Weak"` */
|
|
11
12
|
label: string;
|
|
13
|
+
/** Bar fill as a percentage, 0–100 */
|
|
12
14
|
value: number;
|
|
15
|
+
/**
|
|
16
|
+
* Background utility for the bar fill. Use the Progress bar palette
|
|
17
|
+
* (`bg-green-400`, `bg-brand-red`, `bg-brand-orange`, `bg-brand-yellow`,
|
|
18
|
+
* `bg-muted`) so custom levels stay consistent with Progress (DS-773).
|
|
19
|
+
*/
|
|
13
20
|
color: string;
|
|
14
21
|
}
|
|
15
22
|
/**
|
|
16
23
|
* Default strength levels configuration
|
|
24
|
+
*
|
|
25
|
+
* DESIGN DECISION (DS-293, kept in DS-666): every level shares one fill. The
|
|
26
|
+
* bar's length and the label ("Weak" … "Great") carry the strength, so colour
|
|
27
|
+
* is never the only indicator of state. Per-level red/amber/green would also
|
|
28
|
+
* have to come from the alert-surface tokens (`success-background` is green-200
|
|
29
|
+
* in light, green-950 in dark) — tints tuned as a backdrop, which read as a
|
|
30
|
+
* washed-out or near-black 8px bar.
|
|
31
|
+
*
|
|
32
|
+
* The fill is `green-400` — the same fill the green Progress bar uses, a
|
|
33
|
+
* documented palette-step-by-choice with Figma parity (DS-773, see
|
|
34
|
+
* progress.tsx). The meter IS a Progress, so its green must match; the track
|
|
35
|
+
* beneath stays Progress's own `brand-primary-foreground/20`. The token-first
|
|
36
|
+
* alternative (`bg-brand-primary-foreground`) was tried in DS-666 and rejected
|
|
37
|
+
* in review: its dark value (#00851E) renders a dim bar that diverges from
|
|
38
|
+
* every other green Progress on the page.
|
|
17
39
|
*/
|
|
18
40
|
declare const DEFAULT_STRENGTH_LEVELS: Record<DefaultPasswordStrength, StrengthLevelConfig>;
|
|
19
41
|
/**
|
|
@@ -21,7 +43,7 @@ declare const DEFAULT_STRENGTH_LEVELS: Record<DefaultPasswordStrength, StrengthL
|
|
|
21
43
|
* - Minimum 12 characters required for "ok" or better
|
|
22
44
|
*/
|
|
23
45
|
declare function calculatePasswordStrength(password: string): DefaultPasswordStrength;
|
|
24
|
-
export interface
|
|
46
|
+
export interface InputPasswordProps<T extends string = DefaultPasswordStrength> {
|
|
25
47
|
/**
|
|
26
48
|
* Data hook for automated testing (REQUIRED)
|
|
27
49
|
*/
|
|
@@ -56,9 +78,9 @@ export interface InputPasswordRootProps<T extends string = DefaultPasswordStreng
|
|
|
56
78
|
* @example
|
|
57
79
|
* strengthLevels={{
|
|
58
80
|
* empty: { label: "Enter password", value: 0, color: "bg-muted" },
|
|
59
|
-
* slow: { label: "Slow", value: 33, color: "bg-red
|
|
60
|
-
* medium: { label: "Medium", value: 66, color: "bg-yellow
|
|
61
|
-
* fast: { label: "Fast", value: 100, color: "bg-green-
|
|
81
|
+
* slow: { label: "Slow", value: 33, color: "bg-brand-red" },
|
|
82
|
+
* medium: { label: "Medium", value: 66, color: "bg-brand-yellow" },
|
|
83
|
+
* fast: { label: "Fast", value: 100, color: "bg-green-400" },
|
|
62
84
|
* }}
|
|
63
85
|
*/
|
|
64
86
|
strengthLevels?: Record<T, StrengthLevelConfig>;
|
|
@@ -86,22 +108,22 @@ export interface InputPasswordRootProps<T extends string = DefaultPasswordStreng
|
|
|
86
108
|
className?: string;
|
|
87
109
|
}
|
|
88
110
|
/**
|
|
89
|
-
*
|
|
111
|
+
* InputPassword - Root component that provides context for all InputPassword parts
|
|
90
112
|
*
|
|
91
113
|
* Generic type parameter T allows custom strength levels:
|
|
92
114
|
* @example
|
|
93
115
|
* // Using default levels
|
|
94
|
-
* <
|
|
116
|
+
* <InputPassword dataHook="password">...</InputPassword>
|
|
95
117
|
*
|
|
96
118
|
* // Using custom levels
|
|
97
119
|
* type MyStrength = "empty" | "slow" | "medium" | "fast";
|
|
98
|
-
* <
|
|
120
|
+
* <InputPassword<MyStrength>
|
|
99
121
|
* dataHook="password"
|
|
100
122
|
* strengthLevels={{
|
|
101
123
|
* empty: { label: "Enter password", value: 0, color: "bg-muted" },
|
|
102
|
-
* slow: { label: "Slow", value: 33, color: "bg-red
|
|
103
|
-
* medium: { label: "Medium", value: 66, color: "bg-yellow
|
|
104
|
-
* fast: { label: "Fast", value: 100, color: "bg-green-
|
|
124
|
+
* slow: { label: "Slow", value: 33, color: "bg-brand-red" },
|
|
125
|
+
* medium: { label: "Medium", value: 66, color: "bg-brand-yellow" },
|
|
126
|
+
* fast: { label: "Fast", value: 100, color: "bg-green-400" },
|
|
105
127
|
* }}
|
|
106
128
|
* calculateStrength={(password) => {
|
|
107
129
|
* if (!password) return "empty";
|
|
@@ -111,12 +133,20 @@ export interface InputPasswordRootProps<T extends string = DefaultPasswordStreng
|
|
|
111
133
|
* }}
|
|
112
134
|
* >
|
|
113
135
|
* ...
|
|
114
|
-
* </
|
|
136
|
+
* </InputPassword>
|
|
115
137
|
*/
|
|
116
|
-
declare function
|
|
117
|
-
declare namespace
|
|
138
|
+
declare function InputPassword<T extends string = DefaultPasswordStrength>({ children, dataHook, trackingEl, trackingLabel, disabled, value, onChange, onStrengthChange, strengthLevels, calculateStrength, error, id, className, }: InputPasswordProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
139
|
+
declare namespace InputPassword {
|
|
118
140
|
var displayName: string;
|
|
119
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* @deprecated Use `InputPassword` instead — family roots are bare names (DS-853).
|
|
144
|
+
*/
|
|
145
|
+
declare const InputPasswordRoot: typeof InputPassword;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Use `InputPasswordProps` instead — family roots are bare names (DS-853).
|
|
148
|
+
*/
|
|
149
|
+
export type InputPasswordRootProps<T extends string = DefaultPasswordStrength> = InputPasswordProps<T>;
|
|
120
150
|
export interface InputPasswordFieldProps extends Omit<React.ComponentProps<typeof InputGroupInput>, "type"> {
|
|
121
151
|
/**
|
|
122
152
|
* Additional class name for the InputGroup wrapper
|
|
@@ -169,12 +199,12 @@ export interface InputPasswordStrengthProps {
|
|
|
169
199
|
/**
|
|
170
200
|
* InputPasswordStrength - Password strength indicator
|
|
171
201
|
* Displays a progress bar and optional label showing password strength.
|
|
172
|
-
* Automatically uses the strength levels configured on
|
|
202
|
+
* Automatically uses the strength levels configured on InputPassword.
|
|
173
203
|
*/
|
|
174
204
|
declare function InputPasswordStrength({ className, showLabel, }: InputPasswordStrengthProps): import("react/jsx-runtime").JSX.Element;
|
|
175
205
|
declare namespace InputPasswordStrength {
|
|
176
206
|
var displayName: string;
|
|
177
207
|
}
|
|
178
|
-
export { InputPasswordRoot, InputPasswordField, InputPasswordToggle, InputPasswordStrength, calculatePasswordStrength, DEFAULT_STRENGTH_LEVELS, };
|
|
208
|
+
export { InputPassword, InputPasswordRoot, InputPasswordField, InputPasswordToggle, InputPasswordStrength, calculatePasswordStrength, DEFAULT_STRENGTH_LEVELS, };
|
|
179
209
|
export type { DefaultPasswordStrength, StrengthLevelConfig };
|
|
180
210
|
//# sourceMappingURL=input-password.d.ts.map
|
|
@@ -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;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
|
|
1
|
+
{"version":3,"file":"input-password.d.ts","sourceRoot":"","sources":["../../src/components/input-password.tsx"],"names":[],"mappings":"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"}
|
package/dist/input-password.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as o, jsxs as H } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { EyeOff as
|
|
4
|
-
import { Progress as
|
|
3
|
+
import { EyeOff as L, Eye as R } from "@brightlocal/icons";
|
|
4
|
+
import { Progress as j } from "@brightlocal/ui-components/progress";
|
|
5
5
|
import { cn as x } from "@brightlocal/ui-components/lib/utils";
|
|
6
|
-
import { InputGroup as
|
|
7
|
-
const
|
|
8
|
-
meter: { label: "Meter", value: 0, color: "bg-green-
|
|
9
|
-
weak: { label: "Weak", value: 25, color: "bg-green-
|
|
10
|
-
ok: { label: "Ok", value: 50, color: "bg-green-
|
|
11
|
-
good: { label: "Good", value: 75, color: "bg-green-
|
|
12
|
-
great: { label: "Great", value: 100, color: "bg-green-
|
|
6
|
+
import { InputGroup as M, InputGroupInput as O, InputGroupAddon as Z, InputGroupButton as V } from "@brightlocal/ui-components/input-group";
|
|
7
|
+
const _ = {
|
|
8
|
+
meter: { label: "Meter", value: 0, color: "bg-green-400" },
|
|
9
|
+
weak: { label: "Weak", value: 25, color: "bg-green-400" },
|
|
10
|
+
ok: { label: "Ok", value: 50, color: "bg-green-400" },
|
|
11
|
+
good: { label: "Good", value: 75, color: "bg-green-400" },
|
|
12
|
+
great: { label: "Great", value: 100, color: "bg-green-400" }
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function B(e) {
|
|
15
15
|
if (!e || e.length === 0)
|
|
16
16
|
return "meter";
|
|
17
17
|
if (e.length < 12)
|
|
@@ -24,11 +24,11 @@ function S() {
|
|
|
24
24
|
const e = s.useContext(A);
|
|
25
25
|
if (!e)
|
|
26
26
|
throw new Error(
|
|
27
|
-
"InputPassword compound components must be used within
|
|
27
|
+
"InputPassword compound components must be used within InputPassword"
|
|
28
28
|
);
|
|
29
29
|
return e;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function $({
|
|
32
32
|
children: e,
|
|
33
33
|
dataHook: t,
|
|
34
34
|
trackingEl: n,
|
|
@@ -43,7 +43,7 @@ function B({
|
|
|
43
43
|
id: h,
|
|
44
44
|
className: w
|
|
45
45
|
}) {
|
|
46
|
-
const [m, f] = s.useState(!1), [P, v] = s.useState(""), [k, b] = s.useState("meter"),
|
|
46
|
+
const [m, f] = s.useState(!1), [P, v] = s.useState(""), [k, b] = s.useState("meter"), z = s.useId(), y = h || z, I = r !== void 0 ? r : P, N = g ?? _, C = p ?? B, E = s.useCallback(
|
|
47
47
|
(u) => {
|
|
48
48
|
r === void 0 && v(u), a?.(u);
|
|
49
49
|
},
|
|
@@ -53,12 +53,12 @@ function B({
|
|
|
53
53
|
}, []);
|
|
54
54
|
s.useEffect(() => {
|
|
55
55
|
const u = setTimeout(() => {
|
|
56
|
-
const
|
|
57
|
-
b(
|
|
56
|
+
const T = C(I);
|
|
57
|
+
b(T), i?.(T);
|
|
58
58
|
}, 180);
|
|
59
59
|
return () => clearTimeout(u);
|
|
60
60
|
}, [I, C, i]);
|
|
61
|
-
const
|
|
61
|
+
const F = s.useMemo(
|
|
62
62
|
() => ({
|
|
63
63
|
showPassword: m,
|
|
64
64
|
setShowPassword: f,
|
|
@@ -89,7 +89,7 @@ function B({
|
|
|
89
89
|
c
|
|
90
90
|
]
|
|
91
91
|
);
|
|
92
|
-
return /* @__PURE__ */ o(A.Provider, { value:
|
|
92
|
+
return /* @__PURE__ */ o(A.Provider, { value: F, children: /* @__PURE__ */ o(
|
|
93
93
|
"div",
|
|
94
94
|
{
|
|
95
95
|
className: x("w-full", w),
|
|
@@ -99,8 +99,8 @@ function B({
|
|
|
99
99
|
}
|
|
100
100
|
) });
|
|
101
101
|
}
|
|
102
|
-
|
|
103
|
-
const D = s.forwardRef(
|
|
102
|
+
$.displayName = "InputPassword";
|
|
103
|
+
const Y = $, D = s.forwardRef(
|
|
104
104
|
({ className: e, groupClassName: t, onChange: n, showLabel: d, hideLabel: l, ...r }, a) => {
|
|
105
105
|
const {
|
|
106
106
|
showPassword: i,
|
|
@@ -114,9 +114,9 @@ const D = s.forwardRef(
|
|
|
114
114
|
inputId: P,
|
|
115
115
|
error: v
|
|
116
116
|
} = S();
|
|
117
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ H(M, { className: t, dataHook: w, error: v, children: [
|
|
118
118
|
/* @__PURE__ */ o(
|
|
119
|
-
|
|
119
|
+
O,
|
|
120
120
|
{
|
|
121
121
|
ref: a,
|
|
122
122
|
className: e,
|
|
@@ -132,7 +132,7 @@ const D = s.forwardRef(
|
|
|
132
132
|
...r
|
|
133
133
|
}
|
|
134
134
|
),
|
|
135
|
-
/* @__PURE__ */ o(
|
|
135
|
+
/* @__PURE__ */ o(Z, { align: "inline-end", children: /* @__PURE__ */ o(
|
|
136
136
|
V,
|
|
137
137
|
{
|
|
138
138
|
"aria-label": i ? l ?? "Hide password" : d ?? "Show password",
|
|
@@ -141,7 +141,7 @@ const D = s.forwardRef(
|
|
|
141
141
|
size: "icon-sm",
|
|
142
142
|
variant: "ghost",
|
|
143
143
|
onClick: g,
|
|
144
|
-
children: i ? /* @__PURE__ */ o(
|
|
144
|
+
children: i ? /* @__PURE__ */ o(L, {}) : /* @__PURE__ */ o(R, {})
|
|
145
145
|
}
|
|
146
146
|
) })
|
|
147
147
|
] });
|
|
@@ -170,7 +170,7 @@ const U = s.forwardRef(
|
|
|
170
170
|
variant: l,
|
|
171
171
|
onClick: g,
|
|
172
172
|
...r,
|
|
173
|
-
children: i ? /* @__PURE__ */ o(
|
|
173
|
+
children: i ? /* @__PURE__ */ o(L, {}) : /* @__PURE__ */ o(R, {})
|
|
174
174
|
}
|
|
175
175
|
);
|
|
176
176
|
}
|
|
@@ -185,9 +185,9 @@ function W({
|
|
|
185
185
|
value: 0,
|
|
186
186
|
color: "bg-muted"
|
|
187
187
|
};
|
|
188
|
-
return /* @__PURE__ */ o("div", { className: x("mt-1 space-y-2", e), children: /* @__PURE__ */
|
|
188
|
+
return /* @__PURE__ */ o("div", { className: x("mt-1 space-y-2", e), children: /* @__PURE__ */ H("div", { className: x("flex items-center gap-2", r && "opacity-50"), children: [
|
|
189
189
|
/* @__PURE__ */ o(
|
|
190
|
-
|
|
190
|
+
j,
|
|
191
191
|
{
|
|
192
192
|
className: "h-2 flex-1",
|
|
193
193
|
dataHook: `${l}-strength-progress`,
|
|
@@ -207,10 +207,11 @@ function W({
|
|
|
207
207
|
}
|
|
208
208
|
W.displayName = "InputPasswordStrength";
|
|
209
209
|
export {
|
|
210
|
-
|
|
210
|
+
_ as DEFAULT_STRENGTH_LEVELS,
|
|
211
|
+
$ as InputPassword,
|
|
211
212
|
D as InputPasswordField,
|
|
212
|
-
|
|
213
|
+
Y as InputPasswordRoot,
|
|
213
214
|
W as InputPasswordStrength,
|
|
214
215
|
U as InputPasswordToggle,
|
|
215
|
-
|
|
216
|
+
B as calculatePasswordStrength
|
|
216
217
|
};
|
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] duration-fast ease-out","text-
|
|
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-field","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
|
@@ -10,7 +10,7 @@ const p = f(
|
|
|
10
10
|
"border border-input bg-background rounded-sm",
|
|
11
11
|
"outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out",
|
|
12
12
|
// Typography
|
|
13
|
-
"text-
|
|
13
|
+
"text-field",
|
|
14
14
|
"text-foreground",
|
|
15
15
|
"overflow-hidden text-ellipsis",
|
|
16
16
|
// States - Focus
|
|
@@ -43,30 +43,30 @@ const p = f(
|
|
|
43
43
|
}
|
|
44
44
|
), v = u.forwardRef(
|
|
45
45
|
({
|
|
46
|
-
className:
|
|
46
|
+
className: o,
|
|
47
47
|
hasIcon: r = !1,
|
|
48
48
|
hasSecondaryIcon: t = !1,
|
|
49
49
|
dataHook: i,
|
|
50
50
|
error: d,
|
|
51
51
|
trackingEl: s,
|
|
52
|
-
trackingLabel:
|
|
52
|
+
trackingLabel: l,
|
|
53
53
|
...e
|
|
54
|
-
},
|
|
55
|
-
const
|
|
54
|
+
}, n) => {
|
|
55
|
+
const a = d || e["aria-invalid"] === !0 || e["aria-invalid"] === "true";
|
|
56
56
|
return /* @__PURE__ */ c(
|
|
57
57
|
"input",
|
|
58
58
|
{
|
|
59
|
-
ref:
|
|
60
|
-
"aria-invalid":
|
|
59
|
+
ref: n,
|
|
60
|
+
"aria-invalid": a ? "true" : void 0,
|
|
61
61
|
className: b(
|
|
62
62
|
p({ hasIcon: r, hasSecondaryIcon: t }),
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
a && "border-destructive-40 focus-visible:border-destructive-40 focus-visible:shadow-destructive",
|
|
64
|
+
o
|
|
65
65
|
),
|
|
66
66
|
"data-hook": i,
|
|
67
67
|
"data-slot": "input",
|
|
68
68
|
"data-tracking-el": s,
|
|
69
|
-
"data-tracking-label":
|
|
69
|
+
"data-tracking-label": l,
|
|
70
70
|
...e
|
|
71
71
|
}
|
|
72
72
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),c=require("react"),s=require("@brightlocal/illustrations");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const r=u(c),a=s.ILLUSTRATION_SIZES.md;function i({children:t,size:e,slot:n}){const o=r.isValidElement(t)&&typeof t.type=="function"?r.cloneElement(t,{size:e}):t;return l.jsx("div",{className:"flex shrink-0 items-center justify-center [&>*]:h-auto [&>*]:max-h-full [&>*]:max-w-full","data-slot":n,style:{width:e,height:e},children:o})}exports.BLOCK_ILLUSTRATION_SIZE=a;exports.BlockIllustration=i;
|
|
@@ -7,8 +7,11 @@ import * as React from "react";
|
|
|
7
7
|
* The artwork is the title's companion, not the subject of the screen: much
|
|
8
8
|
* larger and it outweighs the 24px heading under it, and the eye lands on the
|
|
9
9
|
* drawing instead of the words that say what to do next.
|
|
10
|
+
*
|
|
11
|
+
* This is the `md` step of the shared illustration scale, so a consumer who
|
|
12
|
+
* places the same artwork by hand with `size="md"` gets the identical size.
|
|
10
13
|
*/
|
|
11
|
-
declare const BLOCK_ILLUSTRATION_SIZE
|
|
14
|
+
declare const BLOCK_ILLUSTRATION_SIZE: 130;
|
|
12
15
|
/**
|
|
13
16
|
* Props for the internal BlockIllustration wrapper.
|
|
14
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block-illustration.d.ts","sourceRoot":"","sources":["../../src/lib/block-illustration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"block-illustration.d.ts","sourceRoot":"","sources":["../../src/lib/block-illustration.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiC/B;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,uBAAuB,KAAwB,CAAC;AAEtD;;GAEG;AACH,UAAU,sBAAsB;IAC9B,mEAAmE;IACnE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,iBAAS,iBAAiB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,sBAAsB,2CA2B1E;AAED,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { ILLUSTRATION_SIZES as s } from "@brightlocal/illustrations";
|
|
4
|
+
const r = s.md;
|
|
5
|
+
function f({ children: t, size: o, slot: l }) {
|
|
6
|
+
const m = e.isValidElement(t) && typeof t.type == "function" ? e.cloneElement(t, {
|
|
7
|
+
size: o
|
|
7
8
|
}) : t;
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ n(
|
|
9
10
|
"div",
|
|
10
11
|
{
|
|
11
12
|
className: "flex shrink-0 items-center justify-center [&>*]:h-auto [&>*]:max-h-full [&>*]:max-w-full",
|
|
12
13
|
"data-slot": l,
|
|
13
|
-
style: { width:
|
|
14
|
-
children:
|
|
14
|
+
style: { width: o, height: o },
|
|
15
|
+
children: m
|
|
15
16
|
}
|
|
16
17
|
);
|
|
17
18
|
}
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
r as BLOCK_ILLUSTRATION_SIZE,
|
|
21
|
+
f as BlockIllustration
|
|
21
22
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("class-variance-authority"),t=e.cva("bg-muted text-muted-foreground flex size-10 items-center justify-center rounded-full",{variants:{align:{center:"",left:"shrink-0"}},defaultVariants:{align:"center"}});exports.emptyChipStyles=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-chip.d.ts","sourceRoot":"","sources":["../../src/lib/empty-chip.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,eAAe;;8EAQ3B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cva as e } from "class-variance-authority";
|
|
2
|
+
const r = e(
|
|
3
|
+
"bg-muted text-muted-foreground flex size-10 items-center justify-center rounded-full",
|
|
4
|
+
{
|
|
5
|
+
variants: {
|
|
6
|
+
align: { center: "", left: "shrink-0" }
|
|
7
|
+
},
|
|
8
|
+
defaultVariants: { align: "center" }
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
export {
|
|
12
|
+
r as emptyChipStyles
|
|
13
|
+
};
|
package/dist/lib/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("clsx"),a=require("tailwind-merge"),o=a.extendTailwindMerge({extend:{classGroups:{duration:[{duration:["fast","base","slow"]}],ease:[{ease:["emphasized","overshoot"]}],"font-weight":[{text:["emphasis"]}],"font-size":[{text:["display","heading-page","heading-section","heading-subsection","heading-compact","body","body-sm","body-xs","label","label-sm","metric","code","code-inline"]}]}}});function s(...e){return o(t.clsx(e))}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;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("clsx"),a=require("tailwind-merge"),o=a.extendTailwindMerge({extend:{classGroups:{duration:[{duration:["fast","base","slow"]}],ease:[{ease:["emphasized","overshoot"]}],"font-weight":[{text:["emphasis"]}],"font-size":[{text:["display","heading-page","heading-section","heading-subsection","heading-compact","body","body-sm","body-xs","label","label-sm","field","metric","code","code-inline"]}]}}});function s(...e){return o(t.clsx(e))}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.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;AA0C7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED,eAAO,MAAM,0BAA0B,0aACkY,CAAC"}
|
package/dist/lib/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { clsx as
|
|
1
|
+
import { clsx as t } from "clsx";
|
|
2
2
|
import { extendTailwindMerge as a } from "tailwind-merge";
|
|
3
3
|
const o = a({
|
|
4
4
|
extend: {
|
|
@@ -22,6 +22,7 @@ const o = a({
|
|
|
22
22
|
"body-xs",
|
|
23
23
|
"label",
|
|
24
24
|
"label-sm",
|
|
25
|
+
"field",
|
|
25
26
|
"metric",
|
|
26
27
|
"code",
|
|
27
28
|
"code-inline"
|
|
@@ -31,8 +32,8 @@ const o = a({
|
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
});
|
|
34
|
-
function i(...
|
|
35
|
-
return o(e
|
|
35
|
+
function i(...e) {
|
|
36
|
+
return o(t(e));
|
|
36
37
|
}
|
|
37
38
|
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";
|
|
38
39
|
export {
|
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"),h=require("@radix-ui/react-slot"),R=require("class-variance-authority"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),k=require("react"),h=require("@radix-ui/react-slot"),R=require("class-variance-authority"),r=require("@brightlocal/ui-components/lib/utils"),v=require("@brightlocal/ui-components/skeleton");function w(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const i=w(k),d=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-muted"],outline:["bg-background","border","border-border"],loading:["p-0"]}},defaultVariants:{variant:"filled"}}),c=i.forwardRef(({className:e,dataHook:a,trackingEl:t,trackingLabel:o,...n},l)=>s.jsx("ul",{ref:l,className:r.cn("flex flex-col gap-2",e),"data-hook":a,"data-slot":"list","data-tracking-el":t,"data-tracking-label":o,...n}));c.displayName="List";const m=i.forwardRef(({asChild:e=!1,className:a,variant:t,dataHook:o,trackingEl:n,trackingLabel:l,children:I,...y},N)=>{const j=e?h.Slot:"li";return s.jsx(j,{ref:N,className:r.cn(d({variant:t}),a),"data-hook":o,"data-slot":"item","data-tracking-el":n,"data-tracking-label":l,...y,children:t==="loading"?s.jsx(v.Skeleton,{className:"h-13 w-full rounded-lg"}):I})});m.displayName="Item";const f=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("shrink-0",e),"data-slot":"item-media",...a}));f.displayName="ItemMedia";const u=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("flex flex-1 flex-col gap-1",e),"data-slot":"item-content",...a}));u.displayName="ItemContent";const p=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("text-foreground text-body",e),"data-slot":"item-title",...a}));p.displayName="ItemTitle";const g=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("text-body-sm text-muted-foreground",e),"data-slot":"item-description",...a}));g.displayName="ItemDescription";const x=i.forwardRef(({className:e,...a},t)=>s.jsx("div",{ref:t,className:r.cn("text-muted-foreground flex size-9 shrink-0 items-center justify-center rounded-full",e),"data-slot":"item-actions",...a}));x.displayName="ItemActions";const b=i.forwardRef(({className:e,dataHook:a,...t},o)=>s.jsx("li",{ref:o,className:r.cn("text-muted-foreground text-label-sm flex items-center pt-4 pr-2 pb-1 pl-4 first:pt-2",e),"data-hook":a,"data-slot":"item-subheader",...t}));b.displayName="ItemSubheader";exports.Item=m;exports.ItemActions=x;exports.ItemContent=u;exports.ItemDescription=g;exports.ItemMedia=f;exports.ItemSubheader=b;exports.ItemTitle=p;exports.List=c;exports.itemVariants=d;
|
package/dist/list.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),we=require("react"),Se=require("class-variance-authority"),M=require("@brightlocal/icons"),ce=require("@brightlocal/ui-components/button"),Y=require("@brightlocal/ui-components/checkbox"),m=require("@brightlocal/ui-components/command"),u=require("@brightlocal/ui-components/drawer"),ye=require("@brightlocal/ui-components/hooks/use-breakpoint"),Ne=require("@brightlocal/ui-components/input"),ie=require("@brightlocal/ui-components/label"),T=require("@brightlocal/ui-components/lib/utils"),J=require("@brightlocal/ui-components/popover"),Oe=require("./lib/empty-chip.cjs");function $e(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const c in l)if(c!=="default"){const i=Object.getOwnPropertyDescriptor(l,c);Object.defineProperty(s,c,i.get?i:{enumerable:!0,get:()=>l[c]})}}return s.default=l,Object.freeze(s)}const o=$e(we),de=Se.cva(["relative inline-flex items-center justify-between gap-2 py-2","border border-input rounded-sm outline-none transition-[border-color,box-shadow,background-color] duration-fast ease-out","bg-background dark:bg-input/30","text-foreground","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0"],{variants:{size:{default:"h-9 px-3 text-field",sm:"h-8 px-2.5 text-label [&_svg:not([class*='size-'])]:size-4"}},defaultVariants:{size:"default"}});function _e({value:l,defaultValue:s,onValueChange:c,open:i,onOpenChange:z,options:v,collapseFullSelection:R}){const[A,V]=o.useState(s),S=l!==void 0,h=S?l:A,y=o.useMemo(()=>new Set(h),[h]),[d,x]=o.useState(!1),N=i!==void 0,f=N?i:d,[k,B]=o.useState(new Set),O=o.useRef(f);o.useEffect(()=>{f&&!O.current&&B(new Set(h)),O.current=f},[f,h]);const g=a=>{S||V(a),c?.(a)},P=a=>{if(y.has(a)){g(h.filter(p=>p!==a));return}const _=[...h,a];if(R){const p=v.filter(j=>!j.disabled&&j.count!==0),L=new Set(_);if(p.length>0&&p.every(j=>L.has(j.value))){g([]);return}}g(_)},w=a=>{N||x(a),z?.(a)},$=o.useMemo(()=>[...v.filter(a=>k.has(a.value)),...v.filter(a=>!k.has(a.value))],[v,k]);return{clear:()=>g([]),onOpenChange:w,open:f,orderedOptions:$,selectedSet:y,toggleOption:P,value:h}}function oe({checked:l}){return e.jsx("span",{"aria-hidden":"true",className:T.cn(Y.checkboxVariants(),"mt-0 flex items-center justify-center self-center"),"data-state":l?"checked":"unchecked",children:l?e.jsx(M.Check,{}):null})}function K({count:l}){return e.jsx("span",{className:"text-muted-foreground text-label-sm ml-auto tabular-nums",children:l})}const De="__all__",qe="__clear__",ue=o.forwardRef(({className:l,dataHook:s,label:c,options:i,value:z,defaultValue:v=[],onValueChange:R,open:A,onOpenChange:V,size:S="default",icon:h,maxVisibleLabels:y=1,allLabel:d,allIcon:x,allCount:N,searchThreshold:f=10,searchable:k,collapseFullSelection:B=!0,disabled:O=!1,clearLabel:g,summaryLabel:P,searchPlaceholder:w,emptyLabel:$,emptyDescription:a,clearSearchAriaLabel:_,presentation:p="menu",doneLabel:L,drawerDescription:j,trackingEl:he,trackingLabel:me,"aria-label":xe,...fe},ge)=>{const r=_e({collapseFullSelection:B,defaultValue:v,onOpenChange:V,onValueChange:R,open:A,options:i,value:z}),pe=ye.useIsBelowBreakpoint("md"),ve=p==="drawer"||p==="auto"&&pe,Z=o.useId(),[H,I]=o.useState(""),E=H.trim().toLowerCase(),b=E.length>0,U=b?r.orderedOptions.filter(t=>t.label.toLowerCase().includes(E)||t.value.toLowerCase().includes(E)):r.orderedOptions,ee=o.useRef(null),G=k??i.length>f,je=new Map(i.map(t=>[t.value,t.label])),D=r.value.flatMap(t=>{const n=je.get(t);return n===void 0?[]:[n]}),C=D.length,Q=r.value.length===0,q=N??(i.length>0&&i.every(t=>t.count!==void 0)?i.reduce((t,n)=>t+(n.count??0),0):void 0),W=Math.max(1,y);let F,te=!1;if(C===0)F=d??c,te=d===void 0;else if(C<=W)F=D.join(", ");else{const t={"{count}":String(C),"{labels}":D.slice(0,W).join(", "),"{rest}":String(C-W)};F=(P??"{labels} +{rest}").replace(/\{(count|labels|rest)\}/g,n=>t[n]??n)}const be=C>0?`${c}: ${D.join(", ")}`:d!==void 0?`${c}: ${d}`:c,Ce=r.value.map(t=>i.find(n=>n.value===t)).find(t=>t!==void 0),ne=h??(C>0?Ce?.icon:x)??void 0,se=t=>{t||I(""),r.onOpenChange(t)},re=e.jsxs("button",{ref:ge,"aria-label":xe??be,className:T.cn(de({size:S}),l),"data-hook":s,"data-slot":"multi-select-filter","data-tracking-el":he??"multi-select-filter","data-tracking-label":me,disabled:O,type:"button",...fe,children:[ne?e.jsx("span",{"aria-hidden":"true",className:"flex shrink-0 items-center","data-hook":`${s}-icon`,children:ne}):null,e.jsx("span",{className:T.cn(te&&"text-muted-foreground"),"data-hook":`${s}-summary`,children:F}),e.jsx(M.ChevronDown,{"aria-hidden":"true",className:"text-muted-foreground"})]});if(ve){const t=`${Z}-all`;return e.jsxs(u.Drawer,{open:r.open,onOpenChange:se,children:[e.jsx(u.DrawerTrigger,{asChild:!0,children:re}),e.jsxs(u.DrawerContent,{dataHook:`${s}-drawer`,children:[e.jsxs(u.DrawerHeader,{children:[e.jsx(u.DrawerTitle,{children:c}),e.jsx(u.DrawerDescription,{className:"sr-only",children:j??"Picks apply as you make them."})]}),G?e.jsx(u.DrawerBody,{className:"shrink-0 pb-4",children:e.jsx(Ne.Input,{"aria-label":w??"Search options...",dataHook:`${s}-search`,placeholder:w??"Search options...",type:"search",value:H,onChange:n=>I(n.target.value)})}):null,e.jsxs(u.DrawerBody,{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pt-1 pb-2",children:[b&&U.length===0?e.jsxs("div",{className:"text-body-sm flex flex-col items-center gap-1 py-6 text-center","data-hook":`${s}-empty`,children:[e.jsx("span",{"aria-hidden":"true",className:T.cn(Oe.emptyChipStyles(),"mb-1"),children:e.jsx(M.SearchX,{})}),e.jsx("p",{children:$??"No options found."}),e.jsx("p",{className:"text-muted-foreground",children:a??"Try another search."})]}):e.jsxs(e.Fragment,{children:[d!==void 0&&!b?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y.Checkbox,{checked:Q,dataHook:`${s}-option-all`,id:t,onCheckedChange:r.clear}),e.jsxs(ie.Label,{className:"flex-1 gap-2",htmlFor:t,children:[x?e.jsx("span",{"aria-hidden":"true",className:"flex shrink-0 items-center [&_svg]:size-4",children:x}):null,d]}),q!==void 0?e.jsx(K,{count:q}):null]}):null,e.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:U.map((n,X)=>{const ae=r.selectedSet.has(n.value),ke=n.disabled||n.count===0&&!ae,le=`${Z}-${X}`;return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y.Checkbox,{checked:ae,dataHook:`${s}-option-${n.value}`,disabled:ke,id:le,onCheckedChange:()=>r.toggleOption(n.value)}),e.jsxs(ie.Label,{className:"flex-1 gap-2",htmlFor:le,children:[n.icon?e.jsx("span",{"aria-hidden":"true",className:"flex shrink-0 items-center [&_svg]:size-4","data-hook":`${s}-option-${n.value}-icon`,children:n.icon}):null,n.label]})]},n.value)})})]}),r.value.length>0&&!b?e.jsx(ce.Button,{dataHook:`${s}-clear`,variant:"ghost",onClick:r.clear,children:g??"Clear filters"}):null]}),e.jsx(u.DrawerFooter,{children:e.jsx(u.DrawerClose,{asChild:!0,children:e.jsx(ce.Button,{dataHook:`${s}-done`,children:L??"Done"})})})]})]})}return e.jsxs(J.Popover,{open:r.open,onOpenChange:se,children:[e.jsx(J.PopoverTrigger,{asChild:!0,children:re}),e.jsx(J.PopoverContent,{align:"start","aria-label":c,className:"w-max max-w-80 min-w-60 p-0",dataHook:`${s}-popover`,onOpenAutoFocus:t=>{G||(t.preventDefault(),ee.current?.focus())},children:e.jsxs(m.Command,{ref:ee,dataHook:`${s}-command`,shouldFilter:!1,children:[G?e.jsx(m.CommandInput,{autoFocus:!0,clearSearchAriaLabel:_??"Clear search",dataHook:`${s}-search`,placeholder:w??"Search options...",onValueChange:I}):null,e.jsxs(m.CommandList,{"aria-multiselectable":"true",children:[e.jsx(m.CommandEmpty,{description:a??"Try another search.",icon:e.jsx(M.SearchX,{}),children:$??"No options found."}),e.jsxs(m.CommandGroup,{children:[d!==void 0&&!b?e.jsxs(m.CommandItem,{"aria-checked":Q,dataHook:`${s}-option-all`,value:De,onSelect:r.clear,children:[e.jsx(oe,{checked:Q}),x?e.jsx("span",{"aria-hidden":"true",className:"flex shrink-0 items-center [&_svg]:size-4",children:x}):null,d,q!==void 0?e.jsx(K,{count:q}):null]}):null,U.map(t=>{const n=r.selectedSet.has(t.value),X=t.disabled||t.count===0&&!n;return e.jsxs(m.CommandItem,{"aria-checked":n,dataHook:`${s}-option-${t.value}`,disabled:X,value:t.value,onSelect:()=>r.toggleOption(t.value),children:[e.jsx(oe,{checked:n}),t.icon?e.jsx("span",{"aria-hidden":"true",className:"flex shrink-0 items-center [&_svg]:size-4","data-hook":`${s}-option-${t.value}-icon`,children:t.icon}):null,t.label,t.count!==void 0?e.jsx(K,{count:t.count}):null]},t.value)})]}),r.value.length>0&&!b?e.jsx(m.CommandGroup,{className:"border-border border-t",children:e.jsx(m.CommandItem,{className:"justify-center",dataHook:`${s}-clear`,value:qe,onSelect:r.clear,children:g??"Clear filters"})}):null]})]})})]})});ue.displayName="MultiSelectFilter";exports.MultiSelectFilter=ue;exports.multiSelectFilterTriggerVariants=de;
|