@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,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=12449-28564
|
|
4
|
+
// source=packages/components/src/components/DateRangePicker/index.tsx
|
|
5
|
+
// component=DateRangePicker
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
|
|
9
|
+
// `isOpen` only previews the open surface; the picker opens from its trigger at runtime.
|
|
10
|
+
const surface = instance.getEnum('Picker Type', {
|
|
11
|
+
Popover: 'DateRangePicker.Popover',
|
|
12
|
+
Dialog: 'DateRangePicker.Dialog',
|
|
13
|
+
BottomSheet: 'DateRangePicker.BottomSheet'
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// The nested Figma Field (DateRangeField) has no standalone code component; in code the range
|
|
17
|
+
// input is composed from DateField parts inside DateRangePicker, so its properties are read here.
|
|
18
|
+
const field = instance.findInstance('Field (DateRangeField)');
|
|
19
|
+
const rangeField = instance.findInstance('DateRangeField', {
|
|
20
|
+
traverseInstances: true
|
|
21
|
+
});
|
|
22
|
+
const hasField = field.type === 'INSTANCE';
|
|
23
|
+
const hasRangeField = rangeField.type === 'INSTANCE';
|
|
24
|
+
const showLabel = hasField && field.getBoolean('Show Label?');
|
|
25
|
+
const showHelperText = hasField && field.getBoolean('Show Helper Text?');
|
|
26
|
+
const showErrorText = hasField && field.getBoolean('Show Error Text?');
|
|
27
|
+
const isInvalid = hasField ? field.getEnum('isInvalid', {
|
|
28
|
+
true: true,
|
|
29
|
+
false: undefined
|
|
30
|
+
}) : undefined;
|
|
31
|
+
const isReadOnly = hasField ? field.getEnum('isReadOnly', {
|
|
32
|
+
true: true,
|
|
33
|
+
false: undefined
|
|
34
|
+
}) : undefined;
|
|
35
|
+
const isDisabled = hasField ? field.getEnum('isDisabled', {
|
|
36
|
+
true: true,
|
|
37
|
+
false: undefined
|
|
38
|
+
}) : undefined;
|
|
39
|
+
const showPickerTrigger = hasRangeField && rangeField.getBoolean('Show Picker Trigger?');
|
|
40
|
+
const showPrefixSlot = hasRangeField && rangeField.getBoolean('Show Prefix Slot?');
|
|
41
|
+
const labelText = instance.findText('{label}', {
|
|
42
|
+
traverseInstances: true
|
|
43
|
+
}).textContent;
|
|
44
|
+
const helperText = instance.findText('{HelperText}', {
|
|
45
|
+
traverseInstances: true
|
|
46
|
+
}).textContent;
|
|
47
|
+
const errorText = instance.findText('{ErrorText}', {
|
|
48
|
+
traverseInstances: true
|
|
49
|
+
}).textContent;
|
|
50
|
+
const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
51
|
+
const isReadOnlyProp = figma.helpers.react.renderProp('isReadOnly', isReadOnly);
|
|
52
|
+
const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
|
|
53
|
+
export default {
|
|
54
|
+
id: 'date-range-picker',
|
|
55
|
+
imports: ["import { DateField, DateRangePicker, Field } from '@cdx-ui/components'"],
|
|
56
|
+
example: figma.code`
|
|
57
|
+
${showPrefixSlot ? figma.code`{/* The Figma prefix slot has no DateField equivalent. */}` : null}
|
|
58
|
+
<Field${isInvalidProp}${isReadOnlyProp}${isDisabledProp}>
|
|
59
|
+
<DateRangePicker value={value} onValueChange={setValue}>
|
|
60
|
+
${showLabel ? figma.code`<Field.Label>${labelText}</Field.Label>` : null}
|
|
61
|
+
<DateRangePicker.Trigger className="w-full">
|
|
62
|
+
<DateField.Group fullWidth>
|
|
63
|
+
<DateField.Input slot="start" />
|
|
64
|
+
<DateRangePicker.RangeSeparator />
|
|
65
|
+
<DateField.Input slot="end" />
|
|
66
|
+
${showPickerTrigger ? figma.code`<DateField.Suffix>
|
|
67
|
+
<DateRangePicker.TriggerIndicator />
|
|
68
|
+
</DateField.Suffix>` : null}
|
|
69
|
+
</DateField.Group>
|
|
70
|
+
</DateRangePicker.Trigger>
|
|
71
|
+
${!isInvalid && showHelperText ? figma.code`<Field.Helper>${helperText}</Field.Helper>` : null}
|
|
72
|
+
${isInvalid && showErrorText ? figma.code`<Field.Error>${errorText}</Field.Error>` : null}
|
|
73
|
+
<${surface}>
|
|
74
|
+
<DateRangePicker.Calendar accessibilityLabel="${labelText}" />
|
|
75
|
+
</${surface}>
|
|
76
|
+
</DateRangePicker>
|
|
77
|
+
</Field>`
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=DateRangePicker.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","surface","getEnum","Popover","Dialog","BottomSheet","field","findInstance","rangeField","traverseInstances","hasField","type","hasRangeField","showLabel","getBoolean","showHelperText","showErrorText","isInvalid","true","false","undefined","isReadOnly","isDisabled","showPickerTrigger","showPrefixSlot","labelText","findText","textContent","helperText","errorText","isInvalidProp","helpers","react","renderProp","isReadOnlyProp","isDisabledProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/DateRangePicker.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA,MAAMC,OAAO,GAAGF,QAAQ,CAACG,OAAO,CAAC,aAAa,EAAE;EAC9CC,OAAO,EAAE,yBAAyB;EAClCC,MAAM,EAAE,wBAAwB;EAChCC,WAAW,EAAE;AACf,CAAC,CAAC;;AAEF;AACA;AACA,MAAMC,KAAK,GAAGP,QAAQ,CAACQ,YAAY,CAAC,wBAAwB,CAAC;AAC7D,MAAMC,UAAU,GAAGT,QAAQ,CAACQ,YAAY,CAAC,gBAAgB,EAAE;EAAEE,iBAAiB,EAAE;AAAK,CAAC,CAAC;AACvF,MAAMC,QAAQ,GAAGJ,KAAK,CAACK,IAAI,KAAK,UAAU;AAC1C,MAAMC,aAAa,GAAGJ,UAAU,CAACG,IAAI,KAAK,UAAU;AAEpD,MAAME,SAAS,GAAGH,QAAQ,IAAIJ,KAAK,CAACQ,UAAU,CAAC,aAAa,CAAC;AAC7D,MAAMC,cAAc,GAAGL,QAAQ,IAAIJ,KAAK,CAACQ,UAAU,CAAC,mBAAmB,CAAC;AACxE,MAAME,aAAa,GAA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UAAU,CAAC,YAAY,EAAEZ,UAAU,CAAC;AAC/E,MAAMc,cAAc,GAAGrC,KAAK,CAACiC,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAEX,UAAU,CAAC;AAE/E,eAAe;EACbc,EAAE,EAAE,mBAAmB;EACvBC,OAAO,EAAE,CAAC,wEAAwE,CAAC;EACnFC,OAAO,EAAExC,KAAK,CAACyC,IAAI;AACrB,EAAEf,cAAc,GAAG1B,KAAK,CAACyC,IAAI,4DAA4D,GAAG,IAAI;AAChG,QAAQT,aAAa,GAAGI,cAAc,GAAGC,cAAc;AACvD;AACA,MAAMtB,SAAS,GAAGf,KAAK,CAACyC,IAAI,gBAAgBd,SAAS,gBAAgB,GAAG,IAAI;AAC5E;AACA;AACA;AACA;AACA;AACA,UACUF,iBAAiB,GACbzB,KAAK,CAACyC,IAAI;AACxB;AACA,4BAA4B,GACd,IAAI;AAClB;AACA;AACA,MACM,CAACtB,SAAS,IAAIF,cAAc,GAAGjB,KAAK,CAACyC,IAAI,iBAAiBX,UAAU,iBAAiB,GAAG,IAAI;AAClG,MAAMX,SAAS,IAAID,aAAa,GAAGlB,KAAK,CAACyC,IAAI,gBAAgBV,SAAS,gBAAgB,GAAG,IAAI;AAC7F,OAAO5B,OAAO;AACd,sDAAsDwB,SAAS;AAC/D,QAAQxB,OAAO;AACf;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=11787-10754
|
|
4
|
+
// source=packages/components/src/components/DateTimeField/index.tsx
|
|
5
|
+
// component=DateTimeField
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
9
|
+
true: true,
|
|
10
|
+
false: undefined
|
|
11
|
+
});
|
|
12
|
+
const isReadOnly = instance.getEnum('isReadOnly', {
|
|
13
|
+
true: true,
|
|
14
|
+
false: undefined
|
|
15
|
+
});
|
|
16
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
17
|
+
true: true,
|
|
18
|
+
false: undefined
|
|
19
|
+
});
|
|
20
|
+
const showPrefixSlot = instance.getBoolean('Show Prefix Slot?');
|
|
21
|
+
const showPickerTrigger = instance.getBoolean('Show Picker Trigger?');
|
|
22
|
+
|
|
23
|
+
// The nested DateTimeField.Value `format` encodes both the smallest segment and the clock style.
|
|
24
|
+
const granularityByFormat = {
|
|
25
|
+
'MM/DD/YYYY hh:mm A': undefined,
|
|
26
|
+
'MM/DD/YYYY hh:mm:ss A': 'second',
|
|
27
|
+
'MM/DD/YYYY HH:mm (24-hour)': undefined,
|
|
28
|
+
'MM/DD/YYYY HH:mm:ss (24-hour)': 'second'
|
|
29
|
+
};
|
|
30
|
+
const hour12ByFormat = {
|
|
31
|
+
'MM/DD/YYYY hh:mm A': true,
|
|
32
|
+
'MM/DD/YYYY hh:mm:ss A': true,
|
|
33
|
+
'MM/DD/YYYY HH:mm (24-hour)': false,
|
|
34
|
+
'MM/DD/YYYY HH:mm:ss (24-hour)': false
|
|
35
|
+
};
|
|
36
|
+
const value = instance.findInstance('DateTimeField.Value');
|
|
37
|
+
const format = value.type === 'INSTANCE' ? value.getPropertyValue('format') : undefined;
|
|
38
|
+
const granularity = typeof format === 'string' ? granularityByFormat[format] : undefined;
|
|
39
|
+
const hour12 = typeof format === 'string' ? hour12ByFormat[format] : undefined;
|
|
40
|
+
const granularityProp = figma.helpers.react.renderProp('granularity', granularity);
|
|
41
|
+
const hour12Prop = figma.helpers.react.renderProp('hour12', hour12);
|
|
42
|
+
const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
43
|
+
const isReadOnlyProp = figma.helpers.react.renderProp('isReadOnly', isReadOnly);
|
|
44
|
+
const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
|
|
45
|
+
export default {
|
|
46
|
+
id: 'date-time-field',
|
|
47
|
+
imports: ["import { DateTimeField } from '@cdx-ui/components'"],
|
|
48
|
+
example: figma.code`
|
|
49
|
+
${showPrefixSlot ? figma.code`{/* The Figma prefix slot has no DateTimeField equivalent. */}` : null}
|
|
50
|
+
${showPickerTrigger ? figma.code`{/* A picker trigger needs DateTimePicker; DateTimeField has no trigger of its own. */}` : null}
|
|
51
|
+
<DateTimeField
|
|
52
|
+
value={value}
|
|
53
|
+
onValueChange={setValue}
|
|
54
|
+
aria-label="Date and time"${granularityProp}${hour12Prop}${isInvalidProp}${isReadOnlyProp}${isDisabledProp}
|
|
55
|
+
>
|
|
56
|
+
<DateTimeField.Group>
|
|
57
|
+
<DateTimeField.Input>
|
|
58
|
+
{(segment) => <DateTimeField.Segment segment={segment} />}
|
|
59
|
+
</DateTimeField.Input>
|
|
60
|
+
</DateTimeField.Group>
|
|
61
|
+
</DateTimeField>`
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=DateTimeField.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","isInvalid","getEnum","true","false","undefined","isReadOnly","isDisabled","showPrefixSlot","getBoolean","showPickerTrigger","granularityByFormat","hour12ByFormat","value","findInstance","format","type","getPropertyValue","granularity","hour12","granularityProp","helpers","react","renderProp","hour12Prop","isInvalidProp","isReadOnlyProp","isDisabledProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/DateTimeField.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,SAAS,GAAGF,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGP,QAAQ,CAACG,OAAO,CAAC,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AAG3B,KAAK,CAACuB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAEtB,SAAS,CAAC;AAC5E,MAAMyB,cAAc,GAAG5B,KAAK,CAACuB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAEjB,UAAU,CAAC;AAC/E,MAAMqB,cAAc,GAAG7B,KAAK,CAACuB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAEhB,UAAU,CAAC;AAE/E,eAAe;EACbqB,EAAE,EAAE,iBAAiB;EACrBC,OAAO,EAAE,CAAC,oDAAoD,CAAC;EAC/DC,OAAO,EAAEhC,KAAK,CAACiC,IAAI;AACrB,EAAEvB,cAAc,GAAGV,KAAK,CAACiC,IAAI,gEAAgE,GAAG,IAAI;AACpG,EAAErB,iBAAiB,GAAGZ,KAAK,CAACiC,IAAI,yFAAyF,GAAG,IAAI;AAChI;AACA;AACA;AACA,8BAA8BX,eAAe,GAAGI,UAAU,GAAGC,aAAa,GAAGC,cAAc,GAAGC,cAAc;AAC5G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=9959-15591
|
|
4
|
+
// source=packages/components/src/components/Drawer/index.tsx
|
|
5
|
+
// component=Drawer.Content
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
|
|
9
|
+
// Boolean-as-variant: fullBleed is a VARIANT property with "true"/"false" string values.
|
|
10
|
+
// Map "false" to undefined so the prop is omitted at the default value.
|
|
11
|
+
const fullBleed = instance.getEnum('fullBleed', {
|
|
12
|
+
true: true,
|
|
13
|
+
false: undefined
|
|
14
|
+
});
|
|
15
|
+
const fullBleedProp = figma.helpers.react.renderProp('fullBleed', fullBleed);
|
|
16
|
+
const contentSlot = instance.getSlot('children');
|
|
17
|
+
const contentChildren = contentSlot ? figma.helpers.react.renderChildren(contentSlot) : null;
|
|
18
|
+
export default {
|
|
19
|
+
id: 'drawer-content',
|
|
20
|
+
imports: ["import { Drawer } from '@cdx-ui/components'"],
|
|
21
|
+
example: figma.code`<Drawer.Content${fullBleedProp}>${contentChildren}</Drawer.Content>`
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=Drawer.Content.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","fullBleed","getEnum","true","false","undefined","fullBleedProp","helpers","react","renderProp","contentSlot","getSlot","contentChildren","renderChildren","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Drawer.Content.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA,MAAMC,SAAS,GAAGF,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,aAAa,GAAGR,KAAK,CAACS,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAER,SAAS,CAAC;AAE5E,MAAMS,WAAW,GAAGX,QAAQ,CAACY,OAAO,CAAC,UAAU,CAAC;AAChD,MAAMC,eAAe,GAAGF,WAAW,GAAGZ,KAAK,CAACS,OAAO,CAACC,KAAK,CAACK,cAAc,CAACH,WAAW,CAAC,GAAG,IAAI;AAE5F,eAAe;EACbI,EAAE,EAAE,gBAAgB;EACpBC,OAAO,EAAE,CAAC,6CAA6C,CAAC;EACxDC,OAAO,EAAElB,KAAK,CAACmB,IAAI,kBAAkBX,aAAa,IAAIM,eAAe;AACvE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=10047-2140
|
|
4
|
+
// source=packages/components/src/components/Drawer/index.tsx
|
|
5
|
+
// component=Drawer.Description
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
const description = instance.findText('{description}').textContent;
|
|
9
|
+
export default {
|
|
10
|
+
id: 'drawer-description',
|
|
11
|
+
imports: ["import { Drawer } from '@cdx-ui/components'"],
|
|
12
|
+
example: figma.code`<Drawer.Description>${description}</Drawer.Description>`
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Drawer.Description.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","description","findText","textContent","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Drawer.Description.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,WAAW,GAAIF,QAAQ,CAACG,QAAQ,CAAC,eAAe,CAAC,CAAgCC,WAAW;AAElG,eAAe;EACbC,EAAE,EAAE,oBAAoB;EACxBC,OAAO,EAAE,CAAC,6CAA6C,CAAC;EACxDC,OAAO,EAAER,KAAK,CAACS,IAAI,uBAAuBN,WAAW;AACvD,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=9965-15672
|
|
4
|
+
// source=packages/components/src/components/Drawer/index.tsx
|
|
5
|
+
// component=Drawer.Footer
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
|
|
9
|
+
// Viewport is excluded — footer layout is responsive at runtime.
|
|
10
|
+
const showSeparator = instance.getEnum('showSeparator', {
|
|
11
|
+
true: true,
|
|
12
|
+
false: undefined
|
|
13
|
+
});
|
|
14
|
+
const showSeparatorProp = figma.helpers.react.renderProp('showSeparator', showSeparator);
|
|
15
|
+
|
|
16
|
+
// Figma layers are both named "Button", inside the `children` SLOT.
|
|
17
|
+
// findInstance + executeTemplate inlines nested Button Code Connect instead of a {children} pill.
|
|
18
|
+
const actionButtons = instance.findLayers(node => node.type === 'INSTANCE' && node.name === 'Button', {
|
|
19
|
+
traverseInstances: true
|
|
20
|
+
});
|
|
21
|
+
const firstButton = actionButtons[0]?.type === 'INSTANCE' ? actionButtons[0].executeTemplate().example : null;
|
|
22
|
+
const secondButton = actionButtons[1]?.type === 'INSTANCE' ? actionButtons[1].executeTemplate().example : null;
|
|
23
|
+
export default {
|
|
24
|
+
id: 'drawer-footer',
|
|
25
|
+
imports: ["import { Drawer } from '@cdx-ui/components'"],
|
|
26
|
+
metadata: {
|
|
27
|
+
nestable: true
|
|
28
|
+
},
|
|
29
|
+
example: figma.code`
|
|
30
|
+
<Drawer.Footer${showSeparatorProp}>
|
|
31
|
+
${firstButton}
|
|
32
|
+
${secondButton}
|
|
33
|
+
</Drawer.Footer>`
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=Drawer.Footer.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","showSeparator","getEnum","true","false","undefined","showSeparatorProp","helpers","react","renderProp","actionButtons","findLayers","node","type","name","traverseInstances","firstButton","executeTemplate","example","secondButton","id","imports","metadata","nestable","code"],"sourceRoot":"../../../src","sources":["figma/Drawer.Footer.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA,MAAMC,aAAa,GAAGF,QAAQ,CAACG,OAAO,CAAC,eAAe,EAAE;EACtDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,iBAAiB,GAAGR,KAAK,CAACS,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,eAAe,EAAER,aAAa,CAAC;;AAExF;AACA;AACA,MAAMS,aAAa,GAAGX,QAAQ,CAACY,UAAU,CACtCC,IAAI,IAAKA,IAAI,CAACC,IAAI,KAAK,UAAU,IAAID,IAAI,CAACE,IAAI,KAAK,QAAQ,EAC5D;EAAEC,iBAAiB,EAAE;AAAK,CAC5B,CAAC;AACD,MAAMC,WAAW,GACfN,aAAa,CAAC,CAAC,CAAC,EAAEG,IAAI,KAAK,UAAU,GAAGH,aAAa,CAAC,CAAC,CAAC,CAACO,eAAe,CAAC,CAAC,CAACC,OAAO,GAAG,IAAI;AAC3F,MAAMC,YAAY,GAChBT,aAAa,CAAC,CAAC,CAAC,EAAEG,IAAI,KAAK,UAAU,GAAGH,aAAa,CAAC,CAAC,CAAC,CAACO,eAAe,CAAC,CAAC,CAACC,OAAO,GAAG,IAAI;AAE3F,eAAe;EACbE,EAAE,EAAE,eAAe;EACnBC,OAAO,EAAE,CAAC,6CAA6C,CAAC;EACxDC,QAAQ,EAAE;IAAEC,QAAQ,EAAE;EAAK,CAAC;EAC5BL,OAAO,EAAEpB,KAAK,CAAC0B,IAAI;AACrB,gBAAgBlB,iBAAiB;AACjC,IAAIU,WAAW;AACf,IAAIG,YAAY;AAChB;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=10060-3874
|
|
4
|
+
// source=packages/components/src/components/Drawer/index.tsx
|
|
5
|
+
// component=Drawer.Header
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
|
|
9
|
+
// Figma Header property surface (node 10060:3874):
|
|
10
|
+
// - showSeparator — real prop on Drawer.Header
|
|
11
|
+
// - Show Content? / Show LeadingSlot? — design toggles only; they never become props.
|
|
12
|
+
// They only choose which children are composed inside Drawer.Header.
|
|
13
|
+
// - Content SLOT → its children (Drawer.Title / Drawer.Description) as direct children of
|
|
14
|
+
// Drawer.Header, which stacks them in its text column. Not Drawer.Content; that is the body.
|
|
15
|
+
// - LeadingSlot SLOT → Drawer.LeadingSlot
|
|
16
|
+
// - Close is the IconButton instance in Figma. Drawer.Header renders Drawer.Close by default,
|
|
17
|
+
// so it is not emitted.
|
|
18
|
+
|
|
19
|
+
const showSeparator = instance.getEnum('showSeparator', {
|
|
20
|
+
true: true,
|
|
21
|
+
false: false
|
|
22
|
+
});
|
|
23
|
+
const showSeparatorProp = figma.helpers.react.renderProp('showSeparator', showSeparator);
|
|
24
|
+
const showContent = instance.getBoolean('Show Content?');
|
|
25
|
+
const showLeadingSlot = instance.getBoolean('Show LeadingSlot?');
|
|
26
|
+
const leadingSlot = instance.getSlot('LeadingSlot');
|
|
27
|
+
const leadingChildren = showLeadingSlot && leadingSlot ? figma.helpers.react.renderChildren(leadingSlot) : null;
|
|
28
|
+
const contentSlot = instance.getSlot('Content');
|
|
29
|
+
const contentChildren = showContent && contentSlot ? figma.helpers.react.renderChildren(contentSlot) : null;
|
|
30
|
+
export default {
|
|
31
|
+
id: 'drawer-header',
|
|
32
|
+
imports: ["import { Drawer } from '@cdx-ui/components'"],
|
|
33
|
+
example: figma.code`
|
|
34
|
+
<Drawer.Header${showSeparatorProp}>
|
|
35
|
+
${showLeadingSlot ? figma.code`<Drawer.LeadingSlot>${leadingChildren}</Drawer.LeadingSlot>` : null}
|
|
36
|
+
${contentChildren}
|
|
37
|
+
</Drawer.Header>`
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=Drawer.Header.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","showSeparator","getEnum","true","false","showSeparatorProp","helpers","react","renderProp","showContent","getBoolean","showLeadingSlot","leadingSlot","getSlot","leadingChildren","renderChildren","contentSlot","contentChildren","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Drawer.Header.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,aAAa,GAAGF,QAAQ,CAACG,OAAO,CAAC,eAAe,EAAE;EACtDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AACF,MAAMC,iBAAiB,GAAGP,KAAK,CAACQ,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,eAAe,EAAEP,aAAa,CAAC;AAExF,MAAMQ,WAAW,GAAGV,QAAQ,CAACW,UAAU,CAAC,eAAe,CAAC;AACxD,MAAMC,eAAe,GAAGZ,QAAQ,CAACW,UAAU,CAAC,mBAAmB,CAAC;AAEhE,MAAME,WAAW,GAAGb,QAAQ,CAACc,OAAO,CAAC,aAAa,CAAC;AACnD,MAAMC,eAAe,GACnBH,eAAe,IAAIC,WAAW,GAAGd,KAAK,CAACQ,OAAO,CAACC,KAAK,CAACQ,cAAc,CAACH,WAAW,CAAC,GAAG,IAAI;AAEzF,MAAMI,WAAW,GAAGjB,QAAQ,CAACc,OAAO,CAAC,SAAS,CAAC;AAC/C,MAAMI,eAAe,GACnBR,WAAW,IAAIO,WAAW,GAAGlB,KAAK,CAACQ,OAAO,CAACC,KAAK,CAACQ,cAAc,CAACC,WAAW,CAAC,GAAG,IAAI;AAErF,eAAe;EACbE,EAAE,EAAE,eAAe;EACnBC,OAAO,EAAE,CAAC,6CAA6C,CAAC;EACxDC,OAAO,EAAEtB,KAAK,CAACuB,IAAI;AACrB,gBAAgBhB,iBAAiB;AACjC,IAAIM,eAAe,GAAGb,KAAK,CAACuB,IAAI,uBAAuBP,eAAe,uBAAuB,GAAG,IAAI;AACpG,IAAIG,eAAe;AACnB;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=10047-2116
|
|
4
|
+
// source=packages/components/src/components/Drawer/index.tsx
|
|
5
|
+
// component=Drawer.Title
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
const title = instance.findText('{title}').textContent;
|
|
9
|
+
export default {
|
|
10
|
+
id: 'drawer-title',
|
|
11
|
+
imports: ["import { Drawer } from '@cdx-ui/components'"],
|
|
12
|
+
example: figma.code`<Drawer.Title>${title}</Drawer.Title>`
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Drawer.Title.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","title","findText","textContent","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/Drawer.Title.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,KAAK,GAAIF,QAAQ,CAACG,QAAQ,CAAC,SAAS,CAAC,CAAgCC,WAAW;AAEtF,eAAe;EACbC,EAAE,EAAE,cAAc;EAClBC,OAAO,EAAE,CAAC,6CAA6C,CAAC;EACxDC,OAAO,EAAER,KAAK,CAACS,IAAI,iBAAiBN,KAAK;AAC3C,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=9956-15204
|
|
4
|
+
// source=packages/components/src/components/Drawer/index.tsx
|
|
5
|
+
// component=Drawer
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
const size = instance.getEnum('size', {
|
|
9
|
+
narrow: 'small',
|
|
10
|
+
medium: 'default',
|
|
11
|
+
wide: 'large'
|
|
12
|
+
});
|
|
13
|
+
const variant = instance.getEnum('variant', {
|
|
14
|
+
permanent: 'permanent',
|
|
15
|
+
modal: 'modal'
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Delegate to nested Code Connect templates — each sub-component manages its own snippet.
|
|
19
|
+
const headerInstance = instance.findInstance('Drawer.Header');
|
|
20
|
+
const headerSnippet = headerInstance.type === 'INSTANCE' ? headerInstance.executeTemplate().example : null;
|
|
21
|
+
const contentSlot = instance.getSlot('children');
|
|
22
|
+
const contentChildren = contentSlot ? figma.helpers.react.renderChildren(contentSlot) : null;
|
|
23
|
+
const footerInstance = instance.findInstance('Drawer.Footer');
|
|
24
|
+
const footerSnippet = footerInstance.type === 'INSTANCE' ? footerInstance.executeTemplate().example : null;
|
|
25
|
+
export default {
|
|
26
|
+
id: 'drawer',
|
|
27
|
+
imports: ["import { Drawer } from '@cdx-ui/components'"],
|
|
28
|
+
example: figma.code`
|
|
29
|
+
<Drawer variant="${variant}" size="${size}">
|
|
30
|
+
${headerSnippet}
|
|
31
|
+
<Drawer.Content>${contentChildren}</Drawer.Content>
|
|
32
|
+
${footerSnippet}
|
|
33
|
+
</Drawer>`
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=Drawer.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","size","getEnum","narrow","medium","wide","variant","permanent","modal","headerInstance","findInstance","headerSnippet","type","executeTemplate","example","contentSlot","getSlot","contentChildren","helpers","react","renderChildren","footerInstance","footerSnippet","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Drawer.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MA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j8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=5541-5756
|
|
4
|
+
// source=packages/components/src/components/Field/index.tsx
|
|
5
|
+
// component=Field
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
const showLabel = instance.getBoolean('Show Label?');
|
|
9
|
+
const showHelperText = instance.getBoolean('Show Helper Text?');
|
|
10
|
+
const showErrorText = instance.getBoolean('Show Error Text?');
|
|
11
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
12
|
+
true: true,
|
|
13
|
+
false: undefined
|
|
14
|
+
});
|
|
15
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
16
|
+
true: true,
|
|
17
|
+
false: undefined
|
|
18
|
+
});
|
|
19
|
+
const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
20
|
+
const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
|
|
21
|
+
const labelText = instance.findText('{label}', {
|
|
22
|
+
traverseInstances: true
|
|
23
|
+
}).textContent;
|
|
24
|
+
const helperText = instance.findText('{HelperText}', {
|
|
25
|
+
traverseInstances: true
|
|
26
|
+
}).textContent;
|
|
27
|
+
const errorText = instance.findText('{ErrorText}', {
|
|
28
|
+
traverseInstances: true
|
|
29
|
+
}).textContent;
|
|
30
|
+
const checkboxGroup = instance.findInstance('Checkbox.Group');
|
|
31
|
+
let checkboxGroupSnippet;
|
|
32
|
+
if (checkboxGroup.type === 'INSTANCE') {
|
|
33
|
+
checkboxGroupSnippet = checkboxGroup.executeTemplate().example;
|
|
34
|
+
}
|
|
35
|
+
export default {
|
|
36
|
+
id: 'field-checkbox',
|
|
37
|
+
imports: ["import { Field } from '@cdx-ui/components'"],
|
|
38
|
+
example: figma.code`
|
|
39
|
+
<Field${isInvalidProp}${isDisabledProp}>
|
|
40
|
+
${showLabel ? figma.code`<Field.Label>${labelText}</Field.Label>` : null}
|
|
41
|
+
${checkboxGroupSnippet}
|
|
42
|
+
${!isInvalid && showHelperText ? figma.code`<Field.Helper>${helperText}</Field.Helper>` : null}
|
|
43
|
+
${isInvalid && showErrorText ? figma.code`<Field.Error>${errorText}</Field.Error>` : null}
|
|
44
|
+
</Field>`
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=Field.Checkbox.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","showLabel","getBoolean","showHelperText","showErrorText","isInvalid","getEnum","true","false","undefined","isDisabled","isInvalidProp","helpers","react","renderProp","isDisabledProp","labelText","findText","traverseInstances","textContent","helperText","errorText","checkboxGroup","findInstance","checkboxGroupSnippet","type","executeTemplate","example","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Field.Checkbox.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,SAAS,GAAGF,QAAQ,CAACG,UAAU,CAAC,aAAa,CAAC;AACpD,MAAMC,cAAc,GAAGJ,QAAQ,CAACG,UAAU,CAAC,mBAAmB,CAAC;AAC/D,MAAME,aAAa,GAAGL,QAAQ,CAACG,UAAU,CAAC,kBAAkB,CAAC;AAE7D,MAAMG,SAAS,GAAGN,QAAQ,CAACO,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGX,QAAQ,CAACO,OAAO,CAAC,YAAY,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,MAAME,aAAa,GAAGb,KAAK,CAACc,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAET,SAAS,CAAC;AAC5E,MAAMU,cAAc,GAAGjB,KAAK,CAACc,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAEJ,UAAU,CAAC;AAE/E,MAAMM,SAAS,GACbjB,QAAQ,CAACkB,QAAQ,CAAC,SAAS,EAAE;EAC3BC,iBAAiB,EAAE;AACrB,CAAC,CAAC,CACFC,WAAW;AACb,MAAMC,UAAU,GACdrB,QAAQ,CAACkB,QAAQ,CAAC,cAAc,EAAE;EAChCC,iBAAiB,EAAE;AACrB,CAAC,CAAC,CACFC,WAAW;AACb,MAAME,SAAS,GACbtB,QAAQ,CAACkB,QAAQ,CAAC,aAAa,EAAE;EAC/BC,iBAAiB,EAAE;AACrB,CAAC,CAAC,CACFC,WAAW;AAEb,MAAMG,aAAa,GAAGvB,QAAQ,CAACwB,YAAY,CAAC,gBAAgB,CAAC;AAC7D,IAAIC,oBAAiE;AACrE,IAAIF,aAAa,CAACG,IAAI,KAAK,UAAU,EAAE;EACrCD,oBAAoB,GAAGF,aAAa,CAACI,eAAe,CAAC,CAAC,CAACC,OAAO;AAChE;AAEA,eAAe;EACbC,EAAE,EAAE,gBAAgB;EACpBC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDF,OAAO,EAAE7B,KAAK,CAACgC,IAAI;AACrB,QAAQnB,aAAa,GAAGI,cAAc;AACtC,IAAId,SAAS,GAAGH,KAAK,CAACgC,IAAI,gBAAgBd,SAAS,gBAAgB,GAAG,IAAI;AAC1E,IAAIQ,oBAAoB;AACxB,IAAI,CAACnB,SAAS,IAAIF,cAAc,GAAGL,KAAK,CAACgC,IAAI,iBAAiBV,UAAU,iBAAiB,GAAG,IAAI;AAChG,IAAIf,SAAS,IAAID,aAAa,GAAGN,KAAK,CAACgC,IAAI,gBAAgBT,SAAS,gBAAgB,GAAG,IAAI;AAC3F;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=12120-7982
|
|
4
|
+
// source=packages/components/src/components/Field/index.tsx
|
|
5
|
+
// component=Field
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
const showLabel = instance.getBoolean('Show Label?');
|
|
9
|
+
const showHelperText = instance.getBoolean('Show Helper Text?');
|
|
10
|
+
const showErrorText = instance.getBoolean('Show Error Text?');
|
|
11
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
12
|
+
true: true,
|
|
13
|
+
false: undefined
|
|
14
|
+
});
|
|
15
|
+
const isReadOnly = instance.getEnum('isReadOnly', {
|
|
16
|
+
true: true,
|
|
17
|
+
false: undefined
|
|
18
|
+
});
|
|
19
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
20
|
+
true: true,
|
|
21
|
+
false: undefined
|
|
22
|
+
});
|
|
23
|
+
const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
24
|
+
const isReadOnlyProp = figma.helpers.react.renderProp('isReadOnly', isReadOnly);
|
|
25
|
+
const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
|
|
26
|
+
const labelText = instance.findText('{label}', {
|
|
27
|
+
traverseInstances: true
|
|
28
|
+
}).textContent;
|
|
29
|
+
const helperText = instance.findText('{HelperText}', {
|
|
30
|
+
traverseInstances: true
|
|
31
|
+
}).textContent;
|
|
32
|
+
const errorText = instance.findText('{ErrorText}', {
|
|
33
|
+
traverseInstances: true
|
|
34
|
+
}).textContent;
|
|
35
|
+
const dateField = instance.findInstance('DateField');
|
|
36
|
+
let dateFieldSnippet;
|
|
37
|
+
if (dateField.type === 'INSTANCE') {
|
|
38
|
+
dateFieldSnippet = dateField.executeTemplate().example;
|
|
39
|
+
}
|
|
40
|
+
export default {
|
|
41
|
+
id: 'field-date-field',
|
|
42
|
+
imports: ["import { Field } from '@cdx-ui/components'"],
|
|
43
|
+
example: figma.code`
|
|
44
|
+
<Field${isInvalidProp}${isReadOnlyProp}${isDisabledProp}>
|
|
45
|
+
${showLabel ? figma.code`<Field.Label>${labelText}</Field.Label>` : null}
|
|
46
|
+
${dateFieldSnippet}
|
|
47
|
+
${!isInvalid && showHelperText ? figma.code`<Field.Helper>${helperText}</Field.Helper>` : null}
|
|
48
|
+
${isInvalid && showErrorText ? figma.code`<Field.Error>${errorText}</Field.Error>` : null}
|
|
49
|
+
</Field>`
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=Field.DateField.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","showLabel","getBoolean","showHelperText","showErrorText","isInvalid","getEnum","true","false","undefined","isReadOnly","isDisabled","isInvalidProp","helpers","react","renderProp","isReadOnlyProp","isDisabledProp","labelText","findText","traverseInstances","textContent","helperText","errorText","dateField","findInstance","dateFieldSnippet","type","executeTemplate","example","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Field.DateField.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,SAAS,GAAGF,QAAQ,CAACG,UAAU,CAAC,aAAa,CAAC;AACpD,MAAMC,cAAc,GAAGJ,QAAQ,CAACG,UAAU,CAAC,mBAAmB,CAAC;AAC/D,MAAME,aAAa,GAAGL,QAAQ,CAACG,UAAU,CAAC,kBAAkB,CAAC;AAE7D,MAAMG,SAAS,GAAGN,QAAQ,CAACO,OAAO,CAAC,WAAW,EAAE;EAC9CC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,UAAU,GAAGX,QAAQ,CAACO,OAAO,CAAC,YAAY,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAME,UAAU,GAAGZ,QAAQ,CAACO,OAAO,CAAC,YAAY,EAAE;EAChDC,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AAEF,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AAI;AAChG,IAAIjB,SAAS,IAAID,aAAa,GAAGN,KAAK,CAACkC,IAAI,gBAAgBT,SAAS,gBAAgB,GAAG,IAAI;AAC3F;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=12449-31583
|
|
4
|
+
// source=packages/components/src/components/Field/index.tsx
|
|
5
|
+
// component=Field
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
const instance = figma.selectedInstance;
|
|
8
|
+
const showLabel = instance.getBoolean('Show Label?');
|
|
9
|
+
const showHelperText = instance.getBoolean('Show Helper Text?');
|
|
10
|
+
const showErrorText = instance.getBoolean('Show Error Text?');
|
|
11
|
+
const isInvalid = instance.getEnum('isInvalid', {
|
|
12
|
+
true: true,
|
|
13
|
+
false: undefined
|
|
14
|
+
});
|
|
15
|
+
const isReadOnly = instance.getEnum('isReadOnly', {
|
|
16
|
+
true: true,
|
|
17
|
+
false: undefined
|
|
18
|
+
});
|
|
19
|
+
const isDisabled = instance.getEnum('isDisabled', {
|
|
20
|
+
true: true,
|
|
21
|
+
false: undefined
|
|
22
|
+
});
|
|
23
|
+
const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
24
|
+
const isReadOnlyProp = figma.helpers.react.renderProp('isReadOnly', isReadOnly);
|
|
25
|
+
const isDisabledProp = figma.helpers.react.renderProp('isDisabled', isDisabled);
|
|
26
|
+
const labelText = instance.findText('{label}', {
|
|
27
|
+
traverseInstances: true
|
|
28
|
+
}).textContent;
|
|
29
|
+
const helperText = instance.findText('{HelperText}', {
|
|
30
|
+
traverseInstances: true
|
|
31
|
+
}).textContent;
|
|
32
|
+
const errorText = instance.findText('{ErrorText}', {
|
|
33
|
+
traverseInstances: true
|
|
34
|
+
}).textContent;
|
|
35
|
+
const dateTimeField = instance.findInstance('DateTimeField');
|
|
36
|
+
let dateTimeFieldSnippet;
|
|
37
|
+
if (dateTimeField.type === 'INSTANCE') {
|
|
38
|
+
dateTimeFieldSnippet = dateTimeField.executeTemplate().example;
|
|
39
|
+
}
|
|
40
|
+
export default {
|
|
41
|
+
id: 'field-date-time-field',
|
|
42
|
+
imports: ["import { Field } from '@cdx-ui/components'"],
|
|
43
|
+
example: figma.code`
|
|
44
|
+
<Field${isInvalidProp}${isReadOnlyProp}${isDisabledProp}>
|
|
45
|
+
${showLabel ? figma.code`<Field.Label>${labelText}</Field.Label>` : null}
|
|
46
|
+
${dateTimeFieldSnippet}
|
|
47
|
+
${!isInvalid && showHelperText ? figma.code`<Field.Helper>${helperText}</Field.Helper>` : null}
|
|
48
|
+
${isInvalid && showErrorText ? figma.code`<Field.Error>${errorText}</Field.Error>` : null}
|
|
49
|
+
</Field>`
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=Field.DateTimeField.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","showLabel","getBoolean","showHelperText","showErrorText","isInvalid","getEnum","true","false","undefined","isReadOnly","isDisabled","isInvalidProp","helpers","react","renderProp","isReadOnlyProp","isDisabledProp","labelText","findText","traverseInstances","textContent","helperText","errorText","dateTimeField","findInstance","dateTimeFieldSnippet","type","executeTemplate","example","id","imports","code"],"sourceRoot":"../../../src","sources":["figma/Field.DateTimeField.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,SAAS,GAAGF,QAAQ,CAACG,UAAU,CAAC,aAAa,CAAC;AACpD,MAAMC,cAAc,GAAGJ,QAAQ,CAACG,UAAU,CAAC,mBAAmB,CAAC;AAC/D,MAAME,aAAa,GAAGL,QAAQ,CAACG,UAAU,CAAC,kBAAkB,CAAC;AAE7D,MAAMG,SAAS,GAAGN,QAA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EAAE,EAAE,uBAAuB;EAC3BC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDF,OAAO,EAAE/B,KAAK,CAACkC,IAAI;AACrB,QAAQpB,aAAa,GAAGI,cAAc,GAAGC,cAAc;AACvD,IAAIhB,SAAS,GAAGH,KAAK,CAACkC,IAAI,gBAAgBd,SAAS,gBAAgB,GAAG,IAAI;AAC1E,IAAIQ,oBAAoB;AACxB,IAAI,CAACrB,SAAS,IAAIF,cAAc,GAAGL,KAAK,CAACkC,IAAI,iBAAiBV,UAAU,iBAAiB,GAAG,IAAI;AAChG,IAAIjB,SAAS,IAAID,aAAa,GAAGN,KAAK,CAACkC,IAAI,gBAAgBT,SAAS,gBAAgB,GAAG,IAAI;AAC3F;AACA,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// url=https://www.figma.com/design/0lEVMVlLj8ZS4fgItr3pmd/%E2%AD%90-Forge-DS--Components?node-id=9091-16186
|
|
4
|
+
// source=packages/components/src/components/Image/Image.tsx
|
|
5
|
+
// component=Image
|
|
6
|
+
import figma from 'figma';
|
|
7
|
+
|
|
8
|
+
// The Figma Image component has no properties; its fill is a per-instance image override that the
|
|
9
|
+
// template API cannot read, so the snippet uses placeholder `source` and `alt` values.
|
|
10
|
+
export default {
|
|
11
|
+
id: 'image',
|
|
12
|
+
imports: ["import { Image } from '@cdx-ui/components'"],
|
|
13
|
+
example: figma.code`<Image source="https://example.com/image.jpg" alt="Image description" resizeMode="cover" />`,
|
|
14
|
+
metadata: {
|
|
15
|
+
nestable: true
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=Image.figma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["figma","id","imports","example","code","metadata","nestable"],"sourceRoot":"../../../src","sources":["figma/Image.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;;AAEzB;AACA;AACA,eAAe;EACbC,EAAE,EAAE,OAAO;EACXC,OAAO,EAAE,CAAC,4CAA4C,CAAC;EACvDC,OAAO,EAAEH,KAAK,CAACI,IAAI,6FAA6F;EAChHC,QAAQ,EAAE;IAAEC,QAAQ,EAAE;EAAK;AAC7B,CAAC","ignoreList":[]}
|
|
@@ -32,15 +32,43 @@ const labelText = instance.findText('{label}', {
|
|
|
32
32
|
const shortcutText = showShortcut ? instance.findText('{shortcut}', {
|
|
33
33
|
traverseInstances: true
|
|
34
34
|
}).textContent : '';
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
const checkboxLayer = instance.findInstance('Checkbox');
|
|
36
|
+
const radioLayer = instance.findInstance('Radio');
|
|
37
|
+
const buttonLayer = instance.findInstance('Button');
|
|
38
|
+
const hasCheckbox = checkboxLayer.type === 'INSTANCE';
|
|
39
|
+
const hasRadio = radioLayer.type === 'INSTANCE';
|
|
40
|
+
const hasButton = buttonLayer.type === 'INSTANCE';
|
|
41
|
+
const buttonSnippet = hasButton ? buttonLayer.executeTemplate().example : null;
|
|
42
|
+
const countMatch = /^(.*?)\s*\((\d+)\)\s*$/.exec(labelText);
|
|
43
|
+
const rowLabel = countMatch ? countMatch[1] : labelText;
|
|
44
|
+
const countText = countMatch ? countMatch[2] : '';
|
|
45
|
+
const countSnippet = countText ? figma.code` <Menu.ItemCount>${countText}</Menu.ItemCount>` : '';
|
|
46
|
+
const filterExample = hasRadio ? figma.code`
|
|
47
|
+
<Menu.RadioItem value="${rowLabel}"${disabledProp}>
|
|
48
|
+
<Menu.ItemControl />
|
|
49
|
+
<Menu.ItemLabel>${rowLabel}${countSnippet}</Menu.ItemLabel>
|
|
50
|
+
</Menu.RadioItem>` : figma.code`
|
|
51
|
+
<Menu.CheckboxItem color="${color}" onChange={() => {}}${insetProp}${checkedProp}${disabledProp}>
|
|
52
|
+
<Menu.ItemControl />
|
|
53
|
+
<Menu.ItemLabel>${rowLabel}${countSnippet}</Menu.ItemLabel>
|
|
54
|
+
</Menu.CheckboxItem>`;
|
|
55
|
+
const headerExample = figma.code`
|
|
56
|
+
<Menu.GroupHeader>
|
|
57
|
+
<Menu.ItemLabel>${labelText}</Menu.ItemLabel>
|
|
58
|
+
<Menu.ItemAction>
|
|
59
|
+
${buttonSnippet}
|
|
60
|
+
</Menu.ItemAction>
|
|
61
|
+
</Menu.GroupHeader>`;
|
|
62
|
+
const actionExample = figma.code`
|
|
39
63
|
<Menu.CheckboxItem color="${color}" onPress={() => {}}${insetProp}${checkedProp}${disabledProp}>
|
|
40
64
|
${showLeadingIcon ? figma.code`<Menu.ItemIcon as={Icon} />` : ''}
|
|
41
65
|
<Menu.ItemLabel>${labelText}</Menu.ItemLabel>
|
|
42
66
|
${showShortcut ? figma.code`<Menu.ItemShortcut>${shortcutText}</Menu.ItemShortcut>` : ''}
|
|
43
67
|
<Menu.ItemIndicator />
|
|
44
|
-
</Menu.CheckboxItem
|
|
68
|
+
</Menu.CheckboxItem>`;
|
|
69
|
+
export default {
|
|
70
|
+
id: 'menu-checkbox-item',
|
|
71
|
+
imports: ["import { Menu } from '@cdx-ui/components'"],
|
|
72
|
+
example: hasButton && !hasCheckbox && !hasRadio ? headerExample : hasCheckbox || hasRadio ? filterExample : actionExample
|
|
45
73
|
};
|
|
46
74
|
//# sourceMappingURL=Menu.Item.figma.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","instance","selectedInstance","color","getEnum","default","destructive","inset","true","false","undefined","insetProp","helpers","react","renderProp","isSelected","checkedProp","isDisabled","disabledProp","showLeadingIcon","getBoolean","showShortcut","labelText","findText","traverseInstances","textContent","shortcutText","
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","color","getEnum","default","destructive","inset","true","false","undefined","insetProp","helpers","react","renderProp","isSelected","checkedProp","isDisabled","disabledProp","showLeadingIcon","getBoolean","showShortcut","labelText","findText","traverseInstances","textContent","shortcutText","checkboxLayer","findInstance","radioLayer","buttonLayer","hasCheckbox","type","hasRadio","hasButton","buttonSnippet","executeTemplate","example","countMatch","exec","rowLabel","countText","countSnippet","code","filterExample","headerExample","actionExample","id","imports"],"sourceRoot":"../../../src","sources":["figma/Menu.Item.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;AAEvC,MAAMC,KAAK,GAAGF,QAAQ,CAACG,OAAO,CAAC,SAAS,EAAE;EACxCC,OAAO,EAAE,SAAS;EAClBC,WAAW,EAAE;AACf,CAAC,CAAC;AAEF,MAAMC,KAAK,GAAGN,QAAQ,CAACG,OAAO,CAAC,OAAO,EAAE;EACtCI,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,SAAS,GAAGX,KAAK,CAACY,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,OAAO,EAAEP,KAAK,CAAC;AAEhE,MAAMQ,UAAU,GAAGd,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDI,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMM,WAAW,GAAGhB,KAAK,CAACY,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,WAAW,EAAEC,UAAU,CAAC;AAE3E,MAAME,UAAU,GAAGhB,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDI,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMQ,YAAY,GAAGlB,KAAK,CAACY,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,UAAU,EAAEG,UAAU,CAAC;AAE3E,MAAME,eAAe,GAAGlB,QAAQ,CAACmB,UAAU,CAAC,oBAAoB,CAAC;AACjE,MAAMC,YAAY,GAAGpB,QAAQ,CAACmB,UAAU,CAAC,gBAAgB,CAAC;AAE1D,MAAME,SAAS,GACbrB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