@cdx-ui/components 0.1.3 → 0.1.5
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/README.md +1 -1
- package/coverage.svg +1 -1
- package/lib/commonjs/components/Avatar/index.js +30 -8
- package/lib/commonjs/components/Avatar/index.js.map +1 -1
- package/lib/commonjs/components/Avatar/styles.js +163 -7
- package/lib/commonjs/components/Avatar/styles.js.map +1 -1
- package/lib/commonjs/components/CLAUDE.md +2 -1
- package/lib/commonjs/components/Chip/styles.js +1 -1
- package/lib/commonjs/components/Chip/styles.js.map +1 -1
- package/lib/commonjs/components/Drawer/animation.js +13 -0
- package/lib/commonjs/components/Drawer/animation.js.map +1 -0
- package/lib/commonjs/components/Drawer/index.js +739 -0
- package/lib/commonjs/components/Drawer/index.js.map +1 -0
- package/lib/commonjs/components/Drawer/styles.js +185 -0
- package/lib/commonjs/components/Drawer/styles.js.map +1 -0
- package/lib/commonjs/components/Drawer/utils.js +95 -0
- package/lib/commonjs/components/Drawer/utils.js.map +1 -0
- package/lib/commonjs/components/InsuranceDisclosure/styles.js +1 -1
- package/lib/commonjs/components/InsuranceDisclosure/styles.js.map +1 -1
- package/lib/commonjs/components/Menu/index.js +187 -61
- package/lib/commonjs/components/Menu/index.js.map +1 -1
- package/lib/commonjs/components/Menu/styles.js +32 -37
- package/lib/commonjs/components/Menu/styles.js.map +1 -1
- package/lib/commonjs/components/Select/index.js +2 -10
- package/lib/commonjs/components/Select/index.js.map +1 -1
- package/lib/commonjs/components/Tabs/styles.js +9 -10
- package/lib/commonjs/components/Tabs/styles.js.map +1 -1
- package/lib/commonjs/components/Toast/styles.js +1 -1
- package/lib/commonjs/components/Toast/styles.js.map +1 -1
- package/lib/commonjs/components/index.js +12 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/figma/Avatar.figma.js +18 -4
- package/lib/commonjs/figma/Avatar.figma.js.map +1 -1
- package/lib/commonjs/figma/Calendar.figma.js +28 -0
- package/lib/commonjs/figma/Calendar.figma.js.map +1 -0
- package/lib/commonjs/figma/Carousel.NextButton.figma.js +27 -0
- package/lib/commonjs/figma/Carousel.NextButton.figma.js.map +1 -0
- package/lib/commonjs/figma/Carousel.Pagination.figma.js +22 -0
- package/lib/commonjs/figma/Carousel.Pagination.figma.js.map +1 -0
- package/lib/commonjs/figma/Carousel.PrevButton.figma.js +27 -0
- package/lib/commonjs/figma/Carousel.PrevButton.figma.js.map +1 -0
- package/lib/commonjs/figma/Carousel.figma.js +37 -0
- package/lib/commonjs/figma/Carousel.figma.js.map +1 -0
- package/lib/commonjs/figma/Checkbox.Group.figma.js +24 -0
- package/lib/commonjs/figma/Checkbox.Group.figma.js.map +1 -0
- package/lib/commonjs/figma/CurrencyInput.figma.js +54 -0
- package/lib/commonjs/figma/CurrencyInput.figma.js.map +1 -0
- package/lib/commonjs/figma/DateField.figma.js +58 -0
- package/lib/commonjs/figma/DateField.figma.js.map +1 -0
- package/lib/commonjs/figma/DatePicker.figma.js +88 -0
- package/lib/commonjs/figma/DatePicker.figma.js.map +1 -0
- package/lib/commonjs/figma/DateRangePicker.figma.js +85 -0
- package/lib/commonjs/figma/DateRangePicker.figma.js.map +1 -0
- package/lib/commonjs/figma/DateTimeField.figma.js +69 -0
- package/lib/commonjs/figma/DateTimeField.figma.js.map +1 -0
- package/lib/commonjs/figma/Drawer.Content.figma.js +29 -0
- package/lib/commonjs/figma/Drawer.Content.figma.js.map +1 -0
- package/lib/commonjs/figma/Drawer.Description.figma.js +20 -0
- package/lib/commonjs/figma/Drawer.Description.figma.js.map +1 -0
- package/lib/commonjs/figma/Drawer.Footer.figma.js +41 -0
- package/lib/commonjs/figma/Drawer.Footer.figma.js.map +1 -0
- package/lib/commonjs/figma/Drawer.Header.figma.js +45 -0
- package/lib/commonjs/figma/Drawer.Header.figma.js.map +1 -0
- package/lib/commonjs/figma/Drawer.Title.figma.js +20 -0
- package/lib/commonjs/figma/Drawer.Title.figma.js.map +1 -0
- package/lib/commonjs/figma/Drawer.figma.js +41 -0
- package/lib/commonjs/figma/Drawer.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.Checkbox.figma.js +52 -0
- package/lib/commonjs/figma/Field.Checkbox.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.DateField.figma.js +57 -0
- package/lib/commonjs/figma/Field.DateField.figma.js.map +1 -0
- package/lib/commonjs/figma/Field.DateTimeField.figma.js +57 -0
- package/lib/commonjs/figma/Field.DateTimeField.figma.js.map +1 -0
- package/lib/commonjs/figma/Image.figma.js +22 -0
- package/lib/commonjs/figma/Image.figma.js.map +1 -0
- package/lib/commonjs/figma/Menu.Item.figma.js +33 -5
- package/lib/commonjs/figma/Menu.Item.figma.js.map +1 -1
- package/lib/commonjs/figma/MonthCalendar.figma.js +18 -0
- package/lib/commonjs/figma/MonthCalendar.figma.js.map +1 -0
- package/lib/commonjs/figma/ProgressBar.figma.js +54 -0
- package/lib/commonjs/figma/ProgressBar.figma.js.map +1 -0
- package/lib/commonjs/figma/ProgressCircle.figma.js +73 -0
- package/lib/commonjs/figma/ProgressCircle.figma.js.map +1 -0
- package/lib/commonjs/figma/RangeCalendar.figma.js +36 -0
- package/lib/commonjs/figma/RangeCalendar.figma.js.map +1 -0
- package/lib/commonjs/figma/Skeleton.figma.js +31 -0
- package/lib/commonjs/figma/Skeleton.figma.js.map +1 -0
- package/lib/commonjs/figma/Slider.Marker.figma.js +21 -0
- package/lib/commonjs/figma/Slider.Marker.figma.js.map +1 -0
- package/lib/commonjs/figma/Slider.MarkerGroup.figma.js +22 -0
- package/lib/commonjs/figma/Slider.MarkerGroup.figma.js.map +1 -0
- package/lib/commonjs/figma/Slider.Thumb.figma.js +22 -0
- package/lib/commonjs/figma/Slider.Thumb.figma.js.map +1 -0
- package/lib/commonjs/figma/Slider.figma.js +69 -0
- package/lib/commonjs/figma/Slider.figma.js.map +1 -0
- package/lib/commonjs/figma/Switch.figma.js +36 -0
- package/lib/commonjs/figma/Switch.figma.js.map +1 -0
- package/lib/commonjs/figma/Tabs.SegmentedControl.Segment.figma.js +34 -0
- package/lib/commonjs/figma/Tabs.SegmentedControl.Segment.figma.js.map +1 -0
- package/lib/commonjs/figma/Tabs.SegmentedControl.figma.js +43 -0
- package/lib/commonjs/figma/Tabs.SegmentedControl.figma.js.map +1 -0
- package/lib/commonjs/figma/Tabs.Tab.figma.js +34 -0
- package/lib/commonjs/figma/Tabs.Tab.figma.js.map +1 -0
- package/lib/commonjs/figma/Tabs.figma.js +39 -0
- package/lib/commonjs/figma/Tabs.figma.js.map +1 -0
- package/lib/commonjs/figma/Tile.Description.figma.js +23 -0
- package/lib/commonjs/figma/Tile.Description.figma.js.map +1 -0
- package/lib/commonjs/figma/Tile.Group.figma.js +45 -0
- package/lib/commonjs/figma/Tile.Group.figma.js.map +1 -0
- package/lib/commonjs/figma/Tile.LeadingSlot.figma.js +23 -0
- package/lib/commonjs/figma/Tile.LeadingSlot.figma.js.map +1 -0
- package/lib/commonjs/figma/Tile.Title.figma.js +23 -0
- package/lib/commonjs/figma/Tile.Title.figma.js.map +1 -0
- package/lib/commonjs/figma/Tile.TrailingSlot.figma.js +23 -0
- package/lib/commonjs/figma/Tile.TrailingSlot.figma.js.map +1 -0
- package/lib/commonjs/figma/Tile.figma.js +57 -0
- package/lib/commonjs/figma/Tile.figma.js.map +1 -0
- package/lib/commonjs/figma/Toast.Button.figma.js +32 -0
- package/lib/commonjs/figma/Toast.Button.figma.js.map +1 -0
- package/lib/commonjs/figma/Toast.Close.figma.js +20 -0
- package/lib/commonjs/figma/Toast.Close.figma.js.map +1 -0
- package/lib/commonjs/figma/Toast.figma.js +81 -0
- package/lib/commonjs/figma/Toast.figma.js.map +1 -0
- package/lib/commonjs/figma/Tooltip.Content.figma.js +30 -0
- package/lib/commonjs/figma/Tooltip.Content.figma.js.map +1 -0
- package/lib/commonjs/figma/Tooltip.figma.js +46 -0
- package/lib/commonjs/figma/Tooltip.figma.js.map +1 -0
- package/lib/commonjs/figma/VirtualizedList.figma.js +31 -0
- package/lib/commonjs/figma/VirtualizedList.figma.js.map +1 -0
- package/lib/commonjs/figma/icons.figma.batch.json +262 -2
- package/lib/module/components/Avatar/index.js +30 -8
- package/lib/module/components/Avatar/index.js.map +1 -1
- package/lib/module/components/Avatar/styles.js +163 -7
- package/lib/module/components/Avatar/styles.js.map +1 -1
- package/lib/module/components/CLAUDE.md +2 -1
- package/lib/module/components/Chip/styles.js +1 -1
- package/lib/module/components/Chip/styles.js.map +1 -1
- package/lib/module/components/Drawer/animation.js +7 -0
- package/lib/module/components/Drawer/animation.js.map +1 -0
- package/lib/module/components/Drawer/index.js +724 -0
- package/lib/module/components/Drawer/index.js.map +1 -0
- package/lib/module/components/Drawer/styles.js +181 -0
- package/lib/module/components/Drawer/styles.js.map +1 -0
- package/lib/module/components/Drawer/utils.js +86 -0
- package/lib/module/components/Drawer/utils.js.map +1 -0
- package/lib/module/components/InsuranceDisclosure/styles.js +1 -1
- package/lib/module/components/InsuranceDisclosure/styles.js.map +1 -1
- package/lib/module/components/Menu/index.js +178 -52
- package/lib/module/components/Menu/index.js.map +1 -1
- package/lib/module/components/Menu/styles.js +31 -36
- package/lib/module/components/Menu/styles.js.map +1 -1
- package/lib/module/components/Select/index.js +3 -11
- package/lib/module/components/Select/index.js.map +1 -1
- package/lib/module/components/Tabs/styles.js +9 -10
- package/lib/module/components/Tabs/styles.js.map +1 -1
- package/lib/module/components/Toast/styles.js +1 -1
- package/lib/module/components/Toast/styles.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/figma/Avatar.figma.js +18 -4
- package/lib/module/figma/Avatar.figma.js.map +1 -1
- package/lib/module/figma/Calendar.figma.js +22 -0
- package/lib/module/figma/Calendar.figma.js.map +1 -0
- package/lib/module/figma/Carousel.NextButton.figma.js +21 -0
- package/lib/module/figma/Carousel.NextButton.figma.js.map +1 -0
- package/lib/module/figma/Carousel.Pagination.figma.js +18 -0
- package/lib/module/figma/Carousel.Pagination.figma.js.map +1 -0
- package/lib/module/figma/Carousel.PrevButton.figma.js +21 -0
- package/lib/module/figma/Carousel.PrevButton.figma.js.map +1 -0
- package/lib/module/figma/Carousel.figma.js +31 -0
- package/lib/module/figma/Carousel.figma.js.map +1 -0
- package/lib/module/figma/Checkbox.Group.figma.js +18 -0
- package/lib/module/figma/Checkbox.Group.figma.js.map +1 -0
- package/lib/module/figma/CurrencyInput.figma.js +48 -0
- package/lib/module/figma/CurrencyInput.figma.js.map +1 -0
- package/lib/module/figma/DateField.figma.js +52 -0
- package/lib/module/figma/DateField.figma.js.map +1 -0
- package/lib/module/figma/DatePicker.figma.js +82 -0
- package/lib/module/figma/DatePicker.figma.js.map +1 -0
- package/lib/module/figma/DateRangePicker.figma.js +79 -0
- package/lib/module/figma/DateRangePicker.figma.js.map +1 -0
- package/lib/module/figma/DateTimeField.figma.js +63 -0
- package/lib/module/figma/DateTimeField.figma.js.map +1 -0
- package/lib/module/figma/Drawer.Content.figma.js +23 -0
- package/lib/module/figma/Drawer.Content.figma.js.map +1 -0
- package/lib/module/figma/Drawer.Description.figma.js +14 -0
- package/lib/module/figma/Drawer.Description.figma.js.map +1 -0
- package/lib/module/figma/Drawer.Footer.figma.js +35 -0
- package/lib/module/figma/Drawer.Footer.figma.js.map +1 -0
- package/lib/module/figma/Drawer.Header.figma.js +39 -0
- package/lib/module/figma/Drawer.Header.figma.js.map +1 -0
- package/lib/module/figma/Drawer.Title.figma.js +14 -0
- package/lib/module/figma/Drawer.Title.figma.js.map +1 -0
- package/lib/module/figma/Drawer.figma.js +35 -0
- package/lib/module/figma/Drawer.figma.js.map +1 -0
- package/lib/module/figma/Field.Checkbox.figma.js +46 -0
- package/lib/module/figma/Field.Checkbox.figma.js.map +1 -0
- package/lib/module/figma/Field.DateField.figma.js +51 -0
- package/lib/module/figma/Field.DateField.figma.js.map +1 -0
- package/lib/module/figma/Field.DateTimeField.figma.js +51 -0
- package/lib/module/figma/Field.DateTimeField.figma.js.map +1 -0
- package/lib/module/figma/Image.figma.js +18 -0
- package/lib/module/figma/Image.figma.js.map +1 -0
- package/lib/module/figma/Menu.Item.figma.js +33 -5
- package/lib/module/figma/Menu.Item.figma.js.map +1 -1
- package/lib/module/figma/MonthCalendar.figma.js +14 -0
- package/lib/module/figma/MonthCalendar.figma.js.map +1 -0
- package/lib/module/figma/ProgressBar.figma.js +48 -0
- package/lib/module/figma/ProgressBar.figma.js.map +1 -0
- package/lib/module/figma/ProgressCircle.figma.js +67 -0
- package/lib/module/figma/ProgressCircle.figma.js.map +1 -0
- package/lib/module/figma/RangeCalendar.figma.js +30 -0
- package/lib/module/figma/RangeCalendar.figma.js.map +1 -0
- package/lib/module/figma/Skeleton.figma.js +25 -0
- package/lib/module/figma/Skeleton.figma.js.map +1 -0
- package/lib/module/figma/Slider.Marker.figma.js +17 -0
- package/lib/module/figma/Slider.Marker.figma.js.map +1 -0
- package/lib/module/figma/Slider.MarkerGroup.figma.js +18 -0
- package/lib/module/figma/Slider.MarkerGroup.figma.js.map +1 -0
- package/lib/module/figma/Slider.Thumb.figma.js +18 -0
- package/lib/module/figma/Slider.Thumb.figma.js.map +1 -0
- package/lib/module/figma/Slider.figma.js +63 -0
- package/lib/module/figma/Slider.figma.js.map +1 -0
- package/lib/module/figma/Switch.figma.js +30 -0
- package/lib/module/figma/Switch.figma.js.map +1 -0
- package/lib/module/figma/Tabs.SegmentedControl.Segment.figma.js +28 -0
- package/lib/module/figma/Tabs.SegmentedControl.Segment.figma.js.map +1 -0
- package/lib/module/figma/Tabs.SegmentedControl.figma.js +37 -0
- package/lib/module/figma/Tabs.SegmentedControl.figma.js.map +1 -0
- package/lib/module/figma/Tabs.Tab.figma.js +28 -0
- package/lib/module/figma/Tabs.Tab.figma.js.map +1 -0
- package/lib/module/figma/Tabs.figma.js +33 -0
- package/lib/module/figma/Tabs.figma.js.map +1 -0
- package/lib/module/figma/Tile.Description.figma.js +17 -0
- package/lib/module/figma/Tile.Description.figma.js.map +1 -0
- package/lib/module/figma/Tile.Group.figma.js +39 -0
- package/lib/module/figma/Tile.Group.figma.js.map +1 -0
- package/lib/module/figma/Tile.LeadingSlot.figma.js +17 -0
- package/lib/module/figma/Tile.LeadingSlot.figma.js.map +1 -0
- package/lib/module/figma/Tile.Title.figma.js +17 -0
- package/lib/module/figma/Tile.Title.figma.js.map +1 -0
- package/lib/module/figma/Tile.TrailingSlot.figma.js +17 -0
- package/lib/module/figma/Tile.TrailingSlot.figma.js.map +1 -0
- package/lib/module/figma/Tile.figma.js +51 -0
- package/lib/module/figma/Tile.figma.js.map +1 -0
- package/lib/module/figma/Toast.Button.figma.js +26 -0
- package/lib/module/figma/Toast.Button.figma.js.map +1 -0
- package/lib/module/figma/Toast.Close.figma.js +15 -0
- package/lib/module/figma/Toast.Close.figma.js.map +1 -0
- package/lib/module/figma/Toast.figma.js +75 -0
- package/lib/module/figma/Toast.figma.js.map +1 -0
- package/lib/module/figma/Tooltip.Content.figma.js +24 -0
- package/lib/module/figma/Tooltip.Content.figma.js.map +1 -0
- package/lib/module/figma/Tooltip.figma.js +40 -0
- package/lib/module/figma/Tooltip.figma.js.map +1 -0
- package/lib/module/figma/VirtualizedList.figma.js +25 -0
- package/lib/module/figma/VirtualizedList.figma.js.map +1 -0
- package/lib/module/figma/icons.figma.batch.json +262 -2
- package/lib/typescript/components/Avatar/index.d.ts +19 -1
- package/lib/typescript/components/Avatar/index.d.ts.map +1 -1
- package/lib/typescript/components/Avatar/styles.d.ts +10 -1
- package/lib/typescript/components/Avatar/styles.d.ts.map +1 -1
- package/lib/typescript/components/Drawer/animation.d.ts +9 -0
- package/lib/typescript/components/Drawer/animation.d.ts.map +1 -0
- package/lib/typescript/components/Drawer/index.d.ts +106 -0
- package/lib/typescript/components/Drawer/index.d.ts.map +1 -0
- package/lib/typescript/components/Drawer/styles.d.ts +32 -0
- package/lib/typescript/components/Drawer/styles.d.ts.map +1 -0
- package/lib/typescript/components/Drawer/utils.d.ts +23 -0
- package/lib/typescript/components/Drawer/utils.d.ts.map +1 -0
- package/lib/typescript/components/InsuranceDisclosure/styles.d.ts.map +1 -1
- package/lib/typescript/components/Menu/index.d.ts +29 -2
- package/lib/typescript/components/Menu/index.d.ts.map +1 -1
- package/lib/typescript/components/Menu/styles.d.ts +6 -2
- package/lib/typescript/components/Menu/styles.d.ts.map +1 -1
- package/lib/typescript/components/Select/index.d.ts.map +1 -1
- package/lib/typescript/components/Tabs/styles.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/figma/Avatar.figma.d.ts.map +1 -1
- package/lib/typescript/figma/Calendar.figma.d.ts +8 -0
- package/lib/typescript/figma/Calendar.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Carousel.NextButton.figma.d.ts +11 -0
- package/lib/typescript/figma/Carousel.NextButton.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Carousel.Pagination.figma.d.ts +11 -0
- package/lib/typescript/figma/Carousel.Pagination.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Carousel.PrevButton.figma.d.ts +11 -0
- package/lib/typescript/figma/Carousel.PrevButton.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Carousel.figma.d.ts +8 -0
- package/lib/typescript/figma/Carousel.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Checkbox.Group.figma.d.ts +8 -0
- package/lib/typescript/figma/Checkbox.Group.figma.d.ts.map +1 -0
- package/lib/typescript/figma/CurrencyInput.figma.d.ts +8 -0
- package/lib/typescript/figma/CurrencyInput.figma.d.ts.map +1 -0
- package/lib/typescript/figma/DateField.figma.d.ts +8 -0
- package/lib/typescript/figma/DateField.figma.d.ts.map +1 -0
- package/lib/typescript/figma/DatePicker.figma.d.ts +8 -0
- package/lib/typescript/figma/DatePicker.figma.d.ts.map +1 -0
- package/lib/typescript/figma/DateRangePicker.figma.d.ts +8 -0
- package/lib/typescript/figma/DateRangePicker.figma.d.ts.map +1 -0
- package/lib/typescript/figma/DateTimeField.figma.d.ts +8 -0
- package/lib/typescript/figma/DateTimeField.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Drawer.Content.figma.d.ts +8 -0
- package/lib/typescript/figma/Drawer.Content.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Drawer.Description.figma.d.ts +8 -0
- package/lib/typescript/figma/Drawer.Description.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Drawer.Footer.figma.d.ts +11 -0
- package/lib/typescript/figma/Drawer.Footer.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Drawer.Header.figma.d.ts +8 -0
- package/lib/typescript/figma/Drawer.Header.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Drawer.Title.figma.d.ts +8 -0
- package/lib/typescript/figma/Drawer.Title.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Drawer.figma.d.ts +8 -0
- package/lib/typescript/figma/Drawer.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.Checkbox.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.Checkbox.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.DateField.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.DateField.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Field.DateTimeField.figma.d.ts +8 -0
- package/lib/typescript/figma/Field.DateTimeField.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Image.figma.d.ts +11 -0
- package/lib/typescript/figma/Image.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Menu.Item.figma.d.ts.map +1 -1
- package/lib/typescript/figma/MonthCalendar.figma.d.ts +8 -0
- package/lib/typescript/figma/MonthCalendar.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ProgressBar.figma.d.ts +8 -0
- package/lib/typescript/figma/ProgressBar.figma.d.ts.map +1 -0
- package/lib/typescript/figma/ProgressCircle.figma.d.ts +11 -0
- package/lib/typescript/figma/ProgressCircle.figma.d.ts.map +1 -0
- package/lib/typescript/figma/RangeCalendar.figma.d.ts +8 -0
- package/lib/typescript/figma/RangeCalendar.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Skeleton.figma.d.ts +11 -0
- package/lib/typescript/figma/Skeleton.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Slider.Marker.figma.d.ts +11 -0
- package/lib/typescript/figma/Slider.Marker.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Slider.MarkerGroup.figma.d.ts +8 -0
- package/lib/typescript/figma/Slider.MarkerGroup.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Slider.Thumb.figma.d.ts +11 -0
- package/lib/typescript/figma/Slider.Thumb.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Slider.figma.d.ts +8 -0
- package/lib/typescript/figma/Slider.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Switch.figma.d.ts +8 -0
- package/lib/typescript/figma/Switch.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tabs.SegmentedControl.Segment.figma.d.ts +8 -0
- package/lib/typescript/figma/Tabs.SegmentedControl.Segment.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tabs.SegmentedControl.figma.d.ts +8 -0
- package/lib/typescript/figma/Tabs.SegmentedControl.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tabs.Tab.figma.d.ts +8 -0
- package/lib/typescript/figma/Tabs.Tab.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tabs.figma.d.ts +8 -0
- package/lib/typescript/figma/Tabs.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tile.Description.figma.d.ts +11 -0
- package/lib/typescript/figma/Tile.Description.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tile.Group.figma.d.ts +8 -0
- package/lib/typescript/figma/Tile.Group.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tile.LeadingSlot.figma.d.ts +8 -0
- package/lib/typescript/figma/Tile.LeadingSlot.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tile.Title.figma.d.ts +11 -0
- package/lib/typescript/figma/Tile.Title.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tile.TrailingSlot.figma.d.ts +8 -0
- package/lib/typescript/figma/Tile.TrailingSlot.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tile.figma.d.ts +8 -0
- package/lib/typescript/figma/Tile.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Toast.Button.figma.d.ts +14 -0
- package/lib/typescript/figma/Toast.Button.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Toast.Close.figma.d.ts +11 -0
- package/lib/typescript/figma/Toast.Close.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Toast.figma.d.ts +8 -0
- package/lib/typescript/figma/Toast.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tooltip.Content.figma.d.ts +8 -0
- package/lib/typescript/figma/Tooltip.Content.figma.d.ts.map +1 -0
- package/lib/typescript/figma/Tooltip.figma.d.ts +8 -0
- package/lib/typescript/figma/Tooltip.figma.d.ts.map +1 -0
- package/lib/typescript/figma/VirtualizedList.figma.d.ts +8 -0
- package/lib/typescript/figma/VirtualizedList.figma.d.ts.map +1 -0
- package/package.json +6 -6
- package/src/components/Avatar/index.tsx +45 -9
- package/src/components/Avatar/styles.ts +106 -23
- package/src/components/CLAUDE.md +2 -1
- package/src/components/Chip/styles.ts +1 -1
- package/src/components/Drawer/animation.ts +11 -0
- package/src/components/Drawer/index.tsx +896 -0
- package/src/components/Drawer/styles.ts +188 -0
- package/src/components/Drawer/utils.ts +83 -0
- package/src/components/InsuranceDisclosure/styles.ts +1 -3
- package/src/components/Menu/index.tsx +204 -62
- package/src/components/Menu/styles.ts +44 -54
- package/src/components/Select/index.tsx +7 -9
- package/src/components/Tabs/styles.ts +9 -10
- package/src/components/Toast/styles.ts +1 -1
- package/src/components/index.ts +1 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import { cva, type VariantProps } from '@cdx-ui/utils';
|
|
3
|
+
import { TRANSITION_COLORS } from '../../styles/constants';
|
|
4
|
+
|
|
5
|
+
export const drawerPortalVariants = cva(['flex-1', 'absolute inset-0', 'web:fixed']);
|
|
6
|
+
|
|
7
|
+
export const drawerOverlayVariants = cva([
|
|
8
|
+
'absolute inset-0',
|
|
9
|
+
'bg-surface-backdrop',
|
|
10
|
+
'web:transition-opacity web:duration-300 web:ease-[cubic-bezier(0.32,0.72,0,1)]',
|
|
11
|
+
'web:data-[state=entering]:opacity-0',
|
|
12
|
+
'web:data-[state=open]:opacity-100',
|
|
13
|
+
'web:data-[state=closed]:opacity-0 web:data-[state=closed]:duration-[220ms]',
|
|
14
|
+
'web:motion-reduce:transition-none web:motion-reduce:duration-0',
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
const modalTransition = [
|
|
18
|
+
'web:transition-transform web:duration-300 web:ease-[cubic-bezier(0.32,0.72,0,1)]',
|
|
19
|
+
'web:data-[state=open]:translate-x-0 web:data-[state=open]:translate-y-0',
|
|
20
|
+
'web:data-[state=closed]:duration-[220ms]',
|
|
21
|
+
'web:motion-reduce:transition-none web:motion-reduce:duration-0',
|
|
22
|
+
Platform.select({ web: 'shadow-lg', default: '' }),
|
|
23
|
+
]
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.join(' ');
|
|
26
|
+
|
|
27
|
+
export const drawerPanelVariants = cva(
|
|
28
|
+
['flex flex-col bg-surface-primary shrink-0 overflow-hidden relative z-10'],
|
|
29
|
+
{
|
|
30
|
+
variants: {
|
|
31
|
+
size: {
|
|
32
|
+
small: '',
|
|
33
|
+
default: '',
|
|
34
|
+
large: '',
|
|
35
|
+
},
|
|
36
|
+
variant: {
|
|
37
|
+
permanent: 'self-stretch',
|
|
38
|
+
modal: modalTransition,
|
|
39
|
+
},
|
|
40
|
+
placement: {
|
|
41
|
+
left: '',
|
|
42
|
+
right: '',
|
|
43
|
+
top: '',
|
|
44
|
+
bottom: '',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
compoundVariants: [
|
|
48
|
+
{ size: 'small', placement: 'left', class: 'w-[240px]' },
|
|
49
|
+
{ size: 'small', placement: 'right', class: 'w-[240px]' },
|
|
50
|
+
{ size: 'default', placement: 'left', class: 'w-[360px]' },
|
|
51
|
+
{ size: 'default', placement: 'right', class: 'w-[360px]' },
|
|
52
|
+
{ size: 'large', placement: 'left', class: 'w-[480px]' },
|
|
53
|
+
{ size: 'large', placement: 'right', class: 'w-[480px]' },
|
|
54
|
+
{ size: 'small', placement: 'top', class: 'h-[240px] w-full' },
|
|
55
|
+
{ size: 'small', placement: 'bottom', class: 'h-[240px] w-full' },
|
|
56
|
+
{ size: 'default', placement: 'top', class: 'h-[360px] w-full' },
|
|
57
|
+
{ size: 'default', placement: 'bottom', class: 'h-[360px] w-full' },
|
|
58
|
+
{ size: 'large', placement: 'top', class: 'h-[480px] w-full' },
|
|
59
|
+
{ size: 'large', placement: 'bottom', class: 'h-[480px] w-full' },
|
|
60
|
+
{
|
|
61
|
+
variant: 'permanent',
|
|
62
|
+
placement: 'right',
|
|
63
|
+
class: 'h-full border-l border-stroke-secondary',
|
|
64
|
+
},
|
|
65
|
+
{ variant: 'permanent', placement: 'left', class: 'h-full border-r border-stroke-secondary' },
|
|
66
|
+
{ variant: 'permanent', placement: 'top', class: 'w-full border-b border-stroke-secondary' },
|
|
67
|
+
{
|
|
68
|
+
variant: 'permanent',
|
|
69
|
+
placement: 'bottom',
|
|
70
|
+
class: 'w-full border-t border-stroke-secondary',
|
|
71
|
+
},
|
|
72
|
+
{ variant: 'modal', placement: 'left', class: 'h-full max-h-full' },
|
|
73
|
+
{ variant: 'modal', placement: 'right', class: 'h-full max-h-full' },
|
|
74
|
+
{ variant: 'modal', placement: 'top', class: 'w-full max-w-full' },
|
|
75
|
+
{ variant: 'modal', placement: 'bottom', class: 'w-full max-w-full' },
|
|
76
|
+
{
|
|
77
|
+
variant: 'modal',
|
|
78
|
+
placement: 'right',
|
|
79
|
+
class:
|
|
80
|
+
'web:data-[state=entering]:translate-x-full web:data-[state=closed]:translate-x-full',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
variant: 'modal',
|
|
84
|
+
placement: 'left',
|
|
85
|
+
class:
|
|
86
|
+
'web:data-[state=entering]:-translate-x-full web:data-[state=closed]:-translate-x-full',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
variant: 'modal',
|
|
90
|
+
placement: 'bottom',
|
|
91
|
+
class:
|
|
92
|
+
'web:data-[state=entering]:translate-y-full web:data-[state=closed]:translate-y-full',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
variant: 'modal',
|
|
96
|
+
placement: 'top',
|
|
97
|
+
class:
|
|
98
|
+
'web:data-[state=entering]:-translate-y-full web:data-[state=closed]:-translate-y-full',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
defaultVariants: {
|
|
102
|
+
size: 'default',
|
|
103
|
+
variant: 'permanent',
|
|
104
|
+
placement: 'right',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
export const drawerHeaderVariants = cva(
|
|
110
|
+
['relative shrink-0 flex-row items-center gap-1.5 pl-4 pr-4 pb-4'],
|
|
111
|
+
{
|
|
112
|
+
variants: {
|
|
113
|
+
showSeparator: {
|
|
114
|
+
true: 'border-b border-stroke-secondary pb-[17px]',
|
|
115
|
+
false: '',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
defaultVariants: {
|
|
119
|
+
showSeparator: true,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
export const drawerHeaderContentVariants = cva(['flex-1 min-w-0 flex-col items-start']);
|
|
125
|
+
|
|
126
|
+
export const drawerLeadingSlotVariants = cva(['flex shrink-0 items-center justify-center']);
|
|
127
|
+
|
|
128
|
+
export const drawerTitleVariants = cva(['heading-sm text-content-primary']);
|
|
129
|
+
|
|
130
|
+
export const drawerDescriptionVariants = cva(['body-sm text-content-secondary']);
|
|
131
|
+
|
|
132
|
+
export const drawerContentVariants = cva(['flex-1 min-h-0'], {
|
|
133
|
+
variants: {
|
|
134
|
+
fullBleed: {
|
|
135
|
+
true: '',
|
|
136
|
+
false: 'px-4',
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
defaultVariants: {
|
|
140
|
+
fullBleed: false,
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
export const drawerContentInnerVariants = cva(['py-4 gap-4']);
|
|
145
|
+
|
|
146
|
+
export const drawerFooterVariants = cva(['shrink-0 px-4 pt-4'], {
|
|
147
|
+
variants: {
|
|
148
|
+
showSeparator: {
|
|
149
|
+
true: 'border-t border-stroke-secondary pt-[17px]',
|
|
150
|
+
false: '',
|
|
151
|
+
},
|
|
152
|
+
direction: {
|
|
153
|
+
row: 'flex-row items-center justify-end gap-2',
|
|
154
|
+
column: 'flex-col items-stretch gap-2',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
defaultVariants: {
|
|
158
|
+
showSeparator: false,
|
|
159
|
+
direction: 'row',
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
export const drawerCloseVariants = cva([
|
|
164
|
+
'ml-auto shrink-0',
|
|
165
|
+
'min-w-[32px] min-h-[32px] items-center justify-center',
|
|
166
|
+
'p-[6px] rounded-full',
|
|
167
|
+
TRANSITION_COLORS,
|
|
168
|
+
Platform.select({
|
|
169
|
+
default: 'data-[active=true]:opacity-70',
|
|
170
|
+
web: [
|
|
171
|
+
'data-[hover=true]:bg-surface-primary-hover',
|
|
172
|
+
'data-[active=true]:bg-surface-primary-active',
|
|
173
|
+
'data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-stroke-focus data-[focus-visible=true]:ring-offset-2',
|
|
174
|
+
].join(' '),
|
|
175
|
+
}),
|
|
176
|
+
]);
|
|
177
|
+
|
|
178
|
+
export const drawerCloseIconVariants = cva(['size-5 text-content-tertiary']);
|
|
179
|
+
|
|
180
|
+
export type DrawerVariantProps = VariantProps<typeof drawerPanelVariants> & {
|
|
181
|
+
fullBleed?: boolean;
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
export type DrawerPlacement = NonNullable<DrawerVariantProps['placement']>;
|
|
185
|
+
|
|
186
|
+
export type DrawerHeaderVariantProps = VariantProps<typeof drawerHeaderVariants>;
|
|
187
|
+
|
|
188
|
+
export type DrawerFooterVariantProps = VariantProps<typeof drawerFooterVariants>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { useWindowDimensions } from 'react-native';
|
|
3
|
+
import { Easing, Keyframe } from 'react-native-reanimated';
|
|
4
|
+
import { SafeAreaInsetsContext, type EdgeInsets } from 'react-native-safe-area-context';
|
|
5
|
+
import type { DrawerPlacement, DrawerVariantProps } from './styles';
|
|
6
|
+
|
|
7
|
+
export const DRAWER_ENTER_MS = 300;
|
|
8
|
+
export const DRAWER_EXIT_MS = 220;
|
|
9
|
+
export const WEB_TRANSITION_SAFETY_MS = DRAWER_ENTER_MS + 100;
|
|
10
|
+
|
|
11
|
+
export const DRAWER_ENTER_EASING = Easing.bezier(0.32, 0.72, 0, 1);
|
|
12
|
+
export const DRAWER_EXIT_EASING = Easing.bezier(0.4, 0, 1, 1);
|
|
13
|
+
export const DRAWER_WIDE_BREAKPOINT = 600;
|
|
14
|
+
export const DRAWER_EDGE_PADDING = 16;
|
|
15
|
+
export const DRAWER_SIZE_PX = {
|
|
16
|
+
small: 240,
|
|
17
|
+
default: 360,
|
|
18
|
+
large: 480,
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
const ZERO_INSETS: EdgeInsets = { top: 0, bottom: 0, left: 0, right: 0 };
|
|
22
|
+
|
|
23
|
+
export function useSafeInsets(): EdgeInsets {
|
|
24
|
+
return useContext(SafeAreaInsetsContext) ?? ZERO_INSETS;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function isHorizontalDrawerPlacement(placement: DrawerPlacement): boolean {
|
|
28
|
+
return placement === 'left' || placement === 'right';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function resolveDrawerPlacement(
|
|
32
|
+
placement: DrawerVariantProps['placement'],
|
|
33
|
+
): DrawerPlacement {
|
|
34
|
+
return placement ?? 'right';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function useClampedDrawerExtent(
|
|
38
|
+
size: DrawerVariantProps['size'],
|
|
39
|
+
placement: DrawerPlacement,
|
|
40
|
+
): number {
|
|
41
|
+
const { width, height } = useWindowDimensions();
|
|
42
|
+
const token = DRAWER_SIZE_PX[size ?? 'default'];
|
|
43
|
+
return Math.min(token, isHorizontalDrawerPlacement(placement) ? width : height);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function createSlideKeyframes(axis: 'translateX' | 'translateY', offscreen: number) {
|
|
47
|
+
const from = axis === 'translateX' ? { translateX: offscreen } : { translateY: offscreen };
|
|
48
|
+
const to = axis === 'translateX' ? { translateX: 0 } : { translateY: 0 };
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
entering: new Keyframe({
|
|
52
|
+
0: {
|
|
53
|
+
transform: [from],
|
|
54
|
+
},
|
|
55
|
+
100: {
|
|
56
|
+
transform: [to],
|
|
57
|
+
easing: DRAWER_ENTER_EASING,
|
|
58
|
+
},
|
|
59
|
+
}).duration(DRAWER_ENTER_MS),
|
|
60
|
+
exiting: new Keyframe({
|
|
61
|
+
0: {
|
|
62
|
+
transform: [to],
|
|
63
|
+
},
|
|
64
|
+
100: {
|
|
65
|
+
transform: [from],
|
|
66
|
+
easing: DRAWER_EXIT_EASING,
|
|
67
|
+
},
|
|
68
|
+
}).duration(DRAWER_EXIT_MS),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function getDrawerSlideKeyframes(placement: DrawerPlacement, extent: number) {
|
|
73
|
+
switch (placement) {
|
|
74
|
+
case 'left':
|
|
75
|
+
return createSlideKeyframes('translateX', -extent);
|
|
76
|
+
case 'right':
|
|
77
|
+
return createSlideKeyframes('translateX', extent);
|
|
78
|
+
case 'top':
|
|
79
|
+
return createSlideKeyframes('translateY', -extent);
|
|
80
|
+
case 'bottom':
|
|
81
|
+
return createSlideKeyframes('translateY', extent);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -26,6 +26,4 @@ export type InsuranceDisclosureRootVariantProps = VariantProps<
|
|
|
26
26
|
|
|
27
27
|
export const insuranceDisclosureLogoVariants = cva(['h-5 w-11 shrink-0']);
|
|
28
28
|
|
|
29
|
-
export const insuranceDisclosureTextVariants = cva([
|
|
30
|
-
'shrink text-content-primary italic [font-family:var(--font-body-italic)]',
|
|
31
|
-
]);
|
|
29
|
+
export const insuranceDisclosureTextVariants = cva(['shrink text-content-primary italic']);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { forwardRef, useMemo, type ReactNode } from 'react';
|
|
1
|
+
import { Children, forwardRef, isValidElement, useMemo, type ReactNode } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Platform,
|
|
4
4
|
ScrollView,
|
|
@@ -12,6 +12,7 @@ import { Check } from '@cdx-ui/icons';
|
|
|
12
12
|
import {
|
|
13
13
|
MenuCheckboxItem as MenuCheckboxItemPrimitive,
|
|
14
14
|
MenuItem as MenuItemPrimitive,
|
|
15
|
+
MenuItemAction as MenuItemActionPrimitive,
|
|
15
16
|
MenuOverlayRoot as MenuOverlayRootPrimitive,
|
|
16
17
|
MenuPopup as MenuPopupPrimitive,
|
|
17
18
|
MenuRadioGroup as MenuRadioGroupPrimitive,
|
|
@@ -25,6 +26,7 @@ import {
|
|
|
25
26
|
useOptionalMenuPopupContext,
|
|
26
27
|
type IMenuCheckboxItemProps,
|
|
27
28
|
type IMenuItemProps,
|
|
29
|
+
type IMenuItemActionProps,
|
|
28
30
|
type IMenuOverlayRootProps,
|
|
29
31
|
type IMenuPopupProps,
|
|
30
32
|
type IMenuProps,
|
|
@@ -34,8 +36,14 @@ import {
|
|
|
34
36
|
} from '@cdx-ui/primitives';
|
|
35
37
|
import { cn, ParentContext, useParentContext, useStyleContext } from '@cdx-ui/utils';
|
|
36
38
|
import { Icon, type IconProps } from '../Icon';
|
|
39
|
+
import { checkboxIconVariants, checkboxIndicatorVariants } from '../Checkbox/styles';
|
|
40
|
+
import { radioIndicatorVariants, radioInnerDotVariants } from '../Radio/styles';
|
|
37
41
|
import { positionToDataIcon, type IconSlotPosition } from '../../utils/positionToDataIcon';
|
|
38
42
|
import {
|
|
43
|
+
menuGroupHeaderVariants,
|
|
44
|
+
menuItemActionVariants,
|
|
45
|
+
menuItemControlVariants,
|
|
46
|
+
menuItemCountVariants,
|
|
39
47
|
menuItemIconVariants,
|
|
40
48
|
menuItemLabelVariants,
|
|
41
49
|
menuItemIndicatorVariants,
|
|
@@ -53,25 +61,36 @@ const SCOPE = 'MENU';
|
|
|
53
61
|
const MENU_MAX_HEIGHT = 240;
|
|
54
62
|
const MENU_POPUP_MIN_WIDTH = 192;
|
|
55
63
|
const MENU_SCROLL_STYLE: ViewStyle = { flexGrow: 0 };
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
const FILTER_SLOT_NAMES = new Set(['Menu.ItemControl', 'Menu.ItemAction']);
|
|
65
|
+
|
|
66
|
+
const hasFilterChrome = (children: ReactNode): boolean =>
|
|
67
|
+
Children.toArray(children).some((child) => {
|
|
68
|
+
if (!isValidElement(child)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const name = (child.type as { displayName?: string }).displayName;
|
|
72
|
+
return !!name && FILTER_SLOT_NAMES.has(name);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
const useMenuStyleContext = (): Pick<MenuItemVariantProps, 'color' | 'layout'> => {
|
|
58
76
|
const ctx = useStyleContext(SCOPE) as MenuItemVariantProps | undefined;
|
|
59
|
-
return {
|
|
77
|
+
return {
|
|
78
|
+
color: ctx?.color ?? 'neutral',
|
|
79
|
+
layout: ctx?.layout ?? 'default',
|
|
80
|
+
};
|
|
60
81
|
};
|
|
61
82
|
|
|
62
83
|
const useMenuItemStyleValue = (
|
|
63
|
-
sizeProp: MenuItemVariantProps['size'],
|
|
64
84
|
color: NonNullable<MenuItemVariantProps['color']>,
|
|
85
|
+
layout: NonNullable<MenuItemVariantProps['layout']>,
|
|
65
86
|
) => {
|
|
66
|
-
const { size: contextSize } = useMenuStyleContext();
|
|
67
87
|
const parent = useParentContext();
|
|
68
|
-
const size = sizeProp ?? contextSize ?? 'default';
|
|
69
88
|
const contextValue = useMemo(
|
|
70
|
-
() => ({ ...parent, [SCOPE]: {
|
|
71
|
-
[parent,
|
|
89
|
+
() => ({ ...parent, [SCOPE]: { color, layout } }),
|
|
90
|
+
[parent, color, layout],
|
|
72
91
|
);
|
|
73
92
|
|
|
74
|
-
return { contextValue,
|
|
93
|
+
return { contextValue, layout };
|
|
75
94
|
};
|
|
76
95
|
|
|
77
96
|
// =============================================================================
|
|
@@ -167,9 +186,7 @@ export interface MenuContentProps
|
|
|
167
186
|
|
|
168
187
|
const MenuContent = forwardRef<View, MenuContentProps>(
|
|
169
188
|
({ scrollable = false, asSurface = false, className, style, children, ...props }, ref) => {
|
|
170
|
-
const parent = useParentContext();
|
|
171
189
|
const popup = useOptionalMenuPopupContext();
|
|
172
|
-
const ctx = useMemo(() => ({ ...parent, [SCOPE]: { size: 'default' as const } }), [parent]);
|
|
173
190
|
const shouldScroll = scrollable || popup !== null;
|
|
174
191
|
const constrainedStyle =
|
|
175
192
|
popup === null
|
|
@@ -203,19 +220,17 @@ const MenuContent = forwardRef<View, MenuContentProps>(
|
|
|
203
220
|
);
|
|
204
221
|
|
|
205
222
|
return (
|
|
206
|
-
<
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
</MenuRootPrimitive>
|
|
218
|
-
</ParentContext.Provider>
|
|
223
|
+
<MenuRootPrimitive
|
|
224
|
+
ref={ref}
|
|
225
|
+
scrollable={shouldScroll}
|
|
226
|
+
asSurface={asSurface}
|
|
227
|
+
className={computedClassName}
|
|
228
|
+
style={[style, constrainedStyle]}
|
|
229
|
+
{...props}
|
|
230
|
+
{...contentDataAttributes}
|
|
231
|
+
>
|
|
232
|
+
{content}
|
|
233
|
+
</MenuRootPrimitive>
|
|
219
234
|
);
|
|
220
235
|
},
|
|
221
236
|
);
|
|
@@ -238,22 +253,11 @@ export interface MenuItemProps extends Omit<MenuItemVariantProps, 'color'>, IMen
|
|
|
238
253
|
}
|
|
239
254
|
|
|
240
255
|
const MenuItem = forwardRef<View, MenuItemProps>(
|
|
241
|
-
(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
color = 'neutral',
|
|
245
|
-
inset = false,
|
|
246
|
-
size: sizeProp,
|
|
247
|
-
className,
|
|
248
|
-
style,
|
|
249
|
-
children,
|
|
250
|
-
...props
|
|
251
|
-
},
|
|
252
|
-
ref,
|
|
253
|
-
) => {
|
|
254
|
-
const { contextValue, size } = useMenuItemStyleValue(sizeProp, color);
|
|
256
|
+
({ asChild, color = 'neutral', inset = false, className, style, children, ...props }, ref) => {
|
|
257
|
+
const layout = hasFilterChrome(children) ? 'filter' : 'default';
|
|
258
|
+
const { contextValue } = useMenuItemStyleValue(color, layout);
|
|
255
259
|
|
|
256
|
-
const computedClassName = cn(menuItemVariants({ color, inset,
|
|
260
|
+
const computedClassName = cn(menuItemVariants({ color, inset, layout }), className);
|
|
257
261
|
|
|
258
262
|
return (
|
|
259
263
|
<ParentContext.Provider value={contextValue}>
|
|
@@ -283,27 +287,16 @@ export interface MenuCheckboxItemProps
|
|
|
283
287
|
}
|
|
284
288
|
|
|
285
289
|
const MenuCheckboxItem = forwardRef<View, MenuCheckboxItemProps>(
|
|
286
|
-
(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
color = 'neutral',
|
|
290
|
-
inset = false,
|
|
291
|
-
size: sizeProp,
|
|
292
|
-
className,
|
|
293
|
-
style,
|
|
294
|
-
children,
|
|
295
|
-
...props
|
|
296
|
-
},
|
|
297
|
-
ref,
|
|
298
|
-
) => {
|
|
299
|
-
const { contextValue, size } = useMenuItemStyleValue(sizeProp, color);
|
|
290
|
+
({ asChild, color = 'neutral', inset = false, className, style, children, ...props }, ref) => {
|
|
291
|
+
const layout = hasFilterChrome(children) ? 'filter' : 'default';
|
|
292
|
+
const { contextValue } = useMenuItemStyleValue(color, layout);
|
|
300
293
|
|
|
301
294
|
return (
|
|
302
295
|
<ParentContext.Provider value={contextValue}>
|
|
303
296
|
<MenuCheckboxItemPrimitive
|
|
304
297
|
ref={ref}
|
|
305
298
|
asChild={asChild}
|
|
306
|
-
className={cn(menuItemVariants({ color, inset,
|
|
299
|
+
className={cn(menuItemVariants({ color, inset, layout }), className)}
|
|
307
300
|
style={style}
|
|
308
301
|
{...props}
|
|
309
302
|
{...mergeDataAttributes(props, dataAttributes({ slot: 'menu-checkbox-item' }))}
|
|
@@ -354,7 +347,7 @@ const MenuRadioItem = forwardRef<View, MenuRadioItemProps>(
|
|
|
354
347
|
asChild,
|
|
355
348
|
color = 'neutral',
|
|
356
349
|
inset = false,
|
|
357
|
-
|
|
350
|
+
closeOnSelect,
|
|
358
351
|
className,
|
|
359
352
|
style,
|
|
360
353
|
children,
|
|
@@ -362,14 +355,16 @@ const MenuRadioItem = forwardRef<View, MenuRadioItemProps>(
|
|
|
362
355
|
},
|
|
363
356
|
ref,
|
|
364
357
|
) => {
|
|
365
|
-
const
|
|
358
|
+
const layout = hasFilterChrome(children) ? 'filter' : 'default';
|
|
359
|
+
const { contextValue } = useMenuItemStyleValue(color, layout);
|
|
366
360
|
|
|
367
361
|
return (
|
|
368
362
|
<ParentContext.Provider value={contextValue}>
|
|
369
363
|
<MenuRadioItemPrimitive
|
|
370
364
|
ref={ref}
|
|
371
365
|
asChild={asChild}
|
|
372
|
-
|
|
366
|
+
closeOnSelect={closeOnSelect ?? (layout === 'filter' ? false : undefined)}
|
|
367
|
+
className={cn(menuItemVariants({ color, inset, layout }), className)}
|
|
373
368
|
style={style}
|
|
374
369
|
{...props}
|
|
375
370
|
{...mergeDataAttributes(props, dataAttributes({ slot: 'menu-radio-item' }))}
|
|
@@ -387,7 +382,7 @@ MenuRadioItem.displayName = 'Menu.RadioItem';
|
|
|
387
382
|
// ITEM SLOTS
|
|
388
383
|
// =============================================================================
|
|
389
384
|
|
|
390
|
-
export interface MenuItemLabelProps extends TextProps
|
|
385
|
+
export interface MenuItemLabelProps extends TextProps {
|
|
391
386
|
asChild?: boolean;
|
|
392
387
|
className?: string;
|
|
393
388
|
/** Checked state when used outside a selectable Menu item (e.g. `Select.ItemLabel`). */
|
|
@@ -395,8 +390,8 @@ export interface MenuItemLabelProps extends TextProps, Pick<MenuItemVariantProps
|
|
|
395
390
|
}
|
|
396
391
|
|
|
397
392
|
const MenuItemLabel = forwardRef<Text, MenuItemLabelProps>(
|
|
398
|
-
({ asChild, className, style, children, isChecked: checkedProp,
|
|
399
|
-
const { color } = useMenuStyleContext();
|
|
393
|
+
({ asChild, className, style, children, isChecked: checkedProp, ...props }, ref) => {
|
|
394
|
+
const { color, layout } = useMenuStyleContext();
|
|
400
395
|
const menuItemCtx = useOptionalMenuItemContext();
|
|
401
396
|
const checked = checkedProp ?? menuItemCtx?.checked ?? false;
|
|
402
397
|
const Comp = asChild ? Slot : Text;
|
|
@@ -405,7 +400,7 @@ const MenuItemLabel = forwardRef<Text, MenuItemLabelProps>(
|
|
|
405
400
|
<Comp
|
|
406
401
|
ref={ref}
|
|
407
402
|
className={cn(
|
|
408
|
-
menuItemLabelVariants({
|
|
403
|
+
menuItemLabelVariants({ color, layout }),
|
|
409
404
|
checked ? 'font-medium' : undefined,
|
|
410
405
|
className,
|
|
411
406
|
)}
|
|
@@ -630,6 +625,145 @@ const MenuSeparator = forwardRef<View, MenuSeparatorProps>(
|
|
|
630
625
|
|
|
631
626
|
MenuSeparator.displayName = 'Menu.Separator';
|
|
632
627
|
|
|
628
|
+
// =============================================================================
|
|
629
|
+
// FILTER SLOTS
|
|
630
|
+
// =============================================================================
|
|
631
|
+
|
|
632
|
+
export interface MenuGroupHeaderProps extends ViewProps {
|
|
633
|
+
asChild?: boolean;
|
|
634
|
+
className?: string;
|
|
635
|
+
children?: ReactNode;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
const MenuGroupHeader = forwardRef<View, MenuGroupHeaderProps>(
|
|
639
|
+
({ asChild, className, style, children, ...props }, ref) => {
|
|
640
|
+
const parent = useParentContext();
|
|
641
|
+
const ctx = useMemo(
|
|
642
|
+
() => ({
|
|
643
|
+
...parent,
|
|
644
|
+
[SCOPE]: { color: 'neutral' as const, layout: 'filter' as const },
|
|
645
|
+
}),
|
|
646
|
+
[parent],
|
|
647
|
+
);
|
|
648
|
+
const Comp = asChild ? Slot : View;
|
|
649
|
+
|
|
650
|
+
return (
|
|
651
|
+
<ParentContext.Provider value={ctx}>
|
|
652
|
+
<Comp
|
|
653
|
+
ref={ref}
|
|
654
|
+
className={cn(menuGroupHeaderVariants(), className)}
|
|
655
|
+
style={style}
|
|
656
|
+
{...props}
|
|
657
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'menu-group-header' }))}
|
|
658
|
+
>
|
|
659
|
+
{children}
|
|
660
|
+
</Comp>
|
|
661
|
+
</ParentContext.Provider>
|
|
662
|
+
);
|
|
663
|
+
},
|
|
664
|
+
);
|
|
665
|
+
|
|
666
|
+
MenuGroupHeader.displayName = 'Menu.GroupHeader';
|
|
667
|
+
|
|
668
|
+
export interface MenuItemActionProps extends IMenuItemActionProps {
|
|
669
|
+
className?: string;
|
|
670
|
+
children?: ReactNode;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
const MenuItemAction = forwardRef<View, MenuItemActionProps>(
|
|
674
|
+
({ asChild, className, style, children, ...props }, ref) => (
|
|
675
|
+
<MenuItemActionPrimitive
|
|
676
|
+
ref={ref}
|
|
677
|
+
asChild={asChild}
|
|
678
|
+
className={cn(menuItemActionVariants(), className)}
|
|
679
|
+
style={style}
|
|
680
|
+
{...props}
|
|
681
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'menu-item-action' }))}
|
|
682
|
+
>
|
|
683
|
+
{children}
|
|
684
|
+
</MenuItemActionPrimitive>
|
|
685
|
+
),
|
|
686
|
+
);
|
|
687
|
+
|
|
688
|
+
MenuItemAction.displayName = 'Menu.ItemAction';
|
|
689
|
+
|
|
690
|
+
export interface MenuItemControlProps extends ViewProps {
|
|
691
|
+
className?: string;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
const MenuItemControl = ({ className, style, ...props }: MenuItemControlProps) => {
|
|
695
|
+
const menuItem = useOptionalMenuItemContext();
|
|
696
|
+
if (!menuItem || menuItem.itemRole === 'menuitem') {
|
|
697
|
+
return null;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
const checked = menuItem.checked;
|
|
701
|
+
const fieldState = checked ? 'checked' : 'idle';
|
|
702
|
+
const control =
|
|
703
|
+
menuItem.itemRole === 'menuitemradio' ? (
|
|
704
|
+
<View className={radioIndicatorVariants()} {...dataAttributes({ checked, fieldState })}>
|
|
705
|
+
<View
|
|
706
|
+
collapsable={false}
|
|
707
|
+
className={radioInnerDotVariants()}
|
|
708
|
+
{...dataAttributes({ checked, fieldState })}
|
|
709
|
+
/>
|
|
710
|
+
</View>
|
|
711
|
+
) : (
|
|
712
|
+
<View className={checkboxIndicatorVariants()} {...dataAttributes({ checked, fieldState })}>
|
|
713
|
+
{checked ? (
|
|
714
|
+
<Icon
|
|
715
|
+
as={Check}
|
|
716
|
+
className={checkboxIconVariants()}
|
|
717
|
+
accessibilityElementsHidden
|
|
718
|
+
aria-hidden
|
|
719
|
+
/>
|
|
720
|
+
) : null}
|
|
721
|
+
</View>
|
|
722
|
+
);
|
|
723
|
+
|
|
724
|
+
return (
|
|
725
|
+
<View
|
|
726
|
+
className={cn(menuItemControlVariants(), 'pointer-events-none', className)}
|
|
727
|
+
style={style}
|
|
728
|
+
accessible={false}
|
|
729
|
+
accessibilityElementsHidden
|
|
730
|
+
importantForAccessibility="no-hide-descendants"
|
|
731
|
+
aria-hidden
|
|
732
|
+
{...props}
|
|
733
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'menu-item-control' }))}
|
|
734
|
+
>
|
|
735
|
+
{control}
|
|
736
|
+
</View>
|
|
737
|
+
);
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
MenuItemControl.displayName = 'Menu.ItemControl';
|
|
741
|
+
|
|
742
|
+
export interface MenuItemCountProps extends TextProps {
|
|
743
|
+
asChild?: boolean;
|
|
744
|
+
className?: string;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
const MenuItemCount = forwardRef<Text, MenuItemCountProps>(
|
|
748
|
+
({ asChild, className, style, children, ...props }, ref) => {
|
|
749
|
+
const Comp = asChild ? Slot : Text;
|
|
750
|
+
|
|
751
|
+
return (
|
|
752
|
+
<Comp
|
|
753
|
+
ref={ref}
|
|
754
|
+
className={cn(menuItemCountVariants(), className)}
|
|
755
|
+
style={style}
|
|
756
|
+
{...props}
|
|
757
|
+
{...mergeDataAttributes(props, dataAttributes({ slot: 'menu-item-count' }))}
|
|
758
|
+
>
|
|
759
|
+
{children}
|
|
760
|
+
</Comp>
|
|
761
|
+
);
|
|
762
|
+
},
|
|
763
|
+
);
|
|
764
|
+
|
|
765
|
+
MenuItemCount.displayName = 'Menu.ItemCount';
|
|
766
|
+
|
|
633
767
|
// =============================================================================
|
|
634
768
|
// COMPOUND EXPORT
|
|
635
769
|
// =============================================================================
|
|
@@ -646,6 +780,10 @@ type MenuCompoundComponent = typeof MenuOverlayRoot & {
|
|
|
646
780
|
ItemIcon: typeof MenuItemIcon;
|
|
647
781
|
ItemShortcut: typeof MenuItemShortcut;
|
|
648
782
|
ItemIndicator: typeof MenuItemIndicator;
|
|
783
|
+
ItemAction: typeof MenuItemAction;
|
|
784
|
+
ItemControl: typeof MenuItemControl;
|
|
785
|
+
ItemCount: typeof MenuItemCount;
|
|
786
|
+
GroupHeader: typeof MenuGroupHeader;
|
|
649
787
|
SectionLabel: typeof MenuSectionLabel;
|
|
650
788
|
Separator: typeof MenuSeparator;
|
|
651
789
|
};
|
|
@@ -662,6 +800,10 @@ export const Menu = Object.assign(MenuOverlayRoot, {
|
|
|
662
800
|
ItemIcon: MenuItemIcon,
|
|
663
801
|
ItemShortcut: MenuItemShortcut,
|
|
664
802
|
ItemIndicator: MenuItemIndicator,
|
|
803
|
+
ItemAction: MenuItemAction,
|
|
804
|
+
ItemControl: MenuItemControl,
|
|
805
|
+
ItemCount: MenuItemCount,
|
|
806
|
+
GroupHeader: MenuGroupHeader,
|
|
665
807
|
SectionLabel: MenuSectionLabel,
|
|
666
808
|
Separator: MenuSeparator,
|
|
667
809
|
}) as MenuCompoundComponent;
|