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,802 @@
|
|
|
1
|
+
# Drawer
|
|
2
|
+
|
|
3
|
+
Slides in from the sides, top or bottom of the screen. Good for navigation, filters and side content. For a question or a short task that needs the user's full attention, use a Dialog.
|
|
4
|
+
|
|
5
|
+
- CSS: `opui-css/css/components/drawer.css`.
|
|
6
|
+
- Full docs with every example: [HTML](https://open-props-ui.netlify.app/html/components/drawer.md), [Astro](https://open-props-ui.netlify.app/astro/components/drawer.md), [React](https://open-props-ui.netlify.app/react/components/drawer.md), [Svelte](https://open-props-ui.netlify.app/svelte/components/drawer.md), [Vue](https://open-props-ui.netlify.app/vue/components/drawer.md).
|
|
7
|
+
|
|
8
|
+
## Drawer
|
|
9
|
+
|
|
10
|
+
### Parts
|
|
11
|
+
|
|
12
|
+
- `dialog.ui-drawer` (root): Container element.
|
|
13
|
+
- `.ui-header` (`DrawerHeader`): The header, a row for the title and anything next to it, with a close button.
|
|
14
|
+
- `<h2>` (`DrawerTitle`): The title. Names the drawer through `aria-labelledby`.
|
|
15
|
+
- `.ui-content` (`DrawerContent`): The scrollable content.
|
|
16
|
+
- `.ui-footer` (`DrawerFooter`): The footer, a row at the end.
|
|
17
|
+
|
|
18
|
+
### Props and modifiers
|
|
19
|
+
|
|
20
|
+
- `backdrop`: `"blurred"` (default), `"transparent"` (`.ui-backdrop-transparent`). The backdrop style. `"transparent"` keeps the page behind it fully visible.
|
|
21
|
+
- `closedby`: `"any" | "closerequest" | "none"`, `[closedby]`, default `"any"`. How the drawer can be closed. `"any"` also closes it on a click outside.
|
|
22
|
+
- `id`: `string`. The id of the `<dialog>`, which the trigger's `commandfor` points at. Required.
|
|
23
|
+
- `scrollLock`: `boolean`, `.ui-scroll-lock`. Locks page scroll while the drawer is open. With a transparent backdrop the page stays scrollable, except on screens narrower than 500px.
|
|
24
|
+
- `side`: `"block-end"` (`.ui-block-end`), `"block-start"` (`.ui-block-start`), `"inline-end"` (`.ui-inline-end`), `"inline-start"` (default). The side it opens from.
|
|
25
|
+
|
|
26
|
+
### Slots
|
|
27
|
+
|
|
28
|
+
- `default`: The drawer parts, and any other content.
|
|
29
|
+
|
|
30
|
+
### Notes
|
|
31
|
+
|
|
32
|
+
- HTML: Add `autofocus` to the element that gets focus on open. It can be the root or an element inside.
|
|
33
|
+
- Astro, React, Svelte and Vue: Attributes that aren't props go to the `<dialog>`. Without `aria-label` or `aria-labelledby`, the `DrawerTitle` names the drawer. A drawer without a `DrawerTitle` needs an `aria-label`. An `id` on `DrawerTitle` only applies when the drawer has `aria-label` or `aria-labelledby`.
|
|
34
|
+
|
|
35
|
+
## DrawerHeader
|
|
36
|
+
|
|
37
|
+
### Parts
|
|
38
|
+
|
|
39
|
+
- `.ui-header` (root): Container element.
|
|
40
|
+
- `<button>`: Closes the drawer.
|
|
41
|
+
|
|
42
|
+
### Props and modifiers
|
|
43
|
+
|
|
44
|
+
- `closeLabel`: `string`, default `"Close"`. The accessible name of the close button.
|
|
45
|
+
- `commandfor`: `string`. The id of the drawer to close with the `close` command. Without it, the button closes its `Drawer`, or the nearest `<dialog>` on click.
|
|
46
|
+
|
|
47
|
+
### Slots
|
|
48
|
+
|
|
49
|
+
- `default`: The `DrawerTitle`, and any other content before the close button.
|
|
50
|
+
|
|
51
|
+
## DrawerFooter
|
|
52
|
+
|
|
53
|
+
### Parts
|
|
54
|
+
|
|
55
|
+
- `.ui-footer` (root): A row at the end, for buttons, text or anything else.
|
|
56
|
+
- `.ui-footer > .ui-actions`: Groups buttons. Moves to the end when other content comes first.
|
|
57
|
+
|
|
58
|
+
### Props and modifiers
|
|
59
|
+
|
|
60
|
+
- `align`: `"end"` (default), `"start"` (`.ui-align-start`). Alignment for the footer content.
|
|
61
|
+
|
|
62
|
+
### Slots
|
|
63
|
+
|
|
64
|
+
- `default`: The footer content, such as buttons.
|
|
65
|
+
|
|
66
|
+
## Component properties
|
|
67
|
+
|
|
68
|
+
Set inputs on the component, inline or in your CSS. Outputs follow the variant and state, so never override them.
|
|
69
|
+
|
|
70
|
+
### drawer.css
|
|
71
|
+
|
|
72
|
+
- `--_backdrop-bg-color`: The backdrop color. Defaults to `--ui-backdrop-bg-color`, `.ui-backdrop-transparent` clears it.
|
|
73
|
+
- `--_backdrop-blur`: The backdrop filter. Defaults to a `--ui-backdrop-blur` blur, `.ui-backdrop-transparent` removes it.
|
|
74
|
+
- `--_bg-color`: The background. Defaults to `--ui-surface-elevated`.
|
|
75
|
+
- `--_block-size`: Height of `.ui-block-start` and `.ui-block-end` drawers.
|
|
76
|
+
- `--_border-color`: Color of the `.ui-header` and `.ui-footer` dividers, and of the inner edge unless a theme sets `--ui-border-color-raised`. Defaults to `--ui-border-color-on-raised`.
|
|
77
|
+
- `--_border-width`: Width of the inner edge border and the `.ui-header` and `.ui-footer` dividers.
|
|
78
|
+
- `--_content-padding`: Padding of `.ui-content`.
|
|
79
|
+
- `--_edge-border-color`: Color of the inner edge border. `--ui-border-color-raised` when a theme sets it, otherwise `--_border-color`.
|
|
80
|
+
- `--_footer-gap`: Gap between the items in `.ui-footer` and between the buttons in its `.ui-actions`.
|
|
81
|
+
- `--_footer-padding`: Padding of `.ui-footer`.
|
|
82
|
+
- `--_header-padding`: Padding of `.ui-header`.
|
|
83
|
+
- `--_inline-size`: Width of drawers that open from the inline start or end.
|
|
84
|
+
- `--_motion`: Motion multiplier for the transitions. `0` turns them off.
|
|
85
|
+
- `--_scroll-shadow`: Shadow at the edges of `.ui-content` when it scrolls. Defaults to `--ui-shadow-scroll`.
|
|
86
|
+
- `--_shadow`: The shadow. Defaults to `--ui-shadow-overlay`.
|
|
87
|
+
- `--_text-color`: The text color. Defaults to `--ui-text-strong`.
|
|
88
|
+
- `--_title-font-size`: Font size of the title, a heading in `.ui-header`. Defaults to `--ui-font-size-h4`.
|
|
89
|
+
|
|
90
|
+
Outputs: `--_direction`, `--_duration` and `--_ease`.
|
|
91
|
+
|
|
92
|
+
## Theme tokens
|
|
93
|
+
|
|
94
|
+
The stylesheets read `--ui-backdrop-bg-color`, `--ui-backdrop-blur`, `--ui-border-color`, `--ui-border-color-on-raised`, `--ui-border-color-raised`, `--ui-border-width`, `--ui-duration-slow`, `--ui-ease-enter`, `--ui-ease-exit`, `--ui-field-border-color-on-raised`, `--ui-focus-ring-inset`, `--ui-font-size-h4`, `--ui-letter-spacing-heading`, `--ui-motion`, `--ui-rhythm-step`, `--ui-shadow-overlay`, `--ui-shadow-scroll`, `--ui-space-1`, `--ui-space-2`, `--ui-space-3`, `--ui-space-6`, `--ui-surface-elevated` and `--ui-text-strong`. `theming.md` and `tokens.json` describe them.
|
|
95
|
+
|
|
96
|
+
## HTML
|
|
97
|
+
|
|
98
|
+
### Example: Basics
|
|
99
|
+
|
|
100
|
+
```html
|
|
101
|
+
<div class="example-compass">
|
|
102
|
+
<button
|
|
103
|
+
type="button"
|
|
104
|
+
class="ui-button"
|
|
105
|
+
commandfor="drawer-basics-3"
|
|
106
|
+
command="show-modal"
|
|
107
|
+
>
|
|
108
|
+
Block Start
|
|
109
|
+
</button>
|
|
110
|
+
<button
|
|
111
|
+
type="button"
|
|
112
|
+
class="ui-button"
|
|
113
|
+
commandfor="drawer-basics-1"
|
|
114
|
+
command="show-modal"
|
|
115
|
+
>
|
|
116
|
+
Inline Start
|
|
117
|
+
</button>
|
|
118
|
+
<button
|
|
119
|
+
type="button"
|
|
120
|
+
class="ui-button"
|
|
121
|
+
commandfor="drawer-basics-2"
|
|
122
|
+
command="show-modal"
|
|
123
|
+
>
|
|
124
|
+
Inline End
|
|
125
|
+
</button>
|
|
126
|
+
<button
|
|
127
|
+
type="button"
|
|
128
|
+
class="ui-button"
|
|
129
|
+
commandfor="drawer-basics-4"
|
|
130
|
+
command="show-modal"
|
|
131
|
+
>
|
|
132
|
+
Block End
|
|
133
|
+
</button>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<dialog
|
|
137
|
+
class="ui-drawer ui-scroll-lock"
|
|
138
|
+
id="drawer-basics-1"
|
|
139
|
+
aria-labelledby="drawer-basics-1-heading"
|
|
140
|
+
closedby="any"
|
|
141
|
+
>
|
|
142
|
+
<div class="ui-header">
|
|
143
|
+
<h2 id="drawer-basics-1-heading">Inline Start</h2>
|
|
144
|
+
<button type="button" class="ui-button ui-round ui-small" aria-label="Edit">
|
|
145
|
+
<svg
|
|
146
|
+
aria-hidden="true"
|
|
147
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
148
|
+
width="32"
|
|
149
|
+
height="32"
|
|
150
|
+
viewBox="0 0 32 32"
|
|
151
|
+
>
|
|
152
|
+
<path
|
|
153
|
+
fill="currentColor"
|
|
154
|
+
d="M21.65 3.434a4.889 4.889 0 1 1 6.915 6.914l-.902.901l-6.914-6.914zM19.335 5.75L4.357 20.73a3.7 3.7 0 0 0-1.002 1.84l-1.333 6.22a1 1 0 0 0 1.188 1.188l6.22-1.333a3.7 3.7 0 0 0 1.84-1.002l14.98-14.98z"
|
|
155
|
+
/>
|
|
156
|
+
</svg>
|
|
157
|
+
</button>
|
|
158
|
+
<button
|
|
159
|
+
type="button"
|
|
160
|
+
class="ui-button ui-round ui-small"
|
|
161
|
+
aria-label="Close"
|
|
162
|
+
commandfor="drawer-basics-1"
|
|
163
|
+
command="close"
|
|
164
|
+
>
|
|
165
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
166
|
+
</button>
|
|
167
|
+
</div>
|
|
168
|
+
<div class="ui-content">
|
|
169
|
+
<p>
|
|
170
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
171
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
172
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
173
|
+
commodo consequat.
|
|
174
|
+
</p>
|
|
175
|
+
</div>
|
|
176
|
+
<div class="ui-footer">
|
|
177
|
+
<button
|
|
178
|
+
type="button"
|
|
179
|
+
class="ui-button ui-small"
|
|
180
|
+
commandfor="drawer-basics-1"
|
|
181
|
+
command="close"
|
|
182
|
+
>
|
|
183
|
+
Close
|
|
184
|
+
</button>
|
|
185
|
+
</div>
|
|
186
|
+
</dialog>
|
|
187
|
+
|
|
188
|
+
<dialog
|
|
189
|
+
class="ui-drawer ui-scroll-lock ui-inline-end"
|
|
190
|
+
id="drawer-basics-2"
|
|
191
|
+
aria-labelledby="drawer-basics-2-heading"
|
|
192
|
+
closedby="any"
|
|
193
|
+
>
|
|
194
|
+
<div class="ui-header">
|
|
195
|
+
<h2 id="drawer-basics-2-heading">Inline End</h2>
|
|
196
|
+
<button
|
|
197
|
+
type="button"
|
|
198
|
+
class="ui-button ui-round ui-small"
|
|
199
|
+
aria-label="Close"
|
|
200
|
+
commandfor="drawer-basics-2"
|
|
201
|
+
command="close"
|
|
202
|
+
>
|
|
203
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
204
|
+
</button>
|
|
205
|
+
</div>
|
|
206
|
+
<div class="ui-content">
|
|
207
|
+
<p>
|
|
208
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
209
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
210
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
211
|
+
commodo consequat.
|
|
212
|
+
</p>
|
|
213
|
+
</div>
|
|
214
|
+
<div class="ui-footer">
|
|
215
|
+
<button
|
|
216
|
+
type="button"
|
|
217
|
+
class="ui-button ui-small"
|
|
218
|
+
commandfor="drawer-basics-2"
|
|
219
|
+
command="close"
|
|
220
|
+
>
|
|
221
|
+
Close
|
|
222
|
+
</button>
|
|
223
|
+
</div>
|
|
224
|
+
</dialog>
|
|
225
|
+
|
|
226
|
+
<dialog
|
|
227
|
+
class="ui-drawer ui-scroll-lock ui-block-start"
|
|
228
|
+
id="drawer-basics-3"
|
|
229
|
+
aria-labelledby="drawer-basics-3-heading"
|
|
230
|
+
closedby="any"
|
|
231
|
+
>
|
|
232
|
+
<div class="ui-header">
|
|
233
|
+
<h2 id="drawer-basics-3-heading">Block Start</h2>
|
|
234
|
+
<button
|
|
235
|
+
type="button"
|
|
236
|
+
class="ui-button ui-round ui-small"
|
|
237
|
+
aria-label="Close"
|
|
238
|
+
commandfor="drawer-basics-3"
|
|
239
|
+
command="close"
|
|
240
|
+
>
|
|
241
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
242
|
+
</button>
|
|
243
|
+
</div>
|
|
244
|
+
<div class="ui-content">
|
|
245
|
+
<p>
|
|
246
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
247
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
248
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
249
|
+
commodo consequat.
|
|
250
|
+
</p>
|
|
251
|
+
<p>
|
|
252
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
253
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
254
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
255
|
+
</p>
|
|
256
|
+
</div>
|
|
257
|
+
<div class="ui-footer">
|
|
258
|
+
<button
|
|
259
|
+
type="button"
|
|
260
|
+
class="ui-button ui-small"
|
|
261
|
+
commandfor="drawer-basics-3"
|
|
262
|
+
command="close"
|
|
263
|
+
>
|
|
264
|
+
Close
|
|
265
|
+
</button>
|
|
266
|
+
</div>
|
|
267
|
+
</dialog>
|
|
268
|
+
|
|
269
|
+
<dialog
|
|
270
|
+
class="ui-drawer ui-scroll-lock ui-block-end"
|
|
271
|
+
id="drawer-basics-4"
|
|
272
|
+
aria-labelledby="drawer-basics-4-heading"
|
|
273
|
+
closedby="any"
|
|
274
|
+
>
|
|
275
|
+
<div class="ui-header">
|
|
276
|
+
<h2 id="drawer-basics-4-heading">Block End</h2>
|
|
277
|
+
<button
|
|
278
|
+
type="button"
|
|
279
|
+
class="ui-button ui-round ui-small"
|
|
280
|
+
aria-label="Close"
|
|
281
|
+
commandfor="drawer-basics-4"
|
|
282
|
+
command="close"
|
|
283
|
+
>
|
|
284
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
285
|
+
</button>
|
|
286
|
+
</div>
|
|
287
|
+
<div class="ui-content">
|
|
288
|
+
<p>
|
|
289
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
290
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
291
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
292
|
+
commodo consequat.
|
|
293
|
+
</p>
|
|
294
|
+
<p>
|
|
295
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
296
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
297
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
298
|
+
</p>
|
|
299
|
+
</div>
|
|
300
|
+
<div class="ui-footer">
|
|
301
|
+
<button
|
|
302
|
+
type="button"
|
|
303
|
+
class="ui-button ui-small"
|
|
304
|
+
commandfor="drawer-basics-4"
|
|
305
|
+
command="close"
|
|
306
|
+
>
|
|
307
|
+
Close
|
|
308
|
+
</button>
|
|
309
|
+
</div>
|
|
310
|
+
</dialog>
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
## Astro
|
|
314
|
+
|
|
315
|
+
`import { Drawer, DrawerContent, DrawerFooter, DrawerHeader, DrawerTitle } from "opui-css/astro"`
|
|
316
|
+
|
|
317
|
+
### Example: Basics
|
|
318
|
+
|
|
319
|
+
```astro
|
|
320
|
+
---
|
|
321
|
+
import {
|
|
322
|
+
Button,
|
|
323
|
+
Drawer,
|
|
324
|
+
DrawerContent,
|
|
325
|
+
DrawerFooter,
|
|
326
|
+
DrawerHeader,
|
|
327
|
+
DrawerTitle,
|
|
328
|
+
} from "opui-css/astro"
|
|
329
|
+
|
|
330
|
+
const editIcon = `<svg aria-hidden="true" viewBox="0 0 32 32"></svg>`
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
<div class="example-compass">
|
|
334
|
+
<Button commandfor="drawer-basics-3" command="show-modal">Block Start</Button>
|
|
335
|
+
<Button commandfor="drawer-basics-1" command="show-modal">Inline Start</Button
|
|
336
|
+
>
|
|
337
|
+
<Button commandfor="drawer-basics-2" command="show-modal">Inline End</Button>
|
|
338
|
+
<Button commandfor="drawer-basics-4" command="show-modal">Block End</Button>
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
<Drawer id="drawer-basics-1" scrollLock side="inline-start">
|
|
342
|
+
<DrawerHeader>
|
|
343
|
+
<DrawerTitle>Inline Start</DrawerTitle>
|
|
344
|
+
<Button aria-label="Edit" round size="small">
|
|
345
|
+
<Fragment set:html={editIcon} />
|
|
346
|
+
</Button>
|
|
347
|
+
</DrawerHeader>
|
|
348
|
+
<DrawerContent>
|
|
349
|
+
<p>
|
|
350
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
351
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
352
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
353
|
+
commodo consequat.
|
|
354
|
+
</p>
|
|
355
|
+
</DrawerContent>
|
|
356
|
+
<DrawerFooter>
|
|
357
|
+
<Button size="small" commandfor="drawer-basics-1" command="close"
|
|
358
|
+
>Close</Button
|
|
359
|
+
>
|
|
360
|
+
</DrawerFooter>
|
|
361
|
+
</Drawer>
|
|
362
|
+
|
|
363
|
+
<Drawer id="drawer-basics-2" scrollLock side="inline-end">
|
|
364
|
+
<DrawerHeader>
|
|
365
|
+
<DrawerTitle>Inline End</DrawerTitle>
|
|
366
|
+
</DrawerHeader>
|
|
367
|
+
<DrawerContent>
|
|
368
|
+
<p>
|
|
369
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
370
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
371
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
372
|
+
commodo consequat.
|
|
373
|
+
</p>
|
|
374
|
+
</DrawerContent>
|
|
375
|
+
<DrawerFooter>
|
|
376
|
+
<Button size="small" commandfor="drawer-basics-2" command="close"
|
|
377
|
+
>Close</Button
|
|
378
|
+
>
|
|
379
|
+
</DrawerFooter>
|
|
380
|
+
</Drawer>
|
|
381
|
+
|
|
382
|
+
<Drawer id="drawer-basics-3" scrollLock side="block-start">
|
|
383
|
+
<DrawerHeader>
|
|
384
|
+
<DrawerTitle>Block Start</DrawerTitle>
|
|
385
|
+
</DrawerHeader>
|
|
386
|
+
<DrawerContent>
|
|
387
|
+
<p>
|
|
388
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
389
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
390
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
391
|
+
commodo consequat.
|
|
392
|
+
</p>
|
|
393
|
+
<p>
|
|
394
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
395
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
396
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
397
|
+
</p>
|
|
398
|
+
</DrawerContent>
|
|
399
|
+
<DrawerFooter>
|
|
400
|
+
<Button size="small" commandfor="drawer-basics-3" command="close"
|
|
401
|
+
>Close</Button
|
|
402
|
+
>
|
|
403
|
+
</DrawerFooter>
|
|
404
|
+
</Drawer>
|
|
405
|
+
|
|
406
|
+
<Drawer id="drawer-basics-4" scrollLock side="block-end">
|
|
407
|
+
<DrawerHeader>
|
|
408
|
+
<DrawerTitle>Block End</DrawerTitle>
|
|
409
|
+
</DrawerHeader>
|
|
410
|
+
<DrawerContent>
|
|
411
|
+
<p>
|
|
412
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
413
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
414
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
415
|
+
commodo consequat.
|
|
416
|
+
</p>
|
|
417
|
+
<p>
|
|
418
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
419
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
420
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
421
|
+
</p>
|
|
422
|
+
</DrawerContent>
|
|
423
|
+
<DrawerFooter>
|
|
424
|
+
<Button size="small" commandfor="drawer-basics-4" command="close"
|
|
425
|
+
>Close</Button
|
|
426
|
+
>
|
|
427
|
+
</DrawerFooter>
|
|
428
|
+
</Drawer>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
## React
|
|
432
|
+
|
|
433
|
+
`import { Drawer, DrawerContent, DrawerFooter, DrawerHeader, DrawerTitle } from "opui-css/react"`
|
|
434
|
+
|
|
435
|
+
- Client components (`"use client"`): `Drawer` and `DrawerHeader`.
|
|
436
|
+
- Hydration: `commandfor` on `DrawerHeader`. Outside a `Drawer` and without `commandfor`, the button closes the nearest `<dialog>` with a click handler, which only works after hydration. Without hydration: Set `commandfor` to the dialog's id.
|
|
437
|
+
|
|
438
|
+
### Example: Basics
|
|
439
|
+
|
|
440
|
+
```tsx
|
|
441
|
+
import {
|
|
442
|
+
Button,
|
|
443
|
+
Drawer,
|
|
444
|
+
DrawerContent,
|
|
445
|
+
DrawerFooter,
|
|
446
|
+
DrawerHeader,
|
|
447
|
+
DrawerTitle,
|
|
448
|
+
} from "opui-css/react"
|
|
449
|
+
|
|
450
|
+
export default function Basics() {
|
|
451
|
+
return (
|
|
452
|
+
<>
|
|
453
|
+
<div className="example-compass">
|
|
454
|
+
<Button commandfor="drawer-basics-3" command="show-modal">
|
|
455
|
+
Block Start
|
|
456
|
+
</Button>
|
|
457
|
+
<Button commandfor="drawer-basics-1" command="show-modal">
|
|
458
|
+
Inline Start
|
|
459
|
+
</Button>
|
|
460
|
+
<Button commandfor="drawer-basics-2" command="show-modal">
|
|
461
|
+
Inline End
|
|
462
|
+
</Button>
|
|
463
|
+
<Button commandfor="drawer-basics-4" command="show-modal">
|
|
464
|
+
Block End
|
|
465
|
+
</Button>
|
|
466
|
+
</div>
|
|
467
|
+
|
|
468
|
+
<Drawer id="drawer-basics-1" scrollLock side="inline-start">
|
|
469
|
+
<DrawerHeader>
|
|
470
|
+
<DrawerTitle>Inline Start</DrawerTitle>
|
|
471
|
+
<Button aria-label="Edit" round size="small">
|
|
472
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
473
|
+
</Button>
|
|
474
|
+
</DrawerHeader>
|
|
475
|
+
<DrawerContent>
|
|
476
|
+
<p>
|
|
477
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
478
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
479
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
480
|
+
aliquip ex ea commodo consequat.
|
|
481
|
+
</p>
|
|
482
|
+
</DrawerContent>
|
|
483
|
+
<DrawerFooter>
|
|
484
|
+
<Button size="small" commandfor="drawer-basics-1" command="close">
|
|
485
|
+
Close
|
|
486
|
+
</Button>
|
|
487
|
+
</DrawerFooter>
|
|
488
|
+
</Drawer>
|
|
489
|
+
|
|
490
|
+
<Drawer id="drawer-basics-2" scrollLock side="inline-end">
|
|
491
|
+
<DrawerHeader>
|
|
492
|
+
<DrawerTitle>Inline End</DrawerTitle>
|
|
493
|
+
</DrawerHeader>
|
|
494
|
+
<DrawerContent>
|
|
495
|
+
<p>
|
|
496
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
497
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
498
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
499
|
+
aliquip ex ea commodo consequat.
|
|
500
|
+
</p>
|
|
501
|
+
</DrawerContent>
|
|
502
|
+
<DrawerFooter>
|
|
503
|
+
<Button size="small" commandfor="drawer-basics-2" command="close">
|
|
504
|
+
Close
|
|
505
|
+
</Button>
|
|
506
|
+
</DrawerFooter>
|
|
507
|
+
</Drawer>
|
|
508
|
+
|
|
509
|
+
<Drawer id="drawer-basics-3" scrollLock side="block-start">
|
|
510
|
+
<DrawerHeader>
|
|
511
|
+
<DrawerTitle>Block Start</DrawerTitle>
|
|
512
|
+
</DrawerHeader>
|
|
513
|
+
<DrawerContent>
|
|
514
|
+
<p>
|
|
515
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
516
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
517
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
518
|
+
aliquip ex ea commodo consequat.
|
|
519
|
+
</p>
|
|
520
|
+
<p>
|
|
521
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse
|
|
522
|
+
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
|
|
523
|
+
cupidatat non proident, sunt in culpa qui officia deserunt mollit
|
|
524
|
+
anim id est laborum.
|
|
525
|
+
</p>
|
|
526
|
+
</DrawerContent>
|
|
527
|
+
<DrawerFooter>
|
|
528
|
+
<Button size="small" commandfor="drawer-basics-3" command="close">
|
|
529
|
+
Close
|
|
530
|
+
</Button>
|
|
531
|
+
</DrawerFooter>
|
|
532
|
+
</Drawer>
|
|
533
|
+
|
|
534
|
+
<Drawer id="drawer-basics-4" scrollLock side="block-end">
|
|
535
|
+
<DrawerHeader>
|
|
536
|
+
<DrawerTitle>Block End</DrawerTitle>
|
|
537
|
+
</DrawerHeader>
|
|
538
|
+
<DrawerContent>
|
|
539
|
+
<p>
|
|
540
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
541
|
+
eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
|
|
542
|
+
ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
|
|
543
|
+
aliquip ex ea commodo consequat.
|
|
544
|
+
</p>
|
|
545
|
+
<p>
|
|
546
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse
|
|
547
|
+
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
|
|
548
|
+
cupidatat non proident, sunt in culpa qui officia deserunt mollit
|
|
549
|
+
anim id est laborum.
|
|
550
|
+
</p>
|
|
551
|
+
</DrawerContent>
|
|
552
|
+
<DrawerFooter>
|
|
553
|
+
<Button size="small" commandfor="drawer-basics-4" command="close">
|
|
554
|
+
Close
|
|
555
|
+
</Button>
|
|
556
|
+
</DrawerFooter>
|
|
557
|
+
</Drawer>
|
|
558
|
+
</>
|
|
559
|
+
)
|
|
560
|
+
}
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
## Svelte
|
|
564
|
+
|
|
565
|
+
`import { Drawer, DrawerContent, DrawerFooter, DrawerHeader, DrawerTitle } from "opui-css/svelte"`
|
|
566
|
+
|
|
567
|
+
- Hydration: `commandfor` on `DrawerHeader`. Outside a `Drawer` and without `commandfor`, the button closes the nearest `<dialog>` with a click handler, which only works after hydration. Without hydration: Set `commandfor` to the dialog's id.
|
|
568
|
+
|
|
569
|
+
### Example: Basics
|
|
570
|
+
|
|
571
|
+
```svelte
|
|
572
|
+
<script lang="ts">
|
|
573
|
+
import {
|
|
574
|
+
Button,
|
|
575
|
+
Drawer,
|
|
576
|
+
DrawerContent,
|
|
577
|
+
DrawerFooter,
|
|
578
|
+
DrawerHeader,
|
|
579
|
+
DrawerTitle,
|
|
580
|
+
} from "opui-css/svelte"
|
|
581
|
+
</script>
|
|
582
|
+
|
|
583
|
+
<div class="example-compass">
|
|
584
|
+
<Button commandfor="drawer-basics-3" command="show-modal">Block Start</Button>
|
|
585
|
+
<Button commandfor="drawer-basics-1" command="show-modal">Inline Start</Button
|
|
586
|
+
>
|
|
587
|
+
<Button commandfor="drawer-basics-2" command="show-modal">Inline End</Button>
|
|
588
|
+
<Button commandfor="drawer-basics-4" command="show-modal">Block End</Button>
|
|
589
|
+
</div>
|
|
590
|
+
|
|
591
|
+
<Drawer id="drawer-basics-1" scrollLock side="inline-start">
|
|
592
|
+
<DrawerHeader>
|
|
593
|
+
<DrawerTitle>Inline Start</DrawerTitle>
|
|
594
|
+
<Button aria-label="Edit" round size="small">
|
|
595
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
596
|
+
</Button>
|
|
597
|
+
</DrawerHeader>
|
|
598
|
+
<DrawerContent>
|
|
599
|
+
<p>
|
|
600
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
601
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
602
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
603
|
+
commodo consequat.
|
|
604
|
+
</p>
|
|
605
|
+
</DrawerContent>
|
|
606
|
+
<DrawerFooter>
|
|
607
|
+
<Button size="small" commandfor="drawer-basics-1" command="close"
|
|
608
|
+
>Close</Button
|
|
609
|
+
>
|
|
610
|
+
</DrawerFooter>
|
|
611
|
+
</Drawer>
|
|
612
|
+
|
|
613
|
+
<Drawer id="drawer-basics-2" scrollLock side="inline-end">
|
|
614
|
+
<DrawerHeader>
|
|
615
|
+
<DrawerTitle>Inline End</DrawerTitle>
|
|
616
|
+
</DrawerHeader>
|
|
617
|
+
<DrawerContent>
|
|
618
|
+
<p>
|
|
619
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
620
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
621
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
622
|
+
commodo consequat.
|
|
623
|
+
</p>
|
|
624
|
+
</DrawerContent>
|
|
625
|
+
<DrawerFooter>
|
|
626
|
+
<Button size="small" commandfor="drawer-basics-2" command="close"
|
|
627
|
+
>Close</Button
|
|
628
|
+
>
|
|
629
|
+
</DrawerFooter>
|
|
630
|
+
</Drawer>
|
|
631
|
+
|
|
632
|
+
<Drawer id="drawer-basics-3" scrollLock side="block-start">
|
|
633
|
+
<DrawerHeader>
|
|
634
|
+
<DrawerTitle>Block Start</DrawerTitle>
|
|
635
|
+
</DrawerHeader>
|
|
636
|
+
<DrawerContent>
|
|
637
|
+
<p>
|
|
638
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
639
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
640
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
641
|
+
commodo consequat.
|
|
642
|
+
</p>
|
|
643
|
+
<p>
|
|
644
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
645
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
646
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
647
|
+
</p>
|
|
648
|
+
</DrawerContent>
|
|
649
|
+
<DrawerFooter>
|
|
650
|
+
<Button size="small" commandfor="drawer-basics-3" command="close"
|
|
651
|
+
>Close</Button
|
|
652
|
+
>
|
|
653
|
+
</DrawerFooter>
|
|
654
|
+
</Drawer>
|
|
655
|
+
|
|
656
|
+
<Drawer id="drawer-basics-4" scrollLock side="block-end">
|
|
657
|
+
<DrawerHeader>
|
|
658
|
+
<DrawerTitle>Block End</DrawerTitle>
|
|
659
|
+
</DrawerHeader>
|
|
660
|
+
<DrawerContent>
|
|
661
|
+
<p>
|
|
662
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
663
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
664
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
665
|
+
commodo consequat.
|
|
666
|
+
</p>
|
|
667
|
+
<p>
|
|
668
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
669
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
670
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
671
|
+
</p>
|
|
672
|
+
</DrawerContent>
|
|
673
|
+
<DrawerFooter>
|
|
674
|
+
<Button size="small" commandfor="drawer-basics-4" command="close"
|
|
675
|
+
>Close</Button
|
|
676
|
+
>
|
|
677
|
+
</DrawerFooter>
|
|
678
|
+
</Drawer>
|
|
679
|
+
```
|
|
680
|
+
|
|
681
|
+
## Vue
|
|
682
|
+
|
|
683
|
+
`import { Drawer, DrawerContent, DrawerFooter, DrawerHeader, DrawerTitle } from "opui-css/vue"`
|
|
684
|
+
|
|
685
|
+
### Example: Basics
|
|
686
|
+
|
|
687
|
+
```vue
|
|
688
|
+
<script setup lang="ts">
|
|
689
|
+
import {
|
|
690
|
+
Button,
|
|
691
|
+
Drawer,
|
|
692
|
+
DrawerContent,
|
|
693
|
+
DrawerFooter,
|
|
694
|
+
DrawerHeader,
|
|
695
|
+
DrawerTitle,
|
|
696
|
+
} from "opui-css/vue"
|
|
697
|
+
</script>
|
|
698
|
+
|
|
699
|
+
<template>
|
|
700
|
+
<div class="example-compass">
|
|
701
|
+
<Button commandfor="drawer-basics-3" command="show-modal"
|
|
702
|
+
>Block Start</Button
|
|
703
|
+
>
|
|
704
|
+
<Button commandfor="drawer-basics-1" command="show-modal"
|
|
705
|
+
>Inline Start</Button
|
|
706
|
+
>
|
|
707
|
+
<Button commandfor="drawer-basics-2" command="show-modal"
|
|
708
|
+
>Inline End</Button
|
|
709
|
+
>
|
|
710
|
+
<Button commandfor="drawer-basics-4" command="show-modal">Block End</Button>
|
|
711
|
+
</div>
|
|
712
|
+
|
|
713
|
+
<Drawer id="drawer-basics-1" scrollLock side="inline-start">
|
|
714
|
+
<DrawerHeader>
|
|
715
|
+
<DrawerTitle>Inline Start</DrawerTitle>
|
|
716
|
+
<Button aria-label="Edit" round size="small">
|
|
717
|
+
<svg aria-hidden="true" viewBox="0 0 32 32"></svg>
|
|
718
|
+
</Button>
|
|
719
|
+
</DrawerHeader>
|
|
720
|
+
<DrawerContent>
|
|
721
|
+
<p>
|
|
722
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
723
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
724
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
725
|
+
commodo consequat.
|
|
726
|
+
</p>
|
|
727
|
+
</DrawerContent>
|
|
728
|
+
<DrawerFooter>
|
|
729
|
+
<Button size="small" commandfor="drawer-basics-1" command="close"
|
|
730
|
+
>Close</Button
|
|
731
|
+
>
|
|
732
|
+
</DrawerFooter>
|
|
733
|
+
</Drawer>
|
|
734
|
+
|
|
735
|
+
<Drawer id="drawer-basics-2" scrollLock side="inline-end">
|
|
736
|
+
<DrawerHeader>
|
|
737
|
+
<DrawerTitle>Inline End</DrawerTitle>
|
|
738
|
+
</DrawerHeader>
|
|
739
|
+
<DrawerContent>
|
|
740
|
+
<p>
|
|
741
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
742
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
743
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
744
|
+
commodo consequat.
|
|
745
|
+
</p>
|
|
746
|
+
</DrawerContent>
|
|
747
|
+
<DrawerFooter>
|
|
748
|
+
<Button size="small" commandfor="drawer-basics-2" command="close"
|
|
749
|
+
>Close</Button
|
|
750
|
+
>
|
|
751
|
+
</DrawerFooter>
|
|
752
|
+
</Drawer>
|
|
753
|
+
|
|
754
|
+
<Drawer id="drawer-basics-3" scrollLock side="block-start">
|
|
755
|
+
<DrawerHeader>
|
|
756
|
+
<DrawerTitle>Block Start</DrawerTitle>
|
|
757
|
+
</DrawerHeader>
|
|
758
|
+
<DrawerContent>
|
|
759
|
+
<p>
|
|
760
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
761
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
762
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
763
|
+
commodo consequat.
|
|
764
|
+
</p>
|
|
765
|
+
<p>
|
|
766
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
767
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
768
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
769
|
+
</p>
|
|
770
|
+
</DrawerContent>
|
|
771
|
+
<DrawerFooter>
|
|
772
|
+
<Button size="small" commandfor="drawer-basics-3" command="close"
|
|
773
|
+
>Close</Button
|
|
774
|
+
>
|
|
775
|
+
</DrawerFooter>
|
|
776
|
+
</Drawer>
|
|
777
|
+
|
|
778
|
+
<Drawer id="drawer-basics-4" scrollLock side="block-end">
|
|
779
|
+
<DrawerHeader>
|
|
780
|
+
<DrawerTitle>Block End</DrawerTitle>
|
|
781
|
+
</DrawerHeader>
|
|
782
|
+
<DrawerContent>
|
|
783
|
+
<p>
|
|
784
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod
|
|
785
|
+
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
|
|
786
|
+
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
|
|
787
|
+
commodo consequat.
|
|
788
|
+
</p>
|
|
789
|
+
<p>
|
|
790
|
+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
|
791
|
+
dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
|
792
|
+
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
|
793
|
+
</p>
|
|
794
|
+
</DrawerContent>
|
|
795
|
+
<DrawerFooter>
|
|
796
|
+
<Button size="small" commandfor="drawer-basics-4" command="close"
|
|
797
|
+
>Close</Button
|
|
798
|
+
>
|
|
799
|
+
</DrawerFooter>
|
|
800
|
+
</Drawer>
|
|
801
|
+
</template>
|
|
802
|
+
```
|