Documentation navigation

Published API · 0.1.0-rc.1

themes · components/radio-cards

Published themes API declarations for components/radio-cards.

./components/radio-cards

@wsagency/wseffect-themes · MIT · source · MIT license · WS-AGENCY-NOTICE

This entry point is published in @wsagency/wseffect-themes@0.1.0-rc.1. Import it from the package subpath shown below; the signatures and documentation are read from the installed package declarations.

import * as Wseffect from '@wsagency/wseffect-themes/components/radio-cards'

Exported declarations

Bundle

export type Bundle<Value extends string> = Omit<RadioGroup.Bundle<Value>, 'view'> & Readonly<{
    view(model: Model, inputs: ViewInputs<Value>, h: HtmlBuilder<Message>): Html;
}>;

create

create: <Value extends string>() => Bundle<Value>

Message

export type Message = RadioGroup.Message;

Model

export type Model = RadioGroup.Model;

OutMessage

export type OutMessage<Value extends string> = RadioGroup.OutMessage<Value>;

Props

export type Props = typeof Props.Type;

Props

Props: Schema.Struct<{
    readonly size: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly string[]> | Schema.String, Schema.Struct<{
        [k: string]: Schema.optional<Schema.Literals<readonly string[]> | Schema.String>;
    }>]>>;
    readonly variant: Schema.optional<Schema.Literals<readonly ["surface", "classic"]>>;
    readonly color: Schema.optional<Schema.Literals<readonly ["gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky", "custom"]>>;
    readonly highContrast: Schema.optional<Schema.Boolean>;
    readonly columns: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly string[]> | Schema.String, Schema.Struct<{
        [k: string]: Schema.optional<Schema.Literals<readonly string[]> | Schema.String>;
    }>]>>;
    readonly gap: Schema.optional<Schema.Union<readonly [Schema.Literals<readonly string[]> | Schema.String, Schema.Struct<{
        [k: string]: Schema.optional<Schema.Literals<readonly string[]> | Schema.String>;
    }>]>>;
}>

ViewInputs

export type ViewInputs<Value extends string> = Omit<RadioGroup.ViewInputs<Value>, 'props'> & Readonly<{
    props?: Props;
}>;

Props

Props exported by @wsagency/wseffect-themes/components/radio-cards · Props · source
NameTypeRequiredChoicesDescription
size"1" | "2" | "3" | Responsive<"1" | "2" | "3">No——
variant"surface" | "classic"No"surface", "classic"—
color"gray" | "gold" | "bronze" | "brown" | "yellow" | "amber" | "orange" | "tomato" | "red" | "ruby" | "crimson" | "pink" | "plum" | "purple" | "violet" | "iris" | "indigo" | "blue" | "cyan" | "teal" | "jade" | "green" | "grass" | "lime" | "mint" | "sky" | "custom"No"gray", "gold", "bronze", "brown", "yellow", "amber", "orange", "tomato", "red", "ruby", "crimson", "pink", "plum", "purple", "violet", "iris", "indigo", "blue", "cyan", "teal", "jade", "green", "grass", "lime", "mint", "sky", "custom"—
highContrastbooleanNo——
columnsstring | Responsive<string>No——
gapstring | Responsive<string>No——

Rendered component example

RadioCards
Example usage
import * as Themes from '@wsagency/wseffect-themes'
import * as SliderRange from '@wsagency/wseffect-themes/components/slider/range'
import * as Option from 'effect/Option'
import { defineView } from '@wsagency/wseffect-foldkit/submodel'
import { inertHtml, type HtmlBuilder } from '@wsagency/wseffect-foldkit/html'

const example = (h: HtmlBuilder<unknown>) => (() => { const group = Themes.RadioCards.create<'starter' | 'team'>(); const model = group.init({ id: 'plan-cards-example' }); return group.embed(h, { slotId: 'plan-cards-example', model, toParentMessage: (message) => message, viewInputs: { options: [{ value: 'starter', label: h.span([], ['Starter']) }, { value: 'team', label: h.span([], ['Team']) }], selectedValue: Option.some('team'), ariaLabel: 'Plan' } }) })()