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,199 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
|
|
3
|
+
Badges attach a small count or status dot to another element.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/badge.css` and `opui-css/css/components/anchor.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/badge.md), [Astro](https://open-props-ui.netlify.app/astro/components/badge.md), [React](https://open-props-ui.netlify.app/react/components/badge.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/badge.md), [Vue](https://open-props-ui.netlify.app/vue/components/badge.md).
|
|
7
|
+
|
|
8
|
+
## Badge
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `.ui-badge` (root): Container element.
|
|
13
|
+
- `& > :first-child` (slot `default`): The element the badge is anchored to.
|
|
14
|
+
- `.ui-indicator` (prop `label`, slot `indicator`): The indicator, inside `.ui-floating`. Holds `label`, the visible text with `hideLabel`, or only screen reader text with `dot`.
|
|
15
|
+
|
|
16
|
+
### Props and modifiers
|
|
17
|
+
|
|
18
|
+
- `color`: `"critical"` (`.ui-critical`), `"info"` (`.ui-info`), `"neutral"` (`.ui-neutral`), `"success"` (`.ui-success`), `"warning"` (`.ui-warning`). Optional colors.
|
|
19
|
+
- `corner`: `"end-end"` (`.ui-end-end`), `"end-start"` (`.ui-end-start`), `"start-end"` (default), `"start-start"` (`.ui-start-start`). The corner the indicator sits on.
|
|
20
|
+
- `dot`: `boolean`, `.ui-dot`. Renders the indicator as a dot. `label` stays as screen reader text, and the `indicator` slot isn't shown.
|
|
21
|
+
- `hideLabel`: `boolean`, `.ui-indicator > span.ui-sr-only`. Hides `label` visually, for the whole sentence screen readers read, such as "5 unread messages". The `indicator` slot then holds the visible text and is hidden from screen readers.
|
|
22
|
+
- `invisible`: `boolean`, `.ui-invisible`. Hides the indicator.
|
|
23
|
+
|
|
24
|
+
## Component properties
|
|
25
|
+
|
|
26
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
27
|
+
|
|
28
|
+
### badge.css
|
|
29
|
+
|
|
30
|
+
- `--_border-width`: Border width of the indicator.
|
|
31
|
+
- `--_dot-size`: Width and height of the indicator in `.ui-dot`.
|
|
32
|
+
- `--_ease`: Easing of the indicator fade. Defaults to `--ui-ease-enter`.
|
|
33
|
+
- `--_inset`: Distance of the indicator from the opposite edges. `100%` places it on the corner, round avatars move it onto the circle.
|
|
34
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
35
|
+
- `--_size`: Height and minimum width of the indicator.
|
|
36
|
+
|
|
37
|
+
Outputs: `--_accent`, `--_bg-color`, `--_border-color`, `--_direction`, `--_duration`, `--_inset-block`, `--_inset-inline`, `--_shift-x`, `--_shift-y`, `--_sign-x`, `--_sign-y` and `--_text-color`.
|
|
38
|
+
|
|
39
|
+
### anchor.css
|
|
40
|
+
|
|
41
|
+
- `--_shift-x`: Horizontal shift of `.ui-floating`. Defaults to `0`.
|
|
42
|
+
- `--_shift-y`: Vertical shift of `.ui-floating`. Defaults to `0`.
|
|
43
|
+
|
|
44
|
+
## Theme tokens
|
|
45
|
+
|
|
46
|
+
The stylesheets read `--ui-accent-fill-max-lightness`, `--ui-border-width-thick`, `--ui-critical`, `--ui-duration`, `--ui-ease-enter`, `--ui-font-size-caption`, `--ui-font-weight-medium`, `--ui-info`, `--ui-motion`, `--ui-neutral`, `--ui-on-fill`, `--ui-on-primary`, `--ui-on-warning`, `--ui-primary`, `--ui-radius-round`, `--ui-space-1`, `--ui-space-2`, `--ui-space-4`, `--ui-success` and `--ui-warning`. `theming.md` and `tokens.json` describe them.
|
|
47
|
+
|
|
48
|
+
## HTML
|
|
49
|
+
|
|
50
|
+
### Example: Basics
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<span class="ui-badge">
|
|
54
|
+
<svg
|
|
55
|
+
aria-hidden="true"
|
|
56
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
57
|
+
width="32"
|
|
58
|
+
height="32"
|
|
59
|
+
viewBox="0 0 32 32"
|
|
60
|
+
>
|
|
61
|
+
<path
|
|
62
|
+
fill="currentColor"
|
|
63
|
+
d="M2.004 9.303A4.5 4.5 0 0 1 6.5 5h19a4.5 4.5 0 0 1 4.496 4.303l-1.476.82L16 16.864L3.48 10.123zM2 11.588V22.5A4.5 4.5 0 0 0 6.5 27h19a4.5 4.5 0 0 0 4.5-4.5V11.588l-.526.293l-13 7a1 1 0 0 1-.948 0L2.514 11.874z"
|
|
64
|
+
></path>
|
|
65
|
+
</svg>
|
|
66
|
+
<span class="ui-floating">
|
|
67
|
+
<span class="ui-indicator"
|
|
68
|
+
><span aria-hidden="true">5</span
|
|
69
|
+
><span class="ui-sr-only">5 unread messages</span></span
|
|
70
|
+
>
|
|
71
|
+
</span>
|
|
72
|
+
</span>
|
|
73
|
+
|
|
74
|
+
<span class="ui-badge ui-dot">
|
|
75
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
76
|
+
<span class="ui-floating">
|
|
77
|
+
<span class="ui-indicator"
|
|
78
|
+
><span class="ui-sr-only">New messages</span></span
|
|
79
|
+
>
|
|
80
|
+
</span>
|
|
81
|
+
</span>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Astro
|
|
85
|
+
|
|
86
|
+
`import { Badge } from "opui-css/astro"`
|
|
87
|
+
|
|
88
|
+
- `Badge` named slots: `indicator`. Fill one with `slot="indicator"` on a child.
|
|
89
|
+
|
|
90
|
+
### Example: Basics
|
|
91
|
+
|
|
92
|
+
```astro
|
|
93
|
+
---
|
|
94
|
+
import { Badge } from "opui-css/astro"
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
<Badge hideLabel label="5 unread messages">
|
|
98
|
+
<svg
|
|
99
|
+
aria-hidden="true"
|
|
100
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
101
|
+
width="32"
|
|
102
|
+
height="32"
|
|
103
|
+
viewBox="0 0 32 32"
|
|
104
|
+
><path
|
|
105
|
+
fill="currentColor"
|
|
106
|
+
d="M2.004 9.303A4.5 4.5 0 0 1 6.5 5h19a4.5 4.5 0 0 1 4.496 4.303l-1.476.82L16 16.864L3.48 10.123zM2 11.588V22.5A4.5 4.5 0 0 0 6.5 27h19a4.5 4.5 0 0 0 4.5-4.5V11.588l-.526.293l-13 7a1 1 0 0 1-.948 0L2.514 11.874z"
|
|
107
|
+
></path></svg
|
|
108
|
+
>
|
|
109
|
+
<Fragment slot="indicator">5</Fragment>
|
|
110
|
+
</Badge>
|
|
111
|
+
|
|
112
|
+
<Badge dot label="New messages">
|
|
113
|
+
<svg
|
|
114
|
+
aria-hidden="true"
|
|
115
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
116
|
+
width="32"
|
|
117
|
+
height="32"
|
|
118
|
+
viewBox="0 0 32 32"
|
|
119
|
+
><path
|
|
120
|
+
fill="currentColor"
|
|
121
|
+
d="M2.004 9.303A4.5 4.5 0 0 1 6.5 5h19a4.5 4.5 0 0 1 4.496 4.303l-1.476.82L16 16.864L3.48 10.123zM2 11.588V22.5A4.5 4.5 0 0 0 6.5 27h19a4.5 4.5 0 0 0 4.5-4.5V11.588l-.526.293l-13 7a1 1 0 0 1-.948 0L2.514 11.874z"
|
|
122
|
+
></path></svg
|
|
123
|
+
>
|
|
124
|
+
</Badge>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## React
|
|
128
|
+
|
|
129
|
+
`import { Badge } from "opui-css/react"`
|
|
130
|
+
|
|
131
|
+
- `Badge` slot props (`ReactNode`): `children` and `indicator`.
|
|
132
|
+
|
|
133
|
+
### Example: Basics
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { Badge } from "opui-css/react"
|
|
137
|
+
|
|
138
|
+
export default function Basics() {
|
|
139
|
+
return (
|
|
140
|
+
<>
|
|
141
|
+
<Badge hideLabel indicator="5" label="5 unread messages">
|
|
142
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
143
|
+
</Badge>
|
|
144
|
+
|
|
145
|
+
<Badge dot label="New messages">
|
|
146
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
147
|
+
</Badge>
|
|
148
|
+
</>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Svelte
|
|
154
|
+
|
|
155
|
+
`import { Badge } from "opui-css/svelte"`
|
|
156
|
+
|
|
157
|
+
- `Badge` slot snippets: `children` and `indicator`.
|
|
158
|
+
|
|
159
|
+
### Example: Basics
|
|
160
|
+
|
|
161
|
+
```svelte
|
|
162
|
+
<script lang="ts">
|
|
163
|
+
import { Badge } from "opui-css/svelte"
|
|
164
|
+
</script>
|
|
165
|
+
|
|
166
|
+
<Badge hideLabel label="5 unread messages">
|
|
167
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
168
|
+
{#snippet indicator()}5{/snippet}
|
|
169
|
+
</Badge>
|
|
170
|
+
|
|
171
|
+
<Badge dot label="New messages">
|
|
172
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
173
|
+
</Badge>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Vue
|
|
177
|
+
|
|
178
|
+
`import { Badge } from "opui-css/vue"`
|
|
179
|
+
|
|
180
|
+
- `Badge` named slots: `indicator`. Fill one with `<template #indicator>`.
|
|
181
|
+
|
|
182
|
+
### Example: Basics
|
|
183
|
+
|
|
184
|
+
```vue
|
|
185
|
+
<script setup lang="ts">
|
|
186
|
+
import { Badge } from "opui-css/vue"
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<template>
|
|
190
|
+
<Badge hideLabel label="5 unread messages">
|
|
191
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
192
|
+
<template #indicator>5</template>
|
|
193
|
+
</Badge>
|
|
194
|
+
|
|
195
|
+
<Badge dot label="New messages">
|
|
196
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
197
|
+
</Badge>
|
|
198
|
+
</template>
|
|
199
|
+
```
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Button group
|
|
2
|
+
|
|
3
|
+
Groups related buttons by wrapping them with class="ui-button-group" and role="group".
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/button-group.css` and `opui-css/css/components/button.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/button-group.md), [Astro](https://open-props-ui.netlify.app/astro/components/button-group.md), [React](https://open-props-ui.netlify.app/react/components/button-group.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/button-group.md), [Vue](https://open-props-ui.netlify.app/vue/components/button-group.md).
|
|
7
|
+
- The docs page also documents `Button`, see `button.md`.
|
|
8
|
+
|
|
9
|
+
## ButtonGroup
|
|
10
|
+
|
|
11
|
+
### Parts
|
|
12
|
+
|
|
13
|
+
- `.ui-button-group` (root): Container element.
|
|
14
|
+
- `& > .ui-button` (slot `default`): The buttons and button links.
|
|
15
|
+
|
|
16
|
+
### Props and modifiers
|
|
17
|
+
|
|
18
|
+
- `color`: `"critical"` (`.ui-critical`), `"primary"` (`.ui-primary`). Optional colors for the buttons.
|
|
19
|
+
- `orientation`: `"horizontal"` (default), `"vertical"` (`.ui-vertical`). The orientation of the element.
|
|
20
|
+
- `overflow`: `"scroll"` (`.ui-overflow-scroll`), `"shrink"` (`.ui-overflow-shrink`), `"wrap"` (default). What the items do when they don't fit. `"wrap"` wraps them onto more rows, `"scroll"` keeps them on one row and scrolls it sideways, and `"shrink"` keeps them on one row and truncates labels with an ellipsis. Icon-only items keep their size.
|
|
21
|
+
- `size`: `"large"` (`.ui-large`), `"medium"` (default), `"small"` (`.ui-small`), `"x-small"` (`.ui-x-small`). The size of the buttons.
|
|
22
|
+
- `variant`: `"filled"` (`.ui-filled`), `"outlined"` (`.ui-outlined`), `"tonal"` (`.ui-tonal`), `"transparent"` (default). The variant of the buttons.
|
|
23
|
+
|
|
24
|
+
### Notes
|
|
25
|
+
|
|
26
|
+
- HTML: The root needs `role="group"`.
|
|
27
|
+
|
|
28
|
+
## Component properties
|
|
29
|
+
|
|
30
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
31
|
+
|
|
32
|
+
### button-group.css
|
|
33
|
+
|
|
34
|
+
- `--_radius`: Corner radius of the group. Defaults to `--ui-button-radius`, or `--ui-radius` when the theme doesn't set it.
|
|
35
|
+
|
|
36
|
+
Outputs: `--_border-color`, `--_divider-border-color`, `--_edge-accent`, `--_edge-outline-color` and `--_edge-text`.
|
|
37
|
+
|
|
38
|
+
### button.css
|
|
39
|
+
|
|
40
|
+
- `--_accent`: The accent color. Fills, borders, text, hover and active states are derived from it. Defaults to `--ui-button-accent` when a theme sets it. `.ui-primary` and `.ui-critical` set it.
|
|
41
|
+
- `--_accent-fill`: Fill of filled buttons and of hovered outlined and tonal buttons, and the base of the filled hover and pressed shades. `--ui-button-accent-filled` when a theme sets it, else `--_accent`, and in `.ui-critical` `--ui-critical` kept within `--ui-accent-fill-max-lightness`, so the light text stays readable while the border keeps `--ui-critical`.
|
|
42
|
+
- `--_accent-tonal`: Background of `.ui-tonal`. `--ui-surface-tonal`, a palette tint in `.ui-critical`, and `--ui-primary-tonal` or the tint in `.ui-primary`.
|
|
43
|
+
- `--_border-width`: The border width.
|
|
44
|
+
- `--_ease`: Easing of the transitions. Defaults to `--ui-ease`.
|
|
45
|
+
- `--_font-size`: The font size. Set by `.ui-x-small` and `.ui-small`.
|
|
46
|
+
- `--_icon-size`: The size of a direct child `svg`. Icon-only buttons scale it with `--_size`.
|
|
47
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
48
|
+
- `--_on-accent`: Text color on a fill of `--_accent`. Defaults to `--ui-button-on-accent` when a theme sets it. `.ui-primary` sets `--ui-on-primary`, `.ui-critical` `--ui-on-fill`.
|
|
49
|
+
- `--_on-accent-fill`: Text color on `--_accent-fill`: filled buttons, and hovered outlined and tonal ones. `--ui-button-on-accent-filled` when a theme sets it, else `--_on-accent`.
|
|
50
|
+
- `--_on-accent-tonal`: Text color of `.ui-tonal`.
|
|
51
|
+
- `--_padding-inline`: The inline padding. Set by the size classes from `--ui-button-padding-inline` and its size variants.
|
|
52
|
+
- `--_radius`: The corner radius. Defaults to `--ui-button-radius`, or `--ui-radius` when the theme doesn't set it. `.ui-round` makes it round.
|
|
53
|
+
- `--_size`: The height, and the width of an icon-only button. Defaults to `--ui-button-size`, set by the size classes.
|
|
54
|
+
|
|
55
|
+
Outputs: `--_accent-text`, `--_actions-shift`, `--_bg-color`, `--_border-color`, `--_default-active-bg-color`, `--_default-hover-bg-color`, `--_duration`, `--_filled-active-bg-color`, `--_filled-hover-bg-color`, `--_outlined-active-bg-color`, `--_outlined-active-border-color`, `--_outlined-active-text-color`, `--_outlined-hover-bg-color`, `--_outlined-hover-border-color`, `--_outlined-hover-text-color`, `--_shadow`, `--_text-color`, `--_tonal-active-bg-color`, `--_tonal-active-text-color`, `--_tonal-hover-bg-color` and `--_tonal-hover-text-color`.
|
|
56
|
+
|
|
57
|
+
## Theme tokens
|
|
58
|
+
|
|
59
|
+
The stylesheets read `--ui-accent-fill-max-lightness`, `--ui-border-width`, `--ui-button-accent`, `--ui-button-accent-filled`, `--ui-button-font-weight`, `--ui-button-hover-shadow`, `--ui-button-hover-translate`, `--ui-button-on-accent`, `--ui-button-on-accent-filled`, `--ui-button-padding-inline`, `--ui-button-padding-inline-large`, `--ui-button-padding-inline-small`, `--ui-button-padding-inline-x-small`, `--ui-button-radius`, `--ui-button-size`, `--ui-button-size-large`, `--ui-button-size-small`, `--ui-button-size-x-small`, `--ui-control-accent`, `--ui-control-border-color`, `--ui-control-border-color-filled`, `--ui-critical`, `--ui-critical-text`, `--ui-disabled-opacity`, `--ui-duration-fast`, `--ui-ease`, `--ui-field-border-color`, `--ui-field-border-width`, `--ui-focus-ring-inset`, `--ui-focus-ring-offset`, `--ui-focus-ring-width`, `--ui-font-code`, `--ui-font-size-caption`, `--ui-font-size-control`, `--ui-font-size-small`, `--ui-font-weight-bold`, `--ui-font-weight-normal`, `--ui-line-height-tight`, `--ui-motion`, `--ui-on-control-accent`, `--ui-on-fill`, `--ui-on-primary`, `--ui-on-primary-tonal`, `--ui-palette-on-strong`, `--ui-palette-on-tint`, `--ui-palette-strong`, `--ui-palette-tint`, `--ui-primary`, `--ui-primary-text`, `--ui-primary-tonal`, `--ui-radius`, `--ui-radius-round`, `--ui-radius-small`, `--ui-shadow-control`, `--ui-shadow-field`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-state-active-alpha-accent`, `--ui-state-active-alpha-dark`, `--ui-state-active-alpha-light`, `--ui-state-hover-alpha-accent`, `--ui-state-hover-alpha-dark`, `--ui-state-hover-alpha-light`, `--ui-surface-tonal`, `--ui-text`, `--ui-text-disabled`, `--ui-text-max-chroma` and `--ui-text-min-lightness`. `theming.md` and `tokens.json` describe them.
|
|
60
|
+
|
|
61
|
+
## HTML
|
|
62
|
+
|
|
63
|
+
### Example: Variants
|
|
64
|
+
|
|
65
|
+
```html
|
|
66
|
+
<div role="group" class="ui-button-group">
|
|
67
|
+
<button type="button" class="ui-button">Transparent</button>
|
|
68
|
+
<button type="button" class="ui-button">Transparent</button>
|
|
69
|
+
<a class="ui-button" href="#">Transparent</a>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<div role="group" class="ui-button-group ui-outlined">
|
|
73
|
+
<button type="button" class="ui-button">Outlined</button>
|
|
74
|
+
<button type="button" class="ui-button">Outlined</button>
|
|
75
|
+
<a class="ui-button" href="#">Outlined</a>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div role="group" class="ui-button-group ui-tonal">
|
|
79
|
+
<button type="button" class="ui-button">Tonal</button>
|
|
80
|
+
<button type="button" class="ui-button">Tonal</button>
|
|
81
|
+
<a class="ui-button" href="#">Tonal</a>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div role="group" class="ui-button-group ui-filled">
|
|
85
|
+
<button type="button" class="ui-button">Filled</button>
|
|
86
|
+
<button type="button" class="ui-button">Filled</button>
|
|
87
|
+
<a class="ui-button" href="#">Filled</a>
|
|
88
|
+
</div>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Astro
|
|
92
|
+
|
|
93
|
+
`import { ButtonGroup } from "opui-css/astro"`
|
|
94
|
+
|
|
95
|
+
### Example: Variants
|
|
96
|
+
|
|
97
|
+
```astro
|
|
98
|
+
---
|
|
99
|
+
import { Button, ButtonGroup } from "opui-css/astro"
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
<ButtonGroup>
|
|
103
|
+
<Button>Transparent</Button>
|
|
104
|
+
<Button>Transparent</Button>
|
|
105
|
+
<Button href="#">Transparent</Button>
|
|
106
|
+
</ButtonGroup>
|
|
107
|
+
|
|
108
|
+
<ButtonGroup variant="outlined">
|
|
109
|
+
<Button>Outlined</Button>
|
|
110
|
+
<Button>Outlined</Button>
|
|
111
|
+
<Button href="#">Outlined</Button>
|
|
112
|
+
</ButtonGroup>
|
|
113
|
+
|
|
114
|
+
<ButtonGroup variant="tonal">
|
|
115
|
+
<Button>Tonal</Button>
|
|
116
|
+
<Button>Tonal</Button>
|
|
117
|
+
<Button href="#">Tonal</Button>
|
|
118
|
+
</ButtonGroup>
|
|
119
|
+
|
|
120
|
+
<ButtonGroup variant="filled">
|
|
121
|
+
<Button>Filled</Button>
|
|
122
|
+
<Button>Filled</Button>
|
|
123
|
+
<Button href="#">Filled</Button>
|
|
124
|
+
</ButtonGroup>
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## React
|
|
128
|
+
|
|
129
|
+
`import { ButtonGroup } from "opui-css/react"`
|
|
130
|
+
|
|
131
|
+
### Example: Variants
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
import { Button, ButtonGroup } from "opui-css/react"
|
|
135
|
+
|
|
136
|
+
export default function Variants() {
|
|
137
|
+
return (
|
|
138
|
+
<>
|
|
139
|
+
<ButtonGroup>
|
|
140
|
+
<Button>Transparent</Button>
|
|
141
|
+
<Button>Transparent</Button>
|
|
142
|
+
<Button href="#">Transparent</Button>
|
|
143
|
+
</ButtonGroup>
|
|
144
|
+
|
|
145
|
+
<ButtonGroup variant="outlined">
|
|
146
|
+
<Button>Outlined</Button>
|
|
147
|
+
<Button>Outlined</Button>
|
|
148
|
+
<Button href="#">Outlined</Button>
|
|
149
|
+
</ButtonGroup>
|
|
150
|
+
|
|
151
|
+
<ButtonGroup variant="tonal">
|
|
152
|
+
<Button>Tonal</Button>
|
|
153
|
+
<Button>Tonal</Button>
|
|
154
|
+
<Button href="#">Tonal</Button>
|
|
155
|
+
</ButtonGroup>
|
|
156
|
+
|
|
157
|
+
<ButtonGroup variant="filled">
|
|
158
|
+
<Button>Filled</Button>
|
|
159
|
+
<Button>Filled</Button>
|
|
160
|
+
<Button href="#">Filled</Button>
|
|
161
|
+
</ButtonGroup>
|
|
162
|
+
</>
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Svelte
|
|
168
|
+
|
|
169
|
+
`import { ButtonGroup } from "opui-css/svelte"`
|
|
170
|
+
|
|
171
|
+
### Example: Variants
|
|
172
|
+
|
|
173
|
+
```svelte
|
|
174
|
+
<script lang="ts">
|
|
175
|
+
import { Button, ButtonGroup } from "opui-css/svelte"
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<ButtonGroup>
|
|
179
|
+
<Button>Transparent</Button>
|
|
180
|
+
<Button>Transparent</Button>
|
|
181
|
+
<Button href="#">Transparent</Button>
|
|
182
|
+
</ButtonGroup>
|
|
183
|
+
|
|
184
|
+
<ButtonGroup variant="outlined">
|
|
185
|
+
<Button>Outlined</Button>
|
|
186
|
+
<Button>Outlined</Button>
|
|
187
|
+
<Button href="#">Outlined</Button>
|
|
188
|
+
</ButtonGroup>
|
|
189
|
+
|
|
190
|
+
<ButtonGroup variant="tonal">
|
|
191
|
+
<Button>Tonal</Button>
|
|
192
|
+
<Button>Tonal</Button>
|
|
193
|
+
<Button href="#">Tonal</Button>
|
|
194
|
+
</ButtonGroup>
|
|
195
|
+
|
|
196
|
+
<ButtonGroup variant="filled">
|
|
197
|
+
<Button>Filled</Button>
|
|
198
|
+
<Button>Filled</Button>
|
|
199
|
+
<Button href="#">Filled</Button>
|
|
200
|
+
</ButtonGroup>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Vue
|
|
204
|
+
|
|
205
|
+
`import { ButtonGroup } from "opui-css/vue"`
|
|
206
|
+
|
|
207
|
+
### Example: Variants
|
|
208
|
+
|
|
209
|
+
```vue
|
|
210
|
+
<script setup lang="ts">
|
|
211
|
+
import { Button, ButtonGroup } from "opui-css/vue"
|
|
212
|
+
</script>
|
|
213
|
+
|
|
214
|
+
<template>
|
|
215
|
+
<ButtonGroup>
|
|
216
|
+
<Button>Transparent</Button>
|
|
217
|
+
<Button>Transparent</Button>
|
|
218
|
+
<Button href="#">Transparent</Button>
|
|
219
|
+
</ButtonGroup>
|
|
220
|
+
|
|
221
|
+
<ButtonGroup variant="outlined">
|
|
222
|
+
<Button>Outlined</Button>
|
|
223
|
+
<Button>Outlined</Button>
|
|
224
|
+
<Button href="#">Outlined</Button>
|
|
225
|
+
</ButtonGroup>
|
|
226
|
+
|
|
227
|
+
<ButtonGroup variant="tonal">
|
|
228
|
+
<Button>Tonal</Button>
|
|
229
|
+
<Button>Tonal</Button>
|
|
230
|
+
<Button href="#">Tonal</Button>
|
|
231
|
+
</ButtonGroup>
|
|
232
|
+
|
|
233
|
+
<ButtonGroup variant="filled">
|
|
234
|
+
<Button>Filled</Button>
|
|
235
|
+
<Button>Filled</Button>
|
|
236
|
+
<Button href="#">Filled</Button>
|
|
237
|
+
</ButtonGroup>
|
|
238
|
+
</template>
|
|
239
|
+
```
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Button
|
|
2
|
+
|
|
3
|
+
Buttons allow users to take actions, and make choices, with a single tap.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/button.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/button.md), [Astro](https://open-props-ui.netlify.app/astro/components/button.md), [React](https://open-props-ui.netlify.app/react/components/button.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/button.md), [Vue](https://open-props-ui.netlify.app/vue/components/button.md).
|
|
7
|
+
|
|
8
|
+
## Button
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `.ui-button` (root): Container element.
|
|
13
|
+
- `<svg>`: An optional icon.
|
|
14
|
+
- `<kbd>`: An optional keyboard hint.
|
|
15
|
+
|
|
16
|
+
### Props and modifiers
|
|
17
|
+
|
|
18
|
+
- `aria-label`: `string`. The accessible name, for a button without visible text. React and Svelte require it, or `aria-labelledby`, when there are no `children`.
|
|
19
|
+
- `aria-labelledby`: `string`. The id of the element that names a button without visible text, instead of `aria-label`.
|
|
20
|
+
- `as`: `"a" | "button"`, default `"button"`. The element to render. Defaults to `"a"` with `href`.
|
|
21
|
+
- `color`: `"critical"` (`.ui-critical`), `"primary"` (`.ui-primary`). Optional colors.
|
|
22
|
+
- `disabled`: `boolean`. Disables the button. A link button drops its `href` and gets `aria-disabled="true"`.
|
|
23
|
+
- `href`: `string`. The link to use. Renders an `<a>`.
|
|
24
|
+
- `round`: `boolean`, `.ui-round`. Fully rounded corners, a circle when icon-only.
|
|
25
|
+
- `size`: `"large"` (`.ui-large`), `"medium"` (default), `"small"` (`.ui-small`), `"x-small"` (`.ui-x-small`). The size of the element.
|
|
26
|
+
- State (HTML): `current` (`[aria-current="page"]`), `disabled` (`[disabled]`), `disabledLink` (`a[aria-disabled="true"]`). Keeps the pressed background on a transparent (text) button link for the current page in navigation, or dims a disabled one. A link button, which can't take `disabled`, drops its `href` and takes `aria-disabled="true"` instead.
|
|
27
|
+
- `variant`: `"filled"` (`.ui-filled`), `"outlined"` (`.ui-outlined`), `"tonal"` (`.ui-tonal`), `"transparent"` (default). The variant to use.
|
|
28
|
+
|
|
29
|
+
### Slots
|
|
30
|
+
|
|
31
|
+
- `default`: The label and an optional icon.
|
|
32
|
+
|
|
33
|
+
## Component properties
|
|
34
|
+
|
|
35
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
36
|
+
|
|
37
|
+
### button.css
|
|
38
|
+
|
|
39
|
+
- `--_accent`: The accent color. Fills, borders, text, hover and active states are derived from it. Defaults to `--ui-button-accent` when a theme sets it. `.ui-primary` and `.ui-critical` set it.
|
|
40
|
+
- `--_accent-fill`: Fill of filled buttons and of hovered outlined and tonal buttons, and the base of the filled hover and pressed shades. `--ui-button-accent-filled` when a theme sets it, else `--_accent`, and in `.ui-critical` `--ui-critical` kept within `--ui-accent-fill-max-lightness`, so the light text stays readable while the border keeps `--ui-critical`.
|
|
41
|
+
- `--_accent-tonal`: Background of `.ui-tonal`. `--ui-surface-tonal`, a palette tint in `.ui-critical`, and `--ui-primary-tonal` or the tint in `.ui-primary`.
|
|
42
|
+
- `--_border-width`: The border width.
|
|
43
|
+
- `--_ease`: Easing of the transitions. Defaults to `--ui-ease`.
|
|
44
|
+
- `--_font-size`: The font size. Set by `.ui-x-small` and `.ui-small`.
|
|
45
|
+
- `--_icon-size`: The size of a direct child `svg`. Icon-only buttons scale it with `--_size`.
|
|
46
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
47
|
+
- `--_on-accent`: Text color on a fill of `--_accent`. Defaults to `--ui-button-on-accent` when a theme sets it. `.ui-primary` sets `--ui-on-primary`, `.ui-critical` `--ui-on-fill`.
|
|
48
|
+
- `--_on-accent-fill`: Text color on `--_accent-fill`: filled buttons, and hovered outlined and tonal ones. `--ui-button-on-accent-filled` when a theme sets it, else `--_on-accent`.
|
|
49
|
+
- `--_on-accent-tonal`: Text color of `.ui-tonal`.
|
|
50
|
+
- `--_padding-inline`: The inline padding. Set by the size classes from `--ui-button-padding-inline` and its size variants.
|
|
51
|
+
- `--_radius`: The corner radius. Defaults to `--ui-button-radius`, or `--ui-radius` when the theme doesn't set it. `.ui-round` makes it round.
|
|
52
|
+
- `--_size`: The height, and the width of an icon-only button. Defaults to `--ui-button-size`, set by the size classes.
|
|
53
|
+
|
|
54
|
+
Outputs: `--_accent-text`, `--_actions-shift`, `--_bg-color`, `--_border-color`, `--_default-active-bg-color`, `--_default-hover-bg-color`, `--_duration`, `--_filled-active-bg-color`, `--_filled-hover-bg-color`, `--_outlined-active-bg-color`, `--_outlined-active-border-color`, `--_outlined-active-text-color`, `--_outlined-hover-bg-color`, `--_outlined-hover-border-color`, `--_outlined-hover-text-color`, `--_shadow`, `--_text-color`, `--_tonal-active-bg-color`, `--_tonal-active-text-color`, `--_tonal-hover-bg-color` and `--_tonal-hover-text-color`.
|
|
55
|
+
|
|
56
|
+
## Theme tokens
|
|
57
|
+
|
|
58
|
+
The stylesheets read `--ui-accent-fill-max-lightness`, `--ui-border-width`, `--ui-button-accent`, `--ui-button-accent-filled`, `--ui-button-font-weight`, `--ui-button-hover-shadow`, `--ui-button-hover-translate`, `--ui-button-on-accent`, `--ui-button-on-accent-filled`, `--ui-button-padding-inline`, `--ui-button-padding-inline-large`, `--ui-button-padding-inline-small`, `--ui-button-padding-inline-x-small`, `--ui-button-radius`, `--ui-button-size`, `--ui-button-size-large`, `--ui-button-size-small`, `--ui-button-size-x-small`, `--ui-control-accent`, `--ui-control-border-color`, `--ui-control-border-color-filled`, `--ui-critical`, `--ui-critical-text`, `--ui-disabled-opacity`, `--ui-duration-fast`, `--ui-ease`, `--ui-field-border-color`, `--ui-field-border-width`, `--ui-focus-ring-offset`, `--ui-focus-ring-width`, `--ui-font-code`, `--ui-font-size-caption`, `--ui-font-size-control`, `--ui-font-size-small`, `--ui-font-weight-bold`, `--ui-font-weight-normal`, `--ui-line-height-tight`, `--ui-motion`, `--ui-on-control-accent`, `--ui-on-fill`, `--ui-on-primary`, `--ui-on-primary-tonal`, `--ui-palette-on-strong`, `--ui-palette-on-tint`, `--ui-palette-strong`, `--ui-palette-tint`, `--ui-primary`, `--ui-primary-text`, `--ui-primary-tonal`, `--ui-radius`, `--ui-radius-round`, `--ui-radius-small`, `--ui-shadow-control`, `--ui-shadow-field`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-state-active-alpha-accent`, `--ui-state-active-alpha-dark`, `--ui-state-active-alpha-light`, `--ui-state-hover-alpha-accent`, `--ui-state-hover-alpha-dark`, `--ui-state-hover-alpha-light`, `--ui-surface-tonal`, `--ui-text`, `--ui-text-disabled`, `--ui-text-max-chroma` and `--ui-text-min-lightness`. `theming.md` and `tokens.json` describe them.
|
|
59
|
+
|
|
60
|
+
## HTML
|
|
61
|
+
|
|
62
|
+
### Example: Variants
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<div class="example-row">
|
|
66
|
+
<button type="button" class="ui-button">Transparent</button>
|
|
67
|
+
<button type="button" class="ui-button" disabled>Disabled</button>
|
|
68
|
+
<a class="ui-button" href="#">Link</a>
|
|
69
|
+
<a class="ui-button" href="#" aria-current="page">Current</a>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="example-row">
|
|
72
|
+
<button type="button" class="ui-button ui-outlined">Outlined</button>
|
|
73
|
+
<button type="button" class="ui-button ui-outlined" disabled>Disabled</button>
|
|
74
|
+
<a class="ui-button ui-outlined" href="#">Link</a>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="example-row">
|
|
77
|
+
<button type="button" class="ui-button ui-tonal">Tonal</button>
|
|
78
|
+
<button type="button" class="ui-button ui-tonal" disabled>Disabled</button>
|
|
79
|
+
<a class="ui-button ui-tonal" href="#">Link</a>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="example-row">
|
|
82
|
+
<button type="button" class="ui-button ui-filled">Filled</button>
|
|
83
|
+
<button type="button" class="ui-button ui-filled" disabled>Disabled</button>
|
|
84
|
+
<a class="ui-button ui-filled" href="#">Link</a>
|
|
85
|
+
</div>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Astro
|
|
89
|
+
|
|
90
|
+
`import { Button } from "opui-css/astro"`
|
|
91
|
+
|
|
92
|
+
### Example: Variants
|
|
93
|
+
|
|
94
|
+
```astro
|
|
95
|
+
---
|
|
96
|
+
import { Button } from "opui-css/astro"
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
<div class="example-row">
|
|
100
|
+
<Button>Transparent</Button>
|
|
101
|
+
<Button disabled>Disabled</Button>
|
|
102
|
+
<Button href="#">Link</Button>
|
|
103
|
+
<Button href="#" aria-current="page">Current</Button>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="example-row">
|
|
106
|
+
<Button variant="outlined">Outlined</Button>
|
|
107
|
+
<Button variant="outlined" disabled>Disabled</Button>
|
|
108
|
+
<Button variant="outlined" href="#">Link</Button>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="example-row">
|
|
111
|
+
<Button variant="tonal">Tonal</Button>
|
|
112
|
+
<Button variant="tonal" disabled>Disabled</Button>
|
|
113
|
+
<Button variant="tonal" href="#">Link</Button>
|
|
114
|
+
</div>
|
|
115
|
+
<div class="example-row">
|
|
116
|
+
<Button variant="filled">Filled</Button>
|
|
117
|
+
<Button variant="filled" disabled>Disabled</Button>
|
|
118
|
+
<Button variant="filled" href="#">Link</Button>
|
|
119
|
+
</div>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## React
|
|
123
|
+
|
|
124
|
+
`import { Button } from "opui-css/react"`
|
|
125
|
+
|
|
126
|
+
### Example: Variants
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
import { Button } from "opui-css/react"
|
|
130
|
+
|
|
131
|
+
export default function Variants() {
|
|
132
|
+
return (
|
|
133
|
+
<>
|
|
134
|
+
<div className="example-row">
|
|
135
|
+
<Button>Transparent</Button>
|
|
136
|
+
<Button disabled>Disabled</Button>
|
|
137
|
+
<Button href="#">Link</Button>
|
|
138
|
+
<Button href="#" aria-current="page">
|
|
139
|
+
Current
|
|
140
|
+
</Button>
|
|
141
|
+
</div>
|
|
142
|
+
<div className="example-row">
|
|
143
|
+
<Button variant="outlined">Outlined</Button>
|
|
144
|
+
<Button variant="outlined" disabled>
|
|
145
|
+
Disabled
|
|
146
|
+
</Button>
|
|
147
|
+
<Button variant="outlined" href="#">
|
|
148
|
+
Link
|
|
149
|
+
</Button>
|
|
150
|
+
</div>
|
|
151
|
+
<div className="example-row">
|
|
152
|
+
<Button variant="tonal">Tonal</Button>
|
|
153
|
+
<Button variant="tonal" disabled>
|
|
154
|
+
Disabled
|
|
155
|
+
</Button>
|
|
156
|
+
<Button variant="tonal" href="#">
|
|
157
|
+
Link
|
|
158
|
+
</Button>
|
|
159
|
+
</div>
|
|
160
|
+
<div className="example-row">
|
|
161
|
+
<Button variant="filled">Filled</Button>
|
|
162
|
+
<Button variant="filled" disabled>
|
|
163
|
+
Disabled
|
|
164
|
+
</Button>
|
|
165
|
+
<Button variant="filled" href="#">
|
|
166
|
+
Link
|
|
167
|
+
</Button>
|
|
168
|
+
</div>
|
|
169
|
+
</>
|
|
170
|
+
)
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Svelte
|
|
175
|
+
|
|
176
|
+
`import { Button } from "opui-css/svelte"`
|
|
177
|
+
|
|
178
|
+
### Example: Variants
|
|
179
|
+
|
|
180
|
+
```svelte
|
|
181
|
+
<script lang="ts">
|
|
182
|
+
import { Button } from "opui-css/svelte"
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<div class="example-row">
|
|
186
|
+
<Button>Transparent</Button>
|
|
187
|
+
<Button disabled>Disabled</Button>
|
|
188
|
+
<Button href="#">Link</Button>
|
|
189
|
+
<Button href="#" aria-current="page">Current</Button>
|
|
190
|
+
</div>
|
|
191
|
+
<div class="example-row">
|
|
192
|
+
<Button variant="outlined">Outlined</Button>
|
|
193
|
+
<Button variant="outlined" disabled>Disabled</Button>
|
|
194
|
+
<Button variant="outlined" href="#">Link</Button>
|
|
195
|
+
</div>
|
|
196
|
+
<div class="example-row">
|
|
197
|
+
<Button variant="tonal">Tonal</Button>
|
|
198
|
+
<Button variant="tonal" disabled>Disabled</Button>
|
|
199
|
+
<Button variant="tonal" href="#">Link</Button>
|
|
200
|
+
</div>
|
|
201
|
+
<div class="example-row">
|
|
202
|
+
<Button variant="filled">Filled</Button>
|
|
203
|
+
<Button variant="filled" disabled>Disabled</Button>
|
|
204
|
+
<Button variant="filled" href="#">Link</Button>
|
|
205
|
+
</div>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Vue
|
|
209
|
+
|
|
210
|
+
`import { Button } from "opui-css/vue"`
|
|
211
|
+
|
|
212
|
+
### Example: Variants
|
|
213
|
+
|
|
214
|
+
```vue
|
|
215
|
+
<script setup lang="ts">
|
|
216
|
+
import { Button } from "opui-css/vue"
|
|
217
|
+
</script>
|
|
218
|
+
|
|
219
|
+
<template>
|
|
220
|
+
<div class="example-row">
|
|
221
|
+
<Button>Transparent</Button>
|
|
222
|
+
<Button disabled>Disabled</Button>
|
|
223
|
+
<Button href="#">Link</Button>
|
|
224
|
+
<Button href="#" aria-current="page">Current</Button>
|
|
225
|
+
</div>
|
|
226
|
+
<div class="example-row">
|
|
227
|
+
<Button variant="outlined">Outlined</Button>
|
|
228
|
+
<Button variant="outlined" disabled>Disabled</Button>
|
|
229
|
+
<Button variant="outlined" href="#">Link</Button>
|
|
230
|
+
</div>
|
|
231
|
+
<div class="example-row">
|
|
232
|
+
<Button variant="tonal">Tonal</Button>
|
|
233
|
+
<Button variant="tonal" disabled>Disabled</Button>
|
|
234
|
+
<Button variant="tonal" href="#">Link</Button>
|
|
235
|
+
</div>
|
|
236
|
+
<div class="example-row">
|
|
237
|
+
<Button variant="filled">Filled</Button>
|
|
238
|
+
<Button variant="filled" disabled>Disabled</Button>
|
|
239
|
+
<Button variant="filled" href="#">Link</Button>
|
|
240
|
+
</div>
|
|
241
|
+
</template>
|
|
242
|
+
```
|