@flood-md/agent 0.2.8 → 0.2.10
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/DESIGN.md +26 -4
- package/README.md +40 -1
- package/SKILL.md +46 -4
- package/dist/catalog.json +7136 -0
- package/dist/materials/component-accordion.md +42 -0
- package/dist/materials/component-alert-dialog.md +46 -0
- package/dist/materials/component-alert.md +41 -0
- package/dist/materials/component-aspect-ratio.md +36 -0
- package/dist/materials/component-avatar-group.md +39 -0
- package/dist/materials/component-avatar.md +40 -0
- package/dist/materials/component-badge.md +37 -0
- package/dist/materials/component-blockquote.md +35 -0
- package/dist/materials/component-breadcrumb.md +36 -0
- package/dist/materials/component-button-group.md +39 -0
- package/dist/materials/component-button.md +43 -0
- package/dist/materials/component-calendar.md +59 -0
- package/dist/materials/component-card.md +46 -0
- package/dist/materials/component-center.md +39 -0
- package/dist/materials/component-character-count.md +42 -0
- package/dist/materials/component-check-card.md +39 -0
- package/dist/materials/component-checkbox-group.md +48 -0
- package/dist/materials/component-checkbox.md +37 -0
- package/dist/materials/component-code-snippet.md +37 -0
- package/dist/materials/component-collapsible.md +40 -0
- package/dist/materials/component-color-picker.md +49 -0
- package/dist/materials/component-color-swatch.md +35 -0
- package/dist/materials/component-combobox.md +50 -0
- package/dist/materials/component-command-list.md +48 -0
- package/dist/materials/component-container.md +36 -0
- package/dist/materials/component-context-menu.md +43 -0
- package/dist/materials/component-copy-button.md +42 -0
- package/dist/materials/component-data-list-item.md +40 -0
- package/dist/materials/component-data-list.md +38 -0
- package/dist/materials/component-data-table.md +58 -0
- package/dist/materials/component-date-field.md +57 -0
- package/dist/materials/component-date-picker.md +66 -0
- package/dist/materials/component-date-range-field.md +62 -0
- package/dist/materials/component-date-range-picker.md +72 -0
- package/dist/materials/component-date-time-picker.md +60 -0
- package/dist/materials/component-date-time-range-picker.md +66 -0
- package/dist/materials/component-description-list.md +42 -0
- package/dist/materials/component-dialog.md +45 -0
- package/dist/materials/component-divider.md +37 -0
- package/dist/materials/component-drawer.md +50 -0
- package/dist/materials/component-dropzone.md +45 -0
- package/dist/materials/component-editable.md +57 -0
- package/dist/materials/component-empty-state.md +41 -0
- package/dist/materials/component-error-summary.md +40 -0
- package/dist/materials/component-field.md +46 -0
- package/dist/materials/component-fieldset.md +46 -0
- package/dist/materials/component-figure.md +36 -0
- package/dist/materials/component-file-input.md +45 -0
- package/dist/materials/component-file-item.md +48 -0
- package/dist/materials/component-file-list.md +39 -0
- package/dist/materials/component-file-meta.md +36 -0
- package/dist/materials/component-flood-root.md +33 -0
- package/dist/materials/component-grid.md +38 -0
- package/dist/materials/component-heading.md +38 -0
- package/dist/materials/component-hover-card.md +48 -0
- package/dist/materials/component-icon-button.md +41 -0
- package/dist/materials/component-icon-slot.md +37 -0
- package/dist/materials/component-image-preview.md +50 -0
- package/dist/materials/component-image.md +37 -0
- package/dist/materials/component-inline-code.md +36 -0
- package/dist/materials/component-inline.md +39 -0
- package/dist/materials/component-input-group.md +43 -0
- package/dist/materials/component-input.md +39 -0
- package/dist/materials/component-kbd.md +34 -0
- package/dist/materials/component-label.md +37 -0
- package/dist/materials/component-link.md +35 -0
- package/dist/materials/component-list-box.md +57 -0
- package/dist/materials/component-list.md +40 -0
- package/dist/materials/component-menu.md +54 -0
- package/dist/materials/component-meter.md +43 -0
- package/dist/materials/component-metric.md +39 -0
- package/dist/materials/component-multi-select.md +52 -0
- package/dist/materials/component-navigation-list.md +38 -0
- package/dist/materials/component-navigation-tree.md +43 -0
- package/dist/materials/component-number-input.md +47 -0
- package/dist/materials/component-pagination.md +44 -0
- package/dist/materials/component-password-input.md +43 -0
- package/dist/materials/component-pin-input.md +45 -0
- package/dist/materials/component-popover.md +47 -0
- package/dist/materials/component-progress.md +42 -0
- package/dist/materials/component-radio-card.md +43 -0
- package/dist/materials/component-radio-group.md +49 -0
- package/dist/materials/component-radio.md +39 -0
- package/dist/materials/component-range-calendar.md +58 -0
- package/dist/materials/component-rating.md +46 -0
- package/dist/materials/component-resizable-panels.md +48 -0
- package/dist/materials/component-scroll-area.md +42 -0
- package/dist/materials/component-search-input.md +40 -0
- package/dist/materials/component-section.md +42 -0
- package/dist/materials/component-segmented-control.md +51 -0
- package/dist/materials/component-select.md +45 -0
- package/dist/materials/component-skeleton.md +42 -0
- package/dist/materials/component-skip-link.md +37 -0
- package/dist/materials/component-slider.md +51 -0
- package/dist/materials/component-spinner.md +37 -0
- package/dist/materials/component-split.md +40 -0
- package/dist/materials/component-stack.md +37 -0
- package/dist/materials/component-status-indicator.md +38 -0
- package/dist/materials/component-steps.md +40 -0
- package/dist/materials/component-surface.md +37 -0
- package/dist/materials/component-switch.md +35 -0
- package/dist/materials/component-table.md +46 -0
- package/dist/materials/component-tabs.md +43 -0
- package/dist/materials/component-tag-input.md +46 -0
- package/dist/materials/component-tag.md +40 -0
- package/dist/materials/component-text.md +39 -0
- package/dist/materials/component-textarea.md +38 -0
- package/dist/materials/component-time-field.md +56 -0
- package/dist/materials/component-time-picker.md +60 -0
- package/dist/materials/component-timeline.md +38 -0
- package/dist/materials/component-toast-region.md +42 -0
- package/dist/materials/component-toggle-group.md +44 -0
- package/dist/materials/component-toggle.md +39 -0
- package/dist/materials/component-toolbar.md +42 -0
- package/dist/materials/component-tooltip.md +40 -0
- package/dist/materials/component-tree-select.md +56 -0
- package/dist/materials/component-tree.md +52 -0
- package/dist/materials/component-upload-item.md +52 -0
- package/dist/materials/component-upload-list.md +40 -0
- package/dist/materials/component-visually-hidden.md +37 -0
- package/dist/materials/guide-agent-knowledge.md +88 -0
- package/dist/materials/guide-agents.md +96 -0
- package/dist/materials/guide-faq.md +84 -0
- package/dist/materials/guide-foundations.md +232 -0
- package/dist/materials/guide-installation.md +79 -0
- package/dist/materials/guide-interface-content.md +76 -0
- package/dist/materials/guide-introduction.md +40 -0
- package/dist/materials/guide-layout.md +193 -0
- package/dist/materials/guide-privacy.md +23 -0
- package/dist/materials/guide-project-ui.md +127 -0
- package/dist/materials/guide-skills.md +108 -0
- package/dist/materials/guide-theming.md +73 -0
- package/dist/materials/recipe-command-palette.md +66 -0
- package/dist/materials/recipe-filter-bar.md +59 -0
- package/dist/materials/recipe-form-submission.md +39 -0
- package/dist/materials/recipe-grouped-form.md +66 -0
- package/dist/materials/recipe-select-all.md +31 -0
- package/dist/materials/recipe-split-button.md +26 -0
- package/dist/materials/recipe-table-bulk-actions.md +88 -0
- package/dist/materials/recipe-workspace-review.md +134 -0
- package/dist/materials/token-sys.color.accent.content.json +41 -0
- package/dist/materials/token-sys.color.action.danger.content.json +42 -0
- package/dist/materials/token-sys.color.action.ghost.content.json +41 -0
- package/dist/materials/token-sys.color.action.ghost.disabled-content.json +41 -0
- package/dist/materials/token-sys.color.action.ghost.disabled.json +41 -0
- package/dist/materials/token-sys.color.action.ghost.hover.json +41 -0
- package/dist/materials/token-sys.color.action.ghost.pressed.json +41 -0
- package/dist/materials/token-sys.color.action.ghost.rest.json +41 -0
- package/dist/materials/token-sys.color.action.on-surface.content.json +39 -0
- package/dist/materials/token-sys.color.action.on-surface.disabled-content.json +39 -0
- package/dist/materials/token-sys.color.action.on-surface.disabled.json +39 -0
- package/dist/materials/token-sys.color.action.on-surface.hover.json +39 -0
- package/dist/materials/token-sys.color.action.on-surface.pressed.json +39 -0
- package/dist/materials/token-sys.color.action.on-surface.rest.json +39 -0
- package/dist/materials/token-sys.color.action.primary.content.json +39 -0
- package/dist/materials/token-sys.color.action.primary.disabled-content.json +39 -0
- package/dist/materials/token-sys.color.action.primary.disabled.json +39 -0
- package/dist/materials/token-sys.color.action.primary.hover.json +39 -0
- package/dist/materials/token-sys.color.action.primary.pressed.json +39 -0
- package/dist/materials/token-sys.color.action.primary.rest.json +39 -0
- package/dist/materials/token-sys.color.action.subtle.content.json +39 -0
- package/dist/materials/token-sys.color.action.subtle.disabled-content.json +39 -0
- package/dist/materials/token-sys.color.action.subtle.disabled.json +39 -0
- package/dist/materials/token-sys.color.action.subtle.hover.json +39 -0
- package/dist/materials/token-sys.color.action.subtle.pressed.json +39 -0
- package/dist/materials/token-sys.color.action.subtle.rest.json +39 -0
- package/dist/materials/token-sys.color.border.decorative.json +42 -0
- package/dist/materials/token-sys.color.border.default.json +39 -0
- package/dist/materials/token-sys.color.border.floating.json +39 -0
- package/dist/materials/token-sys.color.border.strong.json +39 -0
- package/dist/materials/token-sys.color.content.default.json +41 -0
- package/dist/materials/token-sys.color.content.helper.json +39 -0
- package/dist/materials/token-sys.color.content.subtle.json +43 -0
- package/dist/materials/token-sys.color.divider.decorative.json +41 -0
- package/dist/materials/token-sys.color.feedback.error.json +39 -0
- package/dist/materials/token-sys.color.feedback.info.json +39 -0
- package/dist/materials/token-sys.color.feedback.success.json +39 -0
- package/dist/materials/token-sys.color.feedback.warning.json +39 -0
- package/dist/materials/token-sys.color.field.background.json +39 -0
- package/dist/materials/token-sys.color.field.border.json +39 -0
- package/dist/materials/token-sys.color.field.boundary.json +39 -0
- package/dist/materials/token-sys.color.field.content.json +39 -0
- package/dist/materials/token-sys.color.field.disabled-content.json +39 -0
- package/dist/materials/token-sys.color.field.disabled.json +39 -0
- package/dist/materials/token-sys.color.field.placeholder.json +39 -0
- package/dist/materials/token-sys.color.focus.ring.json +39 -0
- package/dist/materials/token-sys.color.indicator.accent.json +39 -0
- package/dist/materials/token-sys.color.indicator.fill.json +39 -0
- package/dist/materials/token-sys.color.indicator.track.json +39 -0
- package/dist/materials/token-sys.color.loading.placeholder.json +42 -0
- package/dist/materials/token-sys.color.scrollbar.thumb-hover.json +39 -0
- package/dist/materials/token-sys.color.scrollbar.thumb.json +39 -0
- package/dist/materials/token-sys.color.selection.background.json +39 -0
- package/dist/materials/token-sys.color.selection.content.json +39 -0
- package/dist/materials/token-sys.color.selection.floating.json +39 -0
- package/dist/materials/token-sys.color.shadow.floating.json +39 -0
- package/dist/materials/token-sys.color.surface.canvas.json +39 -0
- package/dist/materials/token-sys.color.surface.default.json +39 -0
- package/dist/materials/token-sys.color.surface.floating-translucent.json +39 -0
- package/dist/materials/token-sys.color.surface.floating.json +39 -0
- package/dist/materials/token-sys.color.surface.overlay.json +39 -0
- package/dist/materials/token-sys.color.surface.raised.json +39 -0
- package/dist/materials/token-sys.control.2xl.gap.json +34 -0
- package/dist/materials/token-sys.control.2xl.height.json +34 -0
- package/dist/materials/token-sys.control.2xl.icon-size.json +34 -0
- package/dist/materials/token-sys.control.2xl.line-height.json +31 -0
- package/dist/materials/token-sys.control.2xl.padding-inline.json +34 -0
- package/dist/materials/token-sys.control.2xl.text-size.json +34 -0
- package/dist/materials/token-sys.control.2xs.gap.json +34 -0
- package/dist/materials/token-sys.control.2xs.height.json +34 -0
- package/dist/materials/token-sys.control.2xs.icon-size.json +34 -0
- package/dist/materials/token-sys.control.2xs.line-height.json +31 -0
- package/dist/materials/token-sys.control.2xs.padding-inline.json +34 -0
- package/dist/materials/token-sys.control.2xs.text-size.json +34 -0
- package/dist/materials/token-sys.control.lg.gap.json +34 -0
- package/dist/materials/token-sys.control.lg.height.json +34 -0
- package/dist/materials/token-sys.control.lg.icon-size.json +34 -0
- package/dist/materials/token-sys.control.lg.line-height.json +31 -0
- package/dist/materials/token-sys.control.lg.padding-inline.json +34 -0
- package/dist/materials/token-sys.control.lg.text-size.json +34 -0
- package/dist/materials/token-sys.control.md.gap.json +34 -0
- package/dist/materials/token-sys.control.md.height.json +34 -0
- package/dist/materials/token-sys.control.md.icon-size.json +34 -0
- package/dist/materials/token-sys.control.md.line-height.json +31 -0
- package/dist/materials/token-sys.control.md.padding-inline.json +34 -0
- package/dist/materials/token-sys.control.md.text-size.json +34 -0
- package/dist/materials/token-sys.control.sm.gap.json +34 -0
- package/dist/materials/token-sys.control.sm.height.json +34 -0
- package/dist/materials/token-sys.control.sm.icon-size.json +34 -0
- package/dist/materials/token-sys.control.sm.line-height.json +31 -0
- package/dist/materials/token-sys.control.sm.padding-inline.json +34 -0
- package/dist/materials/token-sys.control.sm.text-size.json +34 -0
- package/dist/materials/token-sys.control.xl.gap.json +34 -0
- package/dist/materials/token-sys.control.xl.height.json +34 -0
- package/dist/materials/token-sys.control.xl.icon-size.json +34 -0
- package/dist/materials/token-sys.control.xl.line-height.json +31 -0
- package/dist/materials/token-sys.control.xl.padding-inline.json +34 -0
- package/dist/materials/token-sys.control.xl.text-size.json +34 -0
- package/dist/materials/token-sys.control.xs.gap.json +34 -0
- package/dist/materials/token-sys.control.xs.height.json +34 -0
- package/dist/materials/token-sys.control.xs.icon-size.json +34 -0
- package/dist/materials/token-sys.control.xs.line-height.json +31 -0
- package/dist/materials/token-sys.control.xs.padding-inline.json +34 -0
- package/dist/materials/token-sys.control.xs.text-size.json +34 -0
- package/dist/materials/token-sys.effect.floating.blur.json +34 -0
- package/dist/materials/token-sys.effect.floating.saturation.json +31 -0
- package/dist/materials/token-sys.effect.floating.shadow-blur.json +34 -0
- package/dist/materials/token-sys.effect.floating.shadow-offset.json +34 -0
- package/dist/materials/token-sys.focus.offset.json +34 -0
- package/dist/materials/token-sys.focus.width.json +34 -0
- package/dist/materials/token-sys.font.mono.json +36 -0
- package/dist/materials/token-sys.font.sans.json +35 -0
- package/dist/materials/token-sys.layer.base.json +31 -0
- package/dist/materials/token-sys.layer.modal.json +31 -0
- package/dist/materials/token-sys.layer.popover.json +31 -0
- package/dist/materials/token-sys.layer.sticky.json +31 -0
- package/dist/materials/token-sys.layer.toast.json +31 -0
- package/dist/materials/token-sys.motion.duration-fast.json +34 -0
- package/dist/materials/token-sys.motion.duration-normal.json +34 -0
- package/dist/materials/token-sys.motion.duration-reduced.json +34 -0
- package/dist/materials/token-sys.motion.easing.json +36 -0
- package/dist/materials/token-sys.radius.action.json +34 -0
- package/dist/materials/token-sys.radius.block.json +34 -0
- package/dist/materials/token-sys.radius.field.json +34 -0
- package/dist/materials/token-sys.radius.indicator.json +34 -0
- package/dist/materials/token-sys.radius.surface.json +34 -0
- package/dist/materials/token-sys.scrollbar.inset.json +34 -0
- package/dist/materials/token-sys.scrollbar.min-thumb.json +34 -0
- package/dist/materials/token-sys.scrollbar.size.json +34 -0
- package/dist/materials/token-sys.size.choice.json +34 -0
- package/dist/materials/token-sys.size.container.lg.json +37 -0
- package/dist/materials/token-sys.size.container.md.json +37 -0
- package/dist/materials/token-sys.size.container.sm.json +37 -0
- package/dist/materials/token-sys.size.grid.min-item.json +37 -0
- package/dist/materials/token-sys.size.indicator.lg.json +34 -0
- package/dist/materials/token-sys.size.indicator.md.json +34 -0
- package/dist/materials/token-sys.size.indicator.sm.json +34 -0
- package/dist/materials/token-sys.size.keycap.lg.json +34 -0
- package/dist/materials/token-sys.size.keycap.md.json +34 -0
- package/dist/materials/token-sys.size.keycap.sm.json +34 -0
- package/dist/materials/token-sys.size.switch-height.json +34 -0
- package/dist/materials/token-sys.size.switch-thumb.json +34 -0
- package/dist/materials/token-sys.size.switch-width.json +34 -0
- package/dist/materials/token-sys.size.touch.json +34 -0
- package/dist/materials/token-sys.space.0.json +34 -0
- package/dist/materials/token-sys.space.1.json +34 -0
- package/dist/materials/token-sys.space.12.json +34 -0
- package/dist/materials/token-sys.space.2.json +34 -0
- package/dist/materials/token-sys.space.3.json +34 -0
- package/dist/materials/token-sys.space.4.json +34 -0
- package/dist/materials/token-sys.space.6.json +34 -0
- package/dist/materials/token-sys.space.8.json +34 -0
- package/dist/materials/token-sys.stroke.width.json +34 -0
- package/dist/materials/token-sys.type.body.line-height.json +31 -0
- package/dist/materials/token-sys.type.body.size.json +34 -0
- package/dist/materials/token-sys.type.body.tracking.json +34 -0
- package/dist/materials/token-sys.type.body.weight.json +31 -0
- package/dist/materials/token-sys.type.compact.line-height.json +31 -0
- package/dist/materials/token-sys.type.compact.size.json +34 -0
- package/dist/materials/token-sys.type.compact.tracking.json +34 -0
- package/dist/materials/token-sys.type.compact.weight.json +31 -0
- package/dist/materials/token-sys.type.control.line-height.json +31 -0
- package/dist/materials/token-sys.type.control.size.json +34 -0
- package/dist/materials/token-sys.type.control.tracking.json +34 -0
- package/dist/materials/token-sys.type.control.weight.json +31 -0
- package/dist/materials/token-sys.type.dialog-title.line-height.json +33 -0
- package/dist/materials/token-sys.type.dialog-title.size.json +36 -0
- package/dist/materials/token-sys.type.dialog-title.tracking.json +36 -0
- package/dist/materials/token-sys.type.dialog-title.weight.json +33 -0
- package/dist/materials/token-sys.type.display.line-height.json +31 -0
- package/dist/materials/token-sys.type.display.size.json +34 -0
- package/dist/materials/token-sys.type.display.tracking.json +34 -0
- package/dist/materials/token-sys.type.display.weight.json +31 -0
- package/dist/materials/token-sys.type.field-label.line-height.json +33 -0
- package/dist/materials/token-sys.type.field-label.size.json +36 -0
- package/dist/materials/token-sys.type.field-label.tracking.json +36 -0
- package/dist/materials/token-sys.type.field-label.weight.json +33 -0
- package/dist/materials/token-sys.type.group-title.line-height.json +33 -0
- package/dist/materials/token-sys.type.group-title.size.json +36 -0
- package/dist/materials/token-sys.type.group-title.tracking.json +36 -0
- package/dist/materials/token-sys.type.group-title.weight.json +33 -0
- package/dist/materials/token-sys.type.helper.line-height.json +31 -0
- package/dist/materials/token-sys.type.helper.size.json +34 -0
- package/dist/materials/token-sys.type.helper.tracking.json +34 -0
- package/dist/materials/token-sys.type.helper.weight.json +31 -0
- package/dist/materials/token-sys.type.label.line-height.json +31 -0
- package/dist/materials/token-sys.type.label.size.json +34 -0
- package/dist/materials/token-sys.type.label.tracking.json +34 -0
- package/dist/materials/token-sys.type.label.weight.json +31 -0
- package/dist/materials/token-sys.type.large.line-height.json +31 -0
- package/dist/materials/token-sys.type.large.size.json +34 -0
- package/dist/materials/token-sys.type.large.tracking.json +34 -0
- package/dist/materials/token-sys.type.large.weight.json +31 -0
- package/dist/materials/token-sys.type.lead.line-height.json +31 -0
- package/dist/materials/token-sys.type.lead.size.json +34 -0
- package/dist/materials/token-sys.type.lead.tracking.json +34 -0
- package/dist/materials/token-sys.type.lead.weight.json +31 -0
- package/dist/materials/token-sys.type.page.line-height.json +31 -0
- package/dist/materials/token-sys.type.page.size.json +34 -0
- package/dist/materials/token-sys.type.page.tracking.json +34 -0
- package/dist/materials/token-sys.type.page.weight.json +31 -0
- package/dist/materials/token-sys.type.section.line-height.json +31 -0
- package/dist/materials/token-sys.type.section.size.json +34 -0
- package/dist/materials/token-sys.type.section.tracking.json +34 -0
- package/dist/materials/token-sys.type.section.weight.json +31 -0
- package/knowledge.json +409 -0
- package/lib/index.d.ts +33 -0
- package/lib/index.mjs +144 -0
- package/lib/inspect.d.ts +12 -0
- package/lib/inspect.mjs +187 -0
- package/manifest.json +91 -1
- package/package.json +9 -1
- package/references/flood-accessibility/SKILL.md +40 -0
- package/references/flood-composition/SKILL.md +30 -0
- package/references/flood-data-display/SKILL.md +69 -0
- package/references/flood-feedback/SKILL.md +58 -0
- package/references/flood-forms/SKILL.md +94 -0
- package/references/flood-foundations/SKILL.md +44 -0
- package/references/flood-hierarchy/SKILL.md +87 -0
- package/references/flood-interface-content/SKILL.md +142 -0
- package/references/flood-navigation/SKILL.md +35 -0
- package/references/flood-overlays/SKILL.md +52 -0
- package/references/flood-records/SKILL.md +108 -0
- package/references/flood-spacing/SKILL.md +62 -0
- package/references/flood-verification/SKILL.md +99 -0
- package/references/interface-content-examples.md +47 -0
- package/references/knowledge.md +49 -0
- package/references/record-decisions.md +25 -0
- package/references/rendered-review.md +97 -0
- package/references/routing.md +1 -0
- package/rules.json +454 -2
- package/workflows.json +152 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# CheckboxGroup
|
|
2
|
+
|
|
3
|
+
A named multiple-choice group with a shared array value and native form behavior.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, CheckboxGroup } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<CheckboxGroup name="notifications" legend="Notifications" options={[{ value: "updates", label: "Product updates" }, { value: "releases", label: "Release notes" }]} defaultValue={["updates"]} />
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Composes Fieldset and existing native choice controls. The ref targets HTMLFieldSetElement; options need unique values and visible labels.
|
|
27
|
+
- value/onValueChange is controlled; defaultValue initializes an uncontrolled group. Native form reset restores uncontrolled defaults without firing onValueChange; controlled values remain owned by the host.
|
|
28
|
+
- name belongs to the inputs. The form prop associates every input with an external form. Disabled options and groups follow native submission rules.
|
|
29
|
+
- CheckboxGroup has no required/min/max shortcut: a required checkbox means that specific checkbox. Validate the selected array in the host and use group status/message.
|
|
30
|
+
|
|
31
|
+
## API reference
|
|
32
|
+
|
|
33
|
+
| Prop | Values | Default |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `legend` | `ReactNode` | `Required` |
|
|
36
|
+
| `legendSize · 0.2.10` | `"label" \| "section"` | `—` |
|
|
37
|
+
| `hideLabel · 0.2.3` | `boolean` | `—` |
|
|
38
|
+
| `hint` | `ReactNode` | `—` |
|
|
39
|
+
| `error` | `ReactNode` | `—` |
|
|
40
|
+
| `message` | `ReactNode` | `—` |
|
|
41
|
+
| `status` | `"error" \| "warning" \| "success" \| "info"` | `—` |
|
|
42
|
+
| `name` | `string` | `Required` |
|
|
43
|
+
| `options` | `readonly ChoiceOption[]` | `Required` |
|
|
44
|
+
| `value` | `readonly string[]` | `—` |
|
|
45
|
+
| `defaultValue` | `readonly string[]` | `[]` |
|
|
46
|
+
| `onValueChange` | `(value: string[]) => void` | `—` |
|
|
47
|
+
| `orientation` | `"vertical" \| "horizontal"` | `"vertical"` |
|
|
48
|
+
| `Native HTML props` | `Omit<FieldsetHTMLAttributes<HTMLFieldSetElement>, "children" \| "defaultValue" \| "role">` | `Forwarded` |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
A labeled native checkbox for independent choices.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, Checkbox } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<Checkbox label="Send project updates" name="updates" defaultChecked />
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Use checked/onChange for controlled state or defaultChecked for native state.
|
|
27
|
+
- Labels stay visible. Disabled does not mean read-only; explain unavailable choices outside the disabled control when needed.
|
|
28
|
+
- The control and visible label form one content-width unit with an 8px-at-16px-root internal gap. Use an explicit parent gap="4" (16px at that root) between units; the glyph keeps its token-defined size.
|
|
29
|
+
- indeterminate sets the native mixed state after hydration; checked still controls form submission. The host owns select-all aggregation and updates. Radio and Switch do not expose this prop.
|
|
30
|
+
|
|
31
|
+
## API reference
|
|
32
|
+
|
|
33
|
+
| Prop | Values | Default |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `label` | `ReactNode` | `Required` |
|
|
36
|
+
| `indeterminate` | `boolean` | `false` |
|
|
37
|
+
| `Native HTML props` | `Omit<InputHTMLAttributes<HTMLInputElement>, "type" \| "size">` | `Forwarded` |
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# CodeSnippet
|
|
2
|
+
|
|
3
|
+
Selectable, wrapping code with an optional host-owned action.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, CodeSnippet } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<CodeSnippet code="git status --short" />
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- CodeSnippet escapes code content and uses the semantic system monospace font stack.
|
|
27
|
+
- The host implements copy behavior, failure handling and feedback. No clipboard or network API runs inside the component.
|
|
28
|
+
- Code text defaults to LTR independently of parent layout. codeDirection can be ltr/rtl/auto; native dir still controls the wrapper and action layout.
|
|
29
|
+
|
|
30
|
+
## API reference
|
|
31
|
+
|
|
32
|
+
| Prop | Values | Default |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `code` | `string` | `Required` |
|
|
35
|
+
| `codeDirection` | `"ltr" \| "rtl" \| "auto"` | `"ltr"` |
|
|
36
|
+
| `action` | `ReactNode` | `—` |
|
|
37
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children">` | `Forwarded` |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Collapsible
|
|
2
|
+
|
|
3
|
+
A named disclosure button and retained show/hide panel.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, Collapsible } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<Collapsible title="Advanced settings">Additional project settings.</Collapsible>
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Use open/onOpenChange or defaultOpen. The panel stays mounted and hidden when closed; hidden form controls keep native form semantics.
|
|
27
|
+
- Title is plain text for a stable button name. Content may be interactive. Disabled prevents trigger activation, not interaction inside an open panel.
|
|
28
|
+
|
|
29
|
+
## API reference
|
|
30
|
+
|
|
31
|
+
| Prop | Values | Default |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `title` | `string` | `Required` |
|
|
34
|
+
| `open` | `boolean` | `—` |
|
|
35
|
+
| `defaultOpen` | `boolean` | `false` |
|
|
36
|
+
| `onOpenChange` | `(open: boolean) => void` | `—` |
|
|
37
|
+
| `disabled` | `boolean` | `false` |
|
|
38
|
+
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` |
|
|
39
|
+
| `headingLevel` | `2 \| 3 \| 4 \| 5 \| 6` | `—` |
|
|
40
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "title" \| "onChange">` | `Forwarded` |
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# ColorPicker
|
|
2
|
+
|
|
3
|
+
An RGB color editor with hex input, channel sliders and reusable presets.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, ColorPicker } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<ColorPicker label="Accent color" defaultValue="#ff47a8" name="accent" presets={["#ff47a8", "#ffffff", "#78b8ff"]} />
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Uses #rrggbb values without alpha or gradients.
|
|
27
|
+
- The hex field owns native form validation; RGB controls provide an additional editing path.
|
|
28
|
+
|
|
29
|
+
## API reference
|
|
30
|
+
|
|
31
|
+
| Prop | Values | Default |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `label` | `string` | `Required` |
|
|
34
|
+
| `hideLabel` | `boolean` | `—` |
|
|
35
|
+
| `value` | `string` | `—` |
|
|
36
|
+
| `defaultValue` | `string` | `—` |
|
|
37
|
+
| `onValueChange` | `(value: string) => void` | `—` |
|
|
38
|
+
| `name` | `string` | `—` |
|
|
39
|
+
| `form` | `string` | `—` |
|
|
40
|
+
| `required` | `boolean` | `—` |
|
|
41
|
+
| `disabled` | `boolean` | `—` |
|
|
42
|
+
| `readOnly` | `boolean` | `—` |
|
|
43
|
+
| `controlSize` | `"sm" \| "md" \| "lg"` | `—` |
|
|
44
|
+
| `presets` | `readonly string[]` | `—` |
|
|
45
|
+
| `invalidMessage` | `string` | `—` |
|
|
46
|
+
| `hexLabel` | `string` | `—` |
|
|
47
|
+
| `channelLabels` | `readonly [string, string, string]` | `—` |
|
|
48
|
+
| `presetsLabel` | `string` | `—` |
|
|
49
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" \| "onChange" \| "children">` | `Forwarded` |
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ColorSwatch
|
|
2
|
+
|
|
3
|
+
A named sample of an opaque RGB color.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, ColorSwatch } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<ColorSwatch label="Flood pink" value="#ff47a8" />
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Opaque RGB colors only; keep a text label wherever color conveys meaning.
|
|
27
|
+
|
|
28
|
+
## API reference
|
|
29
|
+
|
|
30
|
+
| Prop | Values | Default |
|
|
31
|
+
| --- | --- | --- |
|
|
32
|
+
| `value` | `string` | `Required` |
|
|
33
|
+
| `label` | `string` | `Required` |
|
|
34
|
+
| `size` | `"sm" \| "md" \| "lg"` | `—` |
|
|
35
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLSpanElement>, "children" \| "color">` | `Forwarded` |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Combobox
|
|
2
|
+
|
|
3
|
+
Search a defined collection and commit one option while focus stays in the input.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, Field, Combobox } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<Field label="Framework">
|
|
19
|
+
{(control) => <Combobox {...control} name="framework" options={[{value: "react", label: "React"}, {value: "vue", label: "Vue"}, {value: "svelte", label: "Svelte"}]} placeholder="Choose a framework" />}
|
|
20
|
+
</Field>
|
|
21
|
+
</FloodRoot>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Design notes
|
|
27
|
+
|
|
28
|
+
- Typing filters labels and optional keywords; labels remain presentation and only the selected option value is submitted. Enter commits the active option. Escape/Tab/outside interaction discard an uncommitted query. Emptying the input clears selection.
|
|
29
|
+
- Native input ref, Field associations, required validity, controlled/uncontrolled value, forms/reset, read-only/disabled and IME editing are preserved. Options need unique nonempty values and labels. Disabled options remain discoverable and cannot be chosen.
|
|
30
|
+
- Use clearable for the visible clear action; translate clearLabel/toggleLabel/listLabel/emptyMessage/invalidSelectionMessage. The popup reuses Flood ScrollArea and layer positioning. No arbitrary text, multiple selection, async fetching or virtualization engine is supplied. Available in 0.2.5.
|
|
31
|
+
- Only the disclosure chevron is shown by default. Set clearable to opt into the extra clear-selection action; individual MultiSelect tags retain their removal buttons.
|
|
32
|
+
|
|
33
|
+
## API reference
|
|
34
|
+
|
|
35
|
+
| Prop | Values | Default |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| `status` | `"error" \| "warning" \| "success" \| "info"` | `—` |
|
|
38
|
+
| `invalid` | `boolean` | `—` |
|
|
39
|
+
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` |
|
|
40
|
+
| `options` | `readonly ComboboxOption[]` | `Required` |
|
|
41
|
+
| `value` | `string` | `—` |
|
|
42
|
+
| `defaultValue` | `string` | `""` |
|
|
43
|
+
| `onValueChange` | `(value: string) => void` | `—` |
|
|
44
|
+
| `clearable` | `boolean` | `false` |
|
|
45
|
+
| `emptyMessage` | `string` | `"No results found."` |
|
|
46
|
+
| `listLabel` | `string` | `"Options"` |
|
|
47
|
+
| `toggleLabel` | `string` | `"Show options"` |
|
|
48
|
+
| `clearLabel` | `string` | `"Clear selection"` |
|
|
49
|
+
| `invalidSelectionMessage` | `string` | `"Select an option."` |
|
|
50
|
+
| `Native HTML props` | `Omit<InputHTMLAttributes<HTMLInputElement>, "type" \| "value" \| "defaultValue" \| "onChange" \| "children">` | `Forwarded` |
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# CommandList
|
|
2
|
+
|
|
3
|
+
Search and invoke commands with grouped results and keyboard navigation.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, CommandList } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<CommandList label="Search commands" items={[{id:"new",label:"New project",group:"Projects"},{id:"settings",label:"Open settings",group:"Workspace"}]} onAction={id => console.log(id)} />
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- CommandList invokes actions; Combobox and MultiSelect edit form values. A command list has no submitted name or persistent selected value.
|
|
27
|
+
- Typing filters labels, descriptions, group names and keywords. Arrow keys, Home/End and Enter navigate and invoke enabled commands. Escape remains available to a host Dialog.
|
|
28
|
+
- Use query/onQueryChange for host ownership or defaultQuery for local filtering. Loading blocks stale invocation and exposes an announcement; the host owns asynchronous work and cancellation.
|
|
29
|
+
- The ref targets the native search input. Native div props target the wrapper. Translate labels, placeholder, emptyMessage and loadingMessage; hideLabel preserves the search name. No modal, global shortcut or router integration is implied. Introduced in 0.2.7.
|
|
30
|
+
|
|
31
|
+
## API reference
|
|
32
|
+
|
|
33
|
+
| Prop | Values | Default |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `label` | `string` | `Required` |
|
|
36
|
+
| `hideLabel` | `boolean` | `false` |
|
|
37
|
+
| `items` | `readonly CommandListItem[]` | `Required` |
|
|
38
|
+
| `query` | `string` | `—` |
|
|
39
|
+
| `defaultQuery` | `string` | `—` |
|
|
40
|
+
| `onQueryChange` | `(query: string) => void` | `—` |
|
|
41
|
+
| `onAction` | `(id: string) => void` | `—` |
|
|
42
|
+
| `disabled` | `boolean` | `false` |
|
|
43
|
+
| `loading` | `boolean` | `false` |
|
|
44
|
+
| `placeholder` | `string` | `—` |
|
|
45
|
+
| `emptyMessage` | `string` | `—` |
|
|
46
|
+
| `loadingMessage` | `string` | `—` |
|
|
47
|
+
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` |
|
|
48
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "defaultValue" \| "onChange">` | `Forwarded` |
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Container
|
|
2
|
+
|
|
3
|
+
Centered content with token widths and logical gutters.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, Container, Text } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<Container size="md" gutter="6"><Text as="p">Content stays within a readable width.</Text></Container>
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Max width includes gutters (border-box). Sizes sm/md/lg use relative semantic roles; full removes the maximum.
|
|
27
|
+
- Native div props/ref target the container. Gutter uses Space; it does not add vertical spacing or breakpoints.
|
|
28
|
+
- Available in 0.2.4; use matching installed declarations.
|
|
29
|
+
|
|
30
|
+
## API reference
|
|
31
|
+
|
|
32
|
+
| Prop | Values | Default |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `size` | `"sm" \| "md" \| "lg" \| "full"` | `"lg"` |
|
|
35
|
+
| `gutter` | `"0" \| "1" \| "2" \| "3" \| "4" \| "6" \| "8" \| "12"` | `"6"` |
|
|
36
|
+
| `Native HTML props` | `HTMLAttributes<HTMLDivElement>` | `Forwarded` |
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# ContextMenu
|
|
2
|
+
|
|
3
|
+
Context actions at the pointer or keyboard target, sharing the Menu interaction engine.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, ContextMenu, Surface } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<ContextMenu label="Project actions" items={[{id:"rename",label:"Rename"},{id:"duplicate",label:"Duplicate"}]} onAction={id => console.log(id)}><Surface padding="6">Right-click or use Shift+F10.</Surface></ContextMenu>
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Right click opens at the pointer; ContextMenu or Shift+F10 opens near the actual focused target. The wrapper is keyboard-focusable and named.
|
|
27
|
+
- Uses the same Menu items, preferences, nested layers, typeahead and keyboard navigation. Leaf commands close the tree; Escape unwinds one level and restores the real source focus.
|
|
28
|
+
- disabled preserves the native browser context menu. Controlled open and onAction remain host-owned. Provide a visible Menu action as a primary alternative on touch devices. Introduced in 0.2.7.
|
|
29
|
+
|
|
30
|
+
## API reference
|
|
31
|
+
|
|
32
|
+
| Prop | Values | Default |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `label` | `string` | `Required` |
|
|
35
|
+
| `items` | `readonly MenuItem[]` | `Required` |
|
|
36
|
+
| `onAction` | `(id: string) => void` | `—` |
|
|
37
|
+
| `children` | `ReactNode` | `Required` |
|
|
38
|
+
| `open` | `boolean` | `—` |
|
|
39
|
+
| `defaultOpen` | `boolean` | `false` |
|
|
40
|
+
| `onOpenChange` | `(open: boolean) => void` | `—` |
|
|
41
|
+
| `disabled` | `boolean` | `false` |
|
|
42
|
+
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"sm"` |
|
|
43
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children" \| "role">` | `Forwarded` |
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# CopyButton
|
|
2
|
+
|
|
3
|
+
A clipboard action with stable geometry and localized result feedback.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, CopyButton } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<CopyButton value="npm install @flood-md/react" />
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Copies only on a user click. Requires a secure context and Clipboard API; onCopyError receives unavailable/denied errors. The host owns any manual-copy fallback. Native button ref and disabled semantics are preserved.
|
|
27
|
+
- Localize copyLabel/copiedLabel/errorLabel. resetDelay restores the idle state after success. Labels reserve their common width and a live status announces the result. No remote data transfer is built in. Available in 0.2.5.
|
|
28
|
+
|
|
29
|
+
## API reference
|
|
30
|
+
|
|
31
|
+
| Prop | Values | Default |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `variant` | `"solid" \| "subtle" \| "outline" \| "ghost"` | `"subtle"` |
|
|
34
|
+
| `size` | `"2xs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "2xl"` | `"md"` |
|
|
35
|
+
| `value` | `string` | `Required` |
|
|
36
|
+
| `copyLabel` | `string` | `"Copy"` |
|
|
37
|
+
| `copiedLabel` | `string` | `"Copied"` |
|
|
38
|
+
| `errorLabel` | `string` | `"Failed"` |
|
|
39
|
+
| `resetDelay` | `number` | `2000` |
|
|
40
|
+
| `onCopied` | `() => void` | `—` |
|
|
41
|
+
| `onCopyError` | `(error: unknown) => void` | `—` |
|
|
42
|
+
| `Native HTML props` | `Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" \| "value" \| "type" \| "onClick" \| "loading">` | `Forwarded` |
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# DataListItem
|
|
2
|
+
|
|
3
|
+
A structured list row with media, supporting text, metadata and actions.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, DataList, DataListItem } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<DataList>
|
|
19
|
+
<DataListItem title="Design system" description="Foundations and components" metadata="Updated today" />
|
|
20
|
+
</DataList>
|
|
21
|
+
</FloodRoot>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Design notes
|
|
27
|
+
|
|
28
|
+
- Render inside DataList or another native list.
|
|
29
|
+
- The row is not clickable; supply a Link as title when navigation is needed.
|
|
30
|
+
|
|
31
|
+
## API reference
|
|
32
|
+
|
|
33
|
+
| Prop | Values | Default |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| `title` | `ReactNode` | `Required` |
|
|
36
|
+
| `description` | `ReactNode` | `—` |
|
|
37
|
+
| `media` | `ReactNode` | `—` |
|
|
38
|
+
| `metadata` | `ReactNode` | `—` |
|
|
39
|
+
| `actions` | `ReactNode` | `—` |
|
|
40
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLLIElement>, "title" \| "children">` | `Forwarded` |
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# DataList
|
|
2
|
+
|
|
3
|
+
A native list of structured rows with independent links and actions.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, DataList, DataListItem } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<DataList>
|
|
19
|
+
<DataListItem title="Design system" description="Foundations and components" metadata="Updated today" />
|
|
20
|
+
<DataListItem title="Website" description="Documentation and examples" metadata="Updated yesterday" />
|
|
21
|
+
</DataList>
|
|
22
|
+
</FloodRoot>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Design notes
|
|
28
|
+
|
|
29
|
+
- This is a ul/li list, not a listbox or data grid.
|
|
30
|
+
- Keep navigation in the title link and actions in their own buttons.
|
|
31
|
+
|
|
32
|
+
## API reference
|
|
33
|
+
|
|
34
|
+
| Prop | Values | Default |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| `density` | `"compact" \| "comfortable"` | `"comfortable"` |
|
|
37
|
+
| `dividers` | `boolean` | `true` |
|
|
38
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLUListElement>, "role">` | `Forwarded` |
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# DataTable
|
|
2
|
+
|
|
3
|
+
A native data table with local sorting, page-scoped selection and pagination.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, DataTable } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<DataTable caption="Projects" selectable pageSize={5}
|
|
19
|
+
columns={[{id:"name",label:"Project",sortable:true},{id:"status",label:"Status"}]}
|
|
20
|
+
rows={[{id:"design",label:"Design system",cells:{name:"Design system",status:"Active"}}]} />
|
|
21
|
+
</FloodRoot>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Design notes
|
|
27
|
+
|
|
28
|
+
- Supply the complete client collection; remote/server pagination and virtualization are not part of this API.
|
|
29
|
+
- Select all affects selectable rows on the current page and preserves selection on other pages.
|
|
30
|
+
- Use sortValues for rich React cells; missing values sort last in both directions.
|
|
31
|
+
|
|
32
|
+
## API reference
|
|
33
|
+
|
|
34
|
+
| Prop | Values | Default |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| `caption` | `string` | `Required` |
|
|
37
|
+
| `hideCaption` | `boolean` | `—` |
|
|
38
|
+
| `columns` | `readonly DataTableColumn[]` | `Required` |
|
|
39
|
+
| `rows` | `readonly DataTableRow[]` | `Required` |
|
|
40
|
+
| `density` | `"compact" \| "comfortable"` | `—` |
|
|
41
|
+
| `striped` | `boolean` | `—` |
|
|
42
|
+
| `minWidth` | `CSSProperties["minWidth"]` | `—` |
|
|
43
|
+
| `sort` | `DataTableSort \| null` | `—` |
|
|
44
|
+
| `defaultSort` | `DataTableSort \| null` | `—` |
|
|
45
|
+
| `onSortChange` | `(sort: DataTableSort \| null) => void` | `—` |
|
|
46
|
+
| `locale` | `string` | `—` |
|
|
47
|
+
| `selectable` | `boolean` | `—` |
|
|
48
|
+
| `selectedIds` | `readonly string[]` | `—` |
|
|
49
|
+
| `defaultSelectedIds` | `readonly string[]` | `—` |
|
|
50
|
+
| `onSelectionChange` | `(ids: string[]) => void` | `—` |
|
|
51
|
+
| `page` | `number` | `—` |
|
|
52
|
+
| `defaultPage` | `number` | `—` |
|
|
53
|
+
| `pageSize` | `number` | `—` |
|
|
54
|
+
| `onPageChange` | `(page: number) => void` | `—` |
|
|
55
|
+
| `state` | `"ready" \| "loading" \| "error"` | `—` |
|
|
56
|
+
| `onRetry` | `() => void` | `—` |
|
|
57
|
+
| `labels` | `DataTableLabels` | `—` |
|
|
58
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "children">` | `Forwarded` |
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# DateField
|
|
2
|
+
|
|
3
|
+
Segmented Gregorian date entry with canonical form values and explicit date validation.
|
|
4
|
+
|
|
5
|
+
Connect Flood once using [the installation guide](https://flood.md/docs/installation). Then import the components you use; no per-component add command is needed.
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
"use client";
|
|
11
|
+
|
|
12
|
+
import { FloodRoot, DateField } from "@flood-md/react";
|
|
13
|
+
import "@flood-md/react/styles.css";
|
|
14
|
+
|
|
15
|
+
export function Example() {
|
|
16
|
+
return (
|
|
17
|
+
<FloodRoot>
|
|
18
|
+
<DateField label="Start date" name="start" defaultValue="2026-10-26" order="day-month-year" />
|
|
19
|
+
</FloodRoot>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Design notes
|
|
25
|
+
|
|
26
|
+
- Uses three native text segments rather than an operating-system calendar popup. Calendar and DatePicker are separate contracts.
|
|
27
|
+
- Values are canonical YYYY-MM-DD dates from 0001 through 9999, or an empty string. min/max and leap years use civil date arithmetic without timezones.
|
|
28
|
+
- Arrow keys adjust segments. Left/Right move at segment boundaries; IME and modifier shortcuts remain available. Use explicit order and localized segmentLabels/messages.
|
|
29
|
+
- In editable fields, incomplete or invalid drafts block native submission; the hidden named field contains no stale previous date. Controlled values and form resets preserve host ownership.
|
|
30
|
+
- Read only retains copying and accepted canonical submission, even outside current bounds or application constraints. It bypasses native validity without accepting partial or refused drafts. Disabled fields and fieldsets remain excluded. Introduced in the unpublished 0.2.7 source candidate.
|
|
31
|
+
|
|
32
|
+
## API reference
|
|
33
|
+
|
|
34
|
+
| Prop | Values | Default |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| `label` | `string` | `Required` |
|
|
37
|
+
| `hideLabel` | `boolean` | `—` |
|
|
38
|
+
| `value` | `string` | `—` |
|
|
39
|
+
| `defaultValue` | `string` | `—` |
|
|
40
|
+
| `onValueChange` | `(value: string) => void` | `—` |
|
|
41
|
+
| `min` | `string` | `—` |
|
|
42
|
+
| `max` | `string` | `—` |
|
|
43
|
+
| `required` | `boolean` | `—` |
|
|
44
|
+
| `readOnly` | `boolean` | `—` |
|
|
45
|
+
| `disabled` | `boolean` | `—` |
|
|
46
|
+
| `name` | `string` | `—` |
|
|
47
|
+
| `form` | `string` | `—` |
|
|
48
|
+
| `controlSize` | `"sm" \| "md" \| "lg" \| "xl"` | `"md"` |
|
|
49
|
+
| `invalid` | `boolean` | `—` |
|
|
50
|
+
| `status` | `"error" \| "warning" \| "success" \| "info"` | `—` |
|
|
51
|
+
| `description` | `string` | `—` |
|
|
52
|
+
| `order` | `"month-day-year" \| "day-month-year" \| "year-month-day"` | `"month-day-year"` |
|
|
53
|
+
| `segmentLabels` | `Partial<Record<"day" \| "month" \| "year", string>>` | `—` |
|
|
54
|
+
| `messages` | `{ required?: string; invalid?: string; outOfRange?: string }` | `—` |
|
|
55
|
+
| `validationMessage` | `string` | `—` |
|
|
56
|
+
| `end` | `ReactNode` | `—` |
|
|
57
|
+
| `Native HTML props` | `Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" \| "onChange" \| "children">` | `Forwarded` |
|