@mediaradar/design-components 0.4.0 → 0.5.1

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.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
@@ -252,6 +259,11 @@ declare function DateRangeFilter({ caption, defaultValue, value: controlledValue
252
259
  * border-border-interactive, focus-visible:outline-border-focus,
253
260
  * hover:text-text-primary, placeholder:text-text-tertiary, rounded-card,
254
261
  * rounded-full, shadow-overlay, text-brand-primaryAction, text-text-secondary
262
+ * @variant default - Default. Plain keyword input, no match-type control.
263
+ * @variant filterable - Adds an attached match-type dropdown sharing one
264
+ * bordered control, mirroring the legacy Creative Intel search + match-type
265
+ * modal (Any Word/Exact Match/Contextual/Ad Code), including the Or/And
266
+ * sub-choice nested under Any Word.
255
267
  * @dependencies lucide-react
256
268
  * @behavior The match-type dropdown ('filterable' variant) closes on Escape
257
269
  * and outside click. Each mode row is a real `radio` role, with a nested
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
@@ -252,6 +259,11 @@ declare function DateRangeFilter({ caption, defaultValue, value: controlledValue
252
259
  * border-border-interactive, focus-visible:outline-border-focus,
253
260
  * hover:text-text-primary, placeholder:text-text-tertiary, rounded-card,
254
261
  * rounded-full, shadow-overlay, text-brand-primaryAction, text-text-secondary
262
+ * @variant default - Default. Plain keyword input, no match-type control.
263
+ * @variant filterable - Adds an attached match-type dropdown sharing one
264
+ * bordered control, mirroring the legacy Creative Intel search + match-type
265
+ * modal (Any Word/Exact Match/Contextual/Ad Code), including the Or/And
266
+ * sub-choice nested under Any Word.
255
267
  * @dependencies lucide-react
256
268
  * @behavior The match-type dropdown ('filterable' variant) closes on Escape
257
269
  * and outside click. Each mode row is a real `radio` role, with a nested
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) => {
@@ -410,7 +411,13 @@ function CheckBox({ checked, indeterminate, onChange, ariaLabel, disabled, testI
410
411
  "flex h-[18px] w-[18px] shrink-0 items-center justify-center rounded-[5px] border transition-colors",
411
412
  "focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus",
412
413
  on ? "border-transparent bg-brand-primaryAction text-white" : "border-border-interactive bg-input hover:border-brand-primaryAction",
413
- disabled && "cursor-not-allowed opacity-50"
414
+ // Cancels the unchecked hover-border preview when disabled -- without
415
+ // this, a disabled box still visually previews the "you can click
416
+ // this" affordance on hover even though the click does nothing.
417
+ // Found empirically reconciling this against insights-studio-
418
+ // prototype's own (more complete) local CheckBox during its
419
+ // migration -- that version already had this guard.
420
+ disabled && "cursor-not-allowed opacity-50 hover:border-border-interactive"
414
421
  ].filter(Boolean).join(" "),
415
422
  children: indeterminate ? /* @__PURE__ */ jsx4(Minus, { size: 13, strokeWidth: 3 }) : checked ? /* @__PURE__ */ jsx4(Check2, { size: 13, strokeWidth: 3 }) : null
416
423
  }