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,257 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
The Tabs are radio inputs and the Panels are just divs that show and hide based on the radio inputs' :checked state. Use Tabs to switch between panels of content. To pick an option, like a list or grid view, use a Toggle group.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/tabs.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/tabs.md), [Astro](https://open-props-ui.netlify.app/astro/components/tabs.md), [React](https://open-props-ui.netlify.app/react/components/tabs.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/tabs.md), [Vue](https://open-props-ui.netlify.app/vue/components/tabs.md).
|
|
7
|
+
|
|
8
|
+
## Tabs
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `.ui-tabs` (root): Container element.
|
|
13
|
+
- `.ui-input` (`TabsItem`): A visually hidden radio input that holds a tab's state. The tab is its label.
|
|
14
|
+
- `.ui-label` (`TabsLabel`): A tab.
|
|
15
|
+
- `.ui-panel` (`TabsPanel`): The panel of the selected tab.
|
|
16
|
+
|
|
17
|
+
### Props and modifiers
|
|
18
|
+
|
|
19
|
+
- `defaultValue` (React): `string`. The `value` of the tab selected at the start, when `value` is omitted.
|
|
20
|
+
- `name`: `string`, `.ui-input[name]`. The name shared by the tab inputs. Generated when omitted.
|
|
21
|
+
- `onValueChange` (React): `(value: string) => void`. Called with the `value` of the tab when one is selected.
|
|
22
|
+
- `overflow`: `"scroll"` (`.ui-overflow-scroll`), `"wrap"` (default). What the tabs do when they don't fit. `"wrap"` wraps them onto more rows, and `"scroll"` keeps them on one row and scrolls it sideways.
|
|
23
|
+
- `value` (Astro and React): `string`. The `value` of the selected tab. The item whose `value` matches is checked, and the items' own `checked` is ignored.
|
|
24
|
+
- `variant`: `"filled"` (`.ui-filled`), `"line"` (`.ui-line`), `"outlined"` (`.ui-outlined`), `"tonal"` (default). The variant to use. The default `tonal` tabs sit on a tonal track and the selected tab is a raised pill.
|
|
25
|
+
|
|
26
|
+
### Slots
|
|
27
|
+
|
|
28
|
+
- `default`: The tab items.
|
|
29
|
+
|
|
30
|
+
Model: `value` (`string`), the `value` of the selected tab. Astro and React `value`, Svelte `bind:value`, Vue `v-model`.
|
|
31
|
+
|
|
32
|
+
### Notes
|
|
33
|
+
|
|
34
|
+
- HTML: Each tab is three elements, in this order: `input.ui-input[type="radio"]`, `label.ui-label` and `.ui-panel`.
|
|
35
|
+
- Astro: `value` selects the item whose `value` matches on the server. After that the selection lives in the inputs: read it from the form, or listen for `change` in a script.
|
|
36
|
+
- React: Use `value` with `onValueChange`, or `defaultValue`. Without them the items keep their own state, and `onValueChange` still reports changes.
|
|
37
|
+
- Svelte: Bind `value` with a starting value to control the selection. Without it, or bound to `undefined`, the items keep their own state.
|
|
38
|
+
- Vue: Bind `v-model` with a starting value to control the selection. Without it, or bound to `undefined`, the items keep their own state.
|
|
39
|
+
|
|
40
|
+
## TabsItem
|
|
41
|
+
|
|
42
|
+
### Parts
|
|
43
|
+
|
|
44
|
+
- `input.ui-input` (root): The radio input for a tab, followed by the tab and the panel.
|
|
45
|
+
|
|
46
|
+
### Props and modifiers
|
|
47
|
+
|
|
48
|
+
- `checked`: `boolean`, `[checked]`. Selects the tab.
|
|
49
|
+
- `id`: `string`, `[id]`. The id of the input. Generated when omitted.
|
|
50
|
+
- `name`: `string`. Overrides the name shared by the tab inputs.
|
|
51
|
+
- `value`: `string`, `[value]`. The value of the input. The tab is selected while it matches the `value` of `Tabs`.
|
|
52
|
+
|
|
53
|
+
### Slots
|
|
54
|
+
|
|
55
|
+
- `default`: The tab and the panel.
|
|
56
|
+
|
|
57
|
+
### Notes
|
|
58
|
+
|
|
59
|
+
- React: `defaultChecked` selects the starting tab. A tab that loses its check to another one fires no `onChange` of its own, so to control the tabs, give each item a `value` and set `value` with `onValueChange` on `Tabs`. The `Tabs` value then wins and an item's own `checked` and `defaultChecked` are ignored.
|
|
60
|
+
- Svelte: `checked` selects the starting tab. A tab that loses its check to another one fires no `change` of its own, so to control the tabs, give each item a `value` and bind `value` on `Tabs`. The `Tabs` value then wins and an item's own `checked` is ignored.
|
|
61
|
+
- Vue: `checked` selects the starting tab. A tab that loses its check to another one fires no `change` of its own, so to control the tabs, give each item a `value` and bind `v-model` on `Tabs`. The `Tabs` value then wins and an item's own `checked` is ignored.
|
|
62
|
+
|
|
63
|
+
## TabsLabel
|
|
64
|
+
|
|
65
|
+
### Parts
|
|
66
|
+
|
|
67
|
+
- `label.ui-label` (root): The tab.
|
|
68
|
+
|
|
69
|
+
### Props and modifiers
|
|
70
|
+
|
|
71
|
+
- `for` (Astro, Svelte and Vue): `string`, `[for]`. The id of the input it labels. Set by the item.
|
|
72
|
+
- `htmlFor` (React): `string`. The id of the input it labels, as `htmlFor` like on the element. Set by the item.
|
|
73
|
+
|
|
74
|
+
### Slots
|
|
75
|
+
|
|
76
|
+
- `default`: The tab label.
|
|
77
|
+
|
|
78
|
+
## TabsPanel
|
|
79
|
+
|
|
80
|
+
### Parts
|
|
81
|
+
|
|
82
|
+
- `.ui-panel` (root): The panel.
|
|
83
|
+
|
|
84
|
+
### Slots
|
|
85
|
+
|
|
86
|
+
- `default`: The panel content.
|
|
87
|
+
|
|
88
|
+
## Component properties
|
|
89
|
+
|
|
90
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
91
|
+
|
|
92
|
+
### tabs.css
|
|
93
|
+
|
|
94
|
+
- `--_ease`: Easing of the transitions and focus ring. Defaults to `--ui-ease`.
|
|
95
|
+
- `--_indicator-bg-color`: Color of the line under the selected tab. `transparent` unless `.ui-line`, which reads `--ui-tabs-accent` and falls back to `--ui-text-strong`.
|
|
96
|
+
- `--_indicator-size`: Thickness of the line under the selected tab.
|
|
97
|
+
- `--_inset`: Gap between the track edge and the selected tab's background. `0px` in `.ui-line`.
|
|
98
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
99
|
+
- `--_radius`: Corner radius of the track. The selected tab's radius is reduced by `--_inset` and `--_track-border-width`.
|
|
100
|
+
- `--_selected-bg-color`: Background of the selected tab. Defaults to `--ui-surface`, a translucent white in dark mode; the variant classes set it.
|
|
101
|
+
- `--_selected-border-color`: Border color of the selected tab. `--ui-control-border-color`, or `--ui-field-border-color` when the theme doesn't set it, so the pill reaches 3:1 against the track; the variant classes set it to `transparent`.
|
|
102
|
+
- `--_selected-shadow`: Shadow of the selected tab. Defaults to `--ui-shadow-selected`. `.ui-line` and `.ui-outlined` remove it.
|
|
103
|
+
- `--_selected-text-color`: Text color of the selected tab. Defaults to `--ui-tabs-accent`, or `--ui-text-strong` when a theme leaves it unset. `.ui-filled` sets it to `--ui-on-selected-strong`.
|
|
104
|
+
- `--_text-color`: Text color of the unselected tabs. Defaults to `--ui-text-subtle`.
|
|
105
|
+
- `--_track-bg-color`: Background of the track behind the tabs. Defaults to `--ui-surface-tonal`.
|
|
106
|
+
- `--_track-border-color`: Border color of the track. `.ui-outlined` sets it to `--ui-control-border-color`, or `--ui-border-color` when the theme doesn't set it.
|
|
107
|
+
- `--_track-border-width`: Border width of the track. `0px` in `.ui-line`.
|
|
108
|
+
|
|
109
|
+
Outputs: `--_duration` and `--_focus-ring-duration`.
|
|
110
|
+
|
|
111
|
+
## Theme tokens
|
|
112
|
+
|
|
113
|
+
The stylesheets read `--ui-border-color`, `--ui-border-width`, `--ui-border-width-thick`, `--ui-control-border-color`, `--ui-duration`, `--ui-duration-fast`, `--ui-ease`, `--ui-field-border-color`, `--ui-focus-ring-color`, `--ui-focus-ring-inset`, `--ui-focus-ring-offset`, `--ui-focus-ring-style`, `--ui-focus-ring-width`, `--ui-font-size-control`, `--ui-font-weight-medium`, `--ui-line-height-relaxed`, `--ui-motion`, `--ui-on-selected-strong`, `--ui-radius`, `--ui-selected-strong`, `--ui-shadow-selected`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-state-hover-alpha-dark`, `--ui-surface`, `--ui-surface-tonal`, `--ui-tabs-accent`, `--ui-text-strong` and `--ui-text-subtle`. `theming.md` and `tokens.json` describe them.
|
|
114
|
+
|
|
115
|
+
## HTML
|
|
116
|
+
|
|
117
|
+
### Example: Basics
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<div class="ui-tabs">
|
|
121
|
+
<input
|
|
122
|
+
type="radio"
|
|
123
|
+
name="basic-tabs"
|
|
124
|
+
id="tabs-basics-1"
|
|
125
|
+
class="ui-input"
|
|
126
|
+
checked
|
|
127
|
+
/>
|
|
128
|
+
<label for="tabs-basics-1" class="ui-label">Profile</label>
|
|
129
|
+
<div class="ui-panel">Profile settings and information.</div>
|
|
130
|
+
|
|
131
|
+
<input type="radio" name="basic-tabs" id="tabs-basics-2" class="ui-input" />
|
|
132
|
+
<label for="tabs-basics-2" class="ui-label">Settings</label>
|
|
133
|
+
<div class="ui-panel">General account settings.</div>
|
|
134
|
+
|
|
135
|
+
<input type="radio" name="basic-tabs" id="tabs-basics-3" class="ui-input" />
|
|
136
|
+
<label for="tabs-basics-3" class="ui-label">Notifications</label>
|
|
137
|
+
<div class="ui-panel">Manage your notifications.</div>
|
|
138
|
+
</div>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Astro
|
|
142
|
+
|
|
143
|
+
`import { Tabs, TabsItem, TabsLabel, TabsPanel } from "opui-css/astro"`
|
|
144
|
+
|
|
145
|
+
### Example: Basics
|
|
146
|
+
|
|
147
|
+
```astro
|
|
148
|
+
---
|
|
149
|
+
import { Tabs, TabsItem, TabsLabel, TabsPanel } from "opui-css/astro"
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
<Tabs name="basic-tabs">
|
|
153
|
+
<TabsItem checked>
|
|
154
|
+
<TabsLabel>Profile</TabsLabel>
|
|
155
|
+
<TabsPanel>Profile settings and information.</TabsPanel>
|
|
156
|
+
</TabsItem>
|
|
157
|
+
<TabsItem>
|
|
158
|
+
<TabsLabel>Settings</TabsLabel>
|
|
159
|
+
<TabsPanel>General account settings.</TabsPanel>
|
|
160
|
+
</TabsItem>
|
|
161
|
+
<TabsItem>
|
|
162
|
+
<TabsLabel>Notifications</TabsLabel>
|
|
163
|
+
<TabsPanel>Manage your notifications.</TabsPanel>
|
|
164
|
+
</TabsItem>
|
|
165
|
+
</Tabs>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## React
|
|
169
|
+
|
|
170
|
+
`import { Tabs, TabsItem, TabsLabel, TabsPanel } from "opui-css/react"`
|
|
171
|
+
|
|
172
|
+
- Client components (`"use client"`): `Tabs`, `TabsItem` and `TabsLabel`.
|
|
173
|
+
|
|
174
|
+
### Example: Basics
|
|
175
|
+
|
|
176
|
+
```tsx
|
|
177
|
+
import { Tabs, TabsItem, TabsLabel, TabsPanel } from "opui-css/react"
|
|
178
|
+
|
|
179
|
+
export default function Basics() {
|
|
180
|
+
return (
|
|
181
|
+
<Tabs name="basic-tabs">
|
|
182
|
+
<TabsItem defaultChecked>
|
|
183
|
+
<TabsLabel>Profile</TabsLabel>
|
|
184
|
+
<TabsPanel>Profile settings and information.</TabsPanel>
|
|
185
|
+
</TabsItem>
|
|
186
|
+
<TabsItem>
|
|
187
|
+
<TabsLabel>Settings</TabsLabel>
|
|
188
|
+
<TabsPanel>General account settings.</TabsPanel>
|
|
189
|
+
</TabsItem>
|
|
190
|
+
<TabsItem>
|
|
191
|
+
<TabsLabel>Notifications</TabsLabel>
|
|
192
|
+
<TabsPanel>Manage your notifications.</TabsPanel>
|
|
193
|
+
</TabsItem>
|
|
194
|
+
</Tabs>
|
|
195
|
+
)
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Svelte
|
|
200
|
+
|
|
201
|
+
`import { Tabs, TabsItem, TabsLabel, TabsPanel } from "opui-css/svelte"`
|
|
202
|
+
|
|
203
|
+
- Hydration: `bind:value` on `Tabs`. 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.
|
|
204
|
+
|
|
205
|
+
### Example: Basics
|
|
206
|
+
|
|
207
|
+
```svelte
|
|
208
|
+
<script lang="ts">
|
|
209
|
+
import { Tabs, TabsItem, TabsLabel, TabsPanel } from "opui-css/svelte"
|
|
210
|
+
</script>
|
|
211
|
+
|
|
212
|
+
<Tabs name="basic-tabs">
|
|
213
|
+
<TabsItem checked>
|
|
214
|
+
<TabsLabel>Profile</TabsLabel>
|
|
215
|
+
<TabsPanel>Profile settings and information.</TabsPanel>
|
|
216
|
+
</TabsItem>
|
|
217
|
+
<TabsItem>
|
|
218
|
+
<TabsLabel>Settings</TabsLabel>
|
|
219
|
+
<TabsPanel>General account settings.</TabsPanel>
|
|
220
|
+
</TabsItem>
|
|
221
|
+
<TabsItem>
|
|
222
|
+
<TabsLabel>Notifications</TabsLabel>
|
|
223
|
+
<TabsPanel>Manage your notifications.</TabsPanel>
|
|
224
|
+
</TabsItem>
|
|
225
|
+
</Tabs>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Vue
|
|
229
|
+
|
|
230
|
+
`import { Tabs, TabsItem, TabsLabel, TabsPanel } from "opui-css/vue"`
|
|
231
|
+
|
|
232
|
+
- Hydration: `v-model` on `Tabs`. 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.
|
|
233
|
+
|
|
234
|
+
### Example: Basics
|
|
235
|
+
|
|
236
|
+
```vue
|
|
237
|
+
<script setup lang="ts">
|
|
238
|
+
import { Tabs, TabsItem, TabsLabel, TabsPanel } from "opui-css/vue"
|
|
239
|
+
</script>
|
|
240
|
+
|
|
241
|
+
<template>
|
|
242
|
+
<Tabs name="basic-tabs">
|
|
243
|
+
<TabsItem checked>
|
|
244
|
+
<TabsLabel>Profile</TabsLabel>
|
|
245
|
+
<TabsPanel>Profile settings and information.</TabsPanel>
|
|
246
|
+
</TabsItem>
|
|
247
|
+
<TabsItem>
|
|
248
|
+
<TabsLabel>Settings</TabsLabel>
|
|
249
|
+
<TabsPanel>General account settings.</TabsPanel>
|
|
250
|
+
</TabsItem>
|
|
251
|
+
<TabsItem>
|
|
252
|
+
<TabsLabel>Notifications</TabsLabel>
|
|
253
|
+
<TabsPanel>Manage your notifications.</TabsPanel>
|
|
254
|
+
</TabsItem>
|
|
255
|
+
</Tabs>
|
|
256
|
+
</template>
|
|
257
|
+
```
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# Text field
|
|
2
|
+
|
|
3
|
+
An input for single-line text data. Basic text fields with labels, field descriptions, and validation states.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/text-field.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/text-field.md), [Astro](https://open-props-ui.netlify.app/astro/components/text-field.md), [React](https://open-props-ui.netlify.app/react/components/text-field.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/text-field.md), [Vue](https://open-props-ui.netlify.app/vue/components/text-field.md).
|
|
7
|
+
|
|
8
|
+
## TextField
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `label.ui-text-field` (root): Container element.
|
|
13
|
+
- `.ui-label` (prop `label`, slot `label`): The label for the field.
|
|
14
|
+
- `.ui-start-text` (prop `startText`, slot `start-text`): Start text displayed above the field.
|
|
15
|
+
- `.ui-field`: The boxed input area.
|
|
16
|
+
- `.ui-field > .ui-top` (slot `top`): Content above the input, inside the border, with a divider.
|
|
17
|
+
- `.ui-field > .ui-start` (slot `start`): Content at the inline-start of the field, inside the border.
|
|
18
|
+
- `<input>` (model): The input element.
|
|
19
|
+
- `.ui-field > .ui-end` (slot `end`): Content at the inline-end of the field, inside the border.
|
|
20
|
+
- `.ui-field > .ui-bottom` (slot `bottom`): Content below the input, inside the border, with a divider.
|
|
21
|
+
- `.ui-end-text` (prop `endText`, slot `end-text`): Supporting text displayed below the field.
|
|
22
|
+
|
|
23
|
+
### Props and modifiers
|
|
24
|
+
|
|
25
|
+
- `autoFit`: `boolean`, `.ui-auto-fit`. Lets the width follow the content, from `25ch`.
|
|
26
|
+
- `disabled`: `boolean`, `input[disabled]`. Dims the field and blocks input.
|
|
27
|
+
- `error`: `boolean`, `input[aria-invalid="true"]`. Marks the control invalid and shows error styles.
|
|
28
|
+
- `hideLabel`: `boolean`, `.ui-text-field > span.ui-sr-only`. Visually hides the label, `.ui-sr-only` instead of `.ui-label`. The field keeps it as its accessible name.
|
|
29
|
+
- `id`: `string`. The id of the `<input>`.
|
|
30
|
+
- `name`: `string`. The name of the `<input>`. Inside a `FieldGroup`, the group's `name` applies.
|
|
31
|
+
- `required`: `boolean`, `input[required]`. Adds a required mark after the label. The form won't submit while the field is empty.
|
|
32
|
+
- `size`: `"large"` (`.ui-large`), `"medium"` (default), `"small"` (`.ui-small`), `"x-small"` (`.ui-x-small`). The size of the element.
|
|
33
|
+
- `spread`: `boolean`, `.ui-spread`. Pushes the label and start text to one side and the input to the other.
|
|
34
|
+
- `type`: `"numeric" | string`, default `"text"`. The input type. `"numeric"` renders a text input with a numeric keyboard.
|
|
35
|
+
- `variant`: `"filled"` (`.ui-filled`), `"outlined"` (default). The variant to use.
|
|
36
|
+
|
|
37
|
+
### Slots
|
|
38
|
+
|
|
39
|
+
- `default`: Extra content inside the root, such as a `<datalist>`.
|
|
40
|
+
|
|
41
|
+
Model: `value` (`string | number`), the input value. Astro and React `value`, Svelte `bind:value`, Vue `v-model`.
|
|
42
|
+
|
|
43
|
+
### Notes
|
|
44
|
+
|
|
45
|
+
- HTML: Use `.ui-select` for a `<select>` and `.ui-textarea` for a `<textarea>`. You can put a `<datalist>` inside the root.
|
|
46
|
+
- Astro, Svelte and Vue: Attributes that aren't props go to the `<input>`, like `autocomplete` and `placeholder`, and `class` and `style` go to the root `<label>`.
|
|
47
|
+
- React: Attributes that aren't props go to the `<input>`, like `autocomplete` and `placeholder`, and `className` and `style` go to the root `<label>`. Use `value` with `onChange`, or `defaultValue`.
|
|
48
|
+
|
|
49
|
+
## Component properties
|
|
50
|
+
|
|
51
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
52
|
+
|
|
53
|
+
### text-field.css
|
|
54
|
+
|
|
55
|
+
- `--_accent`: Border color of `.ui-field` when focused with a pointer; keyboard focus shows the focus ring instead. Defaults to `--ui-primary`, `--ui-invalid` when invalid.
|
|
56
|
+
- `--_arrow-inset`: Distance of the select arrow from the inline end.
|
|
57
|
+
- `--_chevron-image`: The select arrow, as an image used for a mask.
|
|
58
|
+
- `--_chevron-size`: Width and height of the select arrow.
|
|
59
|
+
- `--_ease`: Easing of the transitions. Defaults to `--ui-ease`.
|
|
60
|
+
- `--_field-padding-block`: The preferred block padding of the control. Set by the size classes.
|
|
61
|
+
- `--_field-padding-inline`: The inline padding of the control and affixes. `.ui-large` sets it.
|
|
62
|
+
- `--_font-size`: The font size of the control and affixes.
|
|
63
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
64
|
+
- `--_size`: The height of `.ui-field`, a minimum so a textarea can grow, and the width and height of a color field. Defaults to `--ui-field-size`, set by the size classes.
|
|
65
|
+
|
|
66
|
+
Outputs: `--_affix-text-color`, `--_arrow-padding`, `--_bg-color`, `--_border-color`, `--_duration`, `--_field-padding-block-fit` and `--_helper-text-color`.
|
|
67
|
+
|
|
68
|
+
## Theme tokens
|
|
69
|
+
|
|
70
|
+
The stylesheets read `--ui-disabled-opacity`, `--ui-duration`, `--ui-ease`, `--ui-field-bg-color`, `--ui-field-border-color`, `--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-padding-inline`, `--ui-field-radius`, `--ui-field-required-text-color`, `--ui-field-size`, `--ui-field-size-large`, `--ui-field-size-small`, `--ui-field-size-x-small`, `--ui-focus-ring-color`, `--ui-focus-ring-offset`, `--ui-focus-ring-style`, `--ui-focus-ring-width`, `--ui-font-body`, `--ui-font-size-caption`, `--ui-font-size-control`, `--ui-font-size-small`, `--ui-icon-size`, `--ui-icon-size-small`, `--ui-invalid`, `--ui-invalid-text`, `--ui-line-height-control`, `--ui-line-height-tight`, `--ui-motion`, `--ui-primary`, `--ui-radius`, `--ui-shadow-control`, `--ui-shadow-field`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-space-4`, `--ui-surface`, `--ui-surface-tonal`, `--ui-surface-tonal-hover`, `--ui-text` and `--ui-text-strong`. `theming.md` and `tokens.json` describe them.
|
|
71
|
+
|
|
72
|
+
## HTML
|
|
73
|
+
|
|
74
|
+
### Example: Variants
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<label class="ui-text-field">
|
|
78
|
+
<span class="ui-label">Outlined</span>
|
|
79
|
+
<span class="ui-field">
|
|
80
|
+
<input type="text" placeholder="Placeholder" />
|
|
81
|
+
</span>
|
|
82
|
+
</label>
|
|
83
|
+
|
|
84
|
+
<label class="ui-text-field ui-filled">
|
|
85
|
+
<span class="ui-label">Filled</span>
|
|
86
|
+
<span class="ui-field">
|
|
87
|
+
<input type="text" placeholder="Placeholder" />
|
|
88
|
+
</span>
|
|
89
|
+
</label>
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Astro
|
|
93
|
+
|
|
94
|
+
`import { TextField } from "opui-css/astro"`
|
|
95
|
+
|
|
96
|
+
- `TextField` named slots: `bottom`, `end`, `end-text`, `label`, `start`, `start-text` and `top`. Fill one with `slot="bottom"` on a child.
|
|
97
|
+
|
|
98
|
+
### Example: Variants
|
|
99
|
+
|
|
100
|
+
```astro
|
|
101
|
+
---
|
|
102
|
+
import { TextField } from "opui-css/astro"
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
<TextField label="Outlined" placeholder="Placeholder" />
|
|
106
|
+
<TextField label="Filled" placeholder="Placeholder" variant="filled" />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## React
|
|
110
|
+
|
|
111
|
+
`import { TextField } from "opui-css/react"`
|
|
112
|
+
|
|
113
|
+
- `TextField` slot props (`ReactNode`): `bottom`, `children`, `end`, `endText`, `label`, `start`, `startText` and `top`.
|
|
114
|
+
- Client components (`"use client"`): `TextField`.
|
|
115
|
+
|
|
116
|
+
### Example: Variants
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import { TextField } from "opui-css/react"
|
|
120
|
+
|
|
121
|
+
export default function Variants() {
|
|
122
|
+
return (
|
|
123
|
+
<>
|
|
124
|
+
<TextField label="Outlined" placeholder="Placeholder" />
|
|
125
|
+
<TextField label="Filled" placeholder="Placeholder" variant="filled" />
|
|
126
|
+
</>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Svelte
|
|
132
|
+
|
|
133
|
+
`import { TextField } from "opui-css/svelte"`
|
|
134
|
+
|
|
135
|
+
- `TextField` slot snippets: `bottom`, `children`, `end`, `endText`, `label`, `start`, `startText` and `top`.
|
|
136
|
+
- Hydration: `bind:value` on `TextField`. 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.
|
|
137
|
+
|
|
138
|
+
### Example: Variants
|
|
139
|
+
|
|
140
|
+
```svelte
|
|
141
|
+
<script lang="ts">
|
|
142
|
+
import { TextField } from "opui-css/svelte"
|
|
143
|
+
</script>
|
|
144
|
+
|
|
145
|
+
<TextField label="Outlined" placeholder="Placeholder" />
|
|
146
|
+
<TextField label="Filled" placeholder="Placeholder" variant="filled" />
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Vue
|
|
150
|
+
|
|
151
|
+
`import { TextField } from "opui-css/vue"`
|
|
152
|
+
|
|
153
|
+
- `TextField` named slots: `bottom`, `end`, `end-text`, `label`, `start`, `start-text` and `top`. Fill one with `<template #bottom>`.
|
|
154
|
+
- Hydration: `v-model` on `TextField`. 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.
|
|
155
|
+
|
|
156
|
+
### Example: Variants
|
|
157
|
+
|
|
158
|
+
```vue
|
|
159
|
+
<script setup lang="ts">
|
|
160
|
+
import { TextField } from "opui-css/vue"
|
|
161
|
+
</script>
|
|
162
|
+
|
|
163
|
+
<template>
|
|
164
|
+
<TextField label="Outlined" placeholder="Placeholder" />
|
|
165
|
+
<TextField label="Filled" placeholder="Placeholder" variant="filled" />
|
|
166
|
+
</template>
|
|
167
|
+
```
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# Textarea
|
|
2
|
+
|
|
3
|
+
An input for multi-line text data. Basic textareas with labels, supporting text, and validation states.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/text-field.css` and `opui-css/css/components/textarea.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/textarea.md), [Astro](https://open-props-ui.netlify.app/astro/components/textarea.md), [React](https://open-props-ui.netlify.app/react/components/textarea.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/textarea.md), [Vue](https://open-props-ui.netlify.app/vue/components/textarea.md).
|
|
7
|
+
|
|
8
|
+
## Textarea
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `label.ui-textarea` (root): Container element.
|
|
13
|
+
- `.ui-label` (prop `label`, slot `label`): The label for the field.
|
|
14
|
+
- `.ui-start-text` (prop `startText`, slot `start-text`): Start text displayed above the field.
|
|
15
|
+
- `.ui-field`: The boxed textarea area.
|
|
16
|
+
- `.ui-field > .ui-top` (slot `top`): Content above the textarea, inside the border, with a divider.
|
|
17
|
+
- `.ui-field > .ui-start` (slot `start`): Content at the inline-start of the field, inside the border.
|
|
18
|
+
- `<textarea>` (model): The textarea element.
|
|
19
|
+
- `.ui-field > .ui-end` (slot `end`): Content at the inline-end of the field, inside the border.
|
|
20
|
+
- `.ui-field > .ui-bottom` (slot `bottom`): Content below the textarea, inside the border, with a divider.
|
|
21
|
+
- `.ui-end-text` (prop `endText`, slot `end-text`): Supporting text displayed below the field.
|
|
22
|
+
|
|
23
|
+
### Props and modifiers
|
|
24
|
+
|
|
25
|
+
- `autoFit`: `boolean`, `.ui-auto-fit`. Lets the width follow the content and allows resizing in both directions.
|
|
26
|
+
- `disabled`: `boolean`, `textarea[disabled]`. Dims the field and blocks input.
|
|
27
|
+
- `error`: `boolean`, `textarea[aria-invalid="true"]`. Marks the control invalid and shows error styles.
|
|
28
|
+
- `hideLabel`: `boolean`, `.ui-textarea > span.ui-sr-only`. Visually hides the label, `.ui-sr-only` instead of `.ui-label`. The field keeps it as its accessible name.
|
|
29
|
+
- `id`: `string`. The id of the `<textarea>`.
|
|
30
|
+
- `name`: `string`. The name of the `<textarea>`. Inside a `FieldGroup`, the group's `name` applies.
|
|
31
|
+
- `required`: `boolean`, `textarea[required]`. Adds a required mark after the label. The form won't submit while the field is empty.
|
|
32
|
+
- `size`: `"large"` (`.ui-large`), `"medium"` (default), `"small"` (`.ui-small`), `"x-small"` (`.ui-x-small`). The size of the element.
|
|
33
|
+
- `spread`: `boolean`, `.ui-spread`. Pushes the label and start text to one side and the textarea to the other.
|
|
34
|
+
- `variant`: `"filled"` (`.ui-filled`), `"outlined"` (default). The variant to use.
|
|
35
|
+
|
|
36
|
+
### Slots
|
|
37
|
+
|
|
38
|
+
- `default`: Extra content inside the root.
|
|
39
|
+
|
|
40
|
+
Model: `value` (`string`), the textarea value. Astro and React `value`, Svelte `bind:value`, Vue `v-model`.
|
|
41
|
+
|
|
42
|
+
### Notes
|
|
43
|
+
|
|
44
|
+
- Astro, Svelte and Vue: Attributes that aren't props go to the `<textarea>`, like `placeholder` and `rows`, and `class` and `style` go to the root `<label>`.
|
|
45
|
+
- React: Attributes that aren't props go to the `<textarea>`, like `placeholder` and `rows`, and `className` and `style` go to the root `<label>`. Use `value` with `onChange`, or `defaultValue`.
|
|
46
|
+
|
|
47
|
+
## Component properties
|
|
48
|
+
|
|
49
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
50
|
+
|
|
51
|
+
### text-field.css
|
|
52
|
+
|
|
53
|
+
- `--_accent`: Border color of `.ui-field` when focused with a pointer; keyboard focus shows the focus ring instead. Defaults to `--ui-primary`, `--ui-invalid` when invalid.
|
|
54
|
+
- `--_arrow-inset`: Distance of the select arrow from the inline end.
|
|
55
|
+
- `--_chevron-image`: The select arrow, as an image used for a mask.
|
|
56
|
+
- `--_chevron-size`: Width and height of the select arrow.
|
|
57
|
+
- `--_ease`: Easing of the transitions. Defaults to `--ui-ease`.
|
|
58
|
+
- `--_field-padding-block`: The preferred block padding of the control. Set by the size classes.
|
|
59
|
+
- `--_field-padding-inline`: The inline padding of the control and affixes. `.ui-large` sets it.
|
|
60
|
+
- `--_font-size`: The font size of the control and affixes.
|
|
61
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
62
|
+
- `--_size`: The height of `.ui-field`, a minimum so a textarea can grow, and the width and height of a color field. Defaults to `--ui-field-size`, set by the size classes.
|
|
63
|
+
|
|
64
|
+
Outputs: `--_affix-text-color`, `--_arrow-padding`, `--_bg-color`, `--_border-color`, `--_duration`, `--_field-padding-block-fit` and `--_helper-text-color`.
|
|
65
|
+
|
|
66
|
+
### textarea.css
|
|
67
|
+
|
|
68
|
+
- `--_max-block-size`: Maximum height the `textarea` grows to with its content.
|
|
69
|
+
|
|
70
|
+
## Theme tokens
|
|
71
|
+
|
|
72
|
+
The stylesheets read `--ui-disabled-opacity`, `--ui-duration`, `--ui-ease`, `--ui-field-bg-color`, `--ui-field-border-color`, `--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-padding-inline`, `--ui-field-radius`, `--ui-field-required-text-color`, `--ui-field-size`, `--ui-field-size-large`, `--ui-field-size-small`, `--ui-field-size-x-small`, `--ui-focus-ring-color`, `--ui-focus-ring-offset`, `--ui-focus-ring-style`, `--ui-focus-ring-width`, `--ui-font-body`, `--ui-font-size-caption`, `--ui-font-size-control`, `--ui-font-size-small`, `--ui-icon-size`, `--ui-icon-size-small`, `--ui-invalid`, `--ui-invalid-text`, `--ui-line-height-control`, `--ui-line-height-tight`, `--ui-motion`, `--ui-primary`, `--ui-radius`, `--ui-shadow-control`, `--ui-shadow-field`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-space-4`, `--ui-surface`, `--ui-surface-tonal`, `--ui-surface-tonal-hover`, `--ui-text` and `--ui-text-strong`. `theming.md` and `tokens.json` describe them.
|
|
73
|
+
|
|
74
|
+
## HTML
|
|
75
|
+
|
|
76
|
+
### Example: Variants
|
|
77
|
+
|
|
78
|
+
```html
|
|
79
|
+
<label class="ui-textarea">
|
|
80
|
+
<span class="ui-label">Outlined</span>
|
|
81
|
+
<span class="ui-field">
|
|
82
|
+
<textarea placeholder="Placeholder"></textarea>
|
|
83
|
+
</span>
|
|
84
|
+
</label>
|
|
85
|
+
|
|
86
|
+
<label class="ui-textarea ui-filled">
|
|
87
|
+
<span class="ui-label">Filled</span>
|
|
88
|
+
<span class="ui-field">
|
|
89
|
+
<textarea placeholder="Placeholder"></textarea>
|
|
90
|
+
</span>
|
|
91
|
+
</label>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Astro
|
|
95
|
+
|
|
96
|
+
`import { Textarea } from "opui-css/astro"`
|
|
97
|
+
|
|
98
|
+
- `Textarea` named slots: `bottom`, `end`, `end-text`, `label`, `start`, `start-text` and `top`. Fill one with `slot="bottom"` on a child.
|
|
99
|
+
|
|
100
|
+
### Example: Variants
|
|
101
|
+
|
|
102
|
+
```astro
|
|
103
|
+
---
|
|
104
|
+
import { Textarea } from "opui-css/astro"
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
<Textarea label="Outlined" placeholder="Placeholder" />
|
|
108
|
+
<Textarea label="Filled" placeholder="Placeholder" variant="filled" />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## React
|
|
112
|
+
|
|
113
|
+
`import { Textarea } from "opui-css/react"`
|
|
114
|
+
|
|
115
|
+
- `Textarea` slot props (`ReactNode`): `bottom`, `children`, `end`, `endText`, `label`, `start`, `startText` and `top`.
|
|
116
|
+
- Client components (`"use client"`): `Textarea`.
|
|
117
|
+
|
|
118
|
+
### Example: Variants
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import { Textarea } from "opui-css/react"
|
|
122
|
+
|
|
123
|
+
export default function Variants() {
|
|
124
|
+
return (
|
|
125
|
+
<>
|
|
126
|
+
<Textarea label="Outlined" placeholder="Placeholder" />
|
|
127
|
+
<Textarea label="Filled" placeholder="Placeholder" variant="filled" />
|
|
128
|
+
</>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Svelte
|
|
134
|
+
|
|
135
|
+
`import { Textarea } from "opui-css/svelte"`
|
|
136
|
+
|
|
137
|
+
- `Textarea` slot snippets: `bottom`, `children`, `end`, `endText`, `label`, `start`, `startText` and `top`.
|
|
138
|
+
- Hydration: `bind:value` on `Textarea`. 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.
|
|
139
|
+
|
|
140
|
+
### Example: Variants
|
|
141
|
+
|
|
142
|
+
```svelte
|
|
143
|
+
<script lang="ts">
|
|
144
|
+
import { Textarea } from "opui-css/svelte"
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<Textarea label="Outlined" placeholder="Placeholder" />
|
|
148
|
+
<Textarea label="Filled" placeholder="Placeholder" variant="filled" />
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Vue
|
|
152
|
+
|
|
153
|
+
`import { Textarea } from "opui-css/vue"`
|
|
154
|
+
|
|
155
|
+
- `Textarea` named slots: `bottom`, `end`, `end-text`, `label`, `start`, `start-text` and `top`. Fill one with `<template #bottom>`.
|
|
156
|
+
- Hydration: `v-model` on `Textarea`. 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.
|
|
157
|
+
|
|
158
|
+
### Example: Variants
|
|
159
|
+
|
|
160
|
+
```vue
|
|
161
|
+
<script setup lang="ts">
|
|
162
|
+
import { Textarea } from "opui-css/vue"
|
|
163
|
+
</script>
|
|
164
|
+
|
|
165
|
+
<template>
|
|
166
|
+
<Textarea label="Outlined" placeholder="Placeholder" />
|
|
167
|
+
<Textarea label="Filled" placeholder="Placeholder" variant="filled" />
|
|
168
|
+
</template>
|
|
169
|
+
```
|