opui-css 5.4.2 → 6.0.0-rc.1
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/CHANGELOG.md +648 -0
- package/MIGRATING-legacy.md +159 -0
- package/MIGRATING.md +1293 -69
- package/README.md +177 -26
- package/astro/index.ts +142 -13
- package/bin/opui-css.mjs +68 -0
- package/components/Accordion/Accordion.astro +6 -33
- package/components/Accordion/Accordion.react.tsx +23 -0
- package/components/Accordion/Accordion.svelte +27 -0
- package/components/Accordion/Accordion.vue +11 -28
- package/components/Accordion/AccordionActions.astro +16 -0
- package/components/Accordion/AccordionActions.react.tsx +15 -0
- package/components/Accordion/AccordionActions.svelte +23 -0
- package/components/Accordion/AccordionActions.vue +18 -0
- package/components/Accordion/AccordionContent.astro +9 -0
- package/components/Accordion/AccordionContent.react.tsx +6 -0
- package/components/Accordion/AccordionContent.svelte +15 -0
- package/components/Accordion/AccordionContent.vue +12 -0
- package/components/Accordion/AccordionSummary.astro +19 -0
- package/components/Accordion/AccordionSummary.react.tsx +30 -0
- package/components/Accordion/AccordionSummary.svelte +24 -0
- package/components/Accordion/AccordionSummary.vue +27 -0
- package/components/Accordion/icons.ts +2 -0
- package/components/Accordion/types.astro.ts +9 -0
- package/components/Accordion/types.react.ts +14 -0
- package/components/Accordion/types.svelte.ts +10 -2
- package/components/Accordion/types.ts +11 -5
- package/components/Accordion/types.vue-props.ts +22 -0
- package/components/Anchor/Anchor.astro +21 -33
- package/components/Anchor/Anchor.react.tsx +38 -0
- package/components/Anchor/Anchor.svelte +47 -0
- package/components/Anchor/Anchor.vue +32 -30
- package/components/Anchor/AnchorContent.astro +17 -0
- package/components/Anchor/AnchorContent.react.tsx +18 -0
- package/components/Anchor/AnchorContent.svelte +23 -0
- package/components/Anchor/AnchorContent.vue +20 -0
- package/components/Anchor/context.astro.ts +4 -0
- package/components/Anchor/context.react.ts +8 -0
- package/components/Anchor/context.svelte.ts +7 -0
- package/components/Anchor/context.vue.ts +4 -0
- package/components/Anchor/root.ts +12 -0
- package/components/Anchor/types.astro.ts +3 -0
- package/components/Anchor/types.react.ts +7 -0
- package/components/Anchor/types.svelte.ts +3 -3
- package/components/Anchor/types.ts +15 -6
- package/components/Anchor/types.vue-props.ts +15 -0
- package/components/Avatar/Avatar.astro +12 -8
- package/components/Avatar/Avatar.react.tsx +34 -0
- package/components/Avatar/Avatar.svelte +39 -0
- package/components/Avatar/Avatar.vue +10 -8
- package/components/Avatar/AvatarGroup.astro +9 -0
- package/components/Avatar/AvatarGroup.react.tsx +12 -0
- package/components/Avatar/AvatarGroup.svelte +15 -0
- package/components/Avatar/AvatarGroup.vue +12 -0
- package/components/Avatar/types.astro.ts +3 -2
- package/components/Avatar/types.react.ts +11 -0
- package/components/Avatar/types.svelte.ts +3 -4
- package/components/Avatar/types.ts +18 -15
- package/components/Avatar/types.vue-props.ts +11 -0
- package/components/Badge/Badge.astro +27 -22
- package/components/Badge/Badge.react.tsx +50 -0
- package/components/Badge/Badge.svelte +48 -0
- package/components/Badge/Badge.vue +15 -19
- package/components/Badge/types.react.ts +6 -0
- package/components/Badge/types.svelte.ts +4 -1
- package/components/Badge/types.ts +3 -3
- package/components/Badge/types.vue-props.ts +7 -0
- package/components/Button/Button.astro +12 -12
- package/components/Button/Button.react.tsx +33 -0
- package/components/Button/Button.svelte +37 -0
- package/components/Button/Button.vue +9 -9
- package/components/Button/types.astro.ts +2 -2
- package/components/Button/types.react.ts +11 -0
- package/components/Button/types.svelte.ts +11 -2
- package/components/Button/types.ts +20 -4
- package/components/Button/types.vue-props.ts +6 -0
- package/components/ButtonGroup/ButtonGroup.astro +7 -3
- package/components/ButtonGroup/ButtonGroup.react.tsx +30 -0
- package/components/ButtonGroup/ButtonGroup.svelte +34 -0
- package/components/ButtonGroup/ButtonGroup.vue +10 -7
- package/components/ButtonGroup/types.react.ts +4 -0
- package/components/ButtonGroup/types.ts +4 -4
- package/components/ButtonGroup/types.vue-props.ts +6 -0
- package/components/Callout/Callout.astro +7 -59
- package/components/Callout/Callout.react.tsx +26 -0
- package/components/Callout/Callout.svelte +32 -0
- package/components/Callout/Callout.vue +8 -48
- package/components/Callout/CalloutContent.astro +9 -0
- package/components/Callout/CalloutContent.react.tsx +6 -0
- package/components/Callout/CalloutContent.svelte +15 -0
- package/components/Callout/CalloutContent.vue +12 -0
- package/components/Callout/CalloutIcon.astro +25 -0
- package/components/Callout/CalloutIcon.react.tsx +26 -0
- package/components/Callout/CalloutIcon.svelte +24 -0
- package/components/Callout/CalloutIcon.vue +25 -0
- package/components/Callout/context.astro.ts +4 -0
- package/components/Callout/context.react.ts +8 -0
- package/components/Callout/context.svelte.ts +7 -0
- package/components/Callout/context.vue.ts +4 -0
- package/components/Callout/icons.ts +23 -0
- package/components/Callout/types.astro.ts +5 -0
- package/components/Callout/types.react.ts +9 -0
- package/components/Callout/types.svelte.ts +5 -3
- package/components/Callout/types.ts +5 -5
- package/components/Callout/types.vue-props.ts +14 -0
- package/components/Card/Card.astro +9 -25
- package/components/Card/Card.react.tsx +15 -0
- package/components/Card/Card.svelte +23 -0
- package/components/Card/Card.vue +10 -20
- package/components/Card/CardActions.astro +16 -0
- package/components/Card/CardActions.react.tsx +15 -0
- package/components/Card/CardActions.svelte +23 -0
- package/components/Card/CardActions.vue +18 -0
- package/components/Card/CardContent.astro +9 -0
- package/components/Card/CardContent.react.tsx +6 -0
- package/components/Card/CardContent.svelte +15 -0
- package/components/Card/CardContent.vue +12 -0
- package/components/Card/CardHeader.astro +9 -0
- package/components/Card/CardHeader.react.tsx +6 -0
- package/components/Card/CardHeader.svelte +15 -0
- package/components/Card/CardHeader.vue +12 -0
- package/components/Card/types.astro.ts +6 -0
- package/components/Card/types.react.ts +10 -0
- package/components/Card/types.svelte.ts +7 -3
- package/components/Card/types.ts +7 -7
- package/components/Card/types.vue-props.ts +17 -0
- package/components/Carousel/Carousel.astro +44 -0
- package/components/Carousel/Carousel.react.tsx +47 -0
- package/components/Carousel/Carousel.svelte +45 -0
- package/components/Carousel/Carousel.vue +44 -0
- package/components/Carousel/types.astro.ts +4 -0
- package/components/Carousel/types.react.ts +4 -0
- package/components/Carousel/types.svelte.ts +4 -0
- package/components/Carousel/types.ts +11 -0
- package/components/Carousel/types.vue-props.ts +6 -0
- package/components/Checkbox/Checkbox.astro +27 -15
- package/components/Checkbox/Checkbox.react.tsx +51 -0
- package/components/Checkbox/Checkbox.svelte +61 -0
- package/components/Checkbox/Checkbox.vue +39 -18
- package/components/Checkbox/CheckboxInput.astro +6 -2
- package/components/Checkbox/CheckboxInput.react.tsx +39 -0
- package/components/Checkbox/CheckboxInput.svelte +34 -0
- package/components/Checkbox/CheckboxInput.vue +29 -11
- package/components/Checkbox/types.astro.ts +2 -3
- package/components/Checkbox/types.react.ts +11 -0
- package/components/Checkbox/types.svelte.ts +8 -4
- package/components/Checkbox/types.ts +8 -4
- package/components/Checkbox/types.vue-props.ts +15 -0
- package/components/Chip/Chip.astro +22 -6
- package/components/Chip/Chip.react.tsx +45 -0
- package/components/Chip/Chip.svelte +45 -0
- package/components/Chip/Chip.vue +16 -9
- package/components/Chip/types.astro.ts +1 -1
- package/components/Chip/types.react.ts +15 -0
- package/components/Chip/types.svelte.ts +6 -4
- package/components/Chip/types.ts +22 -5
- package/components/Chip/types.vue-props.ts +11 -0
- package/components/DescriptionList/DescriptionList.astro +6 -2
- package/components/DescriptionList/DescriptionList.react.tsx +25 -0
- package/components/DescriptionList/DescriptionList.svelte +29 -0
- package/components/DescriptionList/DescriptionList.vue +7 -8
- package/components/DescriptionList/DescriptionListDescription.astro +9 -0
- package/components/DescriptionList/DescriptionListDescription.react.tsx +9 -0
- package/components/DescriptionList/DescriptionListDescription.svelte +15 -0
- package/components/DescriptionList/DescriptionListDescription.vue +15 -0
- package/components/DescriptionList/DescriptionListItem.astro +9 -0
- package/components/DescriptionList/DescriptionListItem.react.tsx +6 -0
- package/components/DescriptionList/DescriptionListItem.svelte +15 -0
- package/components/DescriptionList/{Item.vue → DescriptionListItem.vue} +5 -2
- package/components/DescriptionList/DescriptionListTerm.astro +9 -0
- package/components/DescriptionList/DescriptionListTerm.react.tsx +6 -0
- package/components/DescriptionList/DescriptionListTerm.svelte +15 -0
- package/components/DescriptionList/{Term.vue → DescriptionListTerm.vue} +5 -2
- package/components/DescriptionList/types.astro.ts +3 -3
- package/components/DescriptionList/types.react.ts +10 -0
- package/components/DescriptionList/types.svelte.ts +6 -0
- package/components/DescriptionList/types.ts +3 -1
- package/components/DescriptionList/types.vue-props.ts +12 -0
- package/components/Dialog/Dialog.astro +12 -26
- package/components/Dialog/Dialog.react.tsx +23 -0
- package/components/Dialog/Dialog.svelte +33 -0
- package/components/Dialog/Dialog.vue +13 -23
- package/components/Dialog/DialogContent.astro +9 -0
- package/components/Dialog/DialogContent.react.tsx +6 -0
- package/components/Dialog/DialogContent.svelte +15 -0
- package/components/Dialog/DialogContent.vue +12 -0
- package/components/Dialog/DialogFooter.astro +16 -0
- package/components/Dialog/DialogFooter.react.tsx +15 -0
- package/components/Dialog/DialogFooter.svelte +23 -0
- package/components/Dialog/DialogFooter.vue +18 -0
- package/components/Dialog/DialogHeader.astro +9 -0
- package/components/Dialog/DialogHeader.react.tsx +6 -0
- package/components/Dialog/DialogHeader.svelte +15 -0
- package/components/Dialog/DialogHeader.vue +12 -0
- package/components/Dialog/DialogTitle.astro +14 -0
- package/components/Dialog/DialogTitle.react.tsx +13 -0
- package/components/Dialog/DialogTitle.svelte +23 -0
- package/components/Dialog/DialogTitle.vue +18 -0
- package/components/Dialog/context.astro.ts +4 -0
- package/components/Dialog/context.react.ts +8 -0
- package/components/Dialog/context.svelte.ts +7 -0
- package/components/Dialog/context.vue.ts +4 -0
- package/components/Dialog/types.astro.ts +8 -0
- package/components/Dialog/types.react.ts +12 -0
- package/components/Dialog/types.svelte.ts +11 -3
- package/components/Dialog/types.ts +13 -6
- package/components/Dialog/types.vue-props.ts +24 -0
- package/components/Divider/Divider.astro +29 -7
- package/components/Divider/Divider.react.tsx +36 -0
- package/components/Divider/Divider.svelte +40 -0
- package/components/Divider/Divider.vue +22 -4
- package/components/Divider/types.react.ts +4 -0
- package/components/Divider/types.ts +3 -1
- package/components/Divider/types.vue-props.ts +6 -0
- package/components/Drawer/Drawer.astro +13 -18
- package/components/Drawer/Drawer.react.tsx +40 -0
- package/components/Drawer/Drawer.svelte +50 -0
- package/components/Drawer/Drawer.vue +14 -19
- package/components/Drawer/DrawerContent.astro +9 -0
- package/components/Drawer/DrawerContent.react.tsx +6 -0
- package/components/Drawer/DrawerContent.svelte +15 -0
- package/components/Drawer/DrawerContent.vue +12 -0
- package/components/Drawer/DrawerFooter.astro +9 -4
- package/components/Drawer/DrawerFooter.react.tsx +15 -0
- package/components/Drawer/DrawerFooter.svelte +23 -0
- package/components/Drawer/DrawerFooter.vue +10 -8
- package/components/Drawer/DrawerHeader.astro +18 -10
- package/components/Drawer/DrawerHeader.react.tsx +41 -0
- package/components/Drawer/DrawerHeader.svelte +42 -0
- package/components/Drawer/DrawerHeader.vue +18 -19
- package/components/Drawer/DrawerTitle.astro +14 -0
- package/components/Drawer/DrawerTitle.react.tsx +13 -0
- package/components/Drawer/DrawerTitle.svelte +23 -0
- package/components/Drawer/DrawerTitle.vue +18 -0
- package/components/Drawer/context.astro.ts +4 -0
- package/components/Drawer/context.react.ts +8 -0
- package/components/Drawer/context.svelte.ts +7 -0
- package/components/Drawer/context.vue.ts +4 -0
- package/components/Drawer/icons.ts +2 -0
- package/components/Drawer/types.astro.ts +5 -1
- package/components/Drawer/types.react.ts +13 -0
- package/components/Drawer/types.svelte.ts +6 -5
- package/components/Drawer/types.ts +15 -10
- package/components/Drawer/types.vue-props.ts +24 -0
- package/components/FieldDescription/FieldDescription.astro +1 -1
- package/components/FieldDescription/FieldDescription.react.tsx +6 -0
- package/components/FieldDescription/FieldDescription.svelte +15 -0
- package/components/FieldDescription/FieldDescription.vue +3 -3
- package/components/FieldDescription/types.react.ts +4 -0
- package/components/FieldDescription/types.vue-props.ts +6 -0
- package/components/FieldGroup/FieldGroup.astro +15 -15
- package/components/FieldGroup/FieldGroup.react.tsx +27 -0
- package/components/FieldGroup/FieldGroup.svelte +32 -0
- package/components/FieldGroup/FieldGroup.vue +8 -10
- package/components/FieldGroup/context.astro.ts +4 -0
- package/components/FieldGroup/context.react.ts +8 -0
- package/components/FieldGroup/context.svelte.ts +8 -0
- package/components/FieldGroup/context.vue.ts +4 -0
- package/components/FieldGroup/types.react.ts +4 -0
- package/components/FieldGroup/types.ts +3 -1
- package/components/FieldGroup/types.vue-props.ts +6 -0
- package/components/FieldLegend/FieldLegend.react.tsx +14 -0
- package/components/FieldLegend/FieldLegend.svelte +20 -0
- package/components/FieldLegend/FieldLegend.vue +8 -6
- package/components/FieldLegend/types.react.ts +6 -0
- package/components/FieldLegend/types.svelte.ts +3 -3
- package/components/FieldLegend/types.vue-props.ts +9 -0
- package/components/{FieldSet/FieldSet.astro → Fieldset/Fieldset.astro} +6 -2
- package/components/Fieldset/Fieldset.react.tsx +15 -0
- package/components/Fieldset/Fieldset.svelte +21 -0
- package/components/Fieldset/Fieldset.vue +21 -0
- package/components/Fieldset/types.react.ts +6 -0
- package/components/Fieldset/types.svelte.ts +6 -0
- package/components/Fieldset/types.ts +1 -0
- package/components/Fieldset/types.vue-props.ts +9 -0
- package/components/Form/Form.react.tsx +9 -0
- package/components/Form/Form.svelte +16 -0
- package/components/Form/Form.vue +7 -5
- package/components/Form/types.react.ts +6 -0
- package/components/Form/types.svelte.ts +3 -4
- package/components/Form/types.vue-props.ts +9 -0
- package/components/List/List.astro +3 -3
- package/components/List/List.react.tsx +27 -0
- package/components/List/List.svelte +31 -0
- package/components/List/List.vue +4 -9
- package/components/List/types.react.ts +4 -0
- package/components/List/types.ts +2 -3
- package/components/List/types.vue-props.ts +6 -0
- package/components/ListItem/ListItem.astro +46 -39
- package/components/ListItem/ListItem.react.tsx +65 -0
- package/components/ListItem/ListItem.svelte +80 -0
- package/components/ListItem/ListItem.vue +41 -46
- package/components/ListItem/types.astro.ts +2 -3
- package/components/ListItem/types.react.ts +17 -0
- package/components/ListItem/types.svelte.ts +7 -4
- package/components/ListItem/types.ts +14 -11
- package/components/ListItem/types.vue-props.ts +14 -0
- package/components/Menu/Menu.astro +86 -0
- package/components/Menu/Menu.react.tsx +87 -0
- package/components/Menu/Menu.svelte +71 -0
- package/components/Menu/Menu.vue +76 -0
- package/components/Menu/context.astro.ts +4 -0
- package/components/Menu/context.react.ts +8 -0
- package/components/Menu/context.svelte.ts +7 -0
- package/components/Menu/context.vue.ts +4 -0
- package/components/Menu/types.astro.ts +12 -0
- package/components/Menu/types.react.ts +12 -0
- package/components/Menu/types.svelte.ts +12 -0
- package/components/Menu/types.ts +23 -0
- package/components/Menu/types.vue-props.ts +16 -0
- package/components/Progress/Progress.astro +10 -21
- package/components/Progress/Progress.react.tsx +27 -0
- package/components/Progress/Progress.svelte +30 -0
- package/components/Progress/Progress.vue +17 -21
- package/components/Progress/types.astro.ts +2 -1
- package/components/Progress/types.react.ts +5 -0
- package/components/Progress/types.svelte.ts +2 -1
- package/components/Progress/types.ts +1 -6
- package/components/Progress/types.vue-props.ts +6 -0
- package/components/Radio/Radio.astro +29 -15
- package/components/Radio/Radio.react.tsx +51 -0
- package/components/Radio/Radio.svelte +59 -0
- package/components/Radio/Radio.vue +37 -16
- package/components/Radio/RadioInput.astro +5 -2
- package/components/Radio/RadioInput.react.tsx +10 -0
- package/components/Radio/RadioInput.svelte +27 -0
- package/components/Radio/RadioInput.vue +28 -3
- package/components/Radio/types.astro.ts +2 -1
- package/components/Radio/types.react.ts +11 -0
- package/components/Radio/types.svelte.ts +9 -5
- package/components/Radio/types.ts +9 -4
- package/components/Radio/types.vue-props.ts +15 -0
- package/components/Range/Range.astro +49 -38
- package/components/Range/Range.react.tsx +157 -0
- package/components/Range/Range.svelte +136 -0
- package/components/Range/Range.vue +116 -32
- package/components/Range/types.astro.ts +1 -3
- package/components/Range/types.react.ts +10 -0
- package/components/Range/types.svelte.ts +8 -3
- package/components/Range/types.ts +13 -14
- package/components/Range/types.vue-props.ts +16 -0
- package/components/Range/value.ts +27 -0
- package/components/Select/Select.astro +70 -31
- package/components/Select/Select.react.tsx +124 -0
- package/components/Select/Select.svelte +123 -0
- package/components/Select/Select.vue +108 -36
- package/components/Select/selection.ts +11 -0
- package/components/Select/types.react.ts +6 -0
- package/components/Select/types.svelte.ts +1 -1
- package/components/Select/types.ts +16 -13
- package/components/Select/types.vue-props.ts +20 -0
- package/components/Switch/Switch.astro +22 -26
- package/components/Switch/Switch.react.tsx +63 -0
- package/components/Switch/Switch.svelte +73 -0
- package/components/Switch/Switch.vue +36 -18
- package/components/Switch/SwitchInput.astro +5 -2
- package/components/Switch/SwitchInput.react.tsx +12 -0
- package/components/Switch/SwitchInput.svelte +30 -0
- package/components/Switch/SwitchInput.vue +25 -3
- package/components/Switch/types.astro.ts +4 -2
- package/components/Switch/types.react.ts +11 -0
- package/components/Switch/types.svelte.ts +11 -4
- package/components/Switch/types.ts +9 -6
- package/components/Switch/types.vue-props.ts +17 -0
- package/components/Table/Table.astro +15 -2
- package/components/Table/Table.react.tsx +24 -0
- package/components/Table/Table.svelte +28 -0
- package/components/Table/Table.vue +9 -8
- package/components/Table/TableBody.astro +9 -0
- package/components/Table/TableBody.react.tsx +5 -0
- package/components/Table/TableBody.svelte +9 -0
- package/components/Table/TableBody.vue +12 -0
- package/components/Table/TableCaption.astro +9 -0
- package/components/Table/TableCaption.react.tsx +5 -0
- package/components/Table/TableCaption.svelte +9 -0
- package/components/Table/TableCaption.vue +12 -0
- package/components/Table/TableCell.astro +9 -0
- package/components/Table/TableCell.react.tsx +6 -0
- package/components/Table/TableCell.svelte +16 -0
- package/components/Table/TableCell.vue +12 -0
- package/components/Table/TableColumn.astro +8 -0
- package/components/Table/TableColumn.react.tsx +7 -0
- package/components/Table/TableColumn.svelte +8 -0
- package/components/Table/TableColumn.vue +12 -0
- package/components/Table/TableColumnGroup.astro +9 -0
- package/components/Table/TableColumnGroup.react.tsx +5 -0
- package/components/Table/TableColumnGroup.svelte +9 -0
- package/components/Table/TableColumnGroup.vue +12 -0
- package/components/Table/TableFoot.astro +9 -0
- package/components/Table/TableFoot.react.tsx +5 -0
- package/components/Table/TableFoot.svelte +9 -0
- package/components/Table/TableFoot.vue +12 -0
- package/components/Table/TableHead.astro +9 -0
- package/components/Table/TableHead.react.tsx +5 -0
- package/components/Table/TableHead.svelte +9 -0
- package/components/Table/TableHead.vue +12 -0
- package/components/Table/TableHeaderCell.astro +9 -0
- package/components/Table/TableHeaderCell.react.tsx +10 -0
- package/components/Table/TableHeaderCell.svelte +16 -0
- package/components/Table/TableHeaderCell.vue +12 -0
- package/components/Table/TableRow.astro +9 -0
- package/components/Table/TableRow.react.tsx +5 -0
- package/components/Table/TableRow.svelte +9 -0
- package/components/{DescriptionList/Description.vue → Table/TableRow.vue} +3 -3
- package/components/Table/types.astro.ts +17 -11
- package/components/Table/types.react.ts +22 -0
- package/components/Table/types.svelte.ts +19 -7
- package/components/Table/types.ts +8 -3
- package/components/Table/types.vue-props.ts +28 -0
- package/components/Tabs/Tabs.astro +23 -13
- package/components/Tabs/Tabs.react.tsx +43 -0
- package/components/Tabs/Tabs.svelte +43 -0
- package/components/Tabs/Tabs.vue +19 -9
- package/components/Tabs/TabsItem.astro +16 -28
- package/components/Tabs/TabsItem.react.tsx +47 -0
- package/components/Tabs/TabsItem.svelte +52 -0
- package/components/Tabs/TabsItem.vue +23 -21
- package/components/Tabs/TabsLabel.astro +16 -0
- package/components/Tabs/TabsLabel.react.tsx +17 -0
- package/components/Tabs/TabsLabel.svelte +19 -0
- package/components/Tabs/TabsLabel.vue +16 -0
- package/components/Tabs/TabsPanel.astro +2 -9
- package/components/Tabs/TabsPanel.react.tsx +6 -0
- package/components/Tabs/TabsPanel.svelte +15 -0
- package/components/Tabs/TabsPanel.vue +3 -22
- package/components/Tabs/context.astro.ts +4 -0
- package/components/Tabs/context.react.ts +8 -0
- package/components/Tabs/context.svelte.ts +7 -0
- package/components/Tabs/context.vue.ts +4 -0
- package/components/Tabs/types.astro.ts +5 -3
- package/components/Tabs/types.react.ts +12 -0
- package/components/Tabs/types.svelte.ts +6 -6
- package/components/Tabs/types.ts +10 -8
- package/components/Tabs/types.vue-props.ts +25 -0
- package/components/TextField/TextField.astro +36 -52
- package/components/TextField/TextField.react.tsx +70 -0
- package/components/TextField/TextField.svelte +84 -0
- package/components/TextField/TextField.vue +59 -39
- package/components/TextField/types.astro.ts +1 -3
- package/components/TextField/types.react.ts +12 -0
- package/components/TextField/types.svelte.ts +2 -4
- package/components/TextField/types.ts +11 -25
- package/components/TextField/types.vue-props.ts +21 -0
- package/components/Textarea/Textarea.astro +34 -48
- package/components/Textarea/Textarea.react.tsx +64 -0
- package/components/Textarea/Textarea.svelte +80 -0
- package/components/Textarea/Textarea.vue +55 -31
- package/components/Textarea/types.astro.ts +1 -3
- package/components/Textarea/types.react.ts +8 -0
- package/components/Textarea/types.svelte.ts +1 -9
- package/components/Textarea/types.ts +10 -22
- package/components/Textarea/types.vue-props.ts +20 -0
- package/components/ToggleButton/ToggleButton.astro +14 -14
- package/components/ToggleButton/ToggleButton.react.tsx +57 -0
- package/components/ToggleButton/ToggleButton.svelte +58 -0
- package/components/ToggleButton/ToggleButton.vue +41 -17
- package/components/ToggleButton/types.react.ts +4 -0
- package/components/ToggleButton/types.svelte.ts +0 -2
- package/components/ToggleButton/types.ts +2 -6
- package/components/ToggleButton/types.vue-props.ts +11 -0
- package/components/ToggleGroup/ToggleGroup.astro +16 -18
- package/components/ToggleGroup/ToggleGroup.react.tsx +54 -0
- package/components/ToggleGroup/ToggleGroup.svelte +54 -0
- package/components/ToggleGroup/ToggleGroup.vue +29 -20
- package/components/ToggleGroup/context.astro.ts +5 -0
- package/components/ToggleGroup/context.react.ts +8 -0
- package/components/ToggleGroup/context.svelte.ts +8 -0
- package/components/ToggleGroup/context.vue.ts +4 -0
- package/components/ToggleGroup/selection.ts +12 -0
- package/components/ToggleGroup/types.react.ts +12 -0
- package/components/ToggleGroup/types.svelte.ts +1 -4
- package/components/ToggleGroup/types.ts +11 -9
- package/components/ToggleGroup/types.vue-props.ts +6 -0
- package/components/Tooltip/Tooltip.astro +6 -7
- package/components/Tooltip/Tooltip.react.tsx +24 -0
- package/components/Tooltip/Tooltip.svelte +29 -0
- package/components/Tooltip/Tooltip.vue +7 -8
- package/components/Tooltip/types.react.ts +4 -0
- package/components/Tooltip/types.svelte.ts +1 -4
- package/components/Tooltip/types.ts +2 -8
- package/components/Tooltip/types.vue-props.ts +6 -0
- package/components/content.svelte +9 -0
- package/components/context.astro.ts +15 -0
- package/components/cx.ts +12 -0
- package/components/dev.ts +63 -0
- package/components/group.ts +2 -0
- package/components/id.ts +9 -0
- package/components/style.ts +33 -0
- package/components/tag.ts +6 -0
- package/components/vue.ts +18 -0
- package/core/normalize.css +56 -79
- package/core/palette.css +99 -282
- package/core/utils.css +31 -44
- package/css/compat/avatar.css +7 -0
- package/css/compat/menu.css +20 -0
- package/css/compat.css +3 -0
- package/css/components/accordion.css +123 -59
- package/css/components/anchor.css +21 -8
- package/css/components/avatar.css +57 -17
- package/css/components/badge.css +84 -45
- package/css/components/button-group.css +120 -129
- package/css/components/button.css +326 -116
- package/css/components/callout.css +88 -47
- package/css/components/card.css +181 -63
- package/css/components/carousel.css +399 -0
- package/css/components/checkbox.css +27 -148
- package/css/components/chip.css +175 -52
- package/css/components/choice.css +291 -0
- package/css/components/description-list.css +51 -41
- package/css/components/dialog.css +120 -30
- package/css/components/divider.css +62 -9
- package/css/components/drawer.css +181 -51
- package/css/components/form.css +51 -66
- package/css/components/layout.css +92 -0
- package/css/components/link.css +44 -12
- package/css/components/list.css +252 -135
- package/css/components/menu.css +174 -0
- package/css/components/progress.css +37 -29
- package/css/components/radio.css +32 -141
- package/css/components/range.css +244 -101
- package/css/components/select.css +84 -65
- package/css/components/spinner.css +31 -12
- package/css/components/switch.css +98 -171
- package/css/components/table.css +120 -79
- package/css/components/tabs.css +230 -36
- package/css/components/text-field.css +296 -186
- package/css/components/textarea.css +5 -11
- package/css/components/toggle-button.css +84 -44
- package/css/components/toggle-group.css +62 -32
- package/css/components/tooltip.css +87 -30
- package/css/components/typography.css +519 -298
- package/css/components.css +25 -18
- package/css/imports.css +2 -4
- package/css/js/checkbox.d.ts +3 -0
- package/css/js/checkbox.js +10 -0
- package/css/js/range.d.ts +1 -0
- package/css/js/range.js +44 -0
- package/css/layers.css +2 -0
- package/css/theme.css +729 -103
- package/dist/op.css +12 -237
- package/dist/op.css.map +1 -1
- package/dist/opui.baseline-2023.css +9209 -0
- package/dist/opui.baseline-2023.css.map +1 -0
- package/dist/opui.baseline-2024.css +9209 -0
- package/dist/opui.baseline-2024.css.map +1 -0
- package/dist/opui.baseline-2025.css +9209 -0
- package/dist/opui.baseline-2025.css.map +1 -0
- package/dist/opui.baseline-2026.css +9209 -0
- package/dist/opui.baseline-2026.css.map +1 -0
- package/dist/opui.components.css +5497 -3291
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +6616 -4255
- package/dist/opui.css.map +1 -1
- package/dist/opui.no-compat.css +9182 -0
- package/dist/opui.no-compat.css.map +1 -0
- package/env.d.ts +10 -7
- package/open-props.css +10 -1
- package/package.json +63 -17
- package/react/elements.ts +13 -0
- package/react/index.ts +176 -0
- package/skills/opui/SKILL.md +75 -0
- package/skills/opui/references/accordion.md +253 -0
- package/skills/opui/references/anchor.md +213 -0
- package/skills/opui/references/avatar.md +202 -0
- package/skills/opui/references/badge.md +199 -0
- package/skills/opui/references/button-group.md +239 -0
- package/skills/opui/references/button.md +242 -0
- package/skills/opui/references/callout.md +221 -0
- package/skills/opui/references/card.md +222 -0
- package/skills/opui/references/carousel.md +269 -0
- package/skills/opui/references/checkbox.md +241 -0
- package/skills/opui/references/chip.md +135 -0
- package/skills/opui/references/customizing.md +85 -0
- package/skills/opui/references/description-list.md +191 -0
- package/skills/opui/references/dialog.md +301 -0
- package/skills/opui/references/divider.md +112 -0
- package/skills/opui/references/drawer.md +802 -0
- package/skills/opui/references/form.md +260 -0
- package/skills/opui/references/getting-started.md +398 -0
- package/skills/opui/references/index.md +89 -0
- package/skills/opui/references/layout.md +161 -0
- package/skills/opui/references/list.md +216 -0
- package/skills/opui/references/menu.md +248 -0
- package/skills/opui/references/progress.md +114 -0
- package/skills/opui/references/radio.md +234 -0
- package/skills/opui/references/range.md +150 -0
- package/skills/opui/references/select.md +255 -0
- package/skills/opui/references/spinner.md +85 -0
- package/skills/opui/references/switch.md +223 -0
- package/skills/opui/references/table.md +480 -0
- package/skills/opui/references/tabs.md +257 -0
- package/skills/opui/references/text-field.md +167 -0
- package/skills/opui/references/textarea.md +169 -0
- package/skills/opui/references/theming.md +278 -0
- package/skills/opui/references/toggle.md +222 -0
- package/skills/opui/references/tooltip.md +167 -0
- package/skills/opui/references/typography.md +159 -0
- package/svelte/elements.ts +7 -0
- package/svelte/index.ts +177 -0
- package/themes/bootstrap.css +223 -0
- package/themes/brutalist.css +105 -0
- package/themes/m3.css +152 -0
- package/themes/shadcn.css +125 -0
- package/tokens.json +3729 -0
- package/vue/index.ts +136 -15
- package/components/AGENTS.md +0 -247
- package/components/Accordion/types.d.vue.ts +0 -15
- package/components/Accordion/types.solid.ts +0 -6
- package/components/Anchor/types.d.vue.ts +0 -10
- package/components/Anchor/types.solid.ts +0 -6
- package/components/Avatar/types.d.vue.ts +0 -12
- package/components/Avatar/types.solid.ts +0 -11
- package/components/Badge/types.d.vue.ts +0 -10
- package/components/Badge/types.solid.ts +0 -4
- package/components/Button/types.d.vue.ts +0 -10
- package/components/Button/types.solid.ts +0 -8
- package/components/ButtonGroup/types.d.vue.ts +0 -10
- package/components/ButtonGroup/types.solid.ts +0 -4
- package/components/Callout/types.d.vue.ts +0 -10
- package/components/Callout/types.solid.ts +0 -6
- package/components/Card/types.d.vue.ts +0 -10
- package/components/Card/types.solid.ts +0 -6
- package/components/Checkbox/types.d.vue.ts +0 -11
- package/components/Checkbox/types.solid.ts +0 -9
- package/components/Chip/types.d.vue.ts +0 -10
- package/components/Chip/types.solid.ts +0 -10
- package/components/ClassicSelect/ClassicSelect.astro +0 -60
- package/components/ClassicSelect/ClassicSelect.vue +0 -54
- package/components/ClassicSelect/types.astro.ts +0 -8
- package/components/ClassicSelect/types.d.vue.ts +0 -10
- package/components/ClassicSelect/types.solid.ts +0 -5
- package/components/ClassicSelect/types.svelte.ts +0 -5
- package/components/ClassicSelect/types.ts +0 -15
- package/components/DescriptionList/Description.astro +0 -9
- package/components/DescriptionList/Item.astro +0 -9
- package/components/DescriptionList/Term.astro +0 -9
- package/components/DescriptionList/index.ts +0 -12
- package/components/DescriptionList/types.d.vue.ts +0 -10
- package/components/DescriptionList/types.solid.ts +0 -4
- package/components/Dialog/types.d.vue.ts +0 -10
- package/components/Dialog/types.solid.ts +0 -8
- package/components/Divider/types.d.vue.ts +0 -6
- package/components/Divider/types.solid.ts +0 -4
- package/components/Drawer/types.d.vue.ts +0 -31
- package/components/Drawer/types.solid.ts +0 -12
- package/components/FieldDescription/types.d.vue.ts +0 -10
- package/components/FieldDescription/types.solid.ts +0 -5
- package/components/FieldGroup/types.d.vue.ts +0 -12
- package/components/FieldGroup/types.solid.ts +0 -5
- package/components/FieldLegend/types.d.vue.ts +0 -11
- package/components/FieldLegend/types.solid.ts +0 -5
- package/components/FieldSet/FieldSet.vue +0 -18
- package/components/FieldSet/types.d.vue.ts +0 -11
- package/components/FieldSet/types.solid.ts +0 -5
- package/components/FieldSet/types.svelte.ts +0 -8
- package/components/FieldSet/types.ts +0 -5
- package/components/Form/types.d.vue.ts +0 -11
- package/components/Form/types.solid.ts +0 -5
- package/components/IconButton/IconButton.astro +0 -24
- package/components/IconButton/IconButton.vue +0 -24
- package/components/IconButton/types.astro.ts +0 -6
- package/components/IconButton/types.d.vue.ts +0 -10
- package/components/IconButton/types.solid.ts +0 -8
- package/components/IconButton/types.svelte.ts +0 -6
- package/components/IconButton/types.ts +0 -16
- package/components/List/types.d.vue.ts +0 -10
- package/components/List/types.solid.ts +0 -4
- package/components/ListItem/types.d.vue.ts +0 -10
- package/components/ListItem/types.solid.ts +0 -12
- package/components/Progress/types.d.vue.ts +0 -10
- package/components/Progress/types.solid.ts +0 -4
- package/components/Radio/types.d.vue.ts +0 -11
- package/components/Radio/types.solid.ts +0 -9
- package/components/Range/types.d.vue.ts +0 -14
- package/components/Range/types.solid.ts +0 -6
- package/components/Select/types.d.vue.ts +0 -17
- package/components/Select/types.solid.ts +0 -6
- package/components/Switch/types.d.vue.ts +0 -13
- package/components/Switch/types.solid.ts +0 -9
- package/components/Table/Body.astro +0 -11
- package/components/Table/Body.vue +0 -5
- package/components/Table/Cell.astro +0 -11
- package/components/Table/Cell.vue +0 -5
- package/components/Table/Column.astro +0 -12
- package/components/Table/Column.vue +0 -19
- package/components/Table/ColumnGroup.astro +0 -11
- package/components/Table/ColumnGroup.vue +0 -5
- package/components/Table/Head.astro +0 -11
- package/components/Table/Head.vue +0 -5
- package/components/Table/HeaderCell.astro +0 -11
- package/components/Table/HeaderCell.vue +0 -5
- package/components/Table/Row.astro +0 -11
- package/components/Table/Row.vue +0 -5
- package/components/Table/index.ts +0 -20
- package/components/Table/types.d.vue.ts +0 -10
- package/components/Table/types.solid.ts +0 -8
- package/components/Tabs/TabsTab.astro +0 -15
- package/components/Tabs/TabsTab.vue +0 -24
- package/components/Tabs/index.ts +0 -14
- package/components/Tabs/types.d.vue.ts +0 -31
- package/components/Tabs/types.solid.ts +0 -12
- package/components/TextField/types.d.vue.ts +0 -20
- package/components/TextField/types.solid.ts +0 -22
- package/components/Textarea/types.d.vue.ts +0 -19
- package/components/Textarea/types.solid.ts +0 -6
- package/components/Toast/Toast.astro +0 -42
- package/components/Toast/Toast.vue +0 -48
- package/components/ToggleButton/types.d.vue.ts +0 -10
- package/components/ToggleButton/types.solid.ts +0 -7
- package/components/ToggleGroup/types.d.vue.ts +0 -15
- package/components/ToggleGroup/types.solid.ts +0 -4
- package/components/Tooltip/types.d.vue.ts +0 -10
- package/components/Tooltip/types.solid.ts +0 -6
- package/css/components/icon-button.css +0 -139
- package/css/components/text-input.css +0 -68
- package/css/components/toast.css +0 -157
- package/css/js/toast.js +0 -94
- /package/components/{FieldSet → Fieldset}/types.astro.ts +0 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Menu
|
|
2
|
+
|
|
3
|
+
A popover list of actions or links.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/list.css` and `opui-css/css/components/menu.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/menu.md), [Astro](https://open-props-ui.netlify.app/astro/components/menu.md), [React](https://open-props-ui.netlify.app/react/components/menu.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/menu.md), [Vue](https://open-props-ui.netlify.app/vue/components/menu.md).
|
|
7
|
+
|
|
8
|
+
## Menu
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `menu.ui-menu[popover]` (root): The menu surface, a popover anchored to its trigger.
|
|
13
|
+
- `li.ui-heading`: A group heading. HTML and CSS only.
|
|
14
|
+
- `<li>`: An item, holding a `<button>` or an `<a>` with `href`. Rendered from `items`, or a `ListItem` in the default slot.
|
|
15
|
+
- `.ui-start`: Optional content at the start, such as an icon.
|
|
16
|
+
- `.ui-text`: The label (`label` on an item).
|
|
17
|
+
- `.ui-end`: Optional content at the end, such as a shortcut in a `<kbd>` (`shortcut` on an item).
|
|
18
|
+
|
|
19
|
+
### Props and modifiers
|
|
20
|
+
|
|
21
|
+
- `align`: `"end"` (`.ui-align-end`), `"start"` (default). Which edge of the trigger the menu lines up with.
|
|
22
|
+
- Anchor position area (HTML): `--ui-anchor-position-area`, default `"self-block-end span-self-inline-end"`. Any valid `position-area` value. Overrides the side and alignment classes. The `self-` keywords follow the menu's own direction, so the placement mirrors in a right-to-left part of a left-to-right page.
|
|
23
|
+
- `bordered`: `boolean`, `.ui-bordered`. Adds a border between the items.
|
|
24
|
+
- `dense`: `boolean`, `.ui-dense`. Packs the items tighter.
|
|
25
|
+
- `id`: `string`. The id of the menu, which the trigger's `commandfor` points at. Required.
|
|
26
|
+
- `items`: `MenuItem[]`. The items, as `{ borderTop, color, disabled, href, keepOpen, label, shortcut }` objects. `borderTop` adds a border above the item, `color: "critical"` marks a destructive one, a disabled link has no `href`, and `keepOpen` keeps the menu open on click. Other keys go to the item's `<a>` or `<button>`.
|
|
27
|
+
- Items (HTML): `borderTop` (`li.ui-border-top`), `close` (`li > button[command="hide-popover"]`), `critical` (`li.ui-critical`), `disabled` (`li > button[disabled], li > a[aria-disabled="true"]`). The item states. `close` closes the whole menu on click, also from a submenu, and only button items take it. A disabled link has no `href`.
|
|
28
|
+
- `popover`: `"auto"` (default), `"manual"` (`[popover="manual"]`). The popover type. With `"manual"`, Esc and a click outside don't close the menu, and opening another menu doesn't either.
|
|
29
|
+
- `side`: `"block-end"` (default), `"block-start"` (`.ui-block-start`), `"inline-end"` (`.ui-inline-end`), `"inline-start"` (`.ui-inline-start`). The side of the trigger the menu opens on.
|
|
30
|
+
- Trigger (HTML): `button[commandfor][command="toggle-popover"]`. Opens the menu. `commandfor` is the menu id.
|
|
31
|
+
|
|
32
|
+
### Slots
|
|
33
|
+
|
|
34
|
+
- `default`: The items, such as `ListItem`s.
|
|
35
|
+
|
|
36
|
+
### Notes
|
|
37
|
+
|
|
38
|
+
- HTML: Items are built like `List` items: icons in `.ui-start`, the text in `.ui-text` and shortcuts in `.ui-end`. Open the menu with a button that has `commandfor` set to the menu id and `command="toggle-popover"`.
|
|
39
|
+
- Astro and Vue: Attributes that aren't props go to the `<menu>`. Item keys that aren't listed go to the item's `<a>` or `<button>`, like `target` or `data-*`.
|
|
40
|
+
- React: Attributes that aren't props go to the `<menu>`. Item keys that aren't listed go to the item's `<a>` or `<button>`, like `onClick`, `target` or `data-*`.
|
|
41
|
+
- Svelte: Attributes that aren't props go to the `<menu>`. Item keys that aren't listed go to the item's `<a>` or `<button>`, like `onclick`, `target` or `data-*`.
|
|
42
|
+
|
|
43
|
+
## Component properties
|
|
44
|
+
|
|
45
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
46
|
+
|
|
47
|
+
### list.css
|
|
48
|
+
|
|
49
|
+
- `--_bg-color`: Background of the list and its items. Defaults to `--ui-surface-filled`, `.ui-transparent` and `.ui-tonal` set it.
|
|
50
|
+
- `--_description-text-color`: Text color of the description paragraph in an item. `--ui-text-subtle`, and `--ui-on-selected` on a selected or current row when a theme sets it.
|
|
51
|
+
- `--_divider-border-color`: Color of the lines between items in `.ui-bordered` and on `.ui-border-top`. Defaults to `--ui-border-color`, mixed with 20% `--ui-text-strong` in `.ui-tonal`.
|
|
52
|
+
- `--_hover-bg-color`: Background of hovered items, from `--ui-primary`.
|
|
53
|
+
- `--_item-gap`: Gap between the content of an item. Smaller in `.ui-dense`.
|
|
54
|
+
- `--_item-padding-inline`: Horizontal padding of items, headings and options. `--ui-list-item-padding-inline`, or `--ui-space-3` when a theme leaves it unset.
|
|
55
|
+
- `--_radius`: The corner radius of a `.ui-list`. Defaults to `--ui-radius`, and `0` when the list is a direct child of a `Card`, `Accordion` or `Dialog`, which round and clip it themselves.
|
|
56
|
+
- `--_selected-bg-color`: Background of selected and current items and options. `--ui-selected` when the theme sets it, otherwise `--ui-primary` at `--ui-state-active-alpha-accent`, stronger than `--_hover-bg-color`. With more contrast it is `--_hover-bg-color`, so the text keeps 7:1, and the bar marks the row.
|
|
57
|
+
- `--_selected-indicator-bg-color`: Color of the bar on the start edge of selected and current items and options, which marks them without relying on the fill. Defaults to `--ui-selected-strong`.
|
|
58
|
+
- `--_selected-indicator-size`: Width of the bar on selected and current items. Defaults to `--ui-border-width-thick`.
|
|
59
|
+
- `--_separator-gap`: Space around the lines between items in `.ui-bordered` and on `.ui-border-top`. Smaller in `.ui-dense`.
|
|
60
|
+
- `--_start-image-size`: Width of a square image in `.ui-start`.
|
|
61
|
+
- `--_start-size`: Maximum size of leading and trailing icons, and the indent of `.ui-inset` items. Smaller in `.ui-dense`.
|
|
62
|
+
- `--_start-video-size`: Height of a video in `.ui-start`, which keeps a 16:9 ratio.
|
|
63
|
+
|
|
64
|
+
Outputs: `--_selected-shadow`.
|
|
65
|
+
|
|
66
|
+
### menu.css
|
|
67
|
+
|
|
68
|
+
- `--_bg-color`: The background. Defaults to `--ui-surface-elevated`.
|
|
69
|
+
- `--_border-color`: The edge color. `--ui-border-color-raised` when a theme sets it, otherwise `--ui-border-color-on-raised`.
|
|
70
|
+
- `--_border-width`: The border width. Defaults to `--ui-border-width`.
|
|
71
|
+
- `--_divider-border-color`: Color of the item separators. Defaults to `--ui-border-color-on-raised`.
|
|
72
|
+
- `--_max-block-size`: Maximum height.
|
|
73
|
+
- `--_min-block-size`: Height a popover menu keeps when space is tight, unless its content is shorter. Needs `calc-size()`.
|
|
74
|
+
- `--_min-inline-size`: Minimum width. A popover menu is also at least as wide as its invoker.
|
|
75
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
76
|
+
- `--_offset`: Gap between a popover menu and its invoker.
|
|
77
|
+
- `--_radius`: The corner radius. Defaults to `--ui-radius`.
|
|
78
|
+
- `--_shadow`: The shadow. Defaults to `--ui-shadow-overlay`.
|
|
79
|
+
|
|
80
|
+
Outputs: `--_duration`, `--_ease`, `--_hover-bg-color`, `--_margin-block`, `--_margin-inline`, `--_position-area`, `--_side` and `--_span`.
|
|
81
|
+
|
|
82
|
+
## Theme tokens
|
|
83
|
+
|
|
84
|
+
The stylesheets read `--ui-border-color`, `--ui-border-color-on-filled`, `--ui-border-color-on-raised`, `--ui-border-color-raised`, `--ui-border-width`, `--ui-border-width-thick`, `--ui-choice-size-small`, `--ui-control-size`, `--ui-control-size-small`, `--ui-critical`, `--ui-critical-text`, `--ui-disabled-opacity`, `--ui-duration-slow`, `--ui-ease-enter`, `--ui-ease-exit`, `--ui-field-border-color-on-filled`, `--ui-field-border-color-on-raised`, `--ui-focus-ring-inset`, `--ui-font-code`, `--ui-font-size-caption`, `--ui-font-size-small`, `--ui-font-weight-bold`, `--ui-font-weight-normal`, `--ui-icon-size`, `--ui-icon-size-small`, `--ui-line-height`, `--ui-list-item-padding-inline`, `--ui-menu-radius`, `--ui-motion`, `--ui-on-selected`, `--ui-primary`, `--ui-primary-text`, `--ui-radius`, `--ui-selected`, `--ui-selected-strong`, `--ui-shadow-overlay`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-space-6`, `--ui-state-active-alpha-accent`, `--ui-state-hover-alpha-accent`, `--ui-surface-elevated`, `--ui-surface-filled`, `--ui-surface-tonal`, `--ui-switch-thumb-size-small`, `--ui-switch-track-block-size-small`, `--ui-switch-track-inline-size-small`, `--ui-text`, `--ui-text-strong` and `--ui-text-subtle`. `theming.md` and `tokens.json` describe them.
|
|
85
|
+
|
|
86
|
+
## HTML
|
|
87
|
+
|
|
88
|
+
### Example: Basics
|
|
89
|
+
|
|
90
|
+
```html
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
class="ui-button ui-outlined"
|
|
94
|
+
commandfor="menu-basics-1"
|
|
95
|
+
command="toggle-popover"
|
|
96
|
+
>
|
|
97
|
+
Options
|
|
98
|
+
</button>
|
|
99
|
+
<menu class="ui-menu" id="menu-basics-1" popover>
|
|
100
|
+
<li>
|
|
101
|
+
<button type="button" commandfor="menu-basics-1" command="hide-popover">
|
|
102
|
+
<div class="ui-text"><p>Edit</p></div>
|
|
103
|
+
<div class="ui-end"><kbd>Ctrl+E</kbd></div>
|
|
104
|
+
</button>
|
|
105
|
+
</li>
|
|
106
|
+
<li>
|
|
107
|
+
<button type="button" commandfor="menu-basics-1" command="hide-popover">
|
|
108
|
+
<div class="ui-text"><p>Duplicate</p></div>
|
|
109
|
+
<div class="ui-end"><kbd>Ctrl+D</kbd></div>
|
|
110
|
+
</button>
|
|
111
|
+
</li>
|
|
112
|
+
<li>
|
|
113
|
+
<button type="button" disabled>
|
|
114
|
+
<div class="ui-text"><p>Archive</p></div>
|
|
115
|
+
</button>
|
|
116
|
+
</li>
|
|
117
|
+
<li>
|
|
118
|
+
<a href="/guide/getting-started/">
|
|
119
|
+
<div class="ui-text"><p>Help</p></div>
|
|
120
|
+
</a>
|
|
121
|
+
</li>
|
|
122
|
+
<li class="ui-border-top ui-critical">
|
|
123
|
+
<button type="button" commandfor="menu-basics-1" command="hide-popover">
|
|
124
|
+
<div class="ui-text"><p>Delete</p></div>
|
|
125
|
+
</button>
|
|
126
|
+
</li>
|
|
127
|
+
</menu>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Astro
|
|
131
|
+
|
|
132
|
+
`import { Menu } from "opui-css/astro"`
|
|
133
|
+
|
|
134
|
+
### Example: Basics
|
|
135
|
+
|
|
136
|
+
```astro
|
|
137
|
+
---
|
|
138
|
+
import { Button, Menu } from "opui-css/astro"
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
<Button commandfor="menu-basics-1" command="toggle-popover" variant="outlined">
|
|
142
|
+
Options
|
|
143
|
+
</Button>
|
|
144
|
+
<Menu
|
|
145
|
+
id="menu-basics-1"
|
|
146
|
+
items={[
|
|
147
|
+
{ label: "Edit", shortcut: "Ctrl+E" },
|
|
148
|
+
{ label: "Duplicate", shortcut: "Ctrl+D" },
|
|
149
|
+
{ disabled: true, label: "Archive" },
|
|
150
|
+
{ href: "/guide/getting-started/", label: "Help" },
|
|
151
|
+
{ borderTop: true, color: "critical", label: "Delete" },
|
|
152
|
+
]}
|
|
153
|
+
/>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## React
|
|
157
|
+
|
|
158
|
+
`import { Menu } from "opui-css/react"`
|
|
159
|
+
|
|
160
|
+
- Client components (`"use client"`): `Menu`.
|
|
161
|
+
|
|
162
|
+
### Example: Basics
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
import { Button, Menu } from "opui-css/react"
|
|
166
|
+
|
|
167
|
+
export default function Basics() {
|
|
168
|
+
return (
|
|
169
|
+
<>
|
|
170
|
+
<Button
|
|
171
|
+
commandfor="menu-basics-1"
|
|
172
|
+
command="toggle-popover"
|
|
173
|
+
variant="outlined"
|
|
174
|
+
>
|
|
175
|
+
Options
|
|
176
|
+
</Button>
|
|
177
|
+
<Menu
|
|
178
|
+
id="menu-basics-1"
|
|
179
|
+
items={[
|
|
180
|
+
{ label: "Edit", shortcut: "Ctrl+E" },
|
|
181
|
+
{ label: "Duplicate", shortcut: "Ctrl+D" },
|
|
182
|
+
{ disabled: true, label: "Archive" },
|
|
183
|
+
{ href: "/guide/getting-started/", label: "Help" },
|
|
184
|
+
{ borderTop: true, color: "critical", label: "Delete" },
|
|
185
|
+
]}
|
|
186
|
+
/>
|
|
187
|
+
</>
|
|
188
|
+
)
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Svelte
|
|
193
|
+
|
|
194
|
+
`import { Menu } from "opui-css/svelte"`
|
|
195
|
+
|
|
196
|
+
### Example: Basics
|
|
197
|
+
|
|
198
|
+
```svelte
|
|
199
|
+
<script lang="ts">
|
|
200
|
+
import { Button, Menu } from "opui-css/svelte"
|
|
201
|
+
</script>
|
|
202
|
+
|
|
203
|
+
<Button commandfor="menu-basics-1" command="toggle-popover" variant="outlined">
|
|
204
|
+
Options
|
|
205
|
+
</Button>
|
|
206
|
+
<Menu
|
|
207
|
+
id="menu-basics-1"
|
|
208
|
+
items={[
|
|
209
|
+
{ label: "Edit", shortcut: "Ctrl+E" },
|
|
210
|
+
{ label: "Duplicate", shortcut: "Ctrl+D" },
|
|
211
|
+
{ disabled: true, label: "Archive" },
|
|
212
|
+
{ href: "/guide/getting-started/", label: "Help" },
|
|
213
|
+
{ borderTop: true, color: "critical", label: "Delete" },
|
|
214
|
+
]}
|
|
215
|
+
/>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Vue
|
|
219
|
+
|
|
220
|
+
`import { Menu } from "opui-css/vue"`
|
|
221
|
+
|
|
222
|
+
### Example: Basics
|
|
223
|
+
|
|
224
|
+
```vue
|
|
225
|
+
<script setup lang="ts">
|
|
226
|
+
import { Button, Menu } from "opui-css/vue"
|
|
227
|
+
</script>
|
|
228
|
+
|
|
229
|
+
<template>
|
|
230
|
+
<Button
|
|
231
|
+
commandfor="menu-basics-1"
|
|
232
|
+
command="toggle-popover"
|
|
233
|
+
variant="outlined"
|
|
234
|
+
>
|
|
235
|
+
Options
|
|
236
|
+
</Button>
|
|
237
|
+
<Menu
|
|
238
|
+
id="menu-basics-1"
|
|
239
|
+
:items="[
|
|
240
|
+
{ label: 'Edit', shortcut: 'Ctrl+E' },
|
|
241
|
+
{ label: 'Duplicate', shortcut: 'Ctrl+D' },
|
|
242
|
+
{ disabled: true, label: 'Archive' },
|
|
243
|
+
{ href: '/guide/getting-started/', label: 'Help' },
|
|
244
|
+
{ borderTop: true, color: 'critical', label: 'Delete' },
|
|
245
|
+
]"
|
|
246
|
+
/>
|
|
247
|
+
</template>
|
|
248
|
+
```
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
See also: Spinner.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/progress.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/progress.md), [Astro](https://open-props-ui.netlify.app/astro/components/progress.md), [React](https://open-props-ui.netlify.app/react/components/progress.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/progress.md), [Vue](https://open-props-ui.netlify.app/vue/components/progress.md).
|
|
7
|
+
|
|
8
|
+
## Progress
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `.ui-progress` (root): Container element.
|
|
13
|
+
- `<progress>` (prop `value`, prop `max`): The progress bar.
|
|
14
|
+
|
|
15
|
+
### Props and modifiers
|
|
16
|
+
|
|
17
|
+
- `max`: `number | string`. The maximum value.
|
|
18
|
+
- `value`: `number | string`, `progress[value]`. The current value. Omit it for an indeterminate state.
|
|
19
|
+
- `variant`: `"filled"` (`.ui-filled`), `"tonal"` (default). The variant to use.
|
|
20
|
+
|
|
21
|
+
### Slots
|
|
22
|
+
|
|
23
|
+
- `default`: Fallback content inside the `<progress>`.
|
|
24
|
+
|
|
25
|
+
### Notes
|
|
26
|
+
|
|
27
|
+
- Astro, Svelte and Vue: Attributes that aren't props go to the `<progress>`, like `aria-busy`, `aria-label` and `id`, and `class` and `style` go to the root `<div>`.
|
|
28
|
+
- React: Attributes that aren't props go to the `<progress>`, like `aria-busy`, `aria-label` and `id`, and `className` and `style` go to the root `<div>`.
|
|
29
|
+
|
|
30
|
+
## Component properties
|
|
31
|
+
|
|
32
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
33
|
+
|
|
34
|
+
### progress.css
|
|
35
|
+
|
|
36
|
+
- `--_accent`: Color of the bar. Defaults to `--ui-primary`.
|
|
37
|
+
- `--_bg-color`: Color of the track. `--ui-track-bg-color` when the theme sets it, otherwise `--ui-surface-tonal`; `.ui-filled` sets it to `--ui-surface-filled`.
|
|
38
|
+
- `--_ease`: Easing of the value transition. Defaults to `--ui-ease-enter`.
|
|
39
|
+
- `--_loop-duration`: Length of one cycle of the indeterminate animation, and of the pulse that replaces it when `--_motion` is `0`. `2s` by default, multiplied by `--_motion`.
|
|
40
|
+
- `--_motion`: Motion multiplier for the value transition and the indeterminate animation.
|
|
41
|
+
|
|
42
|
+
Outputs: `--_duration`.
|
|
43
|
+
|
|
44
|
+
## Theme tokens
|
|
45
|
+
|
|
46
|
+
The stylesheets read `--ui-border-width`, `--ui-duration`, `--ui-ease-enter`, `--ui-field-border-color`, `--ui-motion`, `--ui-primary`, `--ui-radius`, `--ui-space-1`, `--ui-surface-filled`, `--ui-surface-tonal` and `--ui-track-bg-color`. `theming.md` and `tokens.json` describe them.
|
|
47
|
+
|
|
48
|
+
## HTML
|
|
49
|
+
|
|
50
|
+
### Example: Indeterminate
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<div class="ui-progress">
|
|
54
|
+
<progress aria-label="Loading"></progress>
|
|
55
|
+
</div>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Astro
|
|
59
|
+
|
|
60
|
+
`import { Progress } from "opui-css/astro"`
|
|
61
|
+
|
|
62
|
+
### Example: Indeterminate
|
|
63
|
+
|
|
64
|
+
```astro
|
|
65
|
+
---
|
|
66
|
+
import { Progress } from "opui-css/astro"
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
<Progress aria-label="Loading" />
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## React
|
|
73
|
+
|
|
74
|
+
`import { Progress } from "opui-css/react"`
|
|
75
|
+
|
|
76
|
+
### Example: Indeterminate
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import { Progress } from "opui-css/react"
|
|
80
|
+
|
|
81
|
+
export default function Indeterminate() {
|
|
82
|
+
return <Progress aria-label="Loading" />
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Svelte
|
|
87
|
+
|
|
88
|
+
`import { Progress } from "opui-css/svelte"`
|
|
89
|
+
|
|
90
|
+
### Example: Indeterminate
|
|
91
|
+
|
|
92
|
+
```svelte
|
|
93
|
+
<script lang="ts">
|
|
94
|
+
import { Progress } from "opui-css/svelte"
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<Progress aria-label="Loading" />
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Vue
|
|
101
|
+
|
|
102
|
+
`import { Progress } from "opui-css/vue"`
|
|
103
|
+
|
|
104
|
+
### Example: Indeterminate
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
import { Progress } from "opui-css/vue"
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<template>
|
|
112
|
+
<Progress aria-label="Loading" />
|
|
113
|
+
</template>
|
|
114
|
+
```
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
# Radio
|
|
2
|
+
|
|
3
|
+
See also: Form documentation.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/radio.css`, `opui-css/css/components/choice.css`, `opui-css/css/components/form.css` and `opui-css/css/components/card.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/radio.md), [Astro](https://open-props-ui.netlify.app/astro/components/radio.md), [React](https://open-props-ui.netlify.app/react/components/radio.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/radio.md), [Vue](https://open-props-ui.netlify.app/vue/components/radio.md).
|
|
7
|
+
- The docs page also documents `FieldGroup`, see `form.md`.
|
|
8
|
+
|
|
9
|
+
## Radio
|
|
10
|
+
|
|
11
|
+
### Parts
|
|
12
|
+
|
|
13
|
+
- `label.ui-radio` (root): Container element.
|
|
14
|
+
- `<input>` (model): The radio input.
|
|
15
|
+
- `.ui-label` (prop `label`, slot `default`): The label.
|
|
16
|
+
- `.ui-end-text` (prop `endText`, slot `end-text`): Supporting text displayed below the label.
|
|
17
|
+
|
|
18
|
+
### Props and modifiers
|
|
19
|
+
|
|
20
|
+
- `card`: `boolean`, `.ui-card`. Renders the radio as a card: a padded, outlined surface that tints when hovered and when checked, with the label and `endText` inside. Add `spread` to put the input at the end, and `variant` to change the surface.
|
|
21
|
+
- `disabled`: `boolean`, `input[aria-disabled="true"]`, `input[disabled]`. Dims the radio and shows a not-allowed cursor. `aria-disabled="true"` looks the same, but keeps the radio focusable and its value in the form, and doesn't stop the change, so block it with a script.
|
|
22
|
+
- `error`: `boolean`, `input[aria-invalid="true"]`. Marks the control invalid and shows error styles.
|
|
23
|
+
- `hideLabel`: `boolean`, `.ui-radio > span.ui-sr-only`. Visually hides the label, `.ui-sr-only` instead of `.ui-label`.
|
|
24
|
+
- `id`: `string`. The id of the `<input>`.
|
|
25
|
+
- `name`: `string`. The name of the `<input>`. Inside a `FieldGroup`, the group's `name` applies.
|
|
26
|
+
- `orientation`: `"horizontal"` (default), `"vertical"` (`.ui-vertical`). The orientation of the element. `vertical` stacks the label under the input.
|
|
27
|
+
- `required`: `boolean`, `input[required]`. Adds a required mark after the label. The form won't submit until one radio in the group is checked.
|
|
28
|
+
- `size`: `"large"` (`.ui-large`), `"medium"` (default), `"small"` (`.ui-small`), `"x-small"` (`.ui-x-small`). The size of the element.
|
|
29
|
+
- `spread`: `boolean`, `.ui-spread`. Pushes the label and the input to opposite ends.
|
|
30
|
+
- `value`: `string`. The value of the `<input>`, submitted with the form when it's checked.
|
|
31
|
+
- `variant`: `"elevated"` (`.ui-elevated`), `"outlined"` (default), `"tonal"` (`.ui-tonal`). The surface of the card, with `card`. `outlined` has a border, `tonal` a tinted surface and `elevated` a shadow, like Card.
|
|
32
|
+
|
|
33
|
+
Model: `value` (`string | number | boolean`), the selected value of the group. Astro and React `value`, Svelte `bind:group`, Vue `v-model`.
|
|
34
|
+
|
|
35
|
+
### Notes
|
|
36
|
+
|
|
37
|
+
- Astro and Vue: Attributes that aren't props go to the `<input>`, like `autofocus` and `form`, and `class` and `style` go to the root `<label>`. To hide the label, set `hideLabel` and keep the text in `label` or the slot.
|
|
38
|
+
- React: Attributes that aren't props go to the `<input>`, like `autofocus` and `form`, and `className` and `style` go to the root `<label>`. To hide the label, set `hideLabel` and keep the text in `label` or `children`. Use `checked` with `onChange` on each radio, or `defaultChecked`.
|
|
39
|
+
- Svelte: Attributes that aren't props go to the `<input>`, like `autofocus` and `form`, and `class` and `style` go to the root `<label>`. To hide the label, set `hideLabel` and keep the text in `label` or `children`.
|
|
40
|
+
|
|
41
|
+
## RadioInput
|
|
42
|
+
|
|
43
|
+
### Parts
|
|
44
|
+
|
|
45
|
+
- `<input type="radio">` (root): The radio input, without a label.
|
|
46
|
+
|
|
47
|
+
Model: `value` (`string | number | boolean`), the selected value of the group. Astro and React `value`, Svelte `bind:group`, Vue `v-model`.
|
|
48
|
+
|
|
49
|
+
### Notes
|
|
50
|
+
|
|
51
|
+
- Astro, React, Svelte and Vue: The radio `<input>` without the label, for a custom layout inside a `label.ui-radio`, such as the end of a `ListItem` with `type="radio"`. Attributes that aren't props go to the `<input>`. Inside a `FieldGroup`, it takes the group's `name`.
|
|
52
|
+
|
|
53
|
+
## Component properties
|
|
54
|
+
|
|
55
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
56
|
+
|
|
57
|
+
### radio.css
|
|
58
|
+
|
|
59
|
+
- `--_accent`: Fill and border of the checked circle. `SelectedItem` in forced colors.
|
|
60
|
+
- `--_on-accent`: Color of the dot on `--_accent`. `SelectedItemText` in forced colors.
|
|
61
|
+
|
|
62
|
+
Outputs: `--_dot-radius`.
|
|
63
|
+
|
|
64
|
+
### choice.css
|
|
65
|
+
|
|
66
|
+
- `--_accent`: Fill and border of the checked input. `--ui-choice-accent` when the theme sets it, otherwise `--ui-primary` with its lightness capped in dark mode, and `--ui-invalid` when invalid.
|
|
67
|
+
- `--_card-padding`: Padding of `.ui-card`. `--ui-space-3`, and `--ui-space-2` in `.ui-small` and `.ui-x-small`.
|
|
68
|
+
- `--_checked-bg-color`: Background of a checked `.ui-card`. `--ui-primary-tonal` when the theme sets it, otherwise `--ui-primary` at `--ui-state-active-alpha-accent`.
|
|
69
|
+
- `--_ease`: Easing of the transitions. Defaults to `--ui-ease`.
|
|
70
|
+
- `--_hover-bg-color`: Background of a hovered `.ui-card`. Defaults to `--ui-surface-tonal-hover`.
|
|
71
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
72
|
+
- `--_on-accent`: Color of the checkmark, dash and dots on `--_accent`. `--ui-choice-on-accent` when the theme sets it, otherwise `--ui-on-primary`, or `--ui-on-fill` in dark mode. `--ui-on-fill` when invalid.
|
|
73
|
+
- `--_ripple-size`: Size of the hover ripple of checkboxes and radios, relative to the input. Set on `input`.
|
|
74
|
+
- `--_size`: Width and height of the checkbox and radio input, which the label centers on. Defaults to `--ui-choice-size`, set by the size classes. `switch.css` sets it to the track height.
|
|
75
|
+
|
|
76
|
+
Outputs: `--_bg-color`, `--_border-color`, `--_border-width`, `--_duration`, `--_shadow` and `--_thumb-scale`.
|
|
77
|
+
|
|
78
|
+
### card.css
|
|
79
|
+
|
|
80
|
+
- `--_ease`: Easing of the focus ring animation. Defaults to `--ui-ease`.
|
|
81
|
+
- `--_elevated-bg-color`: Background of `.ui-elevated`. Defaults to `--ui-surface-elevated`.
|
|
82
|
+
- `--_elevated-shadow`: Shadow of `.ui-elevated`. Defaults to `--ui-shadow-elevated`.
|
|
83
|
+
- `--_motion`: Motion multiplier for the focus ring animation. `0` turns it off.
|
|
84
|
+
- `--_outlined-border-color`: Border color of `.ui-outlined`. Defaults to `--ui-border-color`.
|
|
85
|
+
- `--_padding`: Padding of the header, content and actions. `--ui-card-padding`, or `--ui-space-3` when a theme leaves it unset.
|
|
86
|
+
- `--_surface-bg-color`: Background of default and `.ui-outlined` cards, and border color of `.ui-tonal` and `.ui-elevated` unless a theme sets `--ui-border-color-raised`. Defaults to `--ui-surface`.
|
|
87
|
+
- `--_tonal-bg-color`: Background of `.ui-tonal`. Defaults to `--ui-surface-tonal`.
|
|
88
|
+
|
|
89
|
+
Outputs: `--_bg-color`, `--_border-color`, `--_border-width`, `--_duration` and `--_shadow`.
|
|
90
|
+
|
|
91
|
+
## Theme tokens
|
|
92
|
+
|
|
93
|
+
The stylesheets read `--ui-border-color`, `--ui-border-color-on-raised`, `--ui-border-color-raised`, `--ui-border-width`, `--ui-card-padding`, `--ui-choice-accent`, `--ui-choice-border-color`, `--ui-choice-fill-max-lightness`, `--ui-choice-label-offset`, `--ui-choice-on-accent`, `--ui-choice-ripple-bg-color`, `--ui-choice-size`, `--ui-choice-size-large`, `--ui-choice-size-small`, `--ui-choice-size-x-small`, `--ui-control-accent`, `--ui-disabled-opacity`, `--ui-duration`, `--ui-ease`, `--ui-field-border-color`, `--ui-field-border-color-on-raised`, `--ui-field-border-width`, `--ui-field-helper-font-size`, `--ui-field-helper-line-height`, `--ui-field-helper-text-color`, `--ui-field-label-font-size`, `--ui-field-label-font-weight`, `--ui-field-label-text-color`, `--ui-field-required-text-color`, `--ui-focus-ring-color`, `--ui-focus-ring-offset`, `--ui-focus-ring-style`, `--ui-focus-ring-width`, `--ui-font-size-body`, `--ui-font-size-caption`, `--ui-invalid`, `--ui-invalid-text`, `--ui-line-height-control`, `--ui-line-height-tight`, `--ui-motion`, `--ui-on-control-accent`, `--ui-on-fill`, `--ui-on-primary`, `--ui-primary`, `--ui-primary-tonal`, `--ui-radius`, `--ui-radius-round`, `--ui-shadow-elevated`, `--ui-shadow-surface`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-space-4`, `--ui-space-5`, `--ui-state-active-alpha-accent`, `--ui-state-hover-alpha-accent`, `--ui-surface`, `--ui-surface-elevated`, `--ui-surface-tonal`, `--ui-surface-tonal-hover`, `--ui-switch-thumb-size-large`, `--ui-switch-thumb-size-small`, `--ui-switch-thumb-size-x-small`, `--ui-switch-track-block-size-large`, `--ui-switch-track-block-size-small`, `--ui-switch-track-block-size-x-small`, `--ui-switch-track-inline-size-large`, `--ui-switch-track-inline-size-small`, `--ui-switch-track-inline-size-x-small`, `--ui-text` and `--ui-text-strong`. `theming.md` and `tokens.json` describe them.
|
|
94
|
+
|
|
95
|
+
## HTML
|
|
96
|
+
|
|
97
|
+
### Example: Basics
|
|
98
|
+
|
|
99
|
+
```html
|
|
100
|
+
<form class="ui-form">
|
|
101
|
+
<fieldset class="ui-fieldset">
|
|
102
|
+
<legend>Legend</legend>
|
|
103
|
+
<div class="ui-field-group">
|
|
104
|
+
<label class="ui-radio">
|
|
105
|
+
<input name="radio-group" type="radio" value="1" checked />
|
|
106
|
+
<span class="ui-label">Radio 1</span>
|
|
107
|
+
</label>
|
|
108
|
+
<label class="ui-radio">
|
|
109
|
+
<input name="radio-group" type="radio" value="2" />
|
|
110
|
+
<span class="ui-label">Radio 2</span>
|
|
111
|
+
</label>
|
|
112
|
+
<label class="ui-radio">
|
|
113
|
+
<input name="radio-group" type="radio" value="3" />
|
|
114
|
+
<span class="ui-label">Radio 3</span>
|
|
115
|
+
</label>
|
|
116
|
+
</div>
|
|
117
|
+
</fieldset>
|
|
118
|
+
</form>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
## Astro
|
|
122
|
+
|
|
123
|
+
`import { Radio, RadioInput } from "opui-css/astro"`
|
|
124
|
+
|
|
125
|
+
- `Radio` named slots: `end-text`. Fill one with `slot="end-text"` on a child.
|
|
126
|
+
|
|
127
|
+
### Example: Basics
|
|
128
|
+
|
|
129
|
+
```astro
|
|
130
|
+
---
|
|
131
|
+
import { FieldGroup, FieldLegend, Fieldset, Form, Radio } from "opui-css/astro"
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
<Form>
|
|
135
|
+
<Fieldset>
|
|
136
|
+
<FieldLegend>Legend</FieldLegend>
|
|
137
|
+
<FieldGroup name="radio-group">
|
|
138
|
+
<Radio value="1" checked>Radio 1</Radio>
|
|
139
|
+
<Radio value="2">Radio 2</Radio>
|
|
140
|
+
<Radio value="3">Radio 3</Radio>
|
|
141
|
+
</FieldGroup>
|
|
142
|
+
</Fieldset>
|
|
143
|
+
</Form>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## React
|
|
147
|
+
|
|
148
|
+
`import { Radio, RadioInput } from "opui-css/react"`
|
|
149
|
+
|
|
150
|
+
- `Radio` slot props (`ReactNode`): `children` and `endText`.
|
|
151
|
+
- Client components (`"use client"`): `RadioInput`.
|
|
152
|
+
|
|
153
|
+
### Example: Basics
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import { FieldGroup, FieldLegend, Fieldset, Form, Radio } from "opui-css/react"
|
|
157
|
+
|
|
158
|
+
export default function Basics() {
|
|
159
|
+
return (
|
|
160
|
+
<Form>
|
|
161
|
+
<Fieldset>
|
|
162
|
+
<FieldLegend>Legend</FieldLegend>
|
|
163
|
+
<FieldGroup name="radio-group">
|
|
164
|
+
<Radio value="1" defaultChecked>
|
|
165
|
+
Radio 1
|
|
166
|
+
</Radio>
|
|
167
|
+
<Radio value="2">Radio 2</Radio>
|
|
168
|
+
<Radio value="3">Radio 3</Radio>
|
|
169
|
+
</FieldGroup>
|
|
170
|
+
</Fieldset>
|
|
171
|
+
</Form>
|
|
172
|
+
)
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Svelte
|
|
177
|
+
|
|
178
|
+
`import { Radio, RadioInput } from "opui-css/svelte"`
|
|
179
|
+
|
|
180
|
+
- `Radio` slot snippets: `children` and `endText`.
|
|
181
|
+
- Hydration: `bind:group` on `Radio` and `RadioInput`. The bound value only updates on the client. The native control still changes and submits with its form. Without hydration: Read the value from the form instead.
|
|
182
|
+
|
|
183
|
+
### Example: Basics
|
|
184
|
+
|
|
185
|
+
```svelte
|
|
186
|
+
<script lang="ts">
|
|
187
|
+
import {
|
|
188
|
+
FieldGroup,
|
|
189
|
+
FieldLegend,
|
|
190
|
+
Fieldset,
|
|
191
|
+
Form,
|
|
192
|
+
Radio,
|
|
193
|
+
} from "opui-css/svelte"
|
|
194
|
+
</script>
|
|
195
|
+
|
|
196
|
+
<Form>
|
|
197
|
+
<Fieldset>
|
|
198
|
+
<FieldLegend>Legend</FieldLegend>
|
|
199
|
+
<FieldGroup name="radio-group">
|
|
200
|
+
<Radio value="1" checked>Radio 1</Radio>
|
|
201
|
+
<Radio value="2">Radio 2</Radio>
|
|
202
|
+
<Radio value="3">Radio 3</Radio>
|
|
203
|
+
</FieldGroup>
|
|
204
|
+
</Fieldset>
|
|
205
|
+
</Form>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Vue
|
|
209
|
+
|
|
210
|
+
`import { Radio, RadioInput } from "opui-css/vue"`
|
|
211
|
+
|
|
212
|
+
- `Radio` named slots: `end-text`. Fill one with `<template #end-text>`.
|
|
213
|
+
- Hydration: `v-model` on `Radio` and `RadioInput`. The bound value only updates on the client. The native control still changes and submits with its form. Without hydration: Read the value from the form instead.
|
|
214
|
+
|
|
215
|
+
### Example: Basics
|
|
216
|
+
|
|
217
|
+
```vue
|
|
218
|
+
<script setup lang="ts">
|
|
219
|
+
import { FieldGroup, FieldLegend, Fieldset, Form, Radio } from "opui-css/vue"
|
|
220
|
+
</script>
|
|
221
|
+
|
|
222
|
+
<template>
|
|
223
|
+
<Form>
|
|
224
|
+
<Fieldset>
|
|
225
|
+
<FieldLegend>Legend</FieldLegend>
|
|
226
|
+
<FieldGroup name="radio-group">
|
|
227
|
+
<Radio value="1" checked>Radio 1</Radio>
|
|
228
|
+
<Radio value="2">Radio 2</Radio>
|
|
229
|
+
<Radio value="3">Radio 3</Radio>
|
|
230
|
+
</FieldGroup>
|
|
231
|
+
</Fieldset>
|
|
232
|
+
</Form>
|
|
233
|
+
</template>
|
|
234
|
+
```
|