@slipstream-ui/core 0.11.3 → 0.11.4
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 +27 -5
- package/dist/index.d.ts +27 -5
- package/dist/index.js +16 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -3
- 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 +1 -1
- 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 +16 -4
- 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/form-layout/FormLayout.d.ts +26 -4
- package/dist/src/components/form-layout/FormLayout.js +16 -3
- package/dist/src/components/form-layout/FormLayout.js.map +1 -1
- package/dist/src/components/form-layout/FormLayout.mjs +16 -3
- package/dist/src/components/form-layout/FormLayout.mjs.map +1 -1
- package/package.json +2 -2
- package/src/components/form-layout/FormLayout.test.tsx +26 -0
- package/src/components/form-layout/FormLayout.tsx +37 -5
- 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 +1 -1
- 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 +16 -4
- 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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
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.4",
|
|
8
8
|
"sourceDir": "tombstone-card",
|
|
9
9
|
"exportName": "TombstoneCard",
|
|
10
10
|
"description": "Placeholder card for archived, closed or unavailable marketplace items.",
|
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type GapValue } from '../../utils/gap';
|
|
3
|
+
/** Column count per breakpoint; `base` applies at every width. */
|
|
4
|
+
export type FormLayoutColumns = 1 | 2 | 3 | 4 | {
|
|
5
|
+
base?: 1 | 2 | 3 | 4;
|
|
6
|
+
sm?: 1 | 2 | 3 | 4;
|
|
7
|
+
md?: 1 | 2 | 3 | 4;
|
|
8
|
+
lg?: 1 | 2 | 3 | 4;
|
|
9
|
+
xl?: 1 | 2 | 3 | 4;
|
|
10
|
+
};
|
|
3
11
|
export type FormLayoutProps = React.HTMLAttributes<HTMLElement> & {
|
|
4
12
|
/** Grouping layout: even vertical stack (default), horizontal row, or responsive grid. */
|
|
5
13
|
layout?: 'stack' | 'row' | 'grid';
|
|
6
|
-
/**
|
|
7
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Grid column count (1-4) at every width, or per breakpoint
|
|
16
|
+
* (`{ base: 1, md: 2 }`) for responsive grids without className overrides.
|
|
17
|
+
*/
|
|
18
|
+
columns?: FormLayoutColumns;
|
|
8
19
|
/** Even spacing between children — token ('md') or exact pixels (16). */
|
|
9
20
|
gap?: GapValue;
|
|
10
21
|
/** Group label; renders a semantic <legend> when as="fieldset". */
|
|
11
22
|
legend?: string;
|
|
23
|
+
/** Extra classes for the legend (fieldset mode). */
|
|
24
|
+
legendClassName?: string;
|
|
12
25
|
/** Supporting line under the legend (fieldset mode). */
|
|
13
26
|
description?: string;
|
|
27
|
+
/** Extra classes for the description (fieldset mode). */
|
|
28
|
+
descriptionClassName?: string;
|
|
14
29
|
/** Render as a semantic fieldset (default 'div'). */
|
|
15
30
|
as?: 'div' | 'fieldset';
|
|
16
31
|
};
|
|
@@ -23,14 +38,21 @@ export type FormLayoutProps = React.HTMLAttributes<HTMLElement> & {
|
|
|
23
38
|
declare const FormLayout: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
24
39
|
/** Grouping layout: even vertical stack (default), horizontal row, or responsive grid. */
|
|
25
40
|
layout?: "stack" | "row" | "grid";
|
|
26
|
-
/**
|
|
27
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Grid column count (1-4) at every width, or per breakpoint
|
|
43
|
+
* (`{ base: 1, md: 2 }`) for responsive grids without className overrides.
|
|
44
|
+
*/
|
|
45
|
+
columns?: FormLayoutColumns;
|
|
28
46
|
/** Even spacing between children — token ('md') or exact pixels (16). */
|
|
29
47
|
gap?: GapValue;
|
|
30
48
|
/** Group label; renders a semantic <legend> when as="fieldset". */
|
|
31
49
|
legend?: string;
|
|
50
|
+
/** Extra classes for the legend (fieldset mode). */
|
|
51
|
+
legendClassName?: string;
|
|
32
52
|
/** Supporting line under the legend (fieldset mode). */
|
|
33
53
|
description?: string;
|
|
54
|
+
/** Extra classes for the description (fieldset mode). */
|
|
55
|
+
descriptionClassName?: string;
|
|
34
56
|
/** Render as a semantic fieldset (default 'div'). */
|
|
35
57
|
as?: "div" | "fieldset";
|
|
36
58
|
} & React.RefAttributes<HTMLElement>>;
|
|
@@ -41,13 +41,26 @@ const GRID_COLUMNS = {
|
|
|
41
41
|
3: "grid-cols-3",
|
|
42
42
|
4: "grid-cols-4"
|
|
43
43
|
};
|
|
44
|
+
const GRID_BREAKPOINTS = ["sm", "md", "lg", "xl"];
|
|
45
|
+
function gridColumnClasses(columns) {
|
|
46
|
+
if (typeof columns === "number") return GRID_COLUMNS[columns];
|
|
47
|
+
return [
|
|
48
|
+
columns.base !== void 0 ? GRID_COLUMNS[columns.base] : "",
|
|
49
|
+
...GRID_BREAKPOINTS.map((bp) => {
|
|
50
|
+
const count = columns[bp];
|
|
51
|
+
return count !== void 0 ? `${bp}:${GRID_COLUMNS[count]}` : "";
|
|
52
|
+
})
|
|
53
|
+
].filter(Boolean).join(" ");
|
|
54
|
+
}
|
|
44
55
|
const FormLayout = React.forwardRef(
|
|
45
56
|
({
|
|
46
57
|
layout = "stack",
|
|
47
58
|
columns = 2,
|
|
48
59
|
gap,
|
|
49
60
|
legend,
|
|
61
|
+
legendClassName,
|
|
50
62
|
description,
|
|
63
|
+
descriptionClassName,
|
|
51
64
|
as = "div",
|
|
52
65
|
className,
|
|
53
66
|
style,
|
|
@@ -64,15 +77,15 @@ const FormLayout = React.forwardRef(
|
|
|
64
77
|
"flex min-w-0",
|
|
65
78
|
layout === "stack" && "flex-col",
|
|
66
79
|
layout === "row" && "flex-row flex-wrap items-end",
|
|
67
|
-
layout === "grid" && `grid ${
|
|
80
|
+
layout === "grid" && `grid ${gridColumnClasses(columns)}`,
|
|
68
81
|
gapResolved.className,
|
|
69
82
|
className
|
|
70
83
|
),
|
|
71
84
|
style: { ...gapResolved.style, ...style },
|
|
72
85
|
...props,
|
|
73
86
|
children: [
|
|
74
|
-
legend && as === "fieldset" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("legend", { className: "col-span-full p-0 text-sm font-medium leading-none", children: legend }),
|
|
75
|
-
description && as === "fieldset" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "col-span-full text-xs text-muted-foreground", children: description }),
|
|
87
|
+
legend && as === "fieldset" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("legend", { className: (0, import_cn.cn)("col-span-full p-0 text-sm font-medium leading-none", legendClassName), children: legend }),
|
|
88
|
+
description && as === "fieldset" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: (0, import_cn.cn)("col-span-full text-xs text-muted-foreground", descriptionClassName), children: description }),
|
|
76
89
|
children
|
|
77
90
|
]
|
|
78
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/form-layout/FormLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { resolveGap, type GapValue } from '../../utils/gap';\n\n// Literal classes so Tailwind's scanner keeps them (runtime-built\n// grid-cols-${n} would be purged — same rule as Grid).\nconst GRID_COLUMNS: Record<number, string> = {\n 1: 'grid-cols-1',\n 2: 'grid-cols-2',\n 3: 'grid-cols-3',\n 4: 'grid-cols-4',\n};\n\nexport type FormLayoutProps = React.HTMLAttributes<HTMLElement> & {\n /** Grouping layout: even vertical stack (default), horizontal row, or responsive grid. */\n layout?: 'stack' | 'row' | 'grid';\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/form-layout/FormLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { resolveGap, type GapValue } from '../../utils/gap';\n\n// Literal classes so Tailwind's scanner keeps them (runtime-built\n// grid-cols-${n} would be purged — same rule as Grid).\nconst GRID_COLUMNS: Record<number, string> = {\n 1: 'grid-cols-1',\n 2: 'grid-cols-2',\n 3: 'grid-cols-3',\n 4: 'grid-cols-4',\n};\n\nconst GRID_BREAKPOINTS = ['sm', 'md', 'lg', 'xl'] as const;\n\n/** Column count per breakpoint; `base` applies at every width. */\nexport type FormLayoutColumns =\n | 1\n | 2\n | 3\n | 4\n | { base?: 1 | 2 | 3 | 4; sm?: 1 | 2 | 3 | 4; md?: 1 | 2 | 3 | 4; lg?: 1 | 2 | 3 | 4; xl?: 1 | 2 | 3 | 4 };\n\nfunction gridColumnClasses(columns: FormLayoutColumns): string {\n if (typeof columns === 'number') return GRID_COLUMNS[columns];\n return [\n columns.base !== undefined ? GRID_COLUMNS[columns.base] : '',\n ...GRID_BREAKPOINTS.map((bp) => {\n const count = columns[bp];\n return count !== undefined ? `${bp}:${GRID_COLUMNS[count]}` : '';\n }),\n ]\n .filter(Boolean)\n .join(' ');\n}\n\nexport type FormLayoutProps = React.HTMLAttributes<HTMLElement> & {\n /** Grouping layout: even vertical stack (default), horizontal row, or responsive grid. */\n layout?: 'stack' | 'row' | 'grid';\n /**\n * Grid column count (1-4) at every width, or per breakpoint\n * (`{ base: 1, md: 2 }`) for responsive grids without className overrides.\n */\n columns?: FormLayoutColumns;\n /** Even spacing between children — token ('md') or exact pixels (16). */\n gap?: GapValue;\n /** Group label; renders a semantic <legend> when as=\"fieldset\". */\n legend?: string;\n /** Extra classes for the legend (fieldset mode). */\n legendClassName?: string;\n /** Supporting line under the legend (fieldset mode). */\n description?: string;\n /** Extra classes for the description (fieldset mode). */\n descriptionClassName?: string;\n /** Render as a semantic fieldset (default 'div'). */\n as?: 'div' | 'fieldset';\n};\n\n/**\n * Groups form fields with even, tokenized spacing — the layout half of\n * form composition (FormField/Fieldset provide the per-control semantics).\n * stack keeps one field per row, row flows fields inline, grid spreads\n * them across columns (1-4, literal classes so they survive purging).\n */\nconst FormLayout = React.forwardRef<HTMLElement, FormLayoutProps>(\n (\n {\n layout = 'stack',\n columns = 2,\n gap,\n legend,\n legendClassName,\n description,\n descriptionClassName,\n as = 'div',\n className,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const Tag = as as 'div' | 'fieldset';\n const gapResolved = resolveGap(gap ?? 'md');\n return (\n <Tag\n ref={ref as never}\n className={cn(\n 'flex min-w-0',\n layout === 'stack' && 'flex-col',\n layout === 'row' && 'flex-row flex-wrap items-end',\n layout === 'grid' && `grid ${gridColumnClasses(columns)}`,\n gapResolved.className,\n className\n )}\n style={{ ...gapResolved.style, ...style }}\n {...props}\n >\n {legend && as === 'fieldset' && (\n <legend className={cn('col-span-full p-0 text-sm font-medium leading-none', legendClassName)}>{legend}</legend>\n )}\n {description && as === 'fieldset' && (\n <p className={cn('col-span-full text-xs text-muted-foreground', descriptionClassName)}>{description}</p>\n )}\n {children}\n </Tag>\n );\n }\n);\nFormLayout.displayName = 'FormLayout';\n\nexport { FormLayout };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqFM;AArFN,YAAuB;AACvB,gBAAmB;AACnB,iBAA0C;AAI1C,MAAM,eAAuC;AAAA,EAC3C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,mBAAmB,CAAC,MAAM,MAAM,MAAM,IAAI;AAUhD,SAAS,kBAAkB,SAAoC;AAC7D,MAAI,OAAO,YAAY,SAAU,QAAO,aAAa,OAAO;AAC5D,SAAO;AAAA,IACL,QAAQ,SAAS,SAAY,aAAa,QAAQ,IAAI,IAAI;AAAA,IAC1D,GAAG,iBAAiB,IAAI,CAAC,OAAO;AAC9B,YAAM,QAAQ,QAAQ,EAAE;AACxB,aAAO,UAAU,SAAY,GAAG,EAAE,IAAI,aAAa,KAAK,CAAC,KAAK;AAAA,IAChE,CAAC;AAAA,EACH,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AACb;AA8BA,MAAM,aAAa,MAAM;AAAA,EACvB,CACE;AAAA,IACE,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,MAAM;AACZ,UAAM,kBAAc,uBAAW,OAAO,IAAI;AAC1C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW;AAAA,UACT;AAAA,UACA,WAAW,WAAW;AAAA,UACtB,WAAW,SAAS;AAAA,UACpB,WAAW,UAAU,QAAQ,kBAAkB,OAAO,CAAC;AAAA,UACvD,YAAY;AAAA,UACZ;AAAA,QACF;AAAA,QACA,OAAO,EAAE,GAAG,YAAY,OAAO,GAAG,MAAM;AAAA,QACvC,GAAG;AAAA,QAEH;AAAA,oBAAU,OAAO,cAChB,4CAAC,YAAO,eAAW,cAAG,sDAAsD,eAAe,GAAI,kBAAO;AAAA,UAEvG,eAAe,OAAO,cACrB,4CAAC,OAAE,eAAW,cAAG,+CAA+C,oBAAoB,GAAI,uBAAY;AAAA,UAErG;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;","names":[]}
|
|
@@ -8,13 +8,26 @@ const GRID_COLUMNS = {
|
|
|
8
8
|
3: "grid-cols-3",
|
|
9
9
|
4: "grid-cols-4"
|
|
10
10
|
};
|
|
11
|
+
const GRID_BREAKPOINTS = ["sm", "md", "lg", "xl"];
|
|
12
|
+
function gridColumnClasses(columns) {
|
|
13
|
+
if (typeof columns === "number") return GRID_COLUMNS[columns];
|
|
14
|
+
return [
|
|
15
|
+
columns.base !== void 0 ? GRID_COLUMNS[columns.base] : "",
|
|
16
|
+
...GRID_BREAKPOINTS.map((bp) => {
|
|
17
|
+
const count = columns[bp];
|
|
18
|
+
return count !== void 0 ? `${bp}:${GRID_COLUMNS[count]}` : "";
|
|
19
|
+
})
|
|
20
|
+
].filter(Boolean).join(" ");
|
|
21
|
+
}
|
|
11
22
|
const FormLayout = React.forwardRef(
|
|
12
23
|
({
|
|
13
24
|
layout = "stack",
|
|
14
25
|
columns = 2,
|
|
15
26
|
gap,
|
|
16
27
|
legend,
|
|
28
|
+
legendClassName,
|
|
17
29
|
description,
|
|
30
|
+
descriptionClassName,
|
|
18
31
|
as = "div",
|
|
19
32
|
className,
|
|
20
33
|
style,
|
|
@@ -31,15 +44,15 @@ const FormLayout = React.forwardRef(
|
|
|
31
44
|
"flex min-w-0",
|
|
32
45
|
layout === "stack" && "flex-col",
|
|
33
46
|
layout === "row" && "flex-row flex-wrap items-end",
|
|
34
|
-
layout === "grid" && `grid ${
|
|
47
|
+
layout === "grid" && `grid ${gridColumnClasses(columns)}`,
|
|
35
48
|
gapResolved.className,
|
|
36
49
|
className
|
|
37
50
|
),
|
|
38
51
|
style: { ...gapResolved.style, ...style },
|
|
39
52
|
...props,
|
|
40
53
|
children: [
|
|
41
|
-
legend && as === "fieldset" && /* @__PURE__ */ jsx("legend", { className: "col-span-full p-0 text-sm font-medium leading-none", children: legend }),
|
|
42
|
-
description && as === "fieldset" && /* @__PURE__ */ jsx("p", { className: "col-span-full text-xs text-muted-foreground", children: description }),
|
|
54
|
+
legend && as === "fieldset" && /* @__PURE__ */ jsx("legend", { className: cn("col-span-full p-0 text-sm font-medium leading-none", legendClassName), children: legend }),
|
|
55
|
+
description && as === "fieldset" && /* @__PURE__ */ jsx("p", { className: cn("col-span-full text-xs text-muted-foreground", descriptionClassName), children: description }),
|
|
43
56
|
children
|
|
44
57
|
]
|
|
45
58
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/form-layout/FormLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { resolveGap, type GapValue } from '../../utils/gap';\n\n// Literal classes so Tailwind's scanner keeps them (runtime-built\n// grid-cols-${n} would be purged — same rule as Grid).\nconst GRID_COLUMNS: Record<number, string> = {\n 1: 'grid-cols-1',\n 2: 'grid-cols-2',\n 3: 'grid-cols-3',\n 4: 'grid-cols-4',\n};\n\nexport type FormLayoutProps = React.HTMLAttributes<HTMLElement> & {\n /** Grouping layout: even vertical stack (default), horizontal row, or responsive grid. */\n layout?: 'stack' | 'row' | 'grid';\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/form-layout/FormLayout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { resolveGap, type GapValue } from '../../utils/gap';\n\n// Literal classes so Tailwind's scanner keeps them (runtime-built\n// grid-cols-${n} would be purged — same rule as Grid).\nconst GRID_COLUMNS: Record<number, string> = {\n 1: 'grid-cols-1',\n 2: 'grid-cols-2',\n 3: 'grid-cols-3',\n 4: 'grid-cols-4',\n};\n\nconst GRID_BREAKPOINTS = ['sm', 'md', 'lg', 'xl'] as const;\n\n/** Column count per breakpoint; `base` applies at every width. */\nexport type FormLayoutColumns =\n | 1\n | 2\n | 3\n | 4\n | { base?: 1 | 2 | 3 | 4; sm?: 1 | 2 | 3 | 4; md?: 1 | 2 | 3 | 4; lg?: 1 | 2 | 3 | 4; xl?: 1 | 2 | 3 | 4 };\n\nfunction gridColumnClasses(columns: FormLayoutColumns): string {\n if (typeof columns === 'number') return GRID_COLUMNS[columns];\n return [\n columns.base !== undefined ? GRID_COLUMNS[columns.base] : '',\n ...GRID_BREAKPOINTS.map((bp) => {\n const count = columns[bp];\n return count !== undefined ? `${bp}:${GRID_COLUMNS[count]}` : '';\n }),\n ]\n .filter(Boolean)\n .join(' ');\n}\n\nexport type FormLayoutProps = React.HTMLAttributes<HTMLElement> & {\n /** Grouping layout: even vertical stack (default), horizontal row, or responsive grid. */\n layout?: 'stack' | 'row' | 'grid';\n /**\n * Grid column count (1-4) at every width, or per breakpoint\n * (`{ base: 1, md: 2 }`) for responsive grids without className overrides.\n */\n columns?: FormLayoutColumns;\n /** Even spacing between children — token ('md') or exact pixels (16). */\n gap?: GapValue;\n /** Group label; renders a semantic <legend> when as=\"fieldset\". */\n legend?: string;\n /** Extra classes for the legend (fieldset mode). */\n legendClassName?: string;\n /** Supporting line under the legend (fieldset mode). */\n description?: string;\n /** Extra classes for the description (fieldset mode). */\n descriptionClassName?: string;\n /** Render as a semantic fieldset (default 'div'). */\n as?: 'div' | 'fieldset';\n};\n\n/**\n * Groups form fields with even, tokenized spacing — the layout half of\n * form composition (FormField/Fieldset provide the per-control semantics).\n * stack keeps one field per row, row flows fields inline, grid spreads\n * them across columns (1-4, literal classes so they survive purging).\n */\nconst FormLayout = React.forwardRef<HTMLElement, FormLayoutProps>(\n (\n {\n layout = 'stack',\n columns = 2,\n gap,\n legend,\n legendClassName,\n description,\n descriptionClassName,\n as = 'div',\n className,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const Tag = as as 'div' | 'fieldset';\n const gapResolved = resolveGap(gap ?? 'md');\n return (\n <Tag\n ref={ref as never}\n className={cn(\n 'flex min-w-0',\n layout === 'stack' && 'flex-col',\n layout === 'row' && 'flex-row flex-wrap items-end',\n layout === 'grid' && `grid ${gridColumnClasses(columns)}`,\n gapResolved.className,\n className\n )}\n style={{ ...gapResolved.style, ...style }}\n {...props}\n >\n {legend && as === 'fieldset' && (\n <legend className={cn('col-span-full p-0 text-sm font-medium leading-none', legendClassName)}>{legend}</legend>\n )}\n {description && as === 'fieldset' && (\n <p className={cn('col-span-full text-xs text-muted-foreground', descriptionClassName)}>{description}</p>\n )}\n {children}\n </Tag>\n );\n }\n);\nFormLayout.displayName = 'FormLayout';\n\nexport { FormLayout };\n"],"mappings":"AAqFM,SAcI,KAdJ;AArFN,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,kBAAiC;AAI1C,MAAM,eAAuC;AAAA,EAC3C,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL;AAEA,MAAM,mBAAmB,CAAC,MAAM,MAAM,MAAM,IAAI;AAUhD,SAAS,kBAAkB,SAAoC;AAC7D,MAAI,OAAO,YAAY,SAAU,QAAO,aAAa,OAAO;AAC5D,SAAO;AAAA,IACL,QAAQ,SAAS,SAAY,aAAa,QAAQ,IAAI,IAAI;AAAA,IAC1D,GAAG,iBAAiB,IAAI,CAAC,OAAO;AAC9B,YAAM,QAAQ,QAAQ,EAAE;AACxB,aAAO,UAAU,SAAY,GAAG,EAAE,IAAI,aAAa,KAAK,CAAC,KAAK;AAAA,IAChE,CAAC;AAAA,EACH,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AACb;AA8BA,MAAM,aAAa,MAAM;AAAA,EACvB,CACE;AAAA,IACE,SAAS;AAAA,IACT,UAAU;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,MAAM;AACZ,UAAM,cAAc,WAAW,OAAO,IAAI;AAC1C,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,WAAW,WAAW;AAAA,UACtB,WAAW,SAAS;AAAA,UACpB,WAAW,UAAU,QAAQ,kBAAkB,OAAO,CAAC;AAAA,UACvD,YAAY;AAAA,UACZ;AAAA,QACF;AAAA,QACA,OAAO,EAAE,GAAG,YAAY,OAAO,GAAG,MAAM;AAAA,QACvC,GAAG;AAAA,QAEH;AAAA,oBAAU,OAAO,cAChB,oBAAC,YAAO,WAAW,GAAG,sDAAsD,eAAe,GAAI,kBAAO;AAAA,UAEvG,eAAe,OAAO,cACrB,oBAAC,OAAE,WAAW,GAAG,+CAA+C,oBAAoB,GAAI,uBAAY;AAAA,UAErG;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AACF;AACA,WAAW,cAAc;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slipstream-ui/core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/michaelmcshinsky/slipstream-ui.git",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"typescript": "^5.3.3",
|
|
59
59
|
"vitest": "^5.0.5",
|
|
60
60
|
"@slipstream-ui/eslint-config": "0.0.1",
|
|
61
|
-
"@slipstream-ui/tailwind-config": "0.0.1",
|
|
62
61
|
"@slipstream-ui/typescript-config": "0.0.1",
|
|
62
|
+
"@slipstream-ui/tailwind-config": "0.0.1",
|
|
63
63
|
"@slipstream-ui/vitest-config": "0.0.1"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|