florixui 1.3.2 → 1.4.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/README.md CHANGED
@@ -438,6 +438,26 @@ A fast, composable command menu with fuzzy search for navigating actions, built
438
438
  </Command>
439
439
  ```
440
440
 
441
+ ### Confirm Prompt
442
+
443
+ A confirmation dialog for risky actions — mainly deletes. An amber warning icon sits beside the title with a red confirm button, plus an optional type-to-confirm safeguard and async loading support.
444
+
445
+ ```tsx
446
+ const [show, setShow] = useState(false)
447
+
448
+ <Button variant="destructive" onClick={() => setShow(true)}>
449
+ Delete project
450
+ </Button>
451
+ <ConfirmPrompt
452
+ show={show}
453
+ onCancel={() => setShow(false)}
454
+ onConfirm={() => deleteProject(id)}
455
+ title="Delete project?"
456
+ message="This action cannot be undone…"
457
+ confirmLabel="Delete"
458
+ />
459
+ ```
460
+
441
461
  ### Custom Tabs
442
462
 
443
463
  A higher-level tab strip with two looks — underline and pill — driven by a single items array. Each tab can carry an icon, a numeric count, and a short badge like "New". Built on Radix Tabs for keyboard and a11y support.
@@ -556,7 +576,7 @@ Displays a menu of actions or options triggered by a button, built on Radix UI w
556
576
 
557
577
  ### Faceted Filter
558
578
 
559
- A controlled filter trigger and popover: a searchable list of options selectable as multi-select checkboxes (default) or single-select. Shows the selection as pills and emits the value(s) via onChange so you can filter your own list or API query.
579
+ A controlled filter trigger and popover: a searchable list of options selectable as multi-select checkboxes (default) or single-select. Shows a selected-count badge on the trigger and emits the value(s) via onChange so you can filter your own list or API query.
560
580
 
561
581
  ```tsx
562
582
  const [status, setStatus] = useState<string[]>(['backlog', 'todo'])
@@ -713,6 +733,37 @@ Renders an accessible caption for a form control, associating text with an input
713
733
  </div>
714
734
  ```
715
735
 
736
+ ### List Card
737
+
738
+ A minimal content card for list and grid layouts. A top row (badge + meta), an optional media thumbnail beside a title and description, a footer, and a corner actions menu — every slot is optional, so it renders any kind of data.
739
+
740
+ ```tsx
741
+ <ListCardGrid columns={3}>
742
+ {alerts.map((a) => (
743
+ <ListCard
744
+ key={a.id}
745
+ badge={a.badge}
746
+ title={a.title}
747
+ description={a.description}
748
+ media={a.imageUrl}
749
+ meta={<><ClockIcon className="size-3" /> 10:12 AM</>}
750
+ actions={[
751
+ { label: 'View details', icon: EyeIcon },
752
+ { label: 'Mark as safe', icon: CheckIcon },
753
+ { type: 'separator' },
754
+ { label: 'Archive', icon: ArchiveIcon, destructive: true },
755
+ ]}
756
+ footer={
757
+ <>
758
+ <ListCardPerson name={a.person} />
759
+ <ListCardChip icon={<TruckIcon />}>{a.entity}</ListCardChip>
760
+ </>
761
+ }
762
+ />
763
+ ))}
764
+ </ListCardGrid>
765
+ ```
766
+
716
767
  ### Map
717
768
 
718
769
  An interactive map built on MapLibre GL (via mapcn), with markers, routes, clustering, and overlays. Uses a free CARTO light basemap by default with no attribution — no API key required.
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ export interface ConfirmPromptProps {
3
+ /** Whether the prompt is open. Controlled. */
4
+ show: boolean;
5
+ /** Heading. Defaults to "Are you absolutely sure?". */
6
+ title?: React.ReactNode;
7
+ /** Supporting copy explaining the consequence. */
8
+ message?: React.ReactNode;
9
+ /** Runs when the user confirms. May return a promise for a loading state. */
10
+ onConfirm: () => void | Promise<void>;
11
+ /** Runs when the user cancels / dismisses. */
12
+ onCancel: () => void;
13
+ /** Show a spinner on the confirm button and block dismissal. */
14
+ loading?: boolean;
15
+ /** Disable the confirm button regardless of validation. */
16
+ disabled?: boolean;
17
+ /** Require the user to type `item` exactly before confirming. */
18
+ validate?: boolean;
19
+ /** The string the user must type when `validate` is set. Defaults to "CONFIRM". */
20
+ item?: string | null;
21
+ /** Confirm button label. Defaults to "Confirm". */
22
+ confirmLabel?: string;
23
+ /** Cancel button label. Defaults to "Cancel". */
24
+ cancelLabel?: string;
25
+ }
26
+ /**
27
+ * A confirmation dialog for risky actions — mainly deletes. An amber warning
28
+ * icon sits beside the title, with a red confirm button. Set `validate` to
29
+ * require the user to type `item` exactly before confirming (the
30
+ * "type the name to delete" safeguard). Controlled via `show`/`onCancel`;
31
+ * `onConfirm` may return a promise to show a spinner.
32
+ */
33
+ export declare function ConfirmPrompt({ show, title, message, onConfirm, onCancel, loading: loadingProp, disabled, validate, item, confirmLabel, cancelLabel, }: ConfirmPromptProps): import("react/jsx-runtime").JSX.Element;
@@ -17,8 +17,6 @@ interface BaseProps {
17
17
  searchPlaceholder?: string;
18
18
  /** Hide the search box (for short lists). */
19
19
  searchable?: boolean;
20
- /** Max selected pills to show on the trigger before collapsing to a count. */
21
- maxDisplayed?: number;
22
20
  className?: string;
23
21
  }
24
22
  interface MultiProps extends BaseProps {
@@ -37,7 +35,7 @@ export type FacetedFilterProps = MultiProps | SingleProps;
37
35
  /**
38
36
  * A controlled filter trigger + popover: a searchable list of options, each
39
37
  * selectable (multi-select checkboxes by default, or single-select with
40
- * `mode="single"`). Shows the selection as pills on the trigger and emits the
38
+ * `mode="single"`). Shows a selected-count badge on the trigger and emits the
41
39
  * value(s) via `onChange` — use it to filter your own list or API query.
42
40
  */
43
41
  export declare function FacetedFilter(props: FacetedFilterProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,64 @@
1
+ import { ActionsMenuItem } from './actions-menu';
2
+ import * as React from "react";
3
+ /** A small avatar (image or initials) paired with a label — for card footers. */
4
+ export declare function ListCardPerson({ name, src, className, }: {
5
+ name: string;
6
+ src?: string;
7
+ className?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ /** A bordered chip with an optional leading icon — for entity tags in footers. */
10
+ export declare function ListCardChip({ icon, children, className, }: {
11
+ icon?: React.ReactNode;
12
+ children: React.ReactNode;
13
+ className?: string;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ export interface ListCardProps extends Omit<React.ComponentProps<"div">, "title" | "onSelect"> {
16
+ /** Primary heading. */
17
+ title: React.ReactNode;
18
+ /** Muted secondary line below the title. */
19
+ description?: React.ReactNode;
20
+ /** Leading visual beside the title — an image URL, or any node (icon, avatar). */
21
+ media?: React.ReactNode | string;
22
+ /** Status badge shown in the top-left. */
23
+ badge?: React.ReactNode;
24
+ /** Extra muted text shown in the footer, e.g. a timestamp. */
25
+ meta?: React.ReactNode;
26
+ /** Footer content — pass `ListCardPerson`, `ListCardChip`, or any nodes. */
27
+ footer?: React.ReactNode;
28
+ /** Kebab menu actions (top-right of the card). Pass items or a ready node. */
29
+ actions?: ActionsMenuItem[] | React.ReactNode;
30
+ /**
31
+ * - `stacked` (default): header row (checkbox + badge, menu on the right),
32
+ * then media + title/description, then footer.
33
+ * - `row`: a single line — checkbox, media, title/description, then menu.
34
+ */
35
+ layout?: "stacked" | "row";
36
+ /**
37
+ * Surface style. `default` uses the card background; `alt` uses the muted
38
+ * background so cards stand out when nested on a card-colored surface.
39
+ */
40
+ variant?: "default" | "alt";
41
+ /** Render a selection checkbox. */
42
+ selectable?: boolean;
43
+ /** Controlled checkbox state (with `selectable`). */
44
+ selected?: boolean;
45
+ /** Called when the checkbox toggles. */
46
+ onSelectedChange?: (checked: boolean) => void;
47
+ /** Highlight the card with a ring (e.g. focused/open row). */
48
+ active?: boolean;
49
+ /** Makes the whole card a button. */
50
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
51
+ }
52
+ /**
53
+ * A minimal content card for list / grid layouts: a top row (checkbox + badge,
54
+ * with an actions menu on the right), an optional media thumbnail beside a title
55
+ * + description, and a footer (where `meta` is shown). Every slot is optional,
56
+ * so it renders any kind of data — alerts, tasks, contacts, files, etc.
57
+ */
58
+ export declare function ListCard({ title, description, media, badge, meta, footer, actions, layout, variant, selectable, selected, onSelectedChange, active, onClick, className, ...props }: ListCardProps): import("react/jsx-runtime").JSX.Element;
59
+ export interface ListCardGridProps extends React.ComponentProps<"div"> {
60
+ /** Column count at the widest breakpoint. Defaults to 3. */
61
+ columns?: 1 | 2 | 3 | 4;
62
+ }
63
+ /** A responsive grid that lays out `ListCard`s. */
64
+ export declare function ListCardGrid({ columns, className, ...props }: ListCardGridProps): import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -7,9 +7,11 @@ export * from './components/custom/advanced-select';
7
7
  export * from './components/custom/data-table';
8
8
  export * from './components/custom/form-dialog';
9
9
  export * from './components/custom/card-radio-group';
10
+ export * from './components/custom/confirm-prompt';
10
11
  export * from './components/custom/custom-tabs';
11
12
  export * from './components/custom/def-row';
12
13
  export * from './components/custom/faceted-filter';
14
+ export * from './components/custom/list-card';
13
15
  export * from './components/custom/quick-stat';
14
16
  export * from './components/custom/sensor-card';
15
17
  export * from './components/custom/side-sheet';