@slipstream-ui/core 0.11.2 → 0.11.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/index.d.mts +12 -2
- package/dist/index.d.ts +12 -2
- package/dist/index.js +44 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +313 -273
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/accordion.manifest.json +1 -1
- package/dist/manifests/alert.manifest.json +1 -1
- package/dist/manifests/announcement-bar.manifest.json +1 -1
- package/dist/manifests/app-shell.manifest.json +1 -1
- package/dist/manifests/applied-filters.manifest.json +1 -1
- package/dist/manifests/article-card.manifest.json +1 -1
- package/dist/manifests/auth-layout.manifest.json +1 -1
- package/dist/manifests/autocomplete.manifest.json +1 -1
- package/dist/manifests/avatar.manifest.json +1 -1
- package/dist/manifests/badge.manifest.json +17 -5
- package/dist/manifests/block.manifest.json +1 -1
- package/dist/manifests/bottom-nav.manifest.json +1 -1
- package/dist/manifests/breadcrumb.manifest.json +1 -1
- package/dist/manifests/button-group.manifest.json +1 -1
- package/dist/manifests/button.manifest.json +1 -1
- package/dist/manifests/calendar.manifest.json +1 -1
- package/dist/manifests/card.manifest.json +1 -1
- package/dist/manifests/checkbox.manifest.json +1 -1
- package/dist/manifests/comparison-table.manifest.json +1 -1
- package/dist/manifests/confirm-dialog.manifest.json +1 -1
- package/dist/manifests/contact-strip.manifest.json +1 -1
- package/dist/manifests/container.manifest.json +1 -1
- package/dist/manifests/cta-section.manifest.json +1 -1
- package/dist/manifests/data-table.manifest.json +1 -1
- package/dist/manifests/date-picker-popover.manifest.json +1 -1
- package/dist/manifests/date-picker.manifest.json +1 -1
- package/dist/manifests/date-range-picker.manifest.json +1 -1
- package/dist/manifests/deal-card.manifest.json +1 -1
- package/dist/manifests/dialog.manifest.json +1 -1
- package/dist/manifests/document-card.manifest.json +1 -1
- package/dist/manifests/drawer.manifest.json +1 -1
- package/dist/manifests/empty-state.manifest.json +1 -1
- package/dist/manifests/entity-card.manifest.json +1 -1
- package/dist/manifests/feature-grid.manifest.json +1 -1
- package/dist/manifests/feature-row.manifest.json +1 -1
- package/dist/manifests/fieldset.manifest.json +1 -1
- package/dist/manifests/file-upload.manifest.json +1 -1
- package/dist/manifests/filter-bar.manifest.json +1 -1
- package/dist/manifests/filter-chips.manifest.json +1 -1
- package/dist/manifests/filter-panel.manifest.json +1 -1
- package/dist/manifests/flex.manifest.json +1 -1
- package/dist/manifests/form-field.manifest.json +1 -1
- package/dist/manifests/form-layout.manifest.json +1 -1
- package/dist/manifests/form.manifest.json +1 -1
- package/dist/manifests/grid.manifest.json +1 -1
- package/dist/manifests/heading.manifest.json +1 -1
- package/dist/manifests/hero.manifest.json +1 -1
- package/dist/manifests/image.manifest.json +1 -1
- package/dist/manifests/input-group.manifest.json +1 -1
- package/dist/manifests/input.manifest.json +1 -1
- package/dist/manifests/label.manifest.json +1 -1
- package/dist/manifests/link-tabs.manifest.json +1 -1
- package/dist/manifests/link.manifest.json +1 -1
- package/dist/manifests/list.manifest.json +1 -1
- package/dist/manifests/load-more.manifest.json +1 -1
- package/dist/manifests/logo-cloud.manifest.json +1 -1
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- package/dist/manifests/multi-select.manifest.json +1 -1
- package/dist/manifests/newsletter.manifest.json +1 -1
- package/dist/manifests/page-header.manifest.json +1 -1
- package/dist/manifests/pagination.manifest.json +1 -1
- package/dist/manifests/password-input.manifest.json +1 -1
- package/dist/manifests/popover.manifest.json +1 -1
- package/dist/manifests/process-steps.manifest.json +1 -1
- package/dist/manifests/progress.manifest.json +1 -1
- package/dist/manifests/prose.manifest.json +1 -1
- package/dist/manifests/radio.manifest.json +1 -1
- package/dist/manifests/range-slider.manifest.json +1 -1
- package/dist/manifests/search.manifest.json +1 -1
- package/dist/manifests/section-heading.manifest.json +1 -1
- package/dist/manifests/section.manifest.json +1 -1
- package/dist/manifests/segmented-control.manifest.json +1 -1
- package/dist/manifests/select-menu.manifest.json +1 -1
- package/dist/manifests/select.manifest.json +1 -1
- package/dist/manifests/separator.manifest.json +1 -1
- package/dist/manifests/site-footer.manifest.json +1 -1
- package/dist/manifests/site-header.manifest.json +1 -1
- package/dist/manifests/skeleton.manifest.json +1 -1
- package/dist/manifests/spinner.manifest.json +1 -1
- package/dist/manifests/stat-band.manifest.json +1 -1
- package/dist/manifests/stepper.manifest.json +1 -1
- package/dist/manifests/switch.manifest.json +1 -1
- package/dist/manifests/table-card.manifest.json +1 -1
- package/dist/manifests/table-of-contents.manifest.json +1 -1
- package/dist/manifests/table.manifest.json +1 -1
- package/dist/manifests/tabs.manifest.json +1 -1
- package/dist/manifests/testimonial.manifest.json +1 -1
- package/dist/manifests/text.manifest.json +1 -1
- package/dist/manifests/textarea.manifest.json +1 -1
- package/dist/manifests/theme-toggle.manifest.json +1 -1
- package/dist/manifests/time-picker.manifest.json +1 -1
- package/dist/manifests/timeline.manifest.json +1 -1
- package/dist/manifests/toast.manifest.json +1 -1
- package/dist/manifests/tombstone-card.manifest.json +1 -1
- package/dist/manifests/tooltip.manifest.json +1 -1
- package/dist/src/components/badge/Badge.d.ts +12 -2
- package/dist/src/components/badge/Badge.js +44 -4
- package/dist/src/components/badge/Badge.js.map +1 -1
- package/dist/src/components/badge/Badge.mjs +46 -6
- package/dist/src/components/badge/Badge.mjs.map +1 -1
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/components/badge/Badge.test.tsx +46 -0
- package/src/components/badge/Badge.tsx +58 -4
- package/src/manifests/accordion.manifest.json +1 -1
- package/src/manifests/alert.manifest.json +1 -1
- package/src/manifests/announcement-bar.manifest.json +1 -1
- package/src/manifests/app-shell.manifest.json +1 -1
- package/src/manifests/applied-filters.manifest.json +1 -1
- package/src/manifests/article-card.manifest.json +1 -1
- package/src/manifests/auth-layout.manifest.json +1 -1
- package/src/manifests/autocomplete.manifest.json +1 -1
- package/src/manifests/avatar.manifest.json +1 -1
- package/src/manifests/badge.manifest.json +17 -5
- package/src/manifests/block.manifest.json +1 -1
- package/src/manifests/bottom-nav.manifest.json +1 -1
- package/src/manifests/breadcrumb.manifest.json +1 -1
- package/src/manifests/button-group.manifest.json +1 -1
- package/src/manifests/button.manifest.json +1 -1
- package/src/manifests/calendar.manifest.json +1 -1
- package/src/manifests/card.manifest.json +1 -1
- package/src/manifests/checkbox.manifest.json +1 -1
- package/src/manifests/comparison-table.manifest.json +1 -1
- package/src/manifests/confirm-dialog.manifest.json +1 -1
- package/src/manifests/contact-strip.manifest.json +1 -1
- package/src/manifests/container.manifest.json +1 -1
- package/src/manifests/cta-section.manifest.json +1 -1
- package/src/manifests/data-table.manifest.json +1 -1
- package/src/manifests/date-picker-popover.manifest.json +1 -1
- package/src/manifests/date-picker.manifest.json +1 -1
- package/src/manifests/date-range-picker.manifest.json +1 -1
- package/src/manifests/deal-card.manifest.json +1 -1
- package/src/manifests/dialog.manifest.json +1 -1
- package/src/manifests/document-card.manifest.json +1 -1
- package/src/manifests/drawer.manifest.json +1 -1
- package/src/manifests/empty-state.manifest.json +1 -1
- package/src/manifests/entity-card.manifest.json +1 -1
- package/src/manifests/feature-grid.manifest.json +1 -1
- package/src/manifests/feature-row.manifest.json +1 -1
- package/src/manifests/fieldset.manifest.json +1 -1
- package/src/manifests/file-upload.manifest.json +1 -1
- package/src/manifests/filter-bar.manifest.json +1 -1
- package/src/manifests/filter-chips.manifest.json +1 -1
- package/src/manifests/filter-panel.manifest.json +1 -1
- package/src/manifests/flex.manifest.json +1 -1
- package/src/manifests/form-field.manifest.json +1 -1
- package/src/manifests/form-layout.manifest.json +1 -1
- package/src/manifests/form.manifest.json +1 -1
- package/src/manifests/grid.manifest.json +1 -1
- package/src/manifests/heading.manifest.json +1 -1
- package/src/manifests/hero.manifest.json +1 -1
- package/src/manifests/image.manifest.json +1 -1
- package/src/manifests/input-group.manifest.json +1 -1
- package/src/manifests/input.manifest.json +1 -1
- package/src/manifests/label.manifest.json +1 -1
- package/src/manifests/link-tabs.manifest.json +1 -1
- package/src/manifests/link.manifest.json +1 -1
- package/src/manifests/list.manifest.json +1 -1
- package/src/manifests/load-more.manifest.json +1 -1
- package/src/manifests/logo-cloud.manifest.json +1 -1
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- package/src/manifests/multi-select.manifest.json +1 -1
- package/src/manifests/newsletter.manifest.json +1 -1
- package/src/manifests/page-header.manifest.json +1 -1
- package/src/manifests/pagination.manifest.json +1 -1
- package/src/manifests/password-input.manifest.json +1 -1
- package/src/manifests/popover.manifest.json +1 -1
- package/src/manifests/process-steps.manifest.json +1 -1
- package/src/manifests/progress.manifest.json +1 -1
- package/src/manifests/prose.manifest.json +1 -1
- package/src/manifests/radio.manifest.json +1 -1
- package/src/manifests/range-slider.manifest.json +1 -1
- package/src/manifests/search.manifest.json +1 -1
- package/src/manifests/section-heading.manifest.json +1 -1
- package/src/manifests/section.manifest.json +1 -1
- package/src/manifests/segmented-control.manifest.json +1 -1
- package/src/manifests/select-menu.manifest.json +1 -1
- package/src/manifests/select.manifest.json +1 -1
- package/src/manifests/separator.manifest.json +1 -1
- package/src/manifests/site-footer.manifest.json +1 -1
- package/src/manifests/site-header.manifest.json +1 -1
- package/src/manifests/skeleton.manifest.json +1 -1
- package/src/manifests/spinner.manifest.json +1 -1
- package/src/manifests/stat-band.manifest.json +1 -1
- package/src/manifests/stepper.manifest.json +1 -1
- package/src/manifests/switch.manifest.json +1 -1
- package/src/manifests/table-card.manifest.json +1 -1
- package/src/manifests/table-of-contents.manifest.json +1 -1
- package/src/manifests/table.manifest.json +1 -1
- package/src/manifests/tabs.manifest.json +1 -1
- package/src/manifests/testimonial.manifest.json +1 -1
- package/src/manifests/text.manifest.json +1 -1
- package/src/manifests/textarea.manifest.json +1 -1
- package/src/manifests/theme-toggle.manifest.json +1 -1
- package/src/manifests/time-picker.manifest.json +1 -1
- package/src/manifests/timeline.manifest.json +1 -1
- package/src/manifests/toast.manifest.json +1 -1
- package/src/manifests/tombstone-card.manifest.json +1 -1
- package/src/manifests/tooltip.manifest.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "multi-select",
|
|
9
9
|
"exportName": "MultiSelect",
|
|
10
10
|
"description": "Searchable multi-select filter with visible removable chips and a checkbox panel.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "newsletter",
|
|
9
9
|
"exportName": "Newsletter",
|
|
10
10
|
"description": "Email capture block with inline or stacked layout, pending state, success and failure feedback.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "process-steps",
|
|
9
9
|
"exportName": "ProcessSteps",
|
|
10
10
|
"description": "Ordered process cards with derived step numbers or custom icons.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "prose",
|
|
9
9
|
"exportName": "Prose",
|
|
10
10
|
"description": "Self-contained long-form typography for rendered markdown/MDX: headings, links, lists, code, tables, quotes and figures.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "range-slider",
|
|
9
9
|
"exportName": "RangeSlider",
|
|
10
10
|
"description": "Dual-thumb numeric range slider with labeled native inputs and formatted values.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "section-heading",
|
|
9
9
|
"exportName": "SectionHeading",
|
|
10
10
|
"description": "Section heading block: eyebrow, title (level 2-4), description and actions, with left/center alignment and three sizes.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "section",
|
|
9
9
|
"exportName": "Section",
|
|
10
10
|
"description": "Full-width page section with a surface tone, vertical rhythm and an optional centered container.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "segmented-control",
|
|
9
9
|
"exportName": "SegmentedControl",
|
|
10
10
|
"description": "Single- or multi-select segmented control for view and filter switches.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "select-menu",
|
|
9
9
|
"exportName": "SelectMenu",
|
|
10
10
|
"description": "Custom listbox select for rich options: descriptions, icons, groups, multi-select, custom rows and hidden inputs for forms.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "site-footer",
|
|
9
9
|
"exportName": "SiteFooter",
|
|
10
10
|
"description": "Marketing footer: brand + tagline column, link columns and a legal bar; router-agnostic via linkComponent.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "organism",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "site-header",
|
|
9
9
|
"exportName": "SiteHeader",
|
|
10
10
|
"description": "Marketing/site header: sticky bar with brand, horizontal navigation with prefix-aware active states, right-aligned actions and a mobile drawer.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "stat-band",
|
|
9
9
|
"exportName": "StatBand",
|
|
10
10
|
"description": "Semantic description list of headline stats with labels, optional hints and column presets.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "table-card",
|
|
9
9
|
"exportName": "TableCard",
|
|
10
10
|
"description": "Table shell with title/description, header actions, optional toolbar, edge-to-edge body and a footer row.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "table-of-contents",
|
|
9
9
|
"exportName": "TableOfContents",
|
|
10
10
|
"description": "Sticky 'On this page' navigation with real anchor links, nested levels and aria-current, plus a useScrollSpy hook for the active heading.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "testimonial",
|
|
9
9
|
"exportName": "Testimonial",
|
|
10
10
|
"description": "Semantic written testimonial with quote, person, role, company, avatar and logo slots.",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"tier": "molecule",
|
|
5
5
|
"package": "@slipstream-ui/core",
|
|
6
6
|
"importPath": "@slipstream-ui/core",
|
|
7
|
-
"version": "0.11.
|
|
7
|
+
"version": "0.11.3",
|
|
8
8
|
"sourceDir": "tombstone-card",
|
|
9
9
|
"exportName": "TombstoneCard",
|
|
10
10
|
"description": "Placeholder card for archived, closed or unavailable marketplace items.",
|
|
@@ -1,18 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "default" | "primary" | "destructive" | "danger" | "success" | "warning" | "info" | "outline" | "secondary" | "neutral" | "accent" | null | undefined;
|
|
4
|
+
variant?: "default" | "primary" | "destructive" | "danger" | "success" | "warning" | "info" | "outline" | "outline-success" | "outline-warning" | "outline-info" | "secondary" | "neutral" | "accent" | "outline-danger" | null | undefined;
|
|
5
5
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants> & {
|
|
8
8
|
/** Render the child element (e.g. a router Link) with badge styling. */
|
|
9
9
|
asChild?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Leading status dot, colored to match the variant. Decorative only —
|
|
12
|
+
* pair it with text that carries the meaning.
|
|
13
|
+
*/
|
|
14
|
+
dot?: boolean;
|
|
10
15
|
};
|
|
11
16
|
declare const Badge: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & VariantProps<(props?: ({
|
|
12
|
-
variant?: "default" | "primary" | "destructive" | "danger" | "success" | "warning" | "info" | "outline" | "secondary" | "neutral" | "accent" | null | undefined;
|
|
17
|
+
variant?: "default" | "primary" | "destructive" | "danger" | "success" | "warning" | "info" | "outline" | "outline-success" | "outline-warning" | "outline-info" | "secondary" | "neutral" | "accent" | "outline-danger" | null | undefined;
|
|
13
18
|
size?: "sm" | "md" | "lg" | null | undefined;
|
|
14
19
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
15
20
|
/** Render the child element (e.g. a router Link) with badge styling. */
|
|
16
21
|
asChild?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Leading status dot, colored to match the variant. Decorative only —
|
|
24
|
+
* pair it with text that carries the meaning.
|
|
25
|
+
*/
|
|
26
|
+
dot?: boolean;
|
|
17
27
|
} & React.RefAttributes<HTMLSpanElement>>;
|
|
18
28
|
export { Badge, badgeVariants };
|
|
@@ -55,7 +55,14 @@ const badgeVariants = (0, import_class_variance_authority.cva)(
|
|
|
55
55
|
info: "border-transparent bg-info text-info-foreground hover:bg-info/80",
|
|
56
56
|
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
57
57
|
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
58
|
-
outline: "text-foreground"
|
|
58
|
+
outline: "text-foreground",
|
|
59
|
+
// Quiet outline tones for status metadata (directory chips, filter
|
|
60
|
+
// tags): tinted border and ink text, subtle tint on hover. Follows the
|
|
61
|
+
// Alert/Button outline language.
|
|
62
|
+
"outline-success": "border-success/50 bg-background text-success-ink hover:bg-success/10",
|
|
63
|
+
"outline-warning": "border-warning/50 bg-background text-warning-ink hover:bg-warning/10",
|
|
64
|
+
"outline-info": "border-info/50 bg-background text-info-ink hover:bg-info/10",
|
|
65
|
+
"outline-danger": "border-destructive/50 bg-background text-destructive hover:bg-destructive/10"
|
|
59
66
|
},
|
|
60
67
|
size: {
|
|
61
68
|
sm: "px-2 py-0 text-[11px]",
|
|
@@ -69,10 +76,43 @@ const badgeVariants = (0, import_class_variance_authority.cva)(
|
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
);
|
|
79
|
+
const dotVariants = {
|
|
80
|
+
default: "bg-primary-foreground",
|
|
81
|
+
primary: "bg-primary-foreground",
|
|
82
|
+
neutral: "bg-muted-foreground",
|
|
83
|
+
accent: "bg-accent-foreground",
|
|
84
|
+
danger: "bg-destructive-foreground",
|
|
85
|
+
destructive: "bg-destructive-foreground",
|
|
86
|
+
success: "bg-success-foreground",
|
|
87
|
+
warning: "bg-warning-foreground",
|
|
88
|
+
info: "bg-info-foreground",
|
|
89
|
+
secondary: "bg-secondary-foreground",
|
|
90
|
+
outline: "bg-foreground",
|
|
91
|
+
"outline-success": "bg-success",
|
|
92
|
+
"outline-warning": "bg-warning",
|
|
93
|
+
"outline-info": "bg-info",
|
|
94
|
+
"outline-danger": "bg-destructive"
|
|
95
|
+
};
|
|
72
96
|
const Badge = React.forwardRef(
|
|
73
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
74
|
-
const
|
|
75
|
-
|
|
97
|
+
({ className, variant, size, asChild = false, dot = false, children, ...props }, ref) => {
|
|
98
|
+
const classNames = (0, import_cn.cn)(badgeVariants({ variant, size }), dot && "gap-1.5", className);
|
|
99
|
+
const dotEl = dot ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
100
|
+
"span",
|
|
101
|
+
{
|
|
102
|
+
"aria-hidden": "true",
|
|
103
|
+
className: (0, import_cn.cn)("h-1.5 w-1.5 shrink-0 rounded-full", dotVariants[variant ?? "default"])
|
|
104
|
+
}
|
|
105
|
+
) : null;
|
|
106
|
+
if (asChild) {
|
|
107
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react_slot.Slot, { ref, className: classNames, ...props, children: [
|
|
108
|
+
dotEl,
|
|
109
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_slot.Slottable, { children })
|
|
110
|
+
] });
|
|
111
|
+
}
|
|
112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { ref, className: classNames, ...props, children: [
|
|
113
|
+
dotEl,
|
|
114
|
+
children
|
|
115
|
+
] });
|
|
76
116
|
}
|
|
77
117
|
);
|
|
78
118
|
Badge.displayName = "Badge";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/badge/Badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst badgeVariants = cva(\n 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',\n {\n variants: {\n variant: {\n default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',\n // Aliases used by shadcn/Bootstrap-style codebases.\n primary: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',\n // Neutral pill for metadata (counts, categories) and a tinted\n // brand accent that stays readable on the page surface.\n neutral: 'border-transparent bg-muted text-muted-foreground hover:bg-muted/80',\n accent: 'border-transparent bg-accent text-accent-foreground hover:bg-accent/80',\n danger: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n success: 'border-transparent bg-success text-success-foreground hover:bg-success/80',\n warning: 'border-transparent bg-warning text-warning-foreground hover:bg-warning/80',\n info: 'border-transparent bg-info text-info-foreground hover:bg-info/80',\n secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n outline: 'text-foreground',\n },\n size: {\n sm: 'px-2 py-0 text-[11px]',\n md: 'px-2.5 py-0.5 text-xs',\n lg: 'px-3 py-1 text-sm',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n);\n\nexport type BadgeProps = React.HTMLAttributes<HTMLSpanElement> &\n VariantProps<typeof badgeVariants> & {\n /** Render the child element (e.g. a router Link) with badge styling. */\n asChild?: boolean;\n };\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/badge/Badge.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot, Slottable } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst badgeVariants = cva(\n 'inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',\n {\n variants: {\n variant: {\n default: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',\n // Aliases used by shadcn/Bootstrap-style codebases.\n primary: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',\n // Neutral pill for metadata (counts, categories) and a tinted\n // brand accent that stays readable on the page surface.\n neutral: 'border-transparent bg-muted text-muted-foreground hover:bg-muted/80',\n accent: 'border-transparent bg-accent text-accent-foreground hover:bg-accent/80',\n danger: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n success: 'border-transparent bg-success text-success-foreground hover:bg-success/80',\n warning: 'border-transparent bg-warning text-warning-foreground hover:bg-warning/80',\n info: 'border-transparent bg-info text-info-foreground hover:bg-info/80',\n secondary: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',\n outline: 'text-foreground',\n // Quiet outline tones for status metadata (directory chips, filter\n // tags): tinted border and ink text, subtle tint on hover. Follows the\n // Alert/Button outline language.\n 'outline-success': 'border-success/50 bg-background text-success-ink hover:bg-success/10',\n 'outline-warning': 'border-warning/50 bg-background text-warning-ink hover:bg-warning/10',\n 'outline-info': 'border-info/50 bg-background text-info-ink hover:bg-info/10',\n 'outline-danger': 'border-destructive/50 bg-background text-destructive hover:bg-destructive/10',\n },\n size: {\n sm: 'px-2 py-0 text-[11px]',\n md: 'px-2.5 py-0.5 text-xs',\n lg: 'px-3 py-1 text-sm',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n);\n\nexport type BadgeProps = React.HTMLAttributes<HTMLSpanElement> &\n VariantProps<typeof badgeVariants> & {\n /** Render the child element (e.g. a router Link) with badge styling. */\n asChild?: boolean;\n /**\n * Leading status dot, colored to match the variant. Decorative only —\n * pair it with text that carries the meaning.\n */\n dot?: boolean;\n };\n\n/** Dot fill per variant: foreground ink on solid fills, tone color on outlines. */\nconst dotVariants: Record<NonNullable<BadgeProps['variant']>, string> = {\n default: 'bg-primary-foreground',\n primary: 'bg-primary-foreground',\n neutral: 'bg-muted-foreground',\n accent: 'bg-accent-foreground',\n danger: 'bg-destructive-foreground',\n destructive: 'bg-destructive-foreground',\n success: 'bg-success-foreground',\n warning: 'bg-warning-foreground',\n info: 'bg-info-foreground',\n secondary: 'bg-secondary-foreground',\n outline: 'bg-foreground',\n 'outline-success': 'bg-success',\n 'outline-warning': 'bg-warning',\n 'outline-info': 'bg-info',\n 'outline-danger': 'bg-destructive',\n};\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, variant, size, asChild = false, dot = false, children, ...props }, ref) => {\n const classNames = cn(badgeVariants({ variant, size }), dot && 'gap-1.5', className);\n const dotEl = dot ? (\n <span\n aria-hidden=\"true\"\n className={cn('h-1.5 w-1.5 shrink-0 rounded-full', dotVariants[variant ?? 'default'])}\n />\n ) : null;\n\n if (asChild) {\n // Slot accepts one slottable child; Slottable keeps the dot as a\n // sibling rendered inside the slotted element.\n return (\n <Slot ref={ref} className={classNames} {...props}>\n {dotEl}\n <Slottable>{children}</Slottable>\n </Slot>\n );\n }\n\n return (\n <span ref={ref} className={classNames} {...props}>\n {dotEl}\n {children}\n </span>\n );\n }\n);\nBadge.displayName = 'Badge';\n\nexport { Badge, badgeVariants };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+EM;AA/EN,YAAuB;AACvB,wBAAgC;AAChC,sCAAuC;AACvC,gBAAmB;AAEnB,MAAM,oBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA;AAAA,QAET,SAAS;AAAA;AAAA;AAAA,QAGT,SAAS;AAAA,QACT,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,SAAS;AAAA,QACT,MAAM;AAAA,QACN,WAAW;AAAA,QACX,aAAa;AAAA,QACb,SAAS;AAAA;AAAA;AAAA;AAAA,QAIT,mBAAmB;AAAA,QACnB,mBAAmB;AAAA,QACnB,gBAAgB;AAAA,QAChB,kBAAkB;AAAA,MACpB;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAcA,MAAM,cAAkE;AAAA,EACtE,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,aAAa;AAAA,EACb,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,kBAAkB;AACpB;AAEA,MAAM,QAAQ,MAAM;AAAA,EAClB,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,MAAM,OAAO,UAAU,GAAG,MAAM,GAAG,QAAQ;AACvF,UAAM,iBAAa,cAAG,cAAc,EAAE,SAAS,KAAK,CAAC,GAAG,OAAO,WAAW,SAAS;AACnF,UAAM,QAAQ,MACZ;AAAA,MAAC;AAAA;AAAA,QACC,eAAY;AAAA,QACZ,eAAW,cAAG,qCAAqC,YAAY,WAAW,SAAS,CAAC;AAAA;AAAA,IACtF,IACE;AAEJ,QAAI,SAAS;AAGX,aACE,6CAAC,0BAAK,KAAU,WAAW,YAAa,GAAG,OACxC;AAAA;AAAA,QACD,4CAAC,+BAAW,UAAS;AAAA,SACvB;AAAA,IAEJ;AAEA,WACE,6CAAC,UAAK,KAAU,WAAW,YAAa,GAAG,OACxC;AAAA;AAAA,MACA;AAAA,OACH;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
3
|
+
import { Slot, Slottable } from "@radix-ui/react-slot";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { cn } from "../../utils/cn.mjs";
|
|
6
6
|
const badgeVariants = cva(
|
|
@@ -21,7 +21,14 @@ const badgeVariants = cva(
|
|
|
21
21
|
info: "border-transparent bg-info text-info-foreground hover:bg-info/80",
|
|
22
22
|
secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
23
23
|
destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
|
|
24
|
-
outline: "text-foreground"
|
|
24
|
+
outline: "text-foreground",
|
|
25
|
+
// Quiet outline tones for status metadata (directory chips, filter
|
|
26
|
+
// tags): tinted border and ink text, subtle tint on hover. Follows the
|
|
27
|
+
// Alert/Button outline language.
|
|
28
|
+
"outline-success": "border-success/50 bg-background text-success-ink hover:bg-success/10",
|
|
29
|
+
"outline-warning": "border-warning/50 bg-background text-warning-ink hover:bg-warning/10",
|
|
30
|
+
"outline-info": "border-info/50 bg-background text-info-ink hover:bg-info/10",
|
|
31
|
+
"outline-danger": "border-destructive/50 bg-background text-destructive hover:bg-destructive/10"
|
|
25
32
|
},
|
|
26
33
|
size: {
|
|
27
34
|
sm: "px-2 py-0 text-[11px]",
|
|
@@ -35,10 +42,43 @@ const badgeVariants = cva(
|
|
|
35
42
|
}
|
|
36
43
|
}
|
|
37
44
|
);
|
|
45
|
+
const dotVariants = {
|
|
46
|
+
default: "bg-primary-foreground",
|
|
47
|
+
primary: "bg-primary-foreground",
|
|
48
|
+
neutral: "bg-muted-foreground",
|
|
49
|
+
accent: "bg-accent-foreground",
|
|
50
|
+
danger: "bg-destructive-foreground",
|
|
51
|
+
destructive: "bg-destructive-foreground",
|
|
52
|
+
success: "bg-success-foreground",
|
|
53
|
+
warning: "bg-warning-foreground",
|
|
54
|
+
info: "bg-info-foreground",
|
|
55
|
+
secondary: "bg-secondary-foreground",
|
|
56
|
+
outline: "bg-foreground",
|
|
57
|
+
"outline-success": "bg-success",
|
|
58
|
+
"outline-warning": "bg-warning",
|
|
59
|
+
"outline-info": "bg-info",
|
|
60
|
+
"outline-danger": "bg-destructive"
|
|
61
|
+
};
|
|
38
62
|
const Badge = React.forwardRef(
|
|
39
|
-
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
40
|
-
const
|
|
41
|
-
|
|
63
|
+
({ className, variant, size, asChild = false, dot = false, children, ...props }, ref) => {
|
|
64
|
+
const classNames = cn(badgeVariants({ variant, size }), dot && "gap-1.5", className);
|
|
65
|
+
const dotEl = dot ? /* @__PURE__ */ jsx(
|
|
66
|
+
"span",
|
|
67
|
+
{
|
|
68
|
+
"aria-hidden": "true",
|
|
69
|
+
className: cn("h-1.5 w-1.5 shrink-0 rounded-full", dotVariants[variant ?? "default"])
|
|
70
|
+
}
|
|
71
|
+
) : null;
|
|
72
|
+
if (asChild) {
|
|
73
|
+
return /* @__PURE__ */ jsxs(Slot, { ref, className: classNames, ...props, children: [
|
|
74
|
+
dotEl,
|
|
75
|
+
/* @__PURE__ */ jsx(Slottable, { children })
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
return /* @__PURE__ */ jsxs("span", { ref, className: classNames, ...props, children: [
|
|
79
|
+
dotEl,
|
|
80
|
+
children
|
|
81
|
+
] });
|
|
42
82
|
}
|
|
43
83
|
);
|
|
44
84
|
Badge.displayName = "Badge";
|