opui-css 5.4.2 → 6.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +648 -0
- package/MIGRATING-legacy.md +159 -0
- package/MIGRATING.md +1293 -69
- package/README.md +177 -26
- package/astro/index.ts +142 -13
- package/bin/opui-css.mjs +68 -0
- package/components/Accordion/Accordion.astro +6 -33
- package/components/Accordion/Accordion.react.tsx +23 -0
- package/components/Accordion/Accordion.svelte +27 -0
- package/components/Accordion/Accordion.vue +11 -28
- package/components/Accordion/AccordionActions.astro +16 -0
- package/components/Accordion/AccordionActions.react.tsx +15 -0
- package/components/Accordion/AccordionActions.svelte +23 -0
- package/components/Accordion/AccordionActions.vue +18 -0
- package/components/Accordion/AccordionContent.astro +9 -0
- package/components/Accordion/AccordionContent.react.tsx +6 -0
- package/components/Accordion/AccordionContent.svelte +15 -0
- package/components/Accordion/AccordionContent.vue +12 -0
- package/components/Accordion/AccordionSummary.astro +19 -0
- package/components/Accordion/AccordionSummary.react.tsx +30 -0
- package/components/Accordion/AccordionSummary.svelte +24 -0
- package/components/Accordion/AccordionSummary.vue +27 -0
- package/components/Accordion/icons.ts +2 -0
- package/components/Accordion/types.astro.ts +9 -0
- package/components/Accordion/types.react.ts +14 -0
- package/components/Accordion/types.svelte.ts +10 -2
- package/components/Accordion/types.ts +11 -5
- package/components/Accordion/types.vue-props.ts +22 -0
- package/components/Anchor/Anchor.astro +21 -33
- package/components/Anchor/Anchor.react.tsx +38 -0
- package/components/Anchor/Anchor.svelte +47 -0
- package/components/Anchor/Anchor.vue +32 -30
- package/components/Anchor/AnchorContent.astro +17 -0
- package/components/Anchor/AnchorContent.react.tsx +18 -0
- package/components/Anchor/AnchorContent.svelte +23 -0
- package/components/Anchor/AnchorContent.vue +20 -0
- package/components/Anchor/context.astro.ts +4 -0
- package/components/Anchor/context.react.ts +8 -0
- package/components/Anchor/context.svelte.ts +7 -0
- package/components/Anchor/context.vue.ts +4 -0
- package/components/Anchor/root.ts +12 -0
- package/components/Anchor/types.astro.ts +3 -0
- package/components/Anchor/types.react.ts +7 -0
- package/components/Anchor/types.svelte.ts +3 -3
- package/components/Anchor/types.ts +15 -6
- package/components/Anchor/types.vue-props.ts +15 -0
- package/components/Avatar/Avatar.astro +12 -8
- package/components/Avatar/Avatar.react.tsx +34 -0
- package/components/Avatar/Avatar.svelte +39 -0
- package/components/Avatar/Avatar.vue +10 -8
- package/components/Avatar/AvatarGroup.astro +9 -0
- package/components/Avatar/AvatarGroup.react.tsx +12 -0
- package/components/Avatar/AvatarGroup.svelte +15 -0
- package/components/Avatar/AvatarGroup.vue +12 -0
- package/components/Avatar/types.astro.ts +3 -2
- package/components/Avatar/types.react.ts +11 -0
- package/components/Avatar/types.svelte.ts +3 -4
- package/components/Avatar/types.ts +18 -15
- package/components/Avatar/types.vue-props.ts +11 -0
- package/components/Badge/Badge.astro +27 -22
- package/components/Badge/Badge.react.tsx +50 -0
- package/components/Badge/Badge.svelte +48 -0
- package/components/Badge/Badge.vue +15 -19
- package/components/Badge/types.react.ts +6 -0
- package/components/Badge/types.svelte.ts +4 -1
- package/components/Badge/types.ts +3 -3
- package/components/Badge/types.vue-props.ts +7 -0
- package/components/Button/Button.astro +12 -12
- package/components/Button/Button.react.tsx +33 -0
- package/components/Button/Button.svelte +37 -0
- package/components/Button/Button.vue +9 -9
- package/components/Button/types.astro.ts +2 -2
- package/components/Button/types.react.ts +11 -0
- package/components/Button/types.svelte.ts +11 -2
- package/components/Button/types.ts +20 -4
- package/components/Button/types.vue-props.ts +6 -0
- package/components/ButtonGroup/ButtonGroup.astro +7 -3
- package/components/ButtonGroup/ButtonGroup.react.tsx +30 -0
- package/components/ButtonGroup/ButtonGroup.svelte +34 -0
- package/components/ButtonGroup/ButtonGroup.vue +10 -7
- package/components/ButtonGroup/types.react.ts +4 -0
- package/components/ButtonGroup/types.ts +4 -4
- package/components/ButtonGroup/types.vue-props.ts +6 -0
- package/components/Callout/Callout.astro +7 -59
- package/components/Callout/Callout.react.tsx +26 -0
- package/components/Callout/Callout.svelte +32 -0
- package/components/Callout/Callout.vue +8 -48
- package/components/Callout/CalloutContent.astro +9 -0
- package/components/Callout/CalloutContent.react.tsx +6 -0
- package/components/Callout/CalloutContent.svelte +15 -0
- package/components/Callout/CalloutContent.vue +12 -0
- package/components/Callout/CalloutIcon.astro +25 -0
- package/components/Callout/CalloutIcon.react.tsx +26 -0
- package/components/Callout/CalloutIcon.svelte +24 -0
- package/components/Callout/CalloutIcon.vue +25 -0
- package/components/Callout/context.astro.ts +4 -0
- package/components/Callout/context.react.ts +8 -0
- package/components/Callout/context.svelte.ts +7 -0
- package/components/Callout/context.vue.ts +4 -0
- package/components/Callout/icons.ts +23 -0
- package/components/Callout/types.astro.ts +5 -0
- package/components/Callout/types.react.ts +9 -0
- package/components/Callout/types.svelte.ts +5 -3
- package/components/Callout/types.ts +5 -5
- package/components/Callout/types.vue-props.ts +14 -0
- package/components/Card/Card.astro +9 -25
- package/components/Card/Card.react.tsx +15 -0
- package/components/Card/Card.svelte +23 -0
- package/components/Card/Card.vue +10 -20
- package/components/Card/CardActions.astro +16 -0
- package/components/Card/CardActions.react.tsx +15 -0
- package/components/Card/CardActions.svelte +23 -0
- package/components/Card/CardActions.vue +18 -0
- package/components/Card/CardContent.astro +9 -0
- package/components/Card/CardContent.react.tsx +6 -0
- package/components/Card/CardContent.svelte +15 -0
- package/components/Card/CardContent.vue +12 -0
- package/components/Card/CardHeader.astro +9 -0
- package/components/Card/CardHeader.react.tsx +6 -0
- package/components/Card/CardHeader.svelte +15 -0
- package/components/Card/CardHeader.vue +12 -0
- package/components/Card/types.astro.ts +6 -0
- package/components/Card/types.react.ts +10 -0
- package/components/Card/types.svelte.ts +7 -3
- package/components/Card/types.ts +7 -7
- package/components/Card/types.vue-props.ts +17 -0
- package/components/Carousel/Carousel.astro +44 -0
- package/components/Carousel/Carousel.react.tsx +47 -0
- package/components/Carousel/Carousel.svelte +45 -0
- package/components/Carousel/Carousel.vue +44 -0
- package/components/Carousel/types.astro.ts +4 -0
- package/components/Carousel/types.react.ts +4 -0
- package/components/Carousel/types.svelte.ts +4 -0
- package/components/Carousel/types.ts +11 -0
- package/components/Carousel/types.vue-props.ts +6 -0
- package/components/Checkbox/Checkbox.astro +27 -15
- package/components/Checkbox/Checkbox.react.tsx +51 -0
- package/components/Checkbox/Checkbox.svelte +61 -0
- package/components/Checkbox/Checkbox.vue +39 -18
- package/components/Checkbox/CheckboxInput.astro +6 -2
- package/components/Checkbox/CheckboxInput.react.tsx +39 -0
- package/components/Checkbox/CheckboxInput.svelte +34 -0
- package/components/Checkbox/CheckboxInput.vue +29 -11
- package/components/Checkbox/types.astro.ts +2 -3
- package/components/Checkbox/types.react.ts +11 -0
- package/components/Checkbox/types.svelte.ts +8 -4
- package/components/Checkbox/types.ts +8 -4
- package/components/Checkbox/types.vue-props.ts +15 -0
- package/components/Chip/Chip.astro +22 -6
- package/components/Chip/Chip.react.tsx +45 -0
- package/components/Chip/Chip.svelte +45 -0
- package/components/Chip/Chip.vue +16 -9
- package/components/Chip/types.astro.ts +1 -1
- package/components/Chip/types.react.ts +15 -0
- package/components/Chip/types.svelte.ts +6 -4
- package/components/Chip/types.ts +22 -5
- package/components/Chip/types.vue-props.ts +11 -0
- package/components/DescriptionList/DescriptionList.astro +6 -2
- package/components/DescriptionList/DescriptionList.react.tsx +25 -0
- package/components/DescriptionList/DescriptionList.svelte +29 -0
- package/components/DescriptionList/DescriptionList.vue +7 -8
- package/components/DescriptionList/DescriptionListDescription.astro +9 -0
- package/components/DescriptionList/DescriptionListDescription.react.tsx +9 -0
- package/components/DescriptionList/DescriptionListDescription.svelte +15 -0
- package/components/DescriptionList/DescriptionListDescription.vue +15 -0
- package/components/DescriptionList/DescriptionListItem.astro +9 -0
- package/components/DescriptionList/DescriptionListItem.react.tsx +6 -0
- package/components/DescriptionList/DescriptionListItem.svelte +15 -0
- package/components/DescriptionList/{Item.vue → DescriptionListItem.vue} +5 -2
- package/components/DescriptionList/DescriptionListTerm.astro +9 -0
- package/components/DescriptionList/DescriptionListTerm.react.tsx +6 -0
- package/components/DescriptionList/DescriptionListTerm.svelte +15 -0
- package/components/DescriptionList/{Term.vue → DescriptionListTerm.vue} +5 -2
- package/components/DescriptionList/types.astro.ts +3 -3
- package/components/DescriptionList/types.react.ts +10 -0
- package/components/DescriptionList/types.svelte.ts +6 -0
- package/components/DescriptionList/types.ts +3 -1
- package/components/DescriptionList/types.vue-props.ts +12 -0
- package/components/Dialog/Dialog.astro +12 -26
- package/components/Dialog/Dialog.react.tsx +23 -0
- package/components/Dialog/Dialog.svelte +33 -0
- package/components/Dialog/Dialog.vue +13 -23
- package/components/Dialog/DialogContent.astro +9 -0
- package/components/Dialog/DialogContent.react.tsx +6 -0
- package/components/Dialog/DialogContent.svelte +15 -0
- package/components/Dialog/DialogContent.vue +12 -0
- package/components/Dialog/DialogFooter.astro +16 -0
- package/components/Dialog/DialogFooter.react.tsx +15 -0
- package/components/Dialog/DialogFooter.svelte +23 -0
- package/components/Dialog/DialogFooter.vue +18 -0
- package/components/Dialog/DialogHeader.astro +9 -0
- package/components/Dialog/DialogHeader.react.tsx +6 -0
- package/components/Dialog/DialogHeader.svelte +15 -0
- package/components/Dialog/DialogHeader.vue +12 -0
- package/components/Dialog/DialogTitle.astro +14 -0
- package/components/Dialog/DialogTitle.react.tsx +13 -0
- package/components/Dialog/DialogTitle.svelte +23 -0
- package/components/Dialog/DialogTitle.vue +18 -0
- package/components/Dialog/context.astro.ts +4 -0
- package/components/Dialog/context.react.ts +8 -0
- package/components/Dialog/context.svelte.ts +7 -0
- package/components/Dialog/context.vue.ts +4 -0
- package/components/Dialog/types.astro.ts +8 -0
- package/components/Dialog/types.react.ts +12 -0
- package/components/Dialog/types.svelte.ts +11 -3
- package/components/Dialog/types.ts +13 -6
- package/components/Dialog/types.vue-props.ts +24 -0
- package/components/Divider/Divider.astro +29 -7
- package/components/Divider/Divider.react.tsx +36 -0
- package/components/Divider/Divider.svelte +40 -0
- package/components/Divider/Divider.vue +22 -4
- package/components/Divider/types.react.ts +4 -0
- package/components/Divider/types.ts +3 -1
- package/components/Divider/types.vue-props.ts +6 -0
- package/components/Drawer/Drawer.astro +13 -18
- package/components/Drawer/Drawer.react.tsx +40 -0
- package/components/Drawer/Drawer.svelte +50 -0
- package/components/Drawer/Drawer.vue +14 -19
- package/components/Drawer/DrawerContent.astro +9 -0
- package/components/Drawer/DrawerContent.react.tsx +6 -0
- package/components/Drawer/DrawerContent.svelte +15 -0
- package/components/Drawer/DrawerContent.vue +12 -0
- package/components/Drawer/DrawerFooter.astro +9 -4
- package/components/Drawer/DrawerFooter.react.tsx +15 -0
- package/components/Drawer/DrawerFooter.svelte +23 -0
- package/components/Drawer/DrawerFooter.vue +10 -8
- package/components/Drawer/DrawerHeader.astro +18 -10
- package/components/Drawer/DrawerHeader.react.tsx +41 -0
- package/components/Drawer/DrawerHeader.svelte +42 -0
- package/components/Drawer/DrawerHeader.vue +18 -19
- package/components/Drawer/DrawerTitle.astro +14 -0
- package/components/Drawer/DrawerTitle.react.tsx +13 -0
- package/components/Drawer/DrawerTitle.svelte +23 -0
- package/components/Drawer/DrawerTitle.vue +18 -0
- package/components/Drawer/context.astro.ts +4 -0
- package/components/Drawer/context.react.ts +8 -0
- package/components/Drawer/context.svelte.ts +7 -0
- package/components/Drawer/context.vue.ts +4 -0
- package/components/Drawer/icons.ts +2 -0
- package/components/Drawer/types.astro.ts +5 -1
- package/components/Drawer/types.react.ts +13 -0
- package/components/Drawer/types.svelte.ts +6 -5
- package/components/Drawer/types.ts +15 -10
- package/components/Drawer/types.vue-props.ts +24 -0
- package/components/FieldDescription/FieldDescription.astro +1 -1
- package/components/FieldDescription/FieldDescription.react.tsx +6 -0
- package/components/FieldDescription/FieldDescription.svelte +15 -0
- package/components/FieldDescription/FieldDescription.vue +3 -3
- package/components/FieldDescription/types.react.ts +4 -0
- package/components/FieldDescription/types.vue-props.ts +6 -0
- package/components/FieldGroup/FieldGroup.astro +15 -15
- package/components/FieldGroup/FieldGroup.react.tsx +27 -0
- package/components/FieldGroup/FieldGroup.svelte +32 -0
- package/components/FieldGroup/FieldGroup.vue +8 -10
- package/components/FieldGroup/context.astro.ts +4 -0
- package/components/FieldGroup/context.react.ts +8 -0
- package/components/FieldGroup/context.svelte.ts +8 -0
- package/components/FieldGroup/context.vue.ts +4 -0
- package/components/FieldGroup/types.react.ts +4 -0
- package/components/FieldGroup/types.ts +3 -1
- package/components/FieldGroup/types.vue-props.ts +6 -0
- package/components/FieldLegend/FieldLegend.react.tsx +14 -0
- package/components/FieldLegend/FieldLegend.svelte +20 -0
- package/components/FieldLegend/FieldLegend.vue +8 -6
- package/components/FieldLegend/types.react.ts +6 -0
- package/components/FieldLegend/types.svelte.ts +3 -3
- package/components/FieldLegend/types.vue-props.ts +9 -0
- package/components/{FieldSet/FieldSet.astro → Fieldset/Fieldset.astro} +6 -2
- package/components/Fieldset/Fieldset.react.tsx +15 -0
- package/components/Fieldset/Fieldset.svelte +21 -0
- package/components/Fieldset/Fieldset.vue +21 -0
- package/components/Fieldset/types.react.ts +6 -0
- package/components/Fieldset/types.svelte.ts +6 -0
- package/components/Fieldset/types.ts +1 -0
- package/components/Fieldset/types.vue-props.ts +9 -0
- package/components/Form/Form.react.tsx +9 -0
- package/components/Form/Form.svelte +16 -0
- package/components/Form/Form.vue +7 -5
- package/components/Form/types.react.ts +6 -0
- package/components/Form/types.svelte.ts +3 -4
- package/components/Form/types.vue-props.ts +9 -0
- package/components/List/List.astro +3 -3
- package/components/List/List.react.tsx +27 -0
- package/components/List/List.svelte +31 -0
- package/components/List/List.vue +4 -9
- package/components/List/types.react.ts +4 -0
- package/components/List/types.ts +2 -3
- package/components/List/types.vue-props.ts +6 -0
- package/components/ListItem/ListItem.astro +46 -39
- package/components/ListItem/ListItem.react.tsx +65 -0
- package/components/ListItem/ListItem.svelte +80 -0
- package/components/ListItem/ListItem.vue +41 -46
- package/components/ListItem/types.astro.ts +2 -3
- package/components/ListItem/types.react.ts +17 -0
- package/components/ListItem/types.svelte.ts +7 -4
- package/components/ListItem/types.ts +14 -11
- package/components/ListItem/types.vue-props.ts +14 -0
- package/components/Menu/Menu.astro +86 -0
- package/components/Menu/Menu.react.tsx +87 -0
- package/components/Menu/Menu.svelte +71 -0
- package/components/Menu/Menu.vue +76 -0
- package/components/Menu/context.astro.ts +4 -0
- package/components/Menu/context.react.ts +8 -0
- package/components/Menu/context.svelte.ts +7 -0
- package/components/Menu/context.vue.ts +4 -0
- package/components/Menu/types.astro.ts +12 -0
- package/components/Menu/types.react.ts +12 -0
- package/components/Menu/types.svelte.ts +12 -0
- package/components/Menu/types.ts +23 -0
- package/components/Menu/types.vue-props.ts +16 -0
- package/components/Progress/Progress.astro +10 -21
- package/components/Progress/Progress.react.tsx +27 -0
- package/components/Progress/Progress.svelte +30 -0
- package/components/Progress/Progress.vue +17 -21
- package/components/Progress/types.astro.ts +2 -1
- package/components/Progress/types.react.ts +5 -0
- package/components/Progress/types.svelte.ts +2 -1
- package/components/Progress/types.ts +1 -6
- package/components/Progress/types.vue-props.ts +6 -0
- package/components/Radio/Radio.astro +29 -15
- package/components/Radio/Radio.react.tsx +51 -0
- package/components/Radio/Radio.svelte +59 -0
- package/components/Radio/Radio.vue +37 -16
- package/components/Radio/RadioInput.astro +5 -2
- package/components/Radio/RadioInput.react.tsx +10 -0
- package/components/Radio/RadioInput.svelte +27 -0
- package/components/Radio/RadioInput.vue +28 -3
- package/components/Radio/types.astro.ts +2 -1
- package/components/Radio/types.react.ts +11 -0
- package/components/Radio/types.svelte.ts +9 -5
- package/components/Radio/types.ts +9 -4
- package/components/Radio/types.vue-props.ts +15 -0
- package/components/Range/Range.astro +49 -38
- package/components/Range/Range.react.tsx +157 -0
- package/components/Range/Range.svelte +136 -0
- package/components/Range/Range.vue +116 -32
- package/components/Range/types.astro.ts +1 -3
- package/components/Range/types.react.ts +10 -0
- package/components/Range/types.svelte.ts +8 -3
- package/components/Range/types.ts +13 -14
- package/components/Range/types.vue-props.ts +16 -0
- package/components/Range/value.ts +27 -0
- package/components/Select/Select.astro +70 -31
- package/components/Select/Select.react.tsx +124 -0
- package/components/Select/Select.svelte +123 -0
- package/components/Select/Select.vue +108 -36
- package/components/Select/selection.ts +11 -0
- package/components/Select/types.react.ts +6 -0
- package/components/Select/types.svelte.ts +1 -1
- package/components/Select/types.ts +16 -13
- package/components/Select/types.vue-props.ts +20 -0
- package/components/Switch/Switch.astro +22 -26
- package/components/Switch/Switch.react.tsx +63 -0
- package/components/Switch/Switch.svelte +73 -0
- package/components/Switch/Switch.vue +36 -18
- package/components/Switch/SwitchInput.astro +5 -2
- package/components/Switch/SwitchInput.react.tsx +12 -0
- package/components/Switch/SwitchInput.svelte +30 -0
- package/components/Switch/SwitchInput.vue +25 -3
- package/components/Switch/types.astro.ts +4 -2
- package/components/Switch/types.react.ts +11 -0
- package/components/Switch/types.svelte.ts +11 -4
- package/components/Switch/types.ts +9 -6
- package/components/Switch/types.vue-props.ts +17 -0
- package/components/Table/Table.astro +15 -2
- package/components/Table/Table.react.tsx +24 -0
- package/components/Table/Table.svelte +28 -0
- package/components/Table/Table.vue +9 -8
- package/components/Table/TableBody.astro +9 -0
- package/components/Table/TableBody.react.tsx +5 -0
- package/components/Table/TableBody.svelte +9 -0
- package/components/Table/TableBody.vue +12 -0
- package/components/Table/TableCaption.astro +9 -0
- package/components/Table/TableCaption.react.tsx +5 -0
- package/components/Table/TableCaption.svelte +9 -0
- package/components/Table/TableCaption.vue +12 -0
- package/components/Table/TableCell.astro +9 -0
- package/components/Table/TableCell.react.tsx +6 -0
- package/components/Table/TableCell.svelte +16 -0
- package/components/Table/TableCell.vue +12 -0
- package/components/Table/TableColumn.astro +8 -0
- package/components/Table/TableColumn.react.tsx +7 -0
- package/components/Table/TableColumn.svelte +8 -0
- package/components/Table/TableColumn.vue +12 -0
- package/components/Table/TableColumnGroup.astro +9 -0
- package/components/Table/TableColumnGroup.react.tsx +5 -0
- package/components/Table/TableColumnGroup.svelte +9 -0
- package/components/Table/TableColumnGroup.vue +12 -0
- package/components/Table/TableFoot.astro +9 -0
- package/components/Table/TableFoot.react.tsx +5 -0
- package/components/Table/TableFoot.svelte +9 -0
- package/components/Table/TableFoot.vue +12 -0
- package/components/Table/TableHead.astro +9 -0
- package/components/Table/TableHead.react.tsx +5 -0
- package/components/Table/TableHead.svelte +9 -0
- package/components/Table/TableHead.vue +12 -0
- package/components/Table/TableHeaderCell.astro +9 -0
- package/components/Table/TableHeaderCell.react.tsx +10 -0
- package/components/Table/TableHeaderCell.svelte +16 -0
- package/components/Table/TableHeaderCell.vue +12 -0
- package/components/Table/TableRow.astro +9 -0
- package/components/Table/TableRow.react.tsx +5 -0
- package/components/Table/TableRow.svelte +9 -0
- package/components/{DescriptionList/Description.vue → Table/TableRow.vue} +3 -3
- package/components/Table/types.astro.ts +17 -11
- package/components/Table/types.react.ts +22 -0
- package/components/Table/types.svelte.ts +19 -7
- package/components/Table/types.ts +8 -3
- package/components/Table/types.vue-props.ts +28 -0
- package/components/Tabs/Tabs.astro +23 -13
- package/components/Tabs/Tabs.react.tsx +43 -0
- package/components/Tabs/Tabs.svelte +43 -0
- package/components/Tabs/Tabs.vue +19 -9
- package/components/Tabs/TabsItem.astro +16 -28
- package/components/Tabs/TabsItem.react.tsx +47 -0
- package/components/Tabs/TabsItem.svelte +52 -0
- package/components/Tabs/TabsItem.vue +23 -21
- package/components/Tabs/TabsLabel.astro +16 -0
- package/components/Tabs/TabsLabel.react.tsx +17 -0
- package/components/Tabs/TabsLabel.svelte +19 -0
- package/components/Tabs/TabsLabel.vue +16 -0
- package/components/Tabs/TabsPanel.astro +2 -9
- package/components/Tabs/TabsPanel.react.tsx +6 -0
- package/components/Tabs/TabsPanel.svelte +15 -0
- package/components/Tabs/TabsPanel.vue +3 -22
- package/components/Tabs/context.astro.ts +4 -0
- package/components/Tabs/context.react.ts +8 -0
- package/components/Tabs/context.svelte.ts +7 -0
- package/components/Tabs/context.vue.ts +4 -0
- package/components/Tabs/types.astro.ts +5 -3
- package/components/Tabs/types.react.ts +12 -0
- package/components/Tabs/types.svelte.ts +6 -6
- package/components/Tabs/types.ts +10 -8
- package/components/Tabs/types.vue-props.ts +25 -0
- package/components/TextField/TextField.astro +36 -52
- package/components/TextField/TextField.react.tsx +70 -0
- package/components/TextField/TextField.svelte +84 -0
- package/components/TextField/TextField.vue +59 -39
- package/components/TextField/types.astro.ts +1 -3
- package/components/TextField/types.react.ts +12 -0
- package/components/TextField/types.svelte.ts +2 -4
- package/components/TextField/types.ts +11 -25
- package/components/TextField/types.vue-props.ts +21 -0
- package/components/Textarea/Textarea.astro +34 -48
- package/components/Textarea/Textarea.react.tsx +64 -0
- package/components/Textarea/Textarea.svelte +80 -0
- package/components/Textarea/Textarea.vue +55 -31
- package/components/Textarea/types.astro.ts +1 -3
- package/components/Textarea/types.react.ts +8 -0
- package/components/Textarea/types.svelte.ts +1 -9
- package/components/Textarea/types.ts +10 -22
- package/components/Textarea/types.vue-props.ts +20 -0
- package/components/ToggleButton/ToggleButton.astro +14 -14
- package/components/ToggleButton/ToggleButton.react.tsx +57 -0
- package/components/ToggleButton/ToggleButton.svelte +58 -0
- package/components/ToggleButton/ToggleButton.vue +41 -17
- package/components/ToggleButton/types.react.ts +4 -0
- package/components/ToggleButton/types.svelte.ts +0 -2
- package/components/ToggleButton/types.ts +2 -6
- package/components/ToggleButton/types.vue-props.ts +11 -0
- package/components/ToggleGroup/ToggleGroup.astro +16 -18
- package/components/ToggleGroup/ToggleGroup.react.tsx +54 -0
- package/components/ToggleGroup/ToggleGroup.svelte +54 -0
- package/components/ToggleGroup/ToggleGroup.vue +29 -20
- package/components/ToggleGroup/context.astro.ts +5 -0
- package/components/ToggleGroup/context.react.ts +8 -0
- package/components/ToggleGroup/context.svelte.ts +8 -0
- package/components/ToggleGroup/context.vue.ts +4 -0
- package/components/ToggleGroup/selection.ts +12 -0
- package/components/ToggleGroup/types.react.ts +12 -0
- package/components/ToggleGroup/types.svelte.ts +1 -4
- package/components/ToggleGroup/types.ts +11 -9
- package/components/ToggleGroup/types.vue-props.ts +6 -0
- package/components/Tooltip/Tooltip.astro +6 -7
- package/components/Tooltip/Tooltip.react.tsx +24 -0
- package/components/Tooltip/Tooltip.svelte +29 -0
- package/components/Tooltip/Tooltip.vue +7 -8
- package/components/Tooltip/types.react.ts +4 -0
- package/components/Tooltip/types.svelte.ts +1 -4
- package/components/Tooltip/types.ts +2 -8
- package/components/Tooltip/types.vue-props.ts +6 -0
- package/components/content.svelte +9 -0
- package/components/context.astro.ts +15 -0
- package/components/cx.ts +12 -0
- package/components/dev.ts +63 -0
- package/components/group.ts +2 -0
- package/components/id.ts +9 -0
- package/components/style.ts +33 -0
- package/components/tag.ts +6 -0
- package/components/vue.ts +18 -0
- package/core/normalize.css +56 -79
- package/core/palette.css +99 -282
- package/core/utils.css +31 -44
- package/css/compat/avatar.css +7 -0
- package/css/compat/menu.css +20 -0
- package/css/compat.css +3 -0
- package/css/components/accordion.css +123 -59
- package/css/components/anchor.css +21 -8
- package/css/components/avatar.css +57 -17
- package/css/components/badge.css +84 -45
- package/css/components/button-group.css +120 -129
- package/css/components/button.css +326 -116
- package/css/components/callout.css +88 -47
- package/css/components/card.css +181 -63
- package/css/components/carousel.css +399 -0
- package/css/components/checkbox.css +27 -148
- package/css/components/chip.css +175 -52
- package/css/components/choice.css +291 -0
- package/css/components/description-list.css +51 -41
- package/css/components/dialog.css +120 -30
- package/css/components/divider.css +62 -9
- package/css/components/drawer.css +181 -51
- package/css/components/form.css +51 -66
- package/css/components/layout.css +92 -0
- package/css/components/link.css +44 -12
- package/css/components/list.css +252 -135
- package/css/components/menu.css +174 -0
- package/css/components/progress.css +37 -29
- package/css/components/radio.css +32 -141
- package/css/components/range.css +244 -101
- package/css/components/select.css +84 -65
- package/css/components/spinner.css +31 -12
- package/css/components/switch.css +98 -171
- package/css/components/table.css +120 -79
- package/css/components/tabs.css +230 -36
- package/css/components/text-field.css +296 -186
- package/css/components/textarea.css +5 -11
- package/css/components/toggle-button.css +84 -44
- package/css/components/toggle-group.css +62 -32
- package/css/components/tooltip.css +87 -30
- package/css/components/typography.css +519 -298
- package/css/components.css +25 -18
- package/css/imports.css +2 -4
- package/css/js/checkbox.d.ts +3 -0
- package/css/js/checkbox.js +10 -0
- package/css/js/range.d.ts +1 -0
- package/css/js/range.js +44 -0
- package/css/layers.css +2 -0
- package/css/theme.css +729 -103
- package/dist/op.css +12 -237
- package/dist/op.css.map +1 -1
- package/dist/opui.baseline-2023.css +9209 -0
- package/dist/opui.baseline-2023.css.map +1 -0
- package/dist/opui.baseline-2024.css +9209 -0
- package/dist/opui.baseline-2024.css.map +1 -0
- package/dist/opui.baseline-2025.css +9209 -0
- package/dist/opui.baseline-2025.css.map +1 -0
- package/dist/opui.baseline-2026.css +9209 -0
- package/dist/opui.baseline-2026.css.map +1 -0
- package/dist/opui.components.css +5497 -3291
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +6616 -4255
- package/dist/opui.css.map +1 -1
- package/dist/opui.no-compat.css +9182 -0
- package/dist/opui.no-compat.css.map +1 -0
- package/env.d.ts +10 -7
- package/open-props.css +10 -1
- package/package.json +63 -17
- package/react/elements.ts +13 -0
- package/react/index.ts +176 -0
- package/skills/opui/SKILL.md +75 -0
- package/skills/opui/references/accordion.md +253 -0
- package/skills/opui/references/anchor.md +213 -0
- package/skills/opui/references/avatar.md +202 -0
- package/skills/opui/references/badge.md +199 -0
- package/skills/opui/references/button-group.md +239 -0
- package/skills/opui/references/button.md +242 -0
- package/skills/opui/references/callout.md +221 -0
- package/skills/opui/references/card.md +222 -0
- package/skills/opui/references/carousel.md +269 -0
- package/skills/opui/references/checkbox.md +241 -0
- package/skills/opui/references/chip.md +135 -0
- package/skills/opui/references/customizing.md +85 -0
- package/skills/opui/references/description-list.md +191 -0
- package/skills/opui/references/dialog.md +301 -0
- package/skills/opui/references/divider.md +112 -0
- package/skills/opui/references/drawer.md +802 -0
- package/skills/opui/references/form.md +260 -0
- package/skills/opui/references/getting-started.md +398 -0
- package/skills/opui/references/index.md +89 -0
- package/skills/opui/references/layout.md +161 -0
- package/skills/opui/references/list.md +216 -0
- package/skills/opui/references/menu.md +248 -0
- package/skills/opui/references/progress.md +114 -0
- package/skills/opui/references/radio.md +234 -0
- package/skills/opui/references/range.md +150 -0
- package/skills/opui/references/select.md +255 -0
- package/skills/opui/references/spinner.md +85 -0
- package/skills/opui/references/switch.md +223 -0
- package/skills/opui/references/table.md +480 -0
- package/skills/opui/references/tabs.md +257 -0
- package/skills/opui/references/text-field.md +167 -0
- package/skills/opui/references/textarea.md +169 -0
- package/skills/opui/references/theming.md +278 -0
- package/skills/opui/references/toggle.md +222 -0
- package/skills/opui/references/tooltip.md +167 -0
- package/skills/opui/references/typography.md +159 -0
- package/svelte/elements.ts +7 -0
- package/svelte/index.ts +177 -0
- package/themes/bootstrap.css +223 -0
- package/themes/brutalist.css +105 -0
- package/themes/m3.css +152 -0
- package/themes/shadcn.css +125 -0
- package/tokens.json +3729 -0
- package/vue/index.ts +136 -15
- package/components/AGENTS.md +0 -247
- package/components/Accordion/types.d.vue.ts +0 -15
- package/components/Accordion/types.solid.ts +0 -6
- package/components/Anchor/types.d.vue.ts +0 -10
- package/components/Anchor/types.solid.ts +0 -6
- package/components/Avatar/types.d.vue.ts +0 -12
- package/components/Avatar/types.solid.ts +0 -11
- package/components/Badge/types.d.vue.ts +0 -10
- package/components/Badge/types.solid.ts +0 -4
- package/components/Button/types.d.vue.ts +0 -10
- package/components/Button/types.solid.ts +0 -8
- package/components/ButtonGroup/types.d.vue.ts +0 -10
- package/components/ButtonGroup/types.solid.ts +0 -4
- package/components/Callout/types.d.vue.ts +0 -10
- package/components/Callout/types.solid.ts +0 -6
- package/components/Card/types.d.vue.ts +0 -10
- package/components/Card/types.solid.ts +0 -6
- package/components/Checkbox/types.d.vue.ts +0 -11
- package/components/Checkbox/types.solid.ts +0 -9
- package/components/Chip/types.d.vue.ts +0 -10
- package/components/Chip/types.solid.ts +0 -10
- package/components/ClassicSelect/ClassicSelect.astro +0 -60
- package/components/ClassicSelect/ClassicSelect.vue +0 -54
- package/components/ClassicSelect/types.astro.ts +0 -8
- package/components/ClassicSelect/types.d.vue.ts +0 -10
- package/components/ClassicSelect/types.solid.ts +0 -5
- package/components/ClassicSelect/types.svelte.ts +0 -5
- package/components/ClassicSelect/types.ts +0 -15
- package/components/DescriptionList/Description.astro +0 -9
- package/components/DescriptionList/Item.astro +0 -9
- package/components/DescriptionList/Term.astro +0 -9
- package/components/DescriptionList/index.ts +0 -12
- package/components/DescriptionList/types.d.vue.ts +0 -10
- package/components/DescriptionList/types.solid.ts +0 -4
- package/components/Dialog/types.d.vue.ts +0 -10
- package/components/Dialog/types.solid.ts +0 -8
- package/components/Divider/types.d.vue.ts +0 -6
- package/components/Divider/types.solid.ts +0 -4
- package/components/Drawer/types.d.vue.ts +0 -31
- package/components/Drawer/types.solid.ts +0 -12
- package/components/FieldDescription/types.d.vue.ts +0 -10
- package/components/FieldDescription/types.solid.ts +0 -5
- package/components/FieldGroup/types.d.vue.ts +0 -12
- package/components/FieldGroup/types.solid.ts +0 -5
- package/components/FieldLegend/types.d.vue.ts +0 -11
- package/components/FieldLegend/types.solid.ts +0 -5
- package/components/FieldSet/FieldSet.vue +0 -18
- package/components/FieldSet/types.d.vue.ts +0 -11
- package/components/FieldSet/types.solid.ts +0 -5
- package/components/FieldSet/types.svelte.ts +0 -8
- package/components/FieldSet/types.ts +0 -5
- package/components/Form/types.d.vue.ts +0 -11
- package/components/Form/types.solid.ts +0 -5
- package/components/IconButton/IconButton.astro +0 -24
- package/components/IconButton/IconButton.vue +0 -24
- package/components/IconButton/types.astro.ts +0 -6
- package/components/IconButton/types.d.vue.ts +0 -10
- package/components/IconButton/types.solid.ts +0 -8
- package/components/IconButton/types.svelte.ts +0 -6
- package/components/IconButton/types.ts +0 -16
- package/components/List/types.d.vue.ts +0 -10
- package/components/List/types.solid.ts +0 -4
- package/components/ListItem/types.d.vue.ts +0 -10
- package/components/ListItem/types.solid.ts +0 -12
- package/components/Progress/types.d.vue.ts +0 -10
- package/components/Progress/types.solid.ts +0 -4
- package/components/Radio/types.d.vue.ts +0 -11
- package/components/Radio/types.solid.ts +0 -9
- package/components/Range/types.d.vue.ts +0 -14
- package/components/Range/types.solid.ts +0 -6
- package/components/Select/types.d.vue.ts +0 -17
- package/components/Select/types.solid.ts +0 -6
- package/components/Switch/types.d.vue.ts +0 -13
- package/components/Switch/types.solid.ts +0 -9
- package/components/Table/Body.astro +0 -11
- package/components/Table/Body.vue +0 -5
- package/components/Table/Cell.astro +0 -11
- package/components/Table/Cell.vue +0 -5
- package/components/Table/Column.astro +0 -12
- package/components/Table/Column.vue +0 -19
- package/components/Table/ColumnGroup.astro +0 -11
- package/components/Table/ColumnGroup.vue +0 -5
- package/components/Table/Head.astro +0 -11
- package/components/Table/Head.vue +0 -5
- package/components/Table/HeaderCell.astro +0 -11
- package/components/Table/HeaderCell.vue +0 -5
- package/components/Table/Row.astro +0 -11
- package/components/Table/Row.vue +0 -5
- package/components/Table/index.ts +0 -20
- package/components/Table/types.d.vue.ts +0 -10
- package/components/Table/types.solid.ts +0 -8
- package/components/Tabs/TabsTab.astro +0 -15
- package/components/Tabs/TabsTab.vue +0 -24
- package/components/Tabs/index.ts +0 -14
- package/components/Tabs/types.d.vue.ts +0 -31
- package/components/Tabs/types.solid.ts +0 -12
- package/components/TextField/types.d.vue.ts +0 -20
- package/components/TextField/types.solid.ts +0 -22
- package/components/Textarea/types.d.vue.ts +0 -19
- package/components/Textarea/types.solid.ts +0 -6
- package/components/Toast/Toast.astro +0 -42
- package/components/Toast/Toast.vue +0 -48
- package/components/ToggleButton/types.d.vue.ts +0 -10
- package/components/ToggleButton/types.solid.ts +0 -7
- package/components/ToggleGroup/types.d.vue.ts +0 -15
- package/components/ToggleGroup/types.solid.ts +0 -4
- package/components/Tooltip/types.d.vue.ts +0 -10
- package/components/Tooltip/types.solid.ts +0 -6
- package/css/components/icon-button.css +0 -139
- package/css/components/text-input.css +0 -68
- package/css/components/toast.css +0 -157
- package/css/js/toast.js +0 -94
- /package/components/{FieldSet → Fieldset}/types.astro.ts +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Open Props UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Design system. Components. Modern HTML & CSS.
|
|
4
|
+
|
|
5
|
+
HTML, [Astro](https://astro.build/), [React](https://react.dev/), [Svelte](https://svelte.dev/) and [Vue](https://vuejs.org/) components alongside framework-agnostic CSS. The theme tokens started from [Open Props](https://open-props.style/), and the components don't need it: it ships as an optional companion for your own CSS.
|
|
4
6
|
|
|
5
7
|
- Docs: [open-props-ui.netlify.app](https://open-props-ui.netlify.app/)
|
|
6
8
|
- Source: [github.com/felix-bohlin/ui](https://github.com/felix-bohlin/ui)
|
|
@@ -8,14 +10,16 @@ A CSS UI library exploring how next-gen HTML & CSS features can change the way w
|
|
|
8
10
|
## Install
|
|
9
11
|
|
|
10
12
|
```bash
|
|
11
|
-
pnpm add opui-css
|
|
13
|
+
pnpm add opui-css
|
|
12
14
|
```
|
|
13
15
|
|
|
14
16
|
Peer dependencies:
|
|
15
17
|
|
|
16
|
-
- `astro` `^
|
|
17
|
-
- `
|
|
18
|
-
- `
|
|
18
|
+
- `astro` `^7` (only required if you use the Astro components)
|
|
19
|
+
- `open-props` `^1.7.23` (only required if you import `opui-css/open-props.css`, the Open Props source)
|
|
20
|
+
- `react` and `react-dom` `^19` (only required if you use the React components)
|
|
21
|
+
- `svelte` `^5.57` (only required if you use the Svelte components)
|
|
22
|
+
- `vue` `^3.5` (only required if you use the Vue components)
|
|
19
23
|
|
|
20
24
|
## Usage
|
|
21
25
|
|
|
@@ -28,10 +32,105 @@ import { Button, Card } from "opui-css/astro"
|
|
|
28
32
|
---
|
|
29
33
|
|
|
30
34
|
<Card>
|
|
31
|
-
<Button
|
|
35
|
+
<Button color="primary" variant="filled">Click me</Button>
|
|
36
|
+
</Card>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### React components
|
|
40
|
+
|
|
41
|
+
React components ship markup only, so import the CSS once in your app entry:
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
@import "opui-css/css/imports.css";
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```tsx
|
|
48
|
+
import { Button, Card } from "opui-css/react"
|
|
49
|
+
|
|
50
|
+
export default function App() {
|
|
51
|
+
return (
|
|
52
|
+
<Card>
|
|
53
|
+
<Button color="primary" variant="filled">
|
|
54
|
+
Click me
|
|
55
|
+
</Button>
|
|
56
|
+
</Card>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Containers take parts, such as `CardHeader` and `DialogFooter`. Other slots are props: `children`, and camelCased names such as `endText`. Form controls take the native `value`/`defaultValue`, `checked`/`defaultChecked` and `onChange` props. Components that need context, state or effects (Anchor, Callout, Dialog, Drawer, FieldGroup, Menu, Range, Select, Tabs, TextField, Textarea, ToggleButton and ToggleGroup, and the CheckboxInput, RadioInput and SwitchInput parts) are marked `"use client"`; the rest also render as React Server Components.
|
|
62
|
+
|
|
63
|
+
### Svelte components
|
|
64
|
+
|
|
65
|
+
Svelte components ship markup only, so import the CSS once in your root layout or app entry:
|
|
66
|
+
|
|
67
|
+
```css
|
|
68
|
+
@import "opui-css/css/imports.css";
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```svelte
|
|
72
|
+
<script lang="ts">
|
|
73
|
+
import { Button, Card } from "opui-css/svelte"
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<Card>
|
|
77
|
+
<Button color="primary" variant="filled">Click me</Button>
|
|
32
78
|
</Card>
|
|
33
79
|
```
|
|
34
80
|
|
|
81
|
+
### Vue components
|
|
82
|
+
|
|
83
|
+
Vue components ship markup only, so import the CSS once in your app entry:
|
|
84
|
+
|
|
85
|
+
```css
|
|
86
|
+
@import "opui-css/css/imports.css";
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```vue
|
|
90
|
+
<script setup lang="ts">
|
|
91
|
+
import { Button, Card } from "opui-css/vue"
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<Card>
|
|
96
|
+
<Button color="primary" variant="filled">Click me</Button>
|
|
97
|
+
</Card>
|
|
98
|
+
</template>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
`opui-css/astro`, `opui-css/react`, `opui-css/svelte` and `opui-css/vue` export uncompiled sources (`.astro`, `.tsx`, `.svelte`, `.vue`, `.ts`), so they need a bundler that compiles them, e.g. Astro, or Vite with `@vitejs/plugin-react`, `@sveltejs/vite-plugin-svelte` or `@vitejs/plugin-vue`. In Next.js, add `transpilePackages: ["opui-css"]` to `next.config`.
|
|
102
|
+
|
|
103
|
+
Vite's server build loads dependencies from `node_modules` without compiling them, and Node can't load `.svelte`, `.vue` or `.tsx`, so the package has to go through the bundler on the server too. Astro does this on its own, and SvelteKit through the package's `svelte` field. In Vite SSR, add `ssr: { noExternal: ["opui-css"] }` to `vite.config`, and in Nuxt, add `build: { transpile: ["opui-css"] }` to `nuxt.config`.
|
|
104
|
+
|
|
105
|
+
#### TypeScript
|
|
106
|
+
|
|
107
|
+
The components ship their TypeScript sources instead of `.d.ts` files, so your `tsconfig.json` type-checks them with your own `compilerOptions`. They are checked with `strict: true`, `verbatimModuleSyntax` and `isolatedModules`, and resolve with `moduleResolution: "bundler"`, `"node16"` or `"nodenext"` (not `"node10"`). The React components need `jsx: "react-jsx"` or `"preserve"`. `exactOptionalPropertyTypes` and `noUncheckedIndexedAccess` aren't checked, so they can report errors in the package, and `skipLibCheck` doesn't skip its `.ts` files.
|
|
108
|
+
|
|
109
|
+
#### Ids in Astro
|
|
110
|
+
|
|
111
|
+
Components that link elements with ids (form fields, Tabs, Drawer, Menu, …) read `Astro.locals.$id` when it exists and otherwise generate a random id per render. For stable, per-request ids (useful for snapshot tests), define it in a middleware:
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
// src/middleware.ts
|
|
115
|
+
import { defineMiddleware } from "astro:middleware"
|
|
116
|
+
|
|
117
|
+
export const onRequest = defineMiddleware((context, next) => {
|
|
118
|
+
const counts = new Map<string, number>()
|
|
119
|
+
context.locals.$id = (prefix) => {
|
|
120
|
+
const count = (counts.get(prefix) ?? 0) + 1
|
|
121
|
+
counts.set(prefix, count)
|
|
122
|
+
return `${prefix}-${count}`
|
|
123
|
+
}
|
|
124
|
+
return next()
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Add `/// <reference types="opui-css/env.d.ts" />` to your `env.d.ts` to type `$id` and the `interestfor` attribute on `<a>` and `<button>`.
|
|
129
|
+
|
|
130
|
+
#### Astro runtime
|
|
131
|
+
|
|
132
|
+
The Astro components pass settings to their parts with `AsyncLocalStorage` (`node:async_hooks`), so they run on Node, Deno and Bun. On Cloudflare, enable the `nodejs_compat` compatibility flag.
|
|
133
|
+
|
|
35
134
|
### Plain HTML + CSS (no build step)
|
|
36
135
|
|
|
37
136
|
Drop a pre-bundled stylesheet into any page and use the documented class names:
|
|
@@ -39,18 +138,20 @@ Drop a pre-bundled stylesheet into any page and use the documented class names:
|
|
|
39
138
|
```html
|
|
40
139
|
<link
|
|
41
140
|
rel="stylesheet"
|
|
42
|
-
href="https://cdn.jsdelivr.net/npm/opui-css/dist/opui.css"
|
|
141
|
+
href="https://cdn.jsdelivr.net/npm/opui-css@6/dist/opui.css"
|
|
43
142
|
/>
|
|
44
143
|
|
|
45
144
|
<button class="ui-button ui-primary">Click me</button>
|
|
46
145
|
```
|
|
47
146
|
|
|
48
|
-
`dist/opui.css` is a single self-contained file (Open Props +
|
|
147
|
+
`dist/opui.css` is a single self-contained file (Open Props + palette + theme + normalize + every component + browser fallbacks + utils, in the correct cascade layers). `dist/opui.components.css` has only the layer order, the component styles, their browser fallbacks and the `Layout` classes. The components need `core/palette.css` and `css/theme.css` to look right, and `core/utils.css` holds `.ui-sr-only` and the motion and contrast classes, so load those yourself when you use it. Nothing in the package reads Open Props: `theme.css` holds its own values, and Open Props is in the bundle for your own CSS.
|
|
148
|
+
|
|
149
|
+
The browser fallbacks are the `components.compat` layer, which only applies in browsers without a feature. `dist/opui.no-compat.css` is `dist/opui.css` without them, and `dist/opui.baseline-<year>.css` keeps only the ones that browsers of that Baseline year need ([Compat layer](https://open-props-ui.netlify.app/html/guide/browser-support/#compat)).
|
|
49
150
|
|
|
50
151
|
If you do have a bundler that resolves CSS `@import`s (Vite, Astro, webpack, …), import the source instead so you only ship what you use:
|
|
51
152
|
|
|
52
153
|
```css
|
|
53
|
-
@import "opui-css/css/imports.css"; /*
|
|
154
|
+
@import "opui-css/css/imports.css"; /* dist/opui.css without Open Props */
|
|
54
155
|
@import "opui-css/css/components/button.css"; /* or pick à la carte */
|
|
55
156
|
```
|
|
56
157
|
|
|
@@ -59,28 +160,78 @@ If you do have a bundler that resolves CSS `@import`s (Vite, Astro, webpack, …
|
|
|
59
160
|
The library defines this layer order:
|
|
60
161
|
|
|
61
162
|
```css
|
|
62
|
-
@layer openprops, theme, normalize, components.root, components.extended, utils;
|
|
163
|
+
@layer openprops, theme, normalize, components.prose, components.root, components.extended, components.compat, utils;
|
|
164
|
+
@layer theme.palette, theme.base, theme.custom, theme.severity;
|
|
63
165
|
```
|
|
64
166
|
|
|
65
|
-
|
|
167
|
+
Import `opui-css/css/layers.css` first to set this order when you import single files, and `opui-css/css/compat.css` after the components for the browser fallbacks.
|
|
168
|
+
|
|
169
|
+
Put your theme tokens in `@layer theme.custom`, which beats the defaults in `theme.base`. `theme.severity` comes after it and only holds the palette source of the severity classes, so a theme that sets `--ui-palette-source` doesn't recolor a `.ui-critical` on the same element. Wrap other overrides in a layer above `utils` (or unlayered).
|
|
170
|
+
|
|
171
|
+
## Upgrading
|
|
172
|
+
|
|
173
|
+
Breaking changes and how to update your code are in [MIGRATING.md](./MIGRATING.md) (also on the docs site: [Migrating to v6](https://open-props-ui.netlify.app/html/guide/migrating/)), with every change listed in [CHANGELOG.md](./CHANGELOG.md).
|
|
66
174
|
|
|
67
175
|
## Entry points
|
|
68
176
|
|
|
69
|
-
| Import
|
|
70
|
-
|
|
|
71
|
-
| `opui-css`
|
|
72
|
-
| `opui-css/open-props`
|
|
73
|
-
| `opui-css/
|
|
74
|
-
| `opui-css/dist/opui.
|
|
75
|
-
| `opui-css/dist/
|
|
76
|
-
| `opui-css/
|
|
77
|
-
| `opui-css/
|
|
78
|
-
| `opui-css/
|
|
79
|
-
| `opui-css/
|
|
80
|
-
| `opui-css/
|
|
81
|
-
| `opui-css/
|
|
82
|
-
| `opui-css/
|
|
83
|
-
| `opui-css/components
|
|
177
|
+
| Import | What it gives you |
|
|
178
|
+
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
179
|
+
| `opui-css` | Pre-bundled: everything in one file (default) |
|
|
180
|
+
| `opui-css/open-props` | Pre-bundled: Open Props tokens only, for your own CSS (the components don't read them) |
|
|
181
|
+
| `opui-css/open-props.css` | Source: the Open Props imports (needs `open-props` installed) |
|
|
182
|
+
| `opui-css/dist/opui.css` | Same as default - explicit path |
|
|
183
|
+
| `opui-css/dist/opui.baseline-<year>.css` | Pre-bundled: everything, with only the browser fallbacks that browsers of that Baseline year need |
|
|
184
|
+
| `opui-css/dist/opui.components.css` | Pre-bundled: components only (no Open Props, palette, theme, reset or utils) |
|
|
185
|
+
| `opui-css/dist/opui.no-compat.css` | Pre-bundled: everything but the browser fallbacks |
|
|
186
|
+
| `opui-css/dist/op.css` | Same as `opui-css/open-props` - explicit path |
|
|
187
|
+
| `opui-css/css/imports.css` | Source: everything but Open Props (resolved by your bundler) |
|
|
188
|
+
| `opui-css/css/layers.css` | `@layer` order only |
|
|
189
|
+
| `opui-css/css/compat.css` | All browser fallbacks, in the `components.compat` layer |
|
|
190
|
+
| `opui-css/css/compat/*.css` | The browser fallbacks of one component |
|
|
191
|
+
| `opui-css/css/components.css` | All component styles (no Open Props, palette, theme, reset or utils) |
|
|
192
|
+
| `opui-css/css/components/*.css` | One component at a time |
|
|
193
|
+
| `opui-css/css/theme.css` | Theme tokens (colors, sizes, motion, state) |
|
|
194
|
+
| `opui-css/core/normalize.css` | CSS reset |
|
|
195
|
+
| `opui-css/core/palette.css` | OKLCH palette (required by the components) |
|
|
196
|
+
| `opui-css/core/utils.css` | Utility classes |
|
|
197
|
+
| `opui-css/css/js/checkbox.js` | `activateIndeterminate()`, `initCheckbox()` and `syncIndeterminate()` for indeterminate checkboxes without a framework |
|
|
198
|
+
| `opui-css/css/js/range.js` | `initRange()` keeps a `.ui-range` `<output data-live>` in sync with its slider without a framework |
|
|
199
|
+
| `opui-css/themes/*` | Example themes (`bootstrap`, `brutalist`, `m3`, `shadcn`), with or without `.css` |
|
|
200
|
+
| `opui-css/tokens.json` | Every theme token in the W3C design tokens format |
|
|
201
|
+
| `opui-css/astro` | All Astro components |
|
|
202
|
+
| `opui-css/react` | All React components |
|
|
203
|
+
| `opui-css/svelte` | All Svelte components |
|
|
204
|
+
| `opui-css/vue` | All Vue components |
|
|
205
|
+
| `opui-css/components/*` | Individual Astro, React, Svelte and Vue component sources. The files at the top of `components/` (`cx.ts`, `dev.ts`, `group.ts`, `id.ts`, `style.ts`, `tag.ts`, `vue.ts`, `context.astro.ts` and `content.svelte`) are internal helpers that can change in any release |
|
|
206
|
+
| `opui-css/env.d.ts` | Astro types for `Astro.locals.$id` and `interestfor` (see [Ids in Astro](#ids-in-astro)) |
|
|
207
|
+
| `opui-css/package.json` | The package manifest, for tools that read it |
|
|
208
|
+
|
|
209
|
+
Importing a React component from `opui-css/components/*` skips the type augmentation in `opui-css/react`, which adds `command`, `commandfor` and `interestfor` to React's element types. `Menu` and `DrawerHeader` need it, so add `import type {} from "opui-css/react"` once in your app.
|
|
210
|
+
|
|
211
|
+
## Themes
|
|
212
|
+
|
|
213
|
+
Put your own tokens in `@layer theme.custom`, which beats the defaults and loses to everything else. Example themes ship in `themes/`: `bootstrap` (Bootstrap 5), `brutalist` (neobrutalism), `m3` (Material 3) and `shadcn` (shadcn/ui). They name their fonts (DM Sans, Roboto and Geist) but don't load them.
|
|
214
|
+
|
|
215
|
+
```css
|
|
216
|
+
@import "opui-css/css/imports.css";
|
|
217
|
+
@import "opui-css/themes/brutalist.css";
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Design tokens
|
|
221
|
+
|
|
222
|
+
`opui-css/tokens.json` lists every theme token in the [W3C design tokens](https://www.designtokens.org/) format: its `$type`, description and default as `$value`, and under `$extensions.opui` its CSS variable, tier (`role`, `component` or `hook`), contrast promise and dark and more-contrast values. A plain number, a `px` or `rem` length and an alias of another token are native values (`0.41`, `{"unit": "px", "value": 1}`, `{typography.ui-font-size-100}`) with the CSS beside them as `$extensions.opui.css`. Every other value is the CSS expression, since a color or size that follows another token or the color scheme has no single resolved value, so a design tool resolves those first. Tokens that are unset by default have no `$value`, only an `example`.
|
|
223
|
+
|
|
224
|
+
## AI assistants
|
|
225
|
+
|
|
226
|
+
The package ships an agent skill in `skills/opui`, with one reference per component for every framework, matching the installed version. Agents don't load skills from `node_modules` on their own, so copy it into your project:
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
npx opui-css skill
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
It writes `.claude/skills/opui` and prints the version it copied. Pass `--dir <path>` to copy it into another agent's skills folder (`<path>/opui`), and `--force` to replace an older copy after an upgrade. Without the command: `mkdir -p .claude/skills && cp -r node_modules/opui-css/skills/opui .claude/skills/opui`.
|
|
233
|
+
|
|
234
|
+
The docs are also available as [llms.txt](https://open-props-ui.netlify.app/llms.txt), and every docs page has a Markdown version, e.g. [/html/components/button.md](https://open-props-ui.netlify.app/html/components/button.md).
|
|
84
235
|
|
|
85
236
|
## License
|
|
86
237
|
|
package/astro/index.ts
CHANGED
|
@@ -1,29 +1,48 @@
|
|
|
1
1
|
export { default as Accordion } from "../components/Accordion/Accordion.astro"
|
|
2
|
+
export { default as AccordionActions } from "../components/Accordion/AccordionActions.astro"
|
|
3
|
+
export { default as AccordionContent } from "../components/Accordion/AccordionContent.astro"
|
|
4
|
+
export { default as AccordionSummary } from "../components/Accordion/AccordionSummary.astro"
|
|
2
5
|
export { default as Anchor } from "../components/Anchor/Anchor.astro"
|
|
6
|
+
export { default as AnchorContent } from "../components/Anchor/AnchorContent.astro"
|
|
3
7
|
export { default as Avatar } from "../components/Avatar/Avatar.astro"
|
|
8
|
+
export { default as AvatarGroup } from "../components/Avatar/AvatarGroup.astro"
|
|
4
9
|
export { default as Badge } from "../components/Badge/Badge.astro"
|
|
5
10
|
export { default as Button } from "../components/Button/Button.astro"
|
|
6
11
|
export { default as ButtonGroup } from "../components/ButtonGroup/ButtonGroup.astro"
|
|
7
12
|
export { default as Callout } from "../components/Callout/Callout.astro"
|
|
13
|
+
export { default as CalloutContent } from "../components/Callout/CalloutContent.astro"
|
|
14
|
+
export { default as CalloutIcon } from "../components/Callout/CalloutIcon.astro"
|
|
8
15
|
export { default as Card } from "../components/Card/Card.astro"
|
|
16
|
+
export { default as CardActions } from "../components/Card/CardActions.astro"
|
|
17
|
+
export { default as CardContent } from "../components/Card/CardContent.astro"
|
|
18
|
+
export { default as CardHeader } from "../components/Card/CardHeader.astro"
|
|
19
|
+
export { default as Carousel } from "../components/Carousel/Carousel.astro"
|
|
9
20
|
export { default as Checkbox } from "../components/Checkbox/Checkbox.astro"
|
|
10
21
|
export { default as CheckboxInput } from "../components/Checkbox/CheckboxInput.astro"
|
|
11
22
|
export { default as Chip } from "../components/Chip/Chip.astro"
|
|
12
|
-
export { default as
|
|
13
|
-
export { default as
|
|
23
|
+
export { default as DescriptionList } from "../components/DescriptionList/DescriptionList.astro"
|
|
24
|
+
export { default as DescriptionListDescription } from "../components/DescriptionList/DescriptionListDescription.astro"
|
|
25
|
+
export { default as DescriptionListItem } from "../components/DescriptionList/DescriptionListItem.astro"
|
|
26
|
+
export { default as DescriptionListTerm } from "../components/DescriptionList/DescriptionListTerm.astro"
|
|
14
27
|
export { default as Dialog } from "../components/Dialog/Dialog.astro"
|
|
28
|
+
export { default as DialogContent } from "../components/Dialog/DialogContent.astro"
|
|
29
|
+
export { default as DialogFooter } from "../components/Dialog/DialogFooter.astro"
|
|
30
|
+
export { default as DialogHeader } from "../components/Dialog/DialogHeader.astro"
|
|
31
|
+
export { default as DialogTitle } from "../components/Dialog/DialogTitle.astro"
|
|
15
32
|
export { default as Divider } from "../components/Divider/Divider.astro"
|
|
16
33
|
export { default as Drawer } from "../components/Drawer/Drawer.astro"
|
|
34
|
+
export { default as DrawerContent } from "../components/Drawer/DrawerContent.astro"
|
|
17
35
|
export { default as DrawerFooter } from "../components/Drawer/DrawerFooter.astro"
|
|
18
36
|
export { default as DrawerHeader } from "../components/Drawer/DrawerHeader.astro"
|
|
37
|
+
export { default as DrawerTitle } from "../components/Drawer/DrawerTitle.astro"
|
|
19
38
|
export { default as FieldDescription } from "../components/FieldDescription/FieldDescription.astro"
|
|
20
39
|
export { default as FieldGroup } from "../components/FieldGroup/FieldGroup.astro"
|
|
21
40
|
export { default as FieldLegend } from "../components/FieldLegend/FieldLegend.astro"
|
|
22
|
-
export { default as
|
|
41
|
+
export { default as Fieldset } from "../components/Fieldset/Fieldset.astro"
|
|
23
42
|
export { default as Form } from "../components/Form/Form.astro"
|
|
24
|
-
export { default as IconButton } from "../components/IconButton/IconButton.astro"
|
|
25
43
|
export { default as List } from "../components/List/List.astro"
|
|
26
44
|
export { default as ListItem } from "../components/ListItem/ListItem.astro"
|
|
45
|
+
export { default as Menu } from "../components/Menu/Menu.astro"
|
|
27
46
|
export { default as Progress } from "../components/Progress/Progress.astro"
|
|
28
47
|
export { default as Radio } from "../components/Radio/Radio.astro"
|
|
29
48
|
export { default as RadioInput } from "../components/Radio/RadioInput.astro"
|
|
@@ -31,16 +50,126 @@ export { default as Range } from "../components/Range/Range.astro"
|
|
|
31
50
|
export { default as Select } from "../components/Select/Select.astro"
|
|
32
51
|
export { default as Switch } from "../components/Switch/Switch.astro"
|
|
33
52
|
export { default as SwitchInput } from "../components/Switch/SwitchInput.astro"
|
|
34
|
-
export { default as
|
|
35
|
-
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
} from "../components/
|
|
40
|
-
export { default as
|
|
53
|
+
export { default as Table } from "../components/Table/Table.astro"
|
|
54
|
+
export { default as TableBody } from "../components/Table/TableBody.astro"
|
|
55
|
+
export { default as TableCaption } from "../components/Table/TableCaption.astro"
|
|
56
|
+
export { default as TableCell } from "../components/Table/TableCell.astro"
|
|
57
|
+
export { default as TableColumn } from "../components/Table/TableColumn.astro"
|
|
58
|
+
export { default as TableColumnGroup } from "../components/Table/TableColumnGroup.astro"
|
|
59
|
+
export { default as TableFoot } from "../components/Table/TableFoot.astro"
|
|
60
|
+
export { default as TableHead } from "../components/Table/TableHead.astro"
|
|
61
|
+
export { default as TableHeaderCell } from "../components/Table/TableHeaderCell.astro"
|
|
62
|
+
export { default as TableRow } from "../components/Table/TableRow.astro"
|
|
63
|
+
export { default as Tabs } from "../components/Tabs/Tabs.astro"
|
|
64
|
+
export { default as TabsItem } from "../components/Tabs/TabsItem.astro"
|
|
65
|
+
export { default as TabsLabel } from "../components/Tabs/TabsLabel.astro"
|
|
66
|
+
export { default as TabsPanel } from "../components/Tabs/TabsPanel.astro"
|
|
41
67
|
export { default as Textarea } from "../components/Textarea/Textarea.astro"
|
|
42
68
|
export { default as TextField } from "../components/TextField/TextField.astro"
|
|
43
|
-
export { default as Toast } from "../components/Toast/Toast.astro"
|
|
44
|
-
export { default as Tooltip } from "../components/Tooltip/Tooltip.astro"
|
|
45
69
|
export { default as ToggleButton } from "../components/ToggleButton/ToggleButton.astro"
|
|
46
70
|
export { default as ToggleGroup } from "../components/ToggleGroup/ToggleGroup.astro"
|
|
71
|
+
export { default as Tooltip } from "../components/Tooltip/Tooltip.astro"
|
|
72
|
+
export { default as TooltipContent } from "../components/Anchor/AnchorContent.astro"
|
|
73
|
+
export type {
|
|
74
|
+
AccordionActionsProps,
|
|
75
|
+
AccordionContentProps,
|
|
76
|
+
Props as AccordionProps,
|
|
77
|
+
AccordionSummaryProps,
|
|
78
|
+
} from "../components/Accordion/types.astro"
|
|
79
|
+
export type {
|
|
80
|
+
AnchorContentProps,
|
|
81
|
+
Props as AnchorProps,
|
|
82
|
+
AnchorContentProps as TooltipContentProps,
|
|
83
|
+
} from "../components/Anchor/types.astro"
|
|
84
|
+
export type {
|
|
85
|
+
AvatarGroupProps,
|
|
86
|
+
Props as AvatarProps,
|
|
87
|
+
} from "../components/Avatar/types.astro"
|
|
88
|
+
export type { Props as BadgeProps } from "../components/Badge/types.astro"
|
|
89
|
+
export type { Props as ButtonProps } from "../components/Button/types.astro"
|
|
90
|
+
export type { Props as ButtonGroupProps } from "../components/ButtonGroup/types.astro"
|
|
91
|
+
export type {
|
|
92
|
+
CalloutContentProps,
|
|
93
|
+
CalloutIconProps,
|
|
94
|
+
Props as CalloutProps,
|
|
95
|
+
} from "../components/Callout/types.astro"
|
|
96
|
+
export type {
|
|
97
|
+
CardActionsProps,
|
|
98
|
+
CardContentProps,
|
|
99
|
+
CardHeaderProps,
|
|
100
|
+
Props as CardProps,
|
|
101
|
+
} from "../components/Card/types.astro"
|
|
102
|
+
export type { Props as CarouselProps } from "../components/Carousel/types.astro"
|
|
103
|
+
export type {
|
|
104
|
+
CheckboxInputProps,
|
|
105
|
+
Props as CheckboxProps,
|
|
106
|
+
} from "../components/Checkbox/types.astro"
|
|
107
|
+
export type { Props as ChipProps } from "../components/Chip/types.astro"
|
|
108
|
+
export type {
|
|
109
|
+
DescriptionListDescriptionProps,
|
|
110
|
+
DescriptionListItemProps,
|
|
111
|
+
Props as DescriptionListProps,
|
|
112
|
+
DescriptionListTermProps,
|
|
113
|
+
} from "../components/DescriptionList/types.astro"
|
|
114
|
+
export type {
|
|
115
|
+
DialogContentProps,
|
|
116
|
+
DialogFooterProps,
|
|
117
|
+
DialogHeaderProps,
|
|
118
|
+
Props as DialogProps,
|
|
119
|
+
DialogTitleProps,
|
|
120
|
+
} from "../components/Dialog/types.astro"
|
|
121
|
+
export type { Props as DividerProps } from "../components/Divider/types.astro"
|
|
122
|
+
export type {
|
|
123
|
+
DrawerContentProps,
|
|
124
|
+
DrawerFooterProps,
|
|
125
|
+
DrawerHeaderProps,
|
|
126
|
+
Props as DrawerProps,
|
|
127
|
+
DrawerTitleProps,
|
|
128
|
+
} from "../components/Drawer/types.astro"
|
|
129
|
+
export type { Props as FieldDescriptionProps } from "../components/FieldDescription/types.astro"
|
|
130
|
+
export type { Props as FieldGroupProps } from "../components/FieldGroup/types.astro"
|
|
131
|
+
export type { Props as FieldLegendProps } from "../components/FieldLegend/types.astro"
|
|
132
|
+
export type { Props as FieldsetProps } from "../components/Fieldset/types.astro"
|
|
133
|
+
export type { Props as FormProps } from "../components/Form/types.astro"
|
|
134
|
+
export type { Props as ListProps } from "../components/List/types.astro"
|
|
135
|
+
export type { Props as ListItemProps } from "../components/ListItem/types.astro"
|
|
136
|
+
export type {
|
|
137
|
+
MenuItem,
|
|
138
|
+
Props as MenuProps,
|
|
139
|
+
} from "../components/Menu/types.astro"
|
|
140
|
+
export type { Props as ProgressProps } from "../components/Progress/types.astro"
|
|
141
|
+
export type {
|
|
142
|
+
RadioInputProps,
|
|
143
|
+
Props as RadioProps,
|
|
144
|
+
} from "../components/Radio/types.astro"
|
|
145
|
+
export type { RangeItem } from "../components/Range/types"
|
|
146
|
+
export type { Props as RangeProps } from "../components/Range/types.astro"
|
|
147
|
+
export type { SelectItem } from "../components/Select/types"
|
|
148
|
+
export type { Props as SelectProps } from "../components/Select/types.astro"
|
|
149
|
+
export type {
|
|
150
|
+
SwitchInputProps,
|
|
151
|
+
Props as SwitchProps,
|
|
152
|
+
} from "../components/Switch/types.astro"
|
|
153
|
+
export type {
|
|
154
|
+
TableBodyProps,
|
|
155
|
+
TableCaptionProps,
|
|
156
|
+
TableCellProps,
|
|
157
|
+
TableColumnGroupProps,
|
|
158
|
+
TableColumnProps,
|
|
159
|
+
TableFootProps,
|
|
160
|
+
TableHeaderCellProps,
|
|
161
|
+
TableHeadProps,
|
|
162
|
+
Props as TableProps,
|
|
163
|
+
TableRowProps,
|
|
164
|
+
} from "../components/Table/types.astro"
|
|
165
|
+
export type {
|
|
166
|
+
TabsItemProps,
|
|
167
|
+
TabsLabelProps,
|
|
168
|
+
TabsPanelProps,
|
|
169
|
+
Props as TabsProps,
|
|
170
|
+
} from "../components/Tabs/types.astro"
|
|
171
|
+
export type { Props as TextareaProps } from "../components/Textarea/types.astro"
|
|
172
|
+
export type { Props as TextFieldProps } from "../components/TextField/types.astro"
|
|
173
|
+
export type { Props as ToggleButtonProps } from "../components/ToggleButton/types.astro"
|
|
174
|
+
export type { Props as ToggleGroupProps } from "../components/ToggleGroup/types.astro"
|
|
175
|
+
export type { Props as TooltipProps } from "../components/Tooltip/types.astro"
|
package/bin/opui-css.mjs
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { cpSync, existsSync, readFileSync, rmSync } from "node:fs"
|
|
3
|
+
import path from "node:path"
|
|
4
|
+
import { fileURLToPath } from "node:url"
|
|
5
|
+
import { parseArgs } from "node:util"
|
|
6
|
+
|
|
7
|
+
const packageDir = fileURLToPath(new URL("..", import.meta.url))
|
|
8
|
+
const { version } = JSON.parse(
|
|
9
|
+
readFileSync(path.join(packageDir, "package.json"), "utf8"),
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
const USAGE = `opui-css ${version}
|
|
13
|
+
|
|
14
|
+
Usage: npx opui-css skill [--dir <path>] [--force]
|
|
15
|
+
|
|
16
|
+
Commands:
|
|
17
|
+
skill Copy the opui agent skill into .claude/skills/opui
|
|
18
|
+
|
|
19
|
+
Options:
|
|
20
|
+
--dir <path> Copy it into <path>/opui instead, for another agent's skills folder
|
|
21
|
+
--force Replace an existing copy
|
|
22
|
+
--help Show this help`
|
|
23
|
+
|
|
24
|
+
const fail = (message) => {
|
|
25
|
+
if (message) console.error(`${message}\n`)
|
|
26
|
+
console.error(USAGE)
|
|
27
|
+
process.exit(1)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let parsed
|
|
31
|
+
try {
|
|
32
|
+
parsed = parseArgs({
|
|
33
|
+
allowPositionals: true,
|
|
34
|
+
options: {
|
|
35
|
+
dir: { type: "string" },
|
|
36
|
+
force: { type: "boolean" },
|
|
37
|
+
help: { short: "h", type: "boolean" },
|
|
38
|
+
},
|
|
39
|
+
})
|
|
40
|
+
} catch (error) {
|
|
41
|
+
fail(error.message)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const { positionals, values } = parsed
|
|
45
|
+
if (values.help) fail()
|
|
46
|
+
if (positionals.length === 0) fail("Missing a command.")
|
|
47
|
+
if (positionals[0] !== "skill" || positionals.length > 1) {
|
|
48
|
+
fail(`Unknown command: ${positionals.join(" ")}`)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const source = path.join(packageDir, "skills", "opui")
|
|
52
|
+
const target = path.resolve(
|
|
53
|
+
values.dir ?? path.join(".claude", "skills"),
|
|
54
|
+
"opui",
|
|
55
|
+
)
|
|
56
|
+
const relative = path.relative(process.cwd(), target)
|
|
57
|
+
const shown = relative && !relative.startsWith("..") ? relative : target
|
|
58
|
+
|
|
59
|
+
if (existsSync(target) && !values.force) {
|
|
60
|
+
console.error(
|
|
61
|
+
`${shown} already exists. Run the command again with --force to replace it.`,
|
|
62
|
+
)
|
|
63
|
+
process.exit(1)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
rmSync(target, { force: true, recursive: true })
|
|
67
|
+
cpSync(source, target, { recursive: true })
|
|
68
|
+
console.log(`Copied the opui skill from opui-css ${version} to ${shown}`)
|
|
@@ -3,46 +3,19 @@ import type { Props } from "./types.astro"
|
|
|
3
3
|
|
|
4
4
|
export const title = "Accordion"
|
|
5
5
|
|
|
6
|
-
const {
|
|
7
|
-
const { class: className, name, open, variant, ...rest } = Astro.props
|
|
8
|
-
|
|
9
|
-
const summaryId = $id("summary")
|
|
10
|
-
const contentId = $id("content")
|
|
6
|
+
const { class: className, markerAnimation, variant, ...rest } = Astro.props
|
|
11
7
|
---
|
|
12
8
|
|
|
13
9
|
<details
|
|
14
|
-
name={name}
|
|
15
10
|
class:list={[
|
|
16
11
|
"ui-accordion",
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
markerAnimation &&
|
|
13
|
+
markerAnimation !== "rotate" &&
|
|
14
|
+
`ui-marker-animation-${markerAnimation}`,
|
|
15
|
+
variant && variant !== "plain" && `ui-${variant}`,
|
|
19
16
|
className,
|
|
20
17
|
]}
|
|
21
|
-
open={open}
|
|
22
18
|
{...rest}
|
|
23
19
|
>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<summary id={summaryId} aria-controls={contentId}
|
|
27
|
-
><slot name="summary" /><slot name="marker" /></summary
|
|
28
|
-
>
|
|
29
|
-
|
|
30
|
-
<!-- Content -->
|
|
31
|
-
<div
|
|
32
|
-
id={contentId}
|
|
33
|
-
class="ui-content"
|
|
34
|
-
role="region"
|
|
35
|
-
aria-labelledby={summaryId}
|
|
36
|
-
>
|
|
37
|
-
<slot />
|
|
38
|
-
</div>
|
|
39
|
-
|
|
40
|
-
<!-- Actions -->
|
|
41
|
-
{
|
|
42
|
-
Astro.slots.has("actions") && (
|
|
43
|
-
<div class="ui-actions">
|
|
44
|
-
<slot name="actions" />
|
|
45
|
-
</div>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
20
|
+
<slot />
|
|
48
21
|
</details>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cx } from "../cx"
|
|
2
|
+
import type { Props } from "./types.react"
|
|
3
|
+
|
|
4
|
+
export default function Accordion({
|
|
5
|
+
className,
|
|
6
|
+
markerAnimation,
|
|
7
|
+
variant,
|
|
8
|
+
...rest
|
|
9
|
+
}: Props) {
|
|
10
|
+
return (
|
|
11
|
+
<details
|
|
12
|
+
className={cx([
|
|
13
|
+
"ui-accordion",
|
|
14
|
+
markerAnimation &&
|
|
15
|
+
markerAnimation !== "rotate" &&
|
|
16
|
+
`ui-marker-animation-${markerAnimation}`,
|
|
17
|
+
variant && variant !== "plain" && `ui-${variant}`,
|
|
18
|
+
className,
|
|
19
|
+
])}
|
|
20
|
+
{...rest}
|
|
21
|
+
/>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Props } from "./types.svelte"
|
|
3
|
+
|
|
4
|
+
let {
|
|
5
|
+
class: className,
|
|
6
|
+
markerAnimation,
|
|
7
|
+
variant,
|
|
8
|
+
|
|
9
|
+
// Snippets
|
|
10
|
+
children,
|
|
11
|
+
...rest
|
|
12
|
+
}: Props = $props()
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<details
|
|
16
|
+
class={[
|
|
17
|
+
"ui-accordion",
|
|
18
|
+
markerAnimation &&
|
|
19
|
+
markerAnimation !== "rotate" &&
|
|
20
|
+
`ui-marker-animation-${markerAnimation}`,
|
|
21
|
+
variant && variant !== "plain" && `ui-${variant}`,
|
|
22
|
+
className,
|
|
23
|
+
]}
|
|
24
|
+
{...rest}
|
|
25
|
+
>
|
|
26
|
+
{@render children?.()}
|
|
27
|
+
</details>
|