Published themes API declarations for components/radio-group.
./components/radio-group @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-group'Exported declarations Bundleexport type Bundle<Value extends string> = Readonly<{
Model: typeof RadioGroupUi.Model;
Message: typeof RadioGroupUi.Message;
OutMessage: typeof RadioGroupUi.OutMessage;
init: typeof RadioGroupUi.init;
update: (model: Model, message: Message) => Update.ReturnWithOutMessage<Model, Message, OutMessage<Value>>;
view(model: Model, inputs: ViewInputs<Value>, h: HtmlBuilder<Message>): Html;
fold<ParentModel, ParentMessage, ParentOutMessage>(config: Omit<Update.ChildFoldWithDerivedParentOutMessage<ParentModel, ParentMessage, Model, Message, Message, OutMessage<Value>, ParentOutMessage>, 'update'>): Update.FoldWithOutMessage<ParentModel, ParentMessage, Message, ParentOutMessage>;
embed<ParentMessage>(h: HtmlBuilder<ParentMessage>, config: EmbedConfig<Value, ParentMessage>): Html;
}>;createcreate: <Value extends string>() => Bundle<Value>EmbedConfigexport type EmbedConfig<Value extends string, ParentMessage> = Readonly<{
slotId: string;
model: Model;
toParentMessage(message: Message): ParentMessage;
viewInputs: ViewInputs<Value>;
}>;Messageexport type Message = RadioGroupUi.Message;Modelexport type Model = RadioGroupUi.Model;Optionexport type Option<Value extends string> = Readonly<{
value: Value;
label?: Html;
isDisabled?: boolean;
}>;OutMessageexport type OutMessage<Value extends string> = RadioGroupUi.OutMessage<Value>;Propsexport type Props = typeof Props.Type;PropsProps: 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 ["classic", "surface", "soft"]>>;
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>;
}>ViewInputsexport type ViewInputs<Value extends string> = Omit<UiInputs<Value>, 'toView' | 'options' | 'isOptionDisabled'> & Readonly<{
options: ReadonlyArray<Option<Value>>;
optionToLabel?: (value: Value) => Html;
props?: Props & {
rootClass?: string;
rootStyle?: Readonly<Record<string, string>>;
rootRadius?: string;
rootAccentColor?: string;
segmented?: boolean;
cards?: boolean;
itemClass?: string;
itemInnerClass?: string;
};
}>;Props Props exported by @wsagency/wseffect-themes/components/radio-group · Props · source Name Type Required Choices Description size"1" | "2" | "3" | Responsive<"1" | "2" | "3">No — — variant"classic" | "surface" | "soft"No "classic", "surface", "soft" — 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 — —
Rendered component example RadioGroup 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.RadioGroup.create<'monthly' | 'annual'>(); const model = group.init({ id: 'billing-cycle-example' }); return group.embed(h, { slotId: 'billing-cycle-example', model, toParentMessage: (message) => message, viewInputs: { options: [{ value: 'monthly', label: h.span([], ['Monthly']) }, { value: 'annual', label: h.span([], ['Annual']) }], selectedValue: Option.some('annual'), ariaLabel: 'Billing cycle' } }) })()