@mediaradar/design-components 0.4.0 → 0.5.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/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -159,6 +159,7 @@ declare function AdvertiserSearchPrompt({ label }: AdvertiserSearchPromptProps):
|
|
|
159
159
|
* ```tsx
|
|
160
160
|
* <CheckBox checked={selected} ariaLabel="Select row" onChange={toggle} />
|
|
161
161
|
* <CheckBox checked={allSelected} indeterminate={someSelected} ariaLabel="Select all" onChange={toggleAll} />
|
|
162
|
+
* <CheckBox checked={false} disabled ariaLabel="Select row" title="Max 5 rows -- remove one first" onChange={toggle} />
|
|
162
163
|
* ```
|
|
163
164
|
*/
|
|
164
165
|
interface CheckBoxProps {
|
|
@@ -175,8 +176,14 @@ interface CheckBoxProps {
|
|
|
175
176
|
disabled?: boolean;
|
|
176
177
|
/** Forwarded as `data-testid`, for Playwright/test selectors. */
|
|
177
178
|
testId?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Native tooltip -- e.g. explaining why a disabled box is disabled. Forwarded
|
|
181
|
+
* directly to the underlying `<button>`, same as a plain HTML `title` would
|
|
182
|
+
* be on any other disabled control.
|
|
183
|
+
*/
|
|
184
|
+
title?: string;
|
|
178
185
|
}
|
|
179
|
-
declare function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testId }: CheckBoxProps): react.JSX.Element;
|
|
186
|
+
declare function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testId, title }: CheckBoxProps): react.JSX.Element;
|
|
180
187
|
|
|
181
188
|
/**
|
|
182
189
|
* @pattern DateRangeFilter
|
package/dist/index.d.ts
CHANGED
|
@@ -159,6 +159,7 @@ declare function AdvertiserSearchPrompt({ label }: AdvertiserSearchPromptProps):
|
|
|
159
159
|
* ```tsx
|
|
160
160
|
* <CheckBox checked={selected} ariaLabel="Select row" onChange={toggle} />
|
|
161
161
|
* <CheckBox checked={allSelected} indeterminate={someSelected} ariaLabel="Select all" onChange={toggleAll} />
|
|
162
|
+
* <CheckBox checked={false} disabled ariaLabel="Select row" title="Max 5 rows -- remove one first" onChange={toggle} />
|
|
162
163
|
* ```
|
|
163
164
|
*/
|
|
164
165
|
interface CheckBoxProps {
|
|
@@ -175,8 +176,14 @@ interface CheckBoxProps {
|
|
|
175
176
|
disabled?: boolean;
|
|
176
177
|
/** Forwarded as `data-testid`, for Playwright/test selectors. */
|
|
177
178
|
testId?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Native tooltip -- e.g. explaining why a disabled box is disabled. Forwarded
|
|
181
|
+
* directly to the underlying `<button>`, same as a plain HTML `title` would
|
|
182
|
+
* be on any other disabled control.
|
|
183
|
+
*/
|
|
184
|
+
title?: string;
|
|
178
185
|
}
|
|
179
|
-
declare function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testId }: CheckBoxProps): react.JSX.Element;
|
|
186
|
+
declare function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testId, title }: CheckBoxProps): react.JSX.Element;
|
|
180
187
|
|
|
181
188
|
/**
|
|
182
189
|
* @pattern DateRangeFilter
|
package/dist/index.js
CHANGED
|
@@ -391,7 +391,7 @@ function OptionRow({
|
|
|
391
391
|
// src/CheckBox.tsx
|
|
392
392
|
import { Check as Check2, Minus } from "lucide-react";
|
|
393
393
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
394
|
-
function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testId }) {
|
|
394
|
+
function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testId, title }) {
|
|
395
395
|
const on = checked || indeterminate;
|
|
396
396
|
return /* @__PURE__ */ jsx4(
|
|
397
397
|
"button",
|
|
@@ -400,6 +400,7 @@ function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testI
|
|
|
400
400
|
role: "checkbox",
|
|
401
401
|
"aria-checked": indeterminate ? "mixed" : checked,
|
|
402
402
|
"aria-label": ariaLabel,
|
|
403
|
+
title,
|
|
403
404
|
disabled,
|
|
404
405
|
"data-testid": testId,
|
|
405
406
|
onClick: (e) => {
|