opui-css 5.4.3 → 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 +1015 -373
- package/LICENSE +21 -21
- package/MIGRATING-legacy.md +159 -0
- package/MIGRATING.md +1362 -138
- package/README.md +238 -87
- package/astro/index.ts +175 -46
- package/bin/opui-css.mjs +68 -0
- package/components/Accordion/Accordion.astro +21 -48
- package/components/Accordion/Accordion.react.tsx +23 -0
- package/components/Accordion/Accordion.svelte +27 -0
- package/components/Accordion/Accordion.vue +21 -38
- 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 +13 -4
- package/components/Accordion/types.react.ts +14 -0
- package/components/Accordion/types.svelte.ts +15 -7
- package/components/Accordion/types.ts +16 -10
- package/components/Accordion/types.vue-props.ts +22 -0
- package/components/Anchor/Anchor.astro +37 -49
- package/components/Anchor/Anchor.react.tsx +38 -0
- package/components/Anchor/Anchor.svelte +47 -0
- package/components/Anchor/Anchor.vue +43 -41
- 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 +7 -4
- package/components/Anchor/types.react.ts +7 -0
- package/components/Anchor/types.svelte.ts +7 -7
- package/components/Anchor/types.ts +18 -9
- package/components/Anchor/types.vue-props.ts +15 -0
- package/components/Avatar/Avatar.astro +33 -29
- package/components/Avatar/Avatar.react.tsx +34 -0
- package/components/Avatar/Avatar.svelte +39 -0
- package/components/Avatar/Avatar.vue +26 -24
- 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 +11 -10
- package/components/Avatar/types.react.ts +11 -0
- package/components/Avatar/types.svelte.ts +11 -12
- package/components/Avatar/types.ts +32 -29
- package/components/Avatar/types.vue-props.ts +11 -0
- package/components/Badge/Badge.astro +56 -51
- package/components/Badge/Badge.react.tsx +50 -0
- package/components/Badge/Badge.svelte +48 -0
- package/components/Badge/Badge.vue +36 -40
- package/components/Badge/types.astro.ts +4 -4
- package/components/Badge/types.react.ts +6 -0
- package/components/Badge/types.svelte.ts +7 -4
- package/components/Badge/types.ts +12 -12
- package/components/Badge/types.vue-props.ts +7 -0
- package/components/Button/Button.astro +36 -36
- package/components/Button/Button.react.tsx +33 -0
- package/components/Button/Button.svelte +37 -0
- package/components/Button/Button.vue +27 -27
- package/components/Button/types.astro.ts +6 -6
- package/components/Button/types.react.ts +11 -0
- package/components/Button/types.svelte.ts +15 -6
- package/components/Button/types.ts +32 -16
- package/components/Button/types.vue-props.ts +6 -0
- package/components/ButtonGroup/ButtonGroup.astro +33 -29
- package/components/ButtonGroup/ButtonGroup.react.tsx +30 -0
- package/components/ButtonGroup/ButtonGroup.svelte +34 -0
- package/components/ButtonGroup/ButtonGroup.vue +25 -22
- package/components/ButtonGroup/types.astro.ts +4 -4
- package/components/ButtonGroup/types.react.ts +4 -0
- package/components/ButtonGroup/types.svelte.ts +4 -4
- package/components/ButtonGroup/types.ts +7 -7
- package/components/ButtonGroup/types.vue-props.ts +6 -0
- package/components/Callout/Callout.astro +24 -76
- package/components/Callout/Callout.react.tsx +26 -0
- package/components/Callout/Callout.svelte +32 -0
- package/components/Callout/Callout.vue +23 -63
- 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 +9 -4
- package/components/Callout/types.react.ts +9 -0
- package/components/Callout/types.svelte.ts +9 -7
- package/components/Callout/types.ts +10 -10
- package/components/Callout/types.vue-props.ts +14 -0
- package/components/Card/Card.astro +18 -34
- package/components/Card/Card.react.tsx +15 -0
- package/components/Card/Card.svelte +23 -0
- package/components/Card/Card.vue +18 -28
- 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 +10 -4
- package/components/Card/types.react.ts +10 -0
- package/components/Card/types.svelte.ts +11 -7
- package/components/Card/types.ts +11 -11
- 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 +58 -46
- package/components/Checkbox/Checkbox.react.tsx +51 -0
- package/components/Checkbox/Checkbox.svelte +61 -0
- package/components/Checkbox/Checkbox.vue +64 -43
- package/components/Checkbox/CheckboxInput.astro +20 -16
- package/components/Checkbox/CheckboxInput.react.tsx +39 -0
- package/components/Checkbox/CheckboxInput.svelte +34 -0
- package/components/Checkbox/CheckboxInput.vue +50 -32
- package/components/Checkbox/types.astro.ts +7 -8
- package/components/Checkbox/types.react.ts +11 -0
- package/components/Checkbox/types.svelte.ts +16 -12
- package/components/Checkbox/types.ts +20 -16
- package/components/Checkbox/types.vue-props.ts +15 -0
- package/components/Chip/Chip.astro +47 -31
- package/components/Chip/Chip.react.tsx +45 -0
- package/components/Chip/Chip.svelte +45 -0
- package/components/Chip/Chip.vue +44 -37
- package/components/Chip/types.astro.ts +9 -9
- package/components/Chip/types.react.ts +15 -0
- package/components/Chip/types.svelte.ts +16 -14
- package/components/Chip/types.ts +30 -13
- package/components/Chip/types.vue-props.ts +11 -0
- package/components/DescriptionList/DescriptionList.astro +22 -18
- package/components/DescriptionList/DescriptionList.react.tsx +25 -0
- package/components/DescriptionList/DescriptionList.svelte +29 -0
- package/components/DescriptionList/DescriptionList.vue +22 -23
- 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/{Description.vue → DescriptionListDescription.vue} +15 -12
- 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} +15 -12
- 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} +15 -12
- package/components/DescriptionList/types.astro.ts +10 -10
- package/components/DescriptionList/types.react.ts +10 -0
- package/components/DescriptionList/types.svelte.ts +10 -4
- package/components/DescriptionList/types.ts +5 -3
- package/components/DescriptionList/types.vue-props.ts +12 -0
- package/components/Dialog/Dialog.astro +24 -38
- package/components/Dialog/Dialog.react.tsx +23 -0
- package/components/Dialog/Dialog.svelte +33 -0
- package/components/Dialog/Dialog.vue +25 -35
- 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 +12 -4
- package/components/Dialog/types.react.ts +12 -0
- package/components/Dialog/types.svelte.ts +15 -7
- package/components/Dialog/types.ts +17 -10
- package/components/Dialog/types.vue-props.ts +24 -0
- package/components/Divider/Divider.astro +34 -12
- package/components/Divider/Divider.react.tsx +36 -0
- package/components/Divider/Divider.svelte +40 -0
- package/components/Divider/Divider.vue +30 -12
- package/components/Divider/types.astro.ts +4 -4
- package/components/Divider/types.react.ts +4 -0
- package/components/Divider/types.svelte.ts +4 -4
- package/components/Divider/types.ts +5 -3
- package/components/Divider/types.vue-props.ts +6 -0
- package/components/Drawer/Drawer.astro +42 -47
- package/components/Drawer/Drawer.react.tsx +40 -0
- package/components/Drawer/Drawer.svelte +50 -0
- package/components/Drawer/Drawer.vue +41 -46
- 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 +16 -11
- package/components/Drawer/DrawerFooter.react.tsx +15 -0
- package/components/Drawer/DrawerFooter.svelte +23 -0
- package/components/Drawer/DrawerFooter.vue +18 -16
- package/components/Drawer/DrawerHeader.astro +35 -27
- package/components/Drawer/DrawerHeader.react.tsx +41 -0
- package/components/Drawer/DrawerHeader.svelte +42 -0
- package/components/Drawer/DrawerHeader.vue +35 -36
- 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 +12 -8
- package/components/Drawer/types.react.ts +13 -0
- package/components/Drawer/types.svelte.ts +16 -15
- package/components/Drawer/types.ts +25 -20
- package/components/Drawer/types.vue-props.ts +24 -0
- package/components/FieldDescription/FieldDescription.astro +9 -9
- package/components/FieldDescription/FieldDescription.react.tsx +6 -0
- package/components/FieldDescription/FieldDescription.svelte +15 -0
- package/components/FieldDescription/FieldDescription.vue +12 -12
- package/components/FieldDescription/types.astro.ts +4 -4
- package/components/FieldDescription/types.react.ts +4 -0
- package/components/FieldDescription/types.svelte.ts +4 -4
- package/components/FieldDescription/types.ts +1 -1
- package/components/FieldDescription/types.vue-props.ts +6 -0
- package/components/FieldGroup/FieldGroup.astro +24 -24
- package/components/FieldGroup/FieldGroup.react.tsx +27 -0
- package/components/FieldGroup/FieldGroup.svelte +32 -0
- package/components/FieldGroup/FieldGroup.vue +23 -25
- 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.astro.ts +4 -4
- package/components/FieldGroup/types.react.ts +4 -0
- package/components/FieldGroup/types.svelte.ts +4 -4
- package/components/FieldGroup/types.ts +6 -4
- package/components/FieldGroup/types.vue-props.ts +6 -0
- package/components/FieldLegend/FieldLegend.astro +11 -11
- package/components/FieldLegend/FieldLegend.react.tsx +14 -0
- package/components/FieldLegend/FieldLegend.svelte +20 -0
- package/components/FieldLegend/FieldLegend.vue +20 -18
- package/components/FieldLegend/types.astro.ts +6 -6
- package/components/FieldLegend/types.react.ts +6 -0
- package/components/FieldLegend/types.svelte.ts +6 -6
- package/components/FieldLegend/types.ts +1 -1
- package/components/FieldLegend/types.vue-props.ts +9 -0
- package/components/{FieldSet/FieldSet.astro → Fieldset/Fieldset.astro} +15 -11
- 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 → Fieldset}/types.astro.ts +6 -6
- 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.astro +10 -10
- package/components/Form/Form.react.tsx +9 -0
- package/components/Form/Form.svelte +16 -0
- package/components/Form/Form.vue +16 -14
- package/components/Form/types.astro.ts +6 -6
- package/components/Form/types.react.ts +6 -0
- package/components/Form/types.svelte.ts +6 -7
- package/components/Form/types.ts +1 -1
- package/components/Form/types.vue-props.ts +9 -0
- package/components/List/List.astro +29 -29
- package/components/List/List.react.tsx +27 -0
- package/components/List/List.svelte +31 -0
- package/components/List/List.vue +23 -28
- package/components/List/types.astro.ts +4 -4
- package/components/List/types.react.ts +4 -0
- package/components/List/types.svelte.ts +4 -4
- package/components/List/types.ts +6 -7
- package/components/List/types.vue-props.ts +6 -0
- package/components/ListItem/ListItem.astro +115 -108
- package/components/ListItem/ListItem.react.tsx +65 -0
- package/components/ListItem/ListItem.svelte +80 -0
- package/components/ListItem/ListItem.vue +93 -98
- package/components/ListItem/types.astro.ts +9 -10
- package/components/ListItem/types.react.ts +17 -0
- package/components/ListItem/types.svelte.ts +17 -14
- package/components/ListItem/types.ts +35 -32
- 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 +20 -31
- package/components/Progress/Progress.react.tsx +27 -0
- package/components/Progress/Progress.svelte +30 -0
- package/components/Progress/Progress.vue +30 -34
- package/components/Progress/types.astro.ts +5 -4
- package/components/Progress/types.react.ts +5 -0
- package/components/Progress/types.svelte.ts +5 -4
- package/components/Progress/types.ts +5 -10
- package/components/Progress/types.vue-props.ts +6 -0
- package/components/Radio/Radio.astro +58 -44
- package/components/Radio/Radio.react.tsx +51 -0
- package/components/Radio/Radio.svelte +59 -0
- package/components/Radio/Radio.vue +62 -41
- package/components/Radio/RadioInput.astro +10 -7
- package/components/Radio/RadioInput.react.tsx +10 -0
- package/components/Radio/RadioInput.svelte +27 -0
- package/components/Radio/RadioInput.vue +39 -14
- package/components/Radio/types.astro.ts +7 -6
- package/components/Radio/types.react.ts +11 -0
- package/components/Radio/types.svelte.ts +16 -12
- package/components/Radio/types.ts +17 -12
- package/components/Radio/types.vue-props.ts +15 -0
- package/components/Range/Range.astro +139 -128
- package/components/Range/Range.react.tsx +157 -0
- package/components/Range/Range.svelte +136 -0
- package/components/Range/Range.vue +169 -85
- 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 +24 -25
- package/components/Range/types.vue-props.ts +16 -0
- package/components/Range/value.ts +27 -0
- package/components/Select/Select.astro +147 -108
- package/components/Select/Select.react.tsx +124 -0
- package/components/Select/Select.svelte +123 -0
- package/components/Select/Select.vue +157 -85
- 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 +72 -76
- package/components/Switch/Switch.react.tsx +63 -0
- package/components/Switch/Switch.svelte +73 -0
- package/components/Switch/Switch.vue +81 -63
- package/components/Switch/SwitchInput.astro +10 -7
- package/components/Switch/SwitchInput.react.tsx +12 -0
- package/components/Switch/SwitchInput.svelte +30 -0
- package/components/Switch/SwitchInput.vue +36 -14
- package/components/Switch/types.astro.ts +7 -5
- package/components/Switch/types.react.ts +11 -0
- package/components/Switch/types.svelte.ts +16 -9
- package/components/Switch/types.ts +19 -16
- package/components/Switch/types.vue-props.ts +17 -0
- package/components/Table/Table.astro +27 -14
- package/components/Table/Table.react.tsx +24 -0
- package/components/Table/Table.svelte +28 -0
- package/components/Table/Table.vue +20 -19
- 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/Table/TableRow.vue +12 -0
- package/components/Table/types.astro.ts +22 -16
- package/components/Table/types.react.ts +22 -0
- package/components/Table/types.svelte.ts +23 -11
- package/components/Table/types.ts +14 -9
- package/components/Table/types.vue-props.ts +28 -0
- package/components/Tabs/Tabs.astro +34 -24
- package/components/Tabs/Tabs.react.tsx +43 -0
- package/components/Tabs/Tabs.svelte +43 -0
- package/components/Tabs/Tabs.vue +30 -20
- package/components/Tabs/TabsItem.astro +28 -40
- package/components/Tabs/TabsItem.react.tsx +47 -0
- package/components/Tabs/TabsItem.svelte +52 -0
- package/components/Tabs/TabsItem.vue +41 -39
- 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 +9 -16
- package/components/Tabs/TabsPanel.react.tsx +6 -0
- package/components/Tabs/TabsPanel.svelte +15 -0
- package/components/Tabs/TabsPanel.vue +12 -31
- 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 +13 -11
- package/components/Tabs/types.react.ts +12 -0
- package/components/Tabs/types.svelte.ts +10 -10
- package/components/Tabs/types.ts +21 -19
- package/components/Tabs/types.vue-props.ts +25 -0
- package/components/TextField/TextField.astro +108 -124
- package/components/TextField/TextField.react.tsx +70 -0
- package/components/TextField/TextField.svelte +84 -0
- package/components/TextField/TextField.vue +94 -74
- package/components/TextField/types.astro.ts +15 -17
- 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 +104 -118
- package/components/Textarea/Textarea.react.tsx +64 -0
- package/components/Textarea/Textarea.svelte +80 -0
- package/components/Textarea/Textarea.vue +88 -64
- package/components/Textarea/types.astro.ts +8 -10
- package/components/Textarea/types.react.ts +8 -0
- package/components/Textarea/types.svelte.ts +13 -21
- package/components/Textarea/types.ts +21 -33
- package/components/Textarea/types.vue-props.ts +20 -0
- package/components/ToggleButton/ToggleButton.astro +43 -43
- package/components/ToggleButton/ToggleButton.react.tsx +57 -0
- package/components/ToggleButton/ToggleButton.svelte +58 -0
- package/components/ToggleButton/ToggleButton.vue +65 -41
- package/components/ToggleButton/types.astro.ts +4 -4
- package/components/ToggleButton/types.react.ts +4 -0
- package/components/ToggleButton/types.svelte.ts +5 -7
- package/components/ToggleButton/types.ts +6 -10
- package/components/ToggleButton/types.vue-props.ts +11 -0
- package/components/ToggleGroup/ToggleGroup.astro +40 -42
- package/components/ToggleGroup/ToggleGroup.react.tsx +54 -0
- package/components/ToggleGroup/ToggleGroup.svelte +54 -0
- package/components/ToggleGroup/ToggleGroup.vue +45 -36
- 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.astro.ts +4 -4
- package/components/ToggleGroup/types.react.ts +12 -0
- package/components/ToggleGroup/types.svelte.ts +6 -9
- package/components/ToggleGroup/types.ts +17 -15
- package/components/ToggleGroup/types.vue-props.ts +6 -0
- package/components/Tooltip/Tooltip.astro +22 -23
- package/components/Tooltip/Tooltip.react.tsx +24 -0
- package/components/Tooltip/Tooltip.svelte +29 -0
- package/components/Tooltip/Tooltip.vue +21 -22
- package/components/Tooltip/types.astro.ts +4 -4
- package/components/Tooltip/types.react.ts +4 -0
- package/components/Tooltip/types.svelte.ts +4 -7
- package/components/Tooltip/types.ts +5 -11
- 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 +191 -214
- package/core/palette.css +131 -314
- package/core/utils.css +55 -68
- 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 +237 -173
- package/css/components/anchor.css +40 -27
- package/css/components/avatar.css +105 -65
- package/css/components/badge.css +146 -107
- package/css/components/button-group.css +170 -179
- package/css/components/button.css +422 -212
- package/css/components/callout.css +153 -112
- package/css/components/card.css +234 -116
- package/css/components/carousel.css +399 -0
- package/css/components/checkbox.css +90 -211
- package/css/components/chip.css +215 -92
- package/css/components/choice.css +291 -0
- package/css/components/description-list.css +91 -81
- package/css/components/dialog.css +154 -64
- package/css/components/divider.css +73 -20
- package/css/components/drawer.css +300 -170
- package/css/components/form.css +131 -146
- package/css/components/layout.css +92 -0
- package/css/components/link.css +53 -21
- package/css/components/list.css +460 -343
- package/css/components/menu.css +174 -0
- package/css/components/progress.css +107 -99
- package/css/components/radio.css +61 -170
- package/css/components/range.css +463 -320
- package/css/components/select.css +189 -170
- package/css/components/spinner.css +57 -38
- package/css/components/switch.css +197 -270
- package/css/components/table.css +214 -173
- package/css/components/tabs.css +278 -84
- package/css/components/text-field.css +559 -449
- package/css/components/textarea.css +20 -26
- package/css/components/toggle-button.css +131 -91
- package/css/components/toggle-group.css +86 -56
- package/css/components/tooltip.css +125 -68
- package/css/components/typography.css +801 -580
- package/css/components.css +48 -41
- package/css/imports.css +15 -17
- package/css/js/checkbox.d.ts +3 -0
- package/css/js/checkbox.js +31 -21
- 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 +750 -124
- package/dist/op.css +16 -241
- 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 +7346 -5140
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +8489 -6128
- 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 +17 -14
- package/open-props.css +15 -6
- package/package.json +136 -90
- 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 +175 -54
- 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
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
# Carousel
|
|
2
|
+
|
|
3
|
+
A scrolling list with snap points, buttons and markers.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/carousel.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/carousel.md), [Astro](https://open-props-ui.netlify.app/astro/components/carousel.md), [React](https://open-props-ui.netlify.app/react/components/carousel.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/carousel.md), [Vue](https://open-props-ui.netlify.app/vue/components/carousel.md).
|
|
7
|
+
|
|
8
|
+
## Carousel
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `ul.ui-carousel` (root): The scroller.
|
|
13
|
+
- `<li>` (slot `default`): An item.
|
|
14
|
+
- `::scroll-button(inline-start)` (prop `buttons`): The previous button. `::scroll-button(block-start)` when vertical.
|
|
15
|
+
- `::scroll-button(inline-end)` (prop `buttons`): The next button. `::scroll-button(block-end)` when vertical.
|
|
16
|
+
- `li::scroll-marker` (prop `markers`): A marker, one per item.
|
|
17
|
+
|
|
18
|
+
### Props and modifiers
|
|
19
|
+
|
|
20
|
+
- `align`: `"center"` (`.ui-align-center`), `"start"` (default). Where items snap.
|
|
21
|
+
- `aria-label`: `string`, `[aria-label]`. Accessible name of the carousel.
|
|
22
|
+
- `aspectRatio`: `number | string`, `--_media-aspect-ratio`, default `"16 / 9"`. Aspect ratio that images, videos and iframes are cropped to.
|
|
23
|
+
- `buttons`: `"inside"` (default), `"none"` (`.ui-buttons-none`), `"outside"` (`.ui-buttons-outside`). Previous and next buttons. `"outside"` places them beside the items, and `"none"` leaves them out.
|
|
24
|
+
- `itemsPerView`: `number`, `--_items-per-view`, default `1`. Number of visible items.
|
|
25
|
+
- `markers`: `boolean`, `.ui-markers`. One marker per item, after the list.
|
|
26
|
+
- `orientation`: `"horizontal"` (default), `"vertical"` (`.ui-vertical`). The orientation of the element. A vertical carousel is `--_block-size` tall, `24rem` by default.
|
|
27
|
+
- `peek`: `boolean`, `.ui-peek`. Shows part of the neighboring items.
|
|
28
|
+
- `persistentButtons`: `boolean`, `.ui-persistent-buttons`. Keeps the buttons visible at the ends. A disabled button has a muted border.
|
|
29
|
+
- `stretch`: `boolean`, `.ui-stretch`. Makes each item a grid, so its content (a card, a link) fills the item's height. Media with an aspect ratio keeps it.
|
|
30
|
+
|
|
31
|
+
### Notes
|
|
32
|
+
|
|
33
|
+
- HTML: The root is a `<ul>` with an `aria-label`. CSS adds the buttons, and `.ui-markers` the markers. Smooth scrolling follows `--ui-motion`: `.ui-motion-off` on the carousel or a parent turns it off.
|
|
34
|
+
- Astro, React, Svelte and Vue: Smooth scrolling follows `--ui-motion`: `.ui-motion-off` on the carousel or a parent turns it off.
|
|
35
|
+
|
|
36
|
+
## Component properties
|
|
37
|
+
|
|
38
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
39
|
+
|
|
40
|
+
### carousel.css
|
|
41
|
+
|
|
42
|
+
- `--_block-size`: The height of `.ui-vertical`.
|
|
43
|
+
- `--_button-bg-color`: Background of the scroll buttons. Defaults to `--ui-surface-inverse`.
|
|
44
|
+
- `--_button-disabled-opacity`: Opacity of disabled scroll buttons. `0` hides them, `.ui-persistent-buttons` sets `1`.
|
|
45
|
+
- `--_button-image`: Icon of the scroll buttons, pointing forward. The previous button mirrors it.
|
|
46
|
+
- `--_button-image-size`: The icon size in the scroll buttons.
|
|
47
|
+
- `--_button-inset`: Space between the scroll buttons and the carousel edge.
|
|
48
|
+
- `--_button-next-label`: Accessible label of the next button.
|
|
49
|
+
- `--_button-prev-label`: Accessible label of the previous button.
|
|
50
|
+
- `--_button-shadow`: Shadow of the scroll buttons. Defaults to `--ui-shadow-overlay`.
|
|
51
|
+
- `--_button-size`: Size of the scroll buttons. Defaults to `--ui-button-size-small`.
|
|
52
|
+
- `--_ease`: Easing of the transitions. Defaults to `--ui-ease`.
|
|
53
|
+
- `--_gap`: Space between items.
|
|
54
|
+
- `--_items-per-view`: Number of items per view.
|
|
55
|
+
- `--_marker-bg-color`: Fill of the other markers. Defaults to `transparent`.
|
|
56
|
+
- `--_marker-border-color`: Ring of the other markers. Defaults to `--ui-text`, which keeps its contrast against the page in every theme.
|
|
57
|
+
- `--_marker-gap`: Space between markers.
|
|
58
|
+
- `--_marker-label`: Accessible label of each marker, followed by the item number.
|
|
59
|
+
- `--_marker-selected-bg-color`: Fill and ring of the current marker. Defaults to `--ui-selected-strong`.
|
|
60
|
+
- `--_marker-selected-padding`: Inset of the current marker's dot, smaller than the `--ui-space-2` of the other markers, so the current dot is larger. Defaults to `--ui-space-1`.
|
|
61
|
+
- `--_marker-size`: Size of the markers. The dot sits inside, inset by `--ui-space-2`.
|
|
62
|
+
- `--_markers-gap`: Space between the items and the markers.
|
|
63
|
+
- `--_media-aspect-ratio`: Aspect ratio of `img`, `video` and `iframe` in items.
|
|
64
|
+
- `--_media-radius`: Corner radius of `img`, `video` and `iframe` in items. Defaults to `--ui-radius`.
|
|
65
|
+
- `--_motion`: Motion multiplier for the button and marker transitions. `0` turns them off.
|
|
66
|
+
- `--_padding-block`: Block padding of `.ui-vertical`, showing the neighboring items. Set by `.ui-peek`.
|
|
67
|
+
- `--_padding-inline`: The inline padding, showing the neighboring items. Set by `.ui-peek`.
|
|
68
|
+
- `--_shadow-room`: Room around the items for their box shadows, so the scroll container doesn't clip them: padding that a negative margin cancels, so the layout stays the same. On the scroll axis it is capped by `--_block-room` and `--_inline-room`. Defaults to `--ui-space-3`.
|
|
69
|
+
- `--_snap-align`: Snap alignment of items. `.ui-align-center` sets `center`.
|
|
70
|
+
|
|
71
|
+
Outputs: `--_block-room`, `--_button-border-color`, `--_button-disabled-border-color`, `--_button-end-flip`, `--_button-flip`, `--_button-scale`, `--_button-start-flip`, `--_duration`, `--_inline-room`, `--_item-size` and `--_scale-duration`.
|
|
72
|
+
|
|
73
|
+
## Theme tokens
|
|
74
|
+
|
|
75
|
+
The stylesheets read `--ui-border-width`, `--ui-button-size-small`, `--ui-control-border-color-filled`, `--ui-duration`, `--ui-duration-fast`, `--ui-ease`, `--ui-focus-ring-color`, `--ui-focus-ring-offset`, `--ui-focus-ring-style`, `--ui-focus-ring-width`, `--ui-motion`, `--ui-radius`, `--ui-radius-round`, `--ui-selected-strong`, `--ui-shadow-overlay`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-space-5`, `--ui-space-8`, `--ui-surface-inverse` and `--ui-text`. `theming.md` and `tokens.json` describe them.
|
|
76
|
+
|
|
77
|
+
## HTML
|
|
78
|
+
|
|
79
|
+
### Example: Basics
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<ul class="ui-carousel ui-markers" aria-label="Destinations">
|
|
83
|
+
<li>
|
|
84
|
+
<div class="ui-card ui-tonal">
|
|
85
|
+
<hgroup class="ui-header">
|
|
86
|
+
<p>Destination</p>
|
|
87
|
+
<h3>Kyoto</h3>
|
|
88
|
+
<p>Temples, gardens and quiet lanes.</p>
|
|
89
|
+
</hgroup>
|
|
90
|
+
</div>
|
|
91
|
+
</li>
|
|
92
|
+
<li>
|
|
93
|
+
<div class="ui-card ui-tonal">
|
|
94
|
+
<hgroup class="ui-header">
|
|
95
|
+
<p>Destination</p>
|
|
96
|
+
<h3>Lima</h3>
|
|
97
|
+
<p>Ceviche by the Pacific.</p>
|
|
98
|
+
</hgroup>
|
|
99
|
+
</div>
|
|
100
|
+
</li>
|
|
101
|
+
<li>
|
|
102
|
+
<div class="ui-card ui-tonal">
|
|
103
|
+
<hgroup class="ui-header">
|
|
104
|
+
<p>Destination</p>
|
|
105
|
+
<h3>Lisbon</h3>
|
|
106
|
+
<p>Tiles, trams and custard tarts.</p>
|
|
107
|
+
</hgroup>
|
|
108
|
+
</div>
|
|
109
|
+
</li>
|
|
110
|
+
<li>
|
|
111
|
+
<div class="ui-card ui-tonal">
|
|
112
|
+
<hgroup class="ui-header">
|
|
113
|
+
<p>Destination</p>
|
|
114
|
+
<h3>Oslo</h3>
|
|
115
|
+
<p>Fjords, saunas and modern architecture.</p>
|
|
116
|
+
</hgroup>
|
|
117
|
+
</div>
|
|
118
|
+
</li>
|
|
119
|
+
<li>
|
|
120
|
+
<div class="ui-card ui-tonal">
|
|
121
|
+
<hgroup class="ui-header">
|
|
122
|
+
<p>Destination</p>
|
|
123
|
+
<h3>Tunis</h3>
|
|
124
|
+
<p>Medina markets and Mediterranean light.</p>
|
|
125
|
+
</hgroup>
|
|
126
|
+
</div>
|
|
127
|
+
</li>
|
|
128
|
+
</ul>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Astro
|
|
132
|
+
|
|
133
|
+
`import { Carousel } from "opui-css/astro"`
|
|
134
|
+
|
|
135
|
+
### Example: Basics
|
|
136
|
+
|
|
137
|
+
```astro
|
|
138
|
+
---
|
|
139
|
+
import { Card, CardHeader, Carousel } from "opui-css/astro"
|
|
140
|
+
|
|
141
|
+
const places = [
|
|
142
|
+
{ description: "Temples, gardens and quiet lanes.", title: "Kyoto" },
|
|
143
|
+
{ description: "Ceviche by the Pacific.", title: "Lima" },
|
|
144
|
+
{ description: "Tiles, trams and custard tarts.", title: "Lisbon" },
|
|
145
|
+
{ description: "Fjords, saunas and modern architecture.", title: "Oslo" },
|
|
146
|
+
{ description: "Medina markets and Mediterranean light.", title: "Tunis" },
|
|
147
|
+
]
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
<Carousel aria-label="Destinations" markers>
|
|
151
|
+
{
|
|
152
|
+
places.map(({ description, title }) => (
|
|
153
|
+
<li>
|
|
154
|
+
<Card variant="tonal">
|
|
155
|
+
<CardHeader>
|
|
156
|
+
<p>Destination</p>
|
|
157
|
+
<h3>{title}</h3>
|
|
158
|
+
<p>{description}</p>
|
|
159
|
+
</CardHeader>
|
|
160
|
+
</Card>
|
|
161
|
+
</li>
|
|
162
|
+
))
|
|
163
|
+
}
|
|
164
|
+
</Carousel>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## React
|
|
168
|
+
|
|
169
|
+
`import { Carousel } from "opui-css/react"`
|
|
170
|
+
|
|
171
|
+
### Example: Basics
|
|
172
|
+
|
|
173
|
+
```tsx
|
|
174
|
+
import { Card, CardHeader, Carousel } from "opui-css/react"
|
|
175
|
+
|
|
176
|
+
const places = [
|
|
177
|
+
{ description: "Temples, gardens and quiet lanes.", title: "Kyoto" },
|
|
178
|
+
{ description: "Ceviche by the Pacific.", title: "Lima" },
|
|
179
|
+
{ description: "Tiles, trams and custard tarts.", title: "Lisbon" },
|
|
180
|
+
{ description: "Fjords, saunas and modern architecture.", title: "Oslo" },
|
|
181
|
+
{ description: "Medina markets and Mediterranean light.", title: "Tunis" },
|
|
182
|
+
]
|
|
183
|
+
|
|
184
|
+
export default function Basics() {
|
|
185
|
+
return (
|
|
186
|
+
<Carousel aria-label="Destinations" markers>
|
|
187
|
+
{places.map(({ description, title }) => (
|
|
188
|
+
<li key={title}>
|
|
189
|
+
<Card variant="tonal">
|
|
190
|
+
<CardHeader>
|
|
191
|
+
<p>Destination</p>
|
|
192
|
+
<h3>{title}</h3>
|
|
193
|
+
<p>{description}</p>
|
|
194
|
+
</CardHeader>
|
|
195
|
+
</Card>
|
|
196
|
+
</li>
|
|
197
|
+
))}
|
|
198
|
+
</Carousel>
|
|
199
|
+
)
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Svelte
|
|
204
|
+
|
|
205
|
+
`import { Carousel } from "opui-css/svelte"`
|
|
206
|
+
|
|
207
|
+
### Example: Basics
|
|
208
|
+
|
|
209
|
+
```svelte
|
|
210
|
+
<script lang="ts">
|
|
211
|
+
import { Card, CardHeader, Carousel } from "opui-css/svelte"
|
|
212
|
+
|
|
213
|
+
const places = [
|
|
214
|
+
{ description: "Temples, gardens and quiet lanes.", title: "Kyoto" },
|
|
215
|
+
{ description: "Ceviche by the Pacific.", title: "Lima" },
|
|
216
|
+
{ description: "Tiles, trams and custard tarts.", title: "Lisbon" },
|
|
217
|
+
{ description: "Fjords, saunas and modern architecture.", title: "Oslo" },
|
|
218
|
+
{ description: "Medina markets and Mediterranean light.", title: "Tunis" },
|
|
219
|
+
]
|
|
220
|
+
</script>
|
|
221
|
+
|
|
222
|
+
<Carousel aria-label="Destinations" markers>
|
|
223
|
+
{#each places as { description, title } (title)}
|
|
224
|
+
<li>
|
|
225
|
+
<Card variant="tonal">
|
|
226
|
+
<CardHeader>
|
|
227
|
+
<p>Destination</p>
|
|
228
|
+
<h3>{title}</h3>
|
|
229
|
+
<p>{description}</p>
|
|
230
|
+
</CardHeader>
|
|
231
|
+
</Card>
|
|
232
|
+
</li>
|
|
233
|
+
{/each}
|
|
234
|
+
</Carousel>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
## Vue
|
|
238
|
+
|
|
239
|
+
`import { Carousel } from "opui-css/vue"`
|
|
240
|
+
|
|
241
|
+
### Example: Basics
|
|
242
|
+
|
|
243
|
+
```vue
|
|
244
|
+
<script setup lang="ts">
|
|
245
|
+
import { Card, CardHeader, Carousel } from "opui-css/vue"
|
|
246
|
+
|
|
247
|
+
const places = [
|
|
248
|
+
{ description: "Temples, gardens and quiet lanes.", title: "Kyoto" },
|
|
249
|
+
{ description: "Ceviche by the Pacific.", title: "Lima" },
|
|
250
|
+
{ description: "Tiles, trams and custard tarts.", title: "Lisbon" },
|
|
251
|
+
{ description: "Fjords, saunas and modern architecture.", title: "Oslo" },
|
|
252
|
+
{ description: "Medina markets and Mediterranean light.", title: "Tunis" },
|
|
253
|
+
]
|
|
254
|
+
</script>
|
|
255
|
+
|
|
256
|
+
<template>
|
|
257
|
+
<Carousel aria-label="Destinations" markers>
|
|
258
|
+
<li v-for="{ description, title } in places" :key="title">
|
|
259
|
+
<Card variant="tonal">
|
|
260
|
+
<CardHeader>
|
|
261
|
+
<p>Destination</p>
|
|
262
|
+
<h3>{{ title }}</h3>
|
|
263
|
+
<p>{{ description }}</p>
|
|
264
|
+
</CardHeader>
|
|
265
|
+
</Card>
|
|
266
|
+
</li>
|
|
267
|
+
</Carousel>
|
|
268
|
+
</template>
|
|
269
|
+
```
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Use a Checkbox for choices that are submitted with a form. For a setting that applies right away, use a Switch, and for options in a toolbar a Toggle. See also: Checkbox field group.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/checkbox.css`, `opui-css/css/components/choice.css`, `opui-css/css/components/form.css` and `opui-css/css/components/card.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/checkbox.md), [Astro](https://open-props-ui.netlify.app/astro/components/checkbox.md), [React](https://open-props-ui.netlify.app/react/components/checkbox.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/checkbox.md), [Vue](https://open-props-ui.netlify.app/vue/components/checkbox.md).
|
|
7
|
+
- The docs page also documents `FieldGroup`, see `form.md`.
|
|
8
|
+
|
|
9
|
+
## Checkbox
|
|
10
|
+
|
|
11
|
+
### Parts
|
|
12
|
+
|
|
13
|
+
- `label.ui-checkbox` (root): Container element.
|
|
14
|
+
- `<input>` (model): The checkbox input.
|
|
15
|
+
- `.ui-label` (prop `label`, slot `default`): The label.
|
|
16
|
+
- `.ui-end-text` (prop `endText`, slot `end-text`): Supporting text displayed below the label.
|
|
17
|
+
|
|
18
|
+
### Props and modifiers
|
|
19
|
+
|
|
20
|
+
- `card`: `boolean`, `.ui-card`. Renders the checkbox as a card: a padded, outlined surface that tints when hovered and when checked, with the label and `endText` inside. Add `spread` to put the input at the end, and `variant` to change the surface.
|
|
21
|
+
- `disabled`: `boolean`, `input[aria-disabled="true"]`, `input[disabled]`. Dims the checkbox and shows a not-allowed cursor. `aria-disabled="true"` looks the same, but keeps the checkbox focusable and its value in the form, and doesn't stop the change, so block it with a script.
|
|
22
|
+
- `error`: `boolean`, `input[aria-invalid="true"]`. Marks the control invalid and shows error styles.
|
|
23
|
+
- `hideLabel`: `boolean`, `.ui-checkbox > span.ui-sr-only`. Visually hides the label, `.ui-sr-only` instead of `.ui-label`.
|
|
24
|
+
- `id`: `string`. The id of the `<input>`.
|
|
25
|
+
- `indeterminate`: `boolean`, `input[data-indeterminate]`. Shows a partially checked state. Sets the `indeterminate` property on the `<input>`.
|
|
26
|
+
- `name`: `string`. The name of the `<input>`. Inside a `FieldGroup`, the group's `name` applies.
|
|
27
|
+
- `orientation`: `"horizontal"` (default), `"vertical"` (`.ui-vertical`). The orientation of the element. `vertical` stacks the label under the input.
|
|
28
|
+
- `required`: `boolean`, `input[required]`. Adds a required mark after the label. The form won't submit until it's checked.
|
|
29
|
+
- `size`: `"large"` (`.ui-large`), `"medium"` (default), `"small"` (`.ui-small`), `"x-small"` (`.ui-x-small`). The size of the element.
|
|
30
|
+
- `spread`: `boolean`, `.ui-spread`. Pushes the label and the input to opposite ends.
|
|
31
|
+
- `value`: `string`. The value of the `<input>`, submitted with the form when it's checked.
|
|
32
|
+
- `variant`: `"elevated"` (`.ui-elevated`), `"outlined"` (default), `"tonal"` (`.ui-tonal`). The surface of the card, with `card`. `outlined` has a border, `tonal` a tinted surface and `elevated` a shadow, like Card.
|
|
33
|
+
|
|
34
|
+
Model: `checked` (`boolean | (string | number)[]`), the checked state, or the checked values of a group. Astro and React `checked`, Svelte `bind:checked`, `bind:group`, Vue `v-model`.
|
|
35
|
+
|
|
36
|
+
### Notes
|
|
37
|
+
|
|
38
|
+
- HTML: `data-indeterminate` needs `checkbox.js`. It sets the `indeterminate` property.
|
|
39
|
+
- Astro and Vue: Attributes that aren't props go to the `<input>`, like `autofocus` and `form`, and `class` and `style` go to the root `<label>`. To hide the label, set `hideLabel` and keep the text in `label` or the slot.
|
|
40
|
+
- React: Attributes that aren't props go to the `<input>`, like `autofocus` and `form`, and `className` and `style` go to the root `<label>`. To hide the label, set `hideLabel` and keep the text in `label` or `children`. Use `checked` with `onChange`, or `defaultChecked`. For a group, keep the checked values in your own state.
|
|
41
|
+
- Svelte: Attributes that aren't props go to the `<input>`, like `autofocus` and `form`, and `class` and `style` go to the root `<label>`. To hide the label, set `hideLabel` and keep the text in `label` or `children`.
|
|
42
|
+
|
|
43
|
+
## CheckboxInput
|
|
44
|
+
|
|
45
|
+
### Parts
|
|
46
|
+
|
|
47
|
+
- `<input type="checkbox">` (root): The checkbox input, without a label.
|
|
48
|
+
|
|
49
|
+
### Props and modifiers
|
|
50
|
+
|
|
51
|
+
- `indeterminate`: `boolean`, `[data-indeterminate]`. Shows a partially checked state. Sets the `indeterminate` property on the `<input>`.
|
|
52
|
+
|
|
53
|
+
Model: `checked` (`boolean | (string | number)[]`), the checked state, or the checked values of a group. Astro and React `checked`, Svelte `bind:checked`, `bind:group`, Vue `v-model`.
|
|
54
|
+
|
|
55
|
+
### Notes
|
|
56
|
+
|
|
57
|
+
- Astro, React, Svelte and Vue: The checkbox `<input>` without the label, for a custom layout inside a `label.ui-checkbox`, such as the end of a `ListItem` with `type="checkbox"`. Attributes that aren't props go to the `<input>`. Inside a `FieldGroup`, it takes the group's `name`.
|
|
58
|
+
|
|
59
|
+
## Component properties
|
|
60
|
+
|
|
61
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
62
|
+
|
|
63
|
+
### choice.css
|
|
64
|
+
|
|
65
|
+
- `--_accent`: Fill and border of the checked input. `--ui-choice-accent` when the theme sets it, otherwise `--ui-primary` with its lightness capped in dark mode, and `--ui-invalid` when invalid.
|
|
66
|
+
- `--_card-padding`: Padding of `.ui-card`. `--ui-space-3`, and `--ui-space-2` in `.ui-small` and `.ui-x-small`.
|
|
67
|
+
- `--_checked-bg-color`: Background of a checked `.ui-card`. `--ui-primary-tonal` when the theme sets it, otherwise `--ui-primary` at `--ui-state-active-alpha-accent`.
|
|
68
|
+
- `--_ease`: Easing of the transitions. Defaults to `--ui-ease`.
|
|
69
|
+
- `--_hover-bg-color`: Background of a hovered `.ui-card`. Defaults to `--ui-surface-tonal-hover`.
|
|
70
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
71
|
+
- `--_on-accent`: Color of the checkmark, dash and dots on `--_accent`. `--ui-choice-on-accent` when the theme sets it, otherwise `--ui-on-primary`, or `--ui-on-fill` in dark mode. `--ui-on-fill` when invalid.
|
|
72
|
+
- `--_ripple-size`: Size of the hover ripple of checkboxes and radios, relative to the input. Set on `input`.
|
|
73
|
+
- `--_size`: Width and height of the checkbox and radio input, which the label centers on. Defaults to `--ui-choice-size`, set by the size classes. `switch.css` sets it to the track height.
|
|
74
|
+
|
|
75
|
+
Outputs: `--_bg-color`, `--_border-color`, `--_border-width`, `--_duration`, `--_shadow` and `--_thumb-scale`.
|
|
76
|
+
|
|
77
|
+
### card.css
|
|
78
|
+
|
|
79
|
+
- `--_ease`: Easing of the focus ring animation. Defaults to `--ui-ease`.
|
|
80
|
+
- `--_elevated-bg-color`: Background of `.ui-elevated`. Defaults to `--ui-surface-elevated`.
|
|
81
|
+
- `--_elevated-shadow`: Shadow of `.ui-elevated`. Defaults to `--ui-shadow-elevated`.
|
|
82
|
+
- `--_motion`: Motion multiplier for the focus ring animation. `0` turns it off.
|
|
83
|
+
- `--_outlined-border-color`: Border color of `.ui-outlined`. Defaults to `--ui-border-color`.
|
|
84
|
+
- `--_padding`: Padding of the header, content and actions. `--ui-card-padding`, or `--ui-space-3` when a theme leaves it unset.
|
|
85
|
+
- `--_surface-bg-color`: Background of default and `.ui-outlined` cards, and border color of `.ui-tonal` and `.ui-elevated` unless a theme sets `--ui-border-color-raised`. Defaults to `--ui-surface`.
|
|
86
|
+
- `--_tonal-bg-color`: Background of `.ui-tonal`. Defaults to `--ui-surface-tonal`.
|
|
87
|
+
|
|
88
|
+
Outputs: `--_bg-color`, `--_border-color`, `--_border-width`, `--_duration` and `--_shadow`.
|
|
89
|
+
|
|
90
|
+
## Theme tokens
|
|
91
|
+
|
|
92
|
+
The stylesheets read `--ui-border-color`, `--ui-border-color-on-raised`, `--ui-border-color-raised`, `--ui-border-width`, `--ui-card-padding`, `--ui-choice-accent`, `--ui-choice-border-color`, `--ui-choice-fill-max-lightness`, `--ui-choice-label-offset`, `--ui-choice-on-accent`, `--ui-choice-ripple-bg-color`, `--ui-choice-size`, `--ui-choice-size-large`, `--ui-choice-size-small`, `--ui-choice-size-x-small`, `--ui-control-accent`, `--ui-disabled-opacity`, `--ui-duration`, `--ui-ease`, `--ui-field-border-color`, `--ui-field-border-color-on-raised`, `--ui-field-border-width`, `--ui-field-helper-font-size`, `--ui-field-helper-line-height`, `--ui-field-helper-text-color`, `--ui-field-label-font-size`, `--ui-field-label-font-weight`, `--ui-field-label-text-color`, `--ui-field-required-text-color`, `--ui-focus-ring-color`, `--ui-focus-ring-offset`, `--ui-focus-ring-style`, `--ui-focus-ring-width`, `--ui-font-size-body`, `--ui-font-size-caption`, `--ui-invalid`, `--ui-invalid-text`, `--ui-line-height-control`, `--ui-line-height-tight`, `--ui-motion`, `--ui-on-control-accent`, `--ui-on-fill`, `--ui-on-primary`, `--ui-primary`, `--ui-primary-tonal`, `--ui-radius`, `--ui-radius-x-small`, `--ui-shadow-elevated`, `--ui-shadow-surface`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-space-4`, `--ui-space-5`, `--ui-state-active-alpha-accent`, `--ui-state-hover-alpha-accent`, `--ui-surface`, `--ui-surface-elevated`, `--ui-surface-tonal`, `--ui-surface-tonal-hover`, `--ui-switch-thumb-size-large`, `--ui-switch-thumb-size-small`, `--ui-switch-thumb-size-x-small`, `--ui-switch-track-block-size-large`, `--ui-switch-track-block-size-small`, `--ui-switch-track-block-size-x-small`, `--ui-switch-track-inline-size-large`, `--ui-switch-track-inline-size-small`, `--ui-switch-track-inline-size-x-small`, `--ui-text` and `--ui-text-strong`. `theming.md` and `tokens.json` describe them.
|
|
93
|
+
|
|
94
|
+
## HTML
|
|
95
|
+
|
|
96
|
+
### Example: Basics
|
|
97
|
+
|
|
98
|
+
```html
|
|
99
|
+
<label class="ui-checkbox">
|
|
100
|
+
<input name="checkbox-basics" type="checkbox" checked />
|
|
101
|
+
<span class="ui-sr-only">Checked</span>
|
|
102
|
+
</label>
|
|
103
|
+
|
|
104
|
+
<label class="ui-checkbox">
|
|
105
|
+
<input name="checkbox-basics" type="checkbox" />
|
|
106
|
+
<span class="ui-sr-only">Unchecked</span>
|
|
107
|
+
</label>
|
|
108
|
+
|
|
109
|
+
<label class="ui-checkbox">
|
|
110
|
+
<input name="checkbox-basics" type="checkbox" data-indeterminate />
|
|
111
|
+
<span class="ui-sr-only">Indeterminate</span>
|
|
112
|
+
</label>
|
|
113
|
+
|
|
114
|
+
<label class="ui-checkbox">
|
|
115
|
+
<input name="checkbox-basics" type="checkbox" disabled />
|
|
116
|
+
<span class="ui-sr-only">Disabled</span>
|
|
117
|
+
</label>
|
|
118
|
+
|
|
119
|
+
<label class="ui-checkbox">
|
|
120
|
+
<input name="checkbox-basics" type="checkbox" checked disabled />
|
|
121
|
+
<span class="ui-sr-only">Checked and disabled</span>
|
|
122
|
+
</label>
|
|
123
|
+
|
|
124
|
+
<script type="module">
|
|
125
|
+
import { activateIndeterminate } from "opui-css/css/js/checkbox.js"
|
|
126
|
+
|
|
127
|
+
activateIndeterminate()
|
|
128
|
+
</script>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Astro
|
|
132
|
+
|
|
133
|
+
`import { Checkbox, CheckboxInput } from "opui-css/astro"`
|
|
134
|
+
|
|
135
|
+
- `Checkbox` named slots: `end-text`. Fill one with `slot="end-text"` on a child.
|
|
136
|
+
|
|
137
|
+
### Example: Basics
|
|
138
|
+
|
|
139
|
+
```astro
|
|
140
|
+
---
|
|
141
|
+
import { Checkbox } from "opui-css/astro"
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
<Checkbox checked name="checkbox-basics" hideLabel>Checked</Checkbox>
|
|
145
|
+
<Checkbox name="checkbox-basics" hideLabel>Unchecked</Checkbox>
|
|
146
|
+
<Checkbox indeterminate name="checkbox-basics" hideLabel>Indeterminate</Checkbox
|
|
147
|
+
>
|
|
148
|
+
<Checkbox disabled name="checkbox-basics" hideLabel>Disabled</Checkbox>
|
|
149
|
+
<Checkbox checked disabled name="checkbox-basics" hideLabel
|
|
150
|
+
>Checked and disabled</Checkbox
|
|
151
|
+
>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## React
|
|
155
|
+
|
|
156
|
+
`import { Checkbox, CheckboxInput } from "opui-css/react"`
|
|
157
|
+
|
|
158
|
+
- `Checkbox` slot props (`ReactNode`): `children` and `endText`.
|
|
159
|
+
- Client components (`"use client"`): `CheckboxInput`.
|
|
160
|
+
- Hydration: `indeterminate` on `Checkbox` and `CheckboxInput`. A DOM property, set in a layout effect. The server renders `data-indeterminate`, but the box looks unchecked until hydration. Without hydration: Call `activateIndeterminate()` from `opui-css/css/js/checkbox.js`.
|
|
161
|
+
|
|
162
|
+
### Example: Basics
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
import { Checkbox } from "opui-css/react"
|
|
166
|
+
|
|
167
|
+
export default function Basics() {
|
|
168
|
+
return (
|
|
169
|
+
<>
|
|
170
|
+
<Checkbox defaultChecked name="checkbox-basics" hideLabel>
|
|
171
|
+
Checked
|
|
172
|
+
</Checkbox>
|
|
173
|
+
<Checkbox name="checkbox-basics" hideLabel>
|
|
174
|
+
Unchecked
|
|
175
|
+
</Checkbox>
|
|
176
|
+
<Checkbox indeterminate name="checkbox-basics" hideLabel>
|
|
177
|
+
Indeterminate
|
|
178
|
+
</Checkbox>
|
|
179
|
+
<Checkbox disabled name="checkbox-basics" hideLabel>
|
|
180
|
+
Disabled
|
|
181
|
+
</Checkbox>
|
|
182
|
+
<Checkbox defaultChecked disabled name="checkbox-basics" hideLabel>
|
|
183
|
+
Checked and disabled
|
|
184
|
+
</Checkbox>
|
|
185
|
+
</>
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Svelte
|
|
191
|
+
|
|
192
|
+
`import { Checkbox, CheckboxInput } from "opui-css/svelte"`
|
|
193
|
+
|
|
194
|
+
- `Checkbox` slot snippets: `children` and `endText`.
|
|
195
|
+
- Hydration: `bind:checked` and `bind:group` on `Checkbox` and `CheckboxInput`. 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.
|
|
196
|
+
- Hydration: `indeterminate` on `Checkbox` and `CheckboxInput`. A DOM property, set in an `{@attach}`. The server renders `data-indeterminate`, but the box looks unchecked until hydration. Without hydration: Call `activateIndeterminate()` from `opui-css/css/js/checkbox.js`.
|
|
197
|
+
|
|
198
|
+
### Example: Basics
|
|
199
|
+
|
|
200
|
+
```svelte
|
|
201
|
+
<script lang="ts">
|
|
202
|
+
import { Checkbox } from "opui-css/svelte"
|
|
203
|
+
</script>
|
|
204
|
+
|
|
205
|
+
<Checkbox checked name="checkbox-basics" hideLabel>Checked</Checkbox>
|
|
206
|
+
<Checkbox name="checkbox-basics" hideLabel>Unchecked</Checkbox>
|
|
207
|
+
<Checkbox indeterminate name="checkbox-basics" hideLabel>Indeterminate</Checkbox
|
|
208
|
+
>
|
|
209
|
+
<Checkbox disabled name="checkbox-basics" hideLabel>Disabled</Checkbox>
|
|
210
|
+
<Checkbox checked disabled name="checkbox-basics" hideLabel
|
|
211
|
+
>Checked and disabled</Checkbox
|
|
212
|
+
>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Vue
|
|
216
|
+
|
|
217
|
+
`import { Checkbox, CheckboxInput } from "opui-css/vue"`
|
|
218
|
+
|
|
219
|
+
- `Checkbox` named slots: `end-text`. Fill one with `<template #end-text>`.
|
|
220
|
+
- Hydration: `indeterminate` on `Checkbox` and `CheckboxInput`. A DOM property, set in `watchPostEffect`. The server renders `data-indeterminate`, but the box looks unchecked until hydration. Without hydration: Call `activateIndeterminate()` from `opui-css/css/js/checkbox.js`.
|
|
221
|
+
- Hydration: `v-model` on `Checkbox` and `CheckboxInput`. 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.
|
|
222
|
+
|
|
223
|
+
### Example: Basics
|
|
224
|
+
|
|
225
|
+
```vue
|
|
226
|
+
<script setup lang="ts">
|
|
227
|
+
import { Checkbox } from "opui-css/vue"
|
|
228
|
+
</script>
|
|
229
|
+
|
|
230
|
+
<template>
|
|
231
|
+
<Checkbox checked name="checkbox-basics" hideLabel>Checked</Checkbox>
|
|
232
|
+
<Checkbox name="checkbox-basics" hideLabel>Unchecked</Checkbox>
|
|
233
|
+
<Checkbox indeterminate name="checkbox-basics" hideLabel
|
|
234
|
+
>Indeterminate</Checkbox
|
|
235
|
+
>
|
|
236
|
+
<Checkbox disabled name="checkbox-basics" hideLabel>Disabled</Checkbox>
|
|
237
|
+
<Checkbox checked disabled name="checkbox-basics" hideLabel
|
|
238
|
+
>Checked and disabled</Checkbox
|
|
239
|
+
>
|
|
240
|
+
</template>
|
|
241
|
+
```
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Chip
|
|
2
|
+
|
|
3
|
+
Chips are compact elements that represent an input, attribute, or action. Use them for filters, tags and choices. For the main action, like Save or Send, use a Button.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/chip.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/chip.md), [Astro](https://open-props-ui.netlify.app/astro/components/chip.md), [React](https://open-props-ui.netlify.app/react/components/chip.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/chip.md), [Vue](https://open-props-ui.netlify.app/vue/components/chip.md).
|
|
7
|
+
|
|
8
|
+
## Chip
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `.ui-chip` (root): Container element. Can be a `<div>`, `<a>` or `<button>`.
|
|
13
|
+
- `<svg>` (slot `start`): Optional content at the start, such as an icon.
|
|
14
|
+
- `.ui-chip > .ui-text` (prop `label`, slot `label`): The label, text or rich content.
|
|
15
|
+
- `<svg>` (slot `end`): Optional content at the end, such as an icon.
|
|
16
|
+
|
|
17
|
+
### Props and modifiers
|
|
18
|
+
|
|
19
|
+
- `as`: `"a" | "button" | "div"`, default `"div"`. The element to render. Defaults to `"a"` with `href`.
|
|
20
|
+
- `disabled`: `boolean`. Disables a button chip. A link chip drops its `href` and gets `aria-disabled="true"` instead.
|
|
21
|
+
- `dot`: `boolean`, `.ui-dot`. Adds a leading dot in the chip's color. `critical`, `warning` and `neutral` shape it.
|
|
22
|
+
- `href`: `string`. The link to use. Renders an `<a>`.
|
|
23
|
+
- `multiline`: `boolean`, `.ui-multiline`. Lets the label wrap to multiple lines.
|
|
24
|
+
- Pressed (HTML): `[aria-pressed="true"]`. Fills a pressed button chip with `--ui-selected`, or `--ui-primary`, for a filter or a choice.
|
|
25
|
+
- `severity`: `"critical"` (`.ui-critical`), `"info"` (`.ui-info`), `"neutral"` (`.ui-neutral`), `"success"` (`.ui-success`), `"warning"` (`.ui-warning`). The severity of a status chip. It tints the chip, and colors and shapes its dot.
|
|
26
|
+
- `size`: `"large"` (`.ui-large`), `"medium"` (default), `"small"` (`.ui-small`), `"x-small"` (`.ui-x-small`). The size of the element.
|
|
27
|
+
- State (HTML): `button` (`button[disabled]`), `link` (`a[aria-disabled="true"]`), `static` (`.ui-disabled`). Disables a button chip. A link chip, which can't take `disabled`, drops its `href` and takes `aria-disabled="true"` instead. A static chip can't be disabled; `.ui-disabled` gives it an inactive look without announcing a state.
|
|
28
|
+
- `variant`: `"outlined"` (`.ui-outlined`), `"tonal"` (default). The variant to use.
|
|
29
|
+
|
|
30
|
+
## Component properties
|
|
31
|
+
|
|
32
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
33
|
+
|
|
34
|
+
### chip.css
|
|
35
|
+
|
|
36
|
+
- `--_font-size`: The font size. `.ui-large` sets it.
|
|
37
|
+
- `--_icon-padding-inline`: Inline padding on the side of a leading or trailing `svg`. `.ui-large` sets it.
|
|
38
|
+
- `--_icon-size`: Width of an `svg`. `.ui-large` sets it.
|
|
39
|
+
- `--_padding-inline`: The inline padding. `.ui-large` sets it.
|
|
40
|
+
- `--_pressed-bg-color`: Background of a button chip with `aria-pressed="true"`. `--ui-selected` when the theme sets it, otherwise `--ui-primary`.
|
|
41
|
+
- `--_size`: The height. Defaults to `--ui-chip-size`, set by the size classes.
|
|
42
|
+
|
|
43
|
+
Outputs: `--_accent`, `--_bg-color`, `--_border-color`, `--_dot-bg-color` and `--_text-color`.
|
|
44
|
+
|
|
45
|
+
## Theme tokens
|
|
46
|
+
|
|
47
|
+
The stylesheets read `--ui-border-color`, `--ui-border-width`, `--ui-border-width-thick`, `--ui-chip-radius`, `--ui-chip-size`, `--ui-chip-size-large`, `--ui-chip-size-small`, `--ui-chip-size-x-small`, `--ui-control-border-color`, `--ui-control-border-color-filled`, `--ui-critical`, `--ui-disabled-opacity`, `--ui-font-size-caption`, `--ui-font-size-small`, `--ui-icon-size`, `--ui-icon-size-small`, `--ui-info`, `--ui-neutral`, `--ui-on-primary`, `--ui-on-selected`, `--ui-palette-accent`, `--ui-palette-border`, `--ui-palette-strong`, `--ui-palette-tint-subtle`, `--ui-primary`, `--ui-radius`, `--ui-radius-round`, `--ui-selected`, `--ui-shadow-control`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-success`, `--ui-surface`, `--ui-surface-tonal`, `--ui-surface-tonal-hover`, `--ui-text`, `--ui-text-disabled`, `--ui-text-strong` and `--ui-warning`. `theming.md` and `tokens.json` describe them.
|
|
48
|
+
|
|
49
|
+
## HTML
|
|
50
|
+
|
|
51
|
+
### Example: Variants
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<div class="ui-chip">
|
|
55
|
+
<span class="ui-text">Tonal</span>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="ui-chip ui-outlined">
|
|
59
|
+
<span class="ui-text">Outlined</span>
|
|
60
|
+
</div>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Astro
|
|
64
|
+
|
|
65
|
+
`import { Chip } from "opui-css/astro"`
|
|
66
|
+
|
|
67
|
+
- `Chip` named slots: `end`, `label` and `start`. Fill one with `slot="end"` on a child.
|
|
68
|
+
|
|
69
|
+
### Example: Variants
|
|
70
|
+
|
|
71
|
+
```astro
|
|
72
|
+
---
|
|
73
|
+
import { Chip } from "opui-css/astro"
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
<Chip variant="tonal" label="Tonal" />
|
|
77
|
+
<Chip variant="outlined" label="Outlined" />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## React
|
|
81
|
+
|
|
82
|
+
`import { Chip } from "opui-css/react"`
|
|
83
|
+
|
|
84
|
+
- `Chip` slot props (`ReactNode`): `end`, `label` and `start`.
|
|
85
|
+
|
|
86
|
+
### Example: Variants
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
import { Chip } from "opui-css/react"
|
|
90
|
+
|
|
91
|
+
export default function Variants() {
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
<Chip variant="tonal" label="Tonal" />
|
|
95
|
+
<Chip variant="outlined" label="Outlined" />
|
|
96
|
+
</>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Svelte
|
|
102
|
+
|
|
103
|
+
`import { Chip } from "opui-css/svelte"`
|
|
104
|
+
|
|
105
|
+
- `Chip` slot snippets: `end`, `label` and `start`.
|
|
106
|
+
|
|
107
|
+
### Example: Variants
|
|
108
|
+
|
|
109
|
+
```svelte
|
|
110
|
+
<script lang="ts">
|
|
111
|
+
import { Chip } from "opui-css/svelte"
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<Chip variant="tonal" label="Tonal" />
|
|
115
|
+
<Chip variant="outlined" label="Outlined" />
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Vue
|
|
119
|
+
|
|
120
|
+
`import { Chip } from "opui-css/vue"`
|
|
121
|
+
|
|
122
|
+
- `Chip` named slots: `end`, `label` and `start`. Fill one with `<template #end>`.
|
|
123
|
+
|
|
124
|
+
### Example: Variants
|
|
125
|
+
|
|
126
|
+
```vue
|
|
127
|
+
<script setup lang="ts">
|
|
128
|
+
import { Chip } from "opui-css/vue"
|
|
129
|
+
</script>
|
|
130
|
+
|
|
131
|
+
<template>
|
|
132
|
+
<Chip variant="tonal" label="Tonal" />
|
|
133
|
+
<Chip variant="outlined" label="Outlined" />
|
|
134
|
+
</template>
|
|
135
|
+
```
|