@anker-in/headless-ui 0.0.26 → 0.0.27-alpha.0
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/CONTRIBUTING.md +88 -27
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +19 -0
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +2 -0
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +7 -0
- package/dist/cjs/biz-components/BrandEquity/index.d.ts +1 -0
- package/dist/cjs/biz-components/BrandEquity/index.js +2 -0
- package/dist/cjs/biz-components/BrandEquity/index.js.map +7 -0
- package/dist/cjs/biz-components/Category/index.d.ts +16 -0
- package/dist/cjs/biz-components/Category/index.js +2 -0
- package/dist/cjs/biz-components/Category/index.js.map +7 -0
- package/dist/cjs/biz-components/Evaluate/index.d.ts +19 -0
- package/dist/cjs/biz-components/Evaluate/index.js +2 -0
- package/dist/cjs/biz-components/Evaluate/index.js.map +7 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +7 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +2 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +7 -0
- package/dist/cjs/biz-components/HeroBanner/index.d.ts +1 -0
- package/dist/cjs/biz-components/HeroBanner/index.js +2 -0
- package/dist/cjs/biz-components/HeroBanner/index.js.map +7 -0
- package/dist/cjs/biz-components/HeroBanner/types.d.ts +26 -0
- package/dist/cjs/biz-components/HeroBanner/types.js +2 -0
- package/dist/cjs/biz-components/HeroBanner/types.js.map +7 -0
- package/dist/cjs/biz-components/Marquee/index.d.ts +23 -0
- package/dist/cjs/biz-components/Marquee/index.js +2 -0
- package/dist/cjs/biz-components/Marquee/index.js.map +7 -0
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +6 -0
- package/dist/cjs/biz-components/MemberEquity/index.js +40 -0
- package/dist/cjs/biz-components/MemberEquity/index.js.map +7 -0
- package/dist/cjs/biz-components/MemberEquity/types.d.ts +25 -0
- package/dist/cjs/biz-components/MemberEquity/types.js +2 -0
- package/dist/cjs/biz-components/MemberEquity/types.js.map +7 -0
- package/dist/cjs/biz-components/Shelf/Shelf.d.ts +6 -0
- package/dist/cjs/biz-components/Shelf/Shelf.js +2 -0
- package/dist/cjs/biz-components/Shelf/Shelf.js.map +7 -0
- package/dist/cjs/biz-components/Shelf/index.d.ts +1 -0
- package/dist/cjs/biz-components/Shelf/index.js +2 -0
- package/dist/cjs/biz-components/Shelf/index.js.map +7 -0
- package/dist/cjs/biz-components/Shelf/types.d.ts +6 -0
- package/dist/cjs/biz-components/Shelf/types.js +2 -0
- package/dist/cjs/biz-components/Shelf/types.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +38 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.js +10 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +7 -0
- package/dist/cjs/biz-components/Slogan/index.d.ts +7 -0
- package/dist/cjs/biz-components/Slogan/index.js +2 -0
- package/dist/cjs/biz-components/Slogan/index.js.map +7 -0
- package/dist/cjs/biz-components/Slogan/types.d.ts +24 -0
- package/dist/cjs/biz-components/Slogan/types.js +2 -0
- package/dist/cjs/biz-components/Slogan/types.js.map +7 -0
- package/dist/cjs/biz-components/index.d.ts +9 -0
- package/dist/cjs/biz-components/index.js +2 -0
- package/dist/cjs/biz-components/index.js.map +7 -0
- package/dist/cjs/components/alert.d.ts +17 -0
- package/dist/cjs/components/alert.js +2 -0
- package/dist/cjs/components/alert.js.map +7 -0
- package/dist/cjs/components/avatar.d.ts +26 -0
- package/dist/cjs/components/avatar.js +2 -0
- package/dist/cjs/components/avatar.js.map +7 -0
- package/dist/cjs/components/badge.d.ts +2 -2
- package/dist/cjs/components/badge.js +1 -1
- package/dist/cjs/components/badge.js.map +3 -3
- package/dist/cjs/components/button.d.ts +2 -1
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +3 -3
- package/dist/cjs/components/card.d.ts +8 -0
- package/dist/cjs/components/card.js +2 -0
- package/dist/cjs/components/card.js.map +7 -0
- package/dist/cjs/components/carousel.d.ts +28 -0
- package/dist/cjs/components/carousel.js +2 -0
- package/dist/cjs/components/carousel.js.map +7 -0
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +2 -2
- package/dist/cjs/components/color.d.ts +13 -0
- package/dist/cjs/components/color.js +2 -0
- package/dist/cjs/components/color.js.map +7 -0
- package/dist/cjs/components/container.d.ts +13 -0
- package/dist/cjs/components/container.js +2 -0
- package/dist/cjs/components/container.js.map +7 -0
- package/dist/cjs/components/dialog.d.ts +2 -2
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +2 -2
- package/dist/cjs/components/drawer.d.ts +13 -0
- package/dist/cjs/components/drawer.js +2 -0
- package/dist/cjs/components/drawer.js.map +7 -0
- package/dist/cjs/components/drop-down.d.ts +27 -0
- package/dist/cjs/components/drop-down.js +2 -0
- package/dist/cjs/components/drop-down.js.map +7 -0
- package/dist/cjs/components/gird.d.ts +17 -0
- package/dist/cjs/components/gird.js +2 -0
- package/dist/cjs/components/gird.js.map +7 -0
- package/dist/cjs/components/heading.d.ts +2 -2
- package/dist/cjs/components/heading.js +1 -1
- package/dist/cjs/components/heading.js.map +2 -2
- package/dist/cjs/components/index.d.ts +12 -1
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +2 -2
- package/dist/cjs/components/input-number.d.ts +78 -0
- package/dist/cjs/components/input-number.js +2 -0
- package/dist/cjs/components/input-number.js.map +7 -0
- package/dist/cjs/components/input.js +1 -1
- package/dist/cjs/components/input.js.map +2 -2
- package/dist/cjs/components/link.d.ts +47 -0
- package/dist/cjs/components/link.js +2 -0
- package/dist/cjs/components/link.js.map +7 -0
- package/dist/cjs/components/picture.d.ts +1 -1
- package/dist/cjs/components/picture.js +1 -1
- package/dist/cjs/components/picture.js.map +3 -3
- package/dist/cjs/components/popover.js +1 -1
- package/dist/cjs/components/popover.js.map +2 -2
- package/dist/cjs/components/radio.js +1 -1
- package/dist/cjs/components/radio.js.map +2 -2
- package/dist/cjs/components/skeleton.js +4 -4
- package/dist/cjs/components/skeleton.js.map +1 -1
- package/dist/cjs/components/tabs.d.ts +9 -0
- package/dist/cjs/components/tabs.js +2 -0
- package/dist/cjs/components/tabs.js.map +7 -0
- package/dist/cjs/components/text.d.ts +2 -3
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/text.js.map +3 -3
- package/dist/cjs/components/theme.d.ts +2 -3
- package/dist/cjs/components/theme.js +1 -1
- package/dist/cjs/components/theme.js.map +2 -2
- package/dist/cjs/helpers/constants.d.ts +0 -2
- package/dist/cjs/helpers/constants.js +1 -1
- package/dist/cjs/helpers/constants.js.map +4 -4
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/cjs/icons/spinner.d.ts +1 -1
- package/dist/cjs/icons/spinner.js +1 -1
- package/dist/cjs/icons/spinner.js.map +2 -2
- package/dist/cjs/shared/Styles.d.ts +33 -0
- package/dist/cjs/shared/Styles.js +2 -0
- package/dist/cjs/shared/Styles.js.map +7 -0
- package/dist/cjs/stories/HeroBanner.stories.d.ts +23 -0
- package/dist/cjs/stories/HeroBanner.stories.js +10 -0
- package/dist/cjs/stories/HeroBanner.stories.js.map +7 -0
- package/dist/cjs/stories/MemberEquity.stories.d.ts +9 -0
- package/dist/cjs/stories/MemberEquity.stories.js +31 -0
- package/dist/cjs/stories/MemberEquity.stories.js.map +7 -0
- package/dist/cjs/stories/alert.stories.d.ts +27 -0
- package/dist/cjs/stories/alert.stories.js +2 -0
- package/dist/cjs/stories/alert.stories.js.map +7 -0
- package/dist/cjs/stories/avatar.stories.d.ts +40 -0
- package/dist/cjs/stories/avatar.stories.js +2 -0
- package/dist/cjs/stories/avatar.stories.js.map +7 -0
- package/dist/cjs/stories/badge.stories.d.ts +2 -12
- package/dist/cjs/stories/badge.stories.js +1 -1
- package/dist/cjs/stories/badge.stories.js.map +2 -2
- package/dist/cjs/stories/brandEquity.stories.d.ts +16 -0
- package/dist/cjs/stories/brandEquity.stories.js +2 -0
- package/dist/cjs/stories/brandEquity.stories.js.map +7 -0
- package/dist/cjs/stories/button.stories.d.ts +14 -0
- package/dist/cjs/stories/button.stories.js +1 -1
- package/dist/cjs/stories/button.stories.js.map +3 -3
- package/dist/cjs/stories/card.stories.d.ts +27 -0
- package/dist/cjs/stories/card.stories.js +2 -0
- package/dist/cjs/stories/card.stories.js.map +7 -0
- package/dist/cjs/stories/carousel.stories.d.ts +62 -0
- package/dist/cjs/stories/carousel.stories.js +2 -0
- package/dist/cjs/stories/carousel.stories.js.map +7 -0
- package/dist/cjs/stories/category.stories.d.ts +13 -0
- package/dist/cjs/stories/category.stories.js +2 -0
- package/dist/cjs/stories/category.stories.js.map +7 -0
- package/dist/cjs/stories/checkbox.stories.d.ts +2 -2
- package/dist/cjs/stories/checkbox.stories.js +1 -1
- package/dist/cjs/stories/checkbox.stories.js.map +2 -2
- package/dist/cjs/stories/container.stories.d.ts +23 -0
- package/dist/cjs/stories/container.stories.js +15 -0
- package/dist/cjs/stories/container.stories.js.map +7 -0
- package/dist/cjs/stories/dialog.stories.js +1 -1
- package/dist/cjs/stories/dialog.stories.js.map +2 -2
- package/dist/cjs/stories/drawer.stories.d.ts +20 -0
- package/dist/cjs/stories/drawer.stories.js +2 -0
- package/dist/cjs/stories/drawer.stories.js.map +7 -0
- package/dist/cjs/stories/drop-down.stories.d.ts +16 -0
- package/dist/cjs/stories/drop-down.stories.js +2 -0
- package/dist/cjs/stories/drop-down.stories.js.map +7 -0
- package/dist/cjs/stories/evaluate.stories.d.ts +13 -0
- package/dist/cjs/stories/evaluate.stories.js +2 -0
- package/dist/cjs/stories/evaluate.stories.js.map +7 -0
- package/dist/cjs/stories/grid.stories.d.ts +22 -0
- package/dist/cjs/stories/grid.stories.js +13 -0
- package/dist/cjs/stories/grid.stories.js.map +7 -0
- package/dist/cjs/stories/heading.stories.d.ts +2 -2
- package/dist/cjs/stories/heading.stories.js +1 -1
- package/dist/cjs/stories/heading.stories.js.map +2 -2
- package/dist/cjs/stories/input-number.stories.d.ts +39 -0
- package/dist/cjs/stories/input-number.stories.js +2 -0
- package/dist/cjs/stories/input-number.stories.js.map +7 -0
- package/dist/cjs/stories/input.stories.js +1 -1
- package/dist/cjs/stories/input.stories.js.map +2 -2
- package/dist/cjs/stories/link.stories.d.ts +82 -0
- package/dist/cjs/stories/link.stories.js +2 -0
- package/dist/cjs/stories/link.stories.js.map +7 -0
- package/dist/cjs/stories/marquee.stories.d.ts +49 -0
- package/dist/cjs/stories/marquee.stories.js +2 -0
- package/dist/cjs/stories/marquee.stories.js.map +7 -0
- package/dist/cjs/stories/picture.stories.d.ts +1 -1
- package/dist/cjs/stories/picture.stories.js +2 -2
- package/dist/cjs/stories/picture.stories.js.map +2 -2
- package/dist/cjs/stories/popover.stories.d.ts +1 -1
- package/dist/cjs/stories/popover.stories.js +1 -1
- package/dist/cjs/stories/popover.stories.js.map +2 -2
- package/dist/cjs/stories/radio.stories.js +1 -1
- package/dist/cjs/stories/radio.stories.js.map +2 -2
- package/dist/cjs/stories/shelf.stories.d.ts +15 -0
- package/dist/cjs/stories/shelf.stories.js +2 -0
- package/dist/cjs/stories/shelf.stories.js.map +7 -0
- package/dist/cjs/stories/shelfDisplay.stories.d.ts +13 -0
- package/dist/cjs/stories/shelfDisplay.stories.js +2 -0
- package/dist/cjs/stories/shelfDisplay.stories.js.map +7 -0
- package/dist/cjs/stories/skeleton.stories.js +1 -1
- package/dist/cjs/stories/skeleton.stories.js.map +2 -2
- package/dist/cjs/stories/slogan.stories.d.ts +21 -0
- package/dist/cjs/stories/slogan.stories.js +26 -0
- package/dist/cjs/stories/slogan.stories.js.map +7 -0
- package/dist/cjs/stories/tabs.stories.d.ts +360 -0
- package/dist/cjs/stories/tabs.stories.js +2 -0
- package/dist/cjs/stories/tabs.stories.js.map +7 -0
- package/dist/cjs/stories/text.stories.d.ts +2 -11
- package/dist/cjs/stories/text.stories.js +1 -1
- package/dist/cjs/stories/text.stories.js.map +3 -3
- package/dist/cjs/types/index.d.ts +0 -0
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/index.js.map +7 -0
- package/dist/cjs/types/props.d.ts +5 -0
- package/dist/cjs/types/props.js +2 -0
- package/dist/cjs/types/props.js.map +7 -0
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +19 -0
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +2 -0
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +7 -0
- package/dist/esm/biz-components/BrandEquity/index.d.ts +1 -0
- package/dist/esm/biz-components/BrandEquity/index.js +2 -0
- package/dist/esm/biz-components/BrandEquity/index.js.map +7 -0
- package/dist/esm/biz-components/Category/index.d.ts +16 -0
- package/dist/esm/biz-components/Category/index.js +2 -0
- package/dist/esm/biz-components/Category/index.js.map +7 -0
- package/dist/esm/biz-components/Evaluate/index.d.ts +19 -0
- package/dist/esm/biz-components/Evaluate/index.js +2 -0
- package/dist/esm/biz-components/Evaluate/index.js.map +7 -0
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +7 -0
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +2 -0
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +7 -0
- package/dist/esm/biz-components/HeroBanner/index.d.ts +1 -0
- package/dist/esm/biz-components/HeroBanner/index.js +2 -0
- package/dist/esm/biz-components/HeroBanner/index.js.map +7 -0
- package/dist/esm/biz-components/HeroBanner/types.d.ts +26 -0
- package/dist/esm/biz-components/HeroBanner/types.js +1 -0
- package/dist/esm/biz-components/HeroBanner/types.js.map +7 -0
- package/dist/esm/biz-components/Marquee/index.d.ts +23 -0
- package/dist/esm/biz-components/Marquee/index.js +2 -0
- package/dist/esm/biz-components/Marquee/index.js.map +7 -0
- package/dist/esm/biz-components/MemberEquity/index.d.ts +6 -0
- package/dist/esm/biz-components/MemberEquity/index.js +40 -0
- package/dist/esm/biz-components/MemberEquity/index.js.map +7 -0
- package/dist/esm/biz-components/MemberEquity/types.d.ts +25 -0
- package/dist/esm/biz-components/MemberEquity/types.js +1 -0
- package/dist/esm/biz-components/MemberEquity/types.js.map +7 -0
- package/dist/esm/biz-components/Shelf/Shelf.d.ts +6 -0
- package/dist/esm/biz-components/Shelf/Shelf.js +2 -0
- package/dist/esm/biz-components/Shelf/Shelf.js.map +7 -0
- package/dist/esm/biz-components/Shelf/index.d.ts +1 -0
- package/dist/esm/biz-components/Shelf/index.js +2 -0
- package/dist/esm/biz-components/Shelf/index.js.map +7 -0
- package/dist/esm/biz-components/Shelf/types.d.ts +6 -0
- package/dist/esm/biz-components/Shelf/types.js +1 -0
- package/dist/esm/biz-components/Shelf/types.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/index.d.ts +38 -0
- package/dist/esm/biz-components/ShelfDisplay/index.js +10 -0
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +7 -0
- package/dist/esm/biz-components/Slogan/index.d.ts +7 -0
- package/dist/esm/biz-components/Slogan/index.js +2 -0
- package/dist/esm/biz-components/Slogan/index.js.map +7 -0
- package/dist/esm/biz-components/Slogan/types.d.ts +24 -0
- package/dist/esm/biz-components/Slogan/types.js +1 -0
- package/dist/esm/biz-components/Slogan/types.js.map +7 -0
- package/dist/esm/biz-components/index.d.ts +9 -0
- package/dist/esm/biz-components/index.js +2 -0
- package/dist/esm/biz-components/index.js.map +7 -0
- package/dist/esm/components/alert.d.ts +17 -0
- package/dist/esm/components/alert.js +2 -0
- package/dist/esm/components/alert.js.map +7 -0
- package/dist/esm/components/avatar.d.ts +26 -0
- package/dist/esm/components/avatar.js +2 -0
- package/dist/esm/components/avatar.js.map +7 -0
- package/dist/esm/components/badge.d.ts +2 -2
- package/dist/esm/components/badge.js +1 -1
- package/dist/esm/components/badge.js.map +3 -3
- package/dist/esm/components/button.d.ts +2 -1
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +3 -3
- package/dist/esm/components/card.d.ts +8 -0
- package/dist/esm/components/card.js +2 -0
- package/dist/esm/components/card.js.map +7 -0
- package/dist/esm/components/carousel.d.ts +28 -0
- package/dist/esm/components/carousel.js +2 -0
- package/dist/esm/components/carousel.js.map +7 -0
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +2 -2
- package/dist/esm/components/color.d.ts +13 -0
- package/dist/esm/components/color.js +2 -0
- package/dist/esm/components/color.js.map +7 -0
- package/dist/esm/components/container.d.ts +13 -0
- package/dist/esm/components/container.js +2 -0
- package/dist/esm/components/container.js.map +7 -0
- package/dist/esm/components/dialog.d.ts +2 -2
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +2 -2
- package/dist/esm/components/drawer.d.ts +13 -0
- package/dist/esm/components/drawer.js +2 -0
- package/dist/esm/components/drawer.js.map +7 -0
- package/dist/esm/components/drop-down.d.ts +27 -0
- package/dist/esm/components/drop-down.js +2 -0
- package/dist/esm/components/drop-down.js.map +7 -0
- package/dist/esm/components/gird.d.ts +17 -0
- package/dist/esm/components/gird.js +2 -0
- package/dist/esm/components/gird.js.map +7 -0
- package/dist/esm/components/heading.d.ts +2 -2
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/heading.js.map +2 -2
- package/dist/esm/components/index.d.ts +12 -1
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/input-number.d.ts +78 -0
- package/dist/esm/components/input-number.js +2 -0
- package/dist/esm/components/input-number.js.map +7 -0
- package/dist/esm/components/input.js +1 -1
- package/dist/esm/components/input.js.map +2 -2
- package/dist/esm/components/link.d.ts +47 -0
- package/dist/esm/components/link.js +2 -0
- package/dist/esm/components/link.js.map +7 -0
- package/dist/esm/components/picture.d.ts +1 -1
- package/dist/esm/components/picture.js +1 -1
- package/dist/esm/components/picture.js.map +3 -3
- package/dist/esm/components/popover.js +1 -1
- package/dist/esm/components/popover.js.map +2 -2
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/radio.js.map +2 -2
- package/dist/esm/components/skeleton.js +4 -4
- package/dist/esm/components/skeleton.js.map +1 -1
- package/dist/esm/components/tabs.d.ts +9 -0
- package/dist/esm/components/tabs.js +2 -0
- package/dist/esm/components/tabs.js.map +7 -0
- package/dist/esm/components/text.d.ts +2 -3
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.js.map +3 -3
- package/dist/esm/components/theme.d.ts +2 -3
- package/dist/esm/components/theme.js +1 -1
- package/dist/esm/components/theme.js.map +2 -2
- package/dist/esm/helpers/constants.d.ts +0 -2
- package/dist/esm/helpers/constants.js +1 -1
- package/dist/esm/helpers/constants.js.map +3 -3
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/dist/esm/icons/spinner.d.ts +1 -1
- package/dist/esm/icons/spinner.js +1 -1
- package/dist/esm/icons/spinner.js.map +2 -2
- package/dist/esm/shared/Styles.d.ts +33 -0
- package/dist/esm/shared/Styles.js +2 -0
- package/dist/esm/shared/Styles.js.map +7 -0
- package/dist/esm/stories/HeroBanner.stories.d.ts +23 -0
- package/dist/esm/stories/HeroBanner.stories.js +10 -0
- package/dist/esm/stories/HeroBanner.stories.js.map +7 -0
- package/dist/esm/stories/MemberEquity.stories.d.ts +9 -0
- package/dist/esm/stories/MemberEquity.stories.js +31 -0
- package/dist/esm/stories/MemberEquity.stories.js.map +7 -0
- package/dist/esm/stories/alert.stories.d.ts +27 -0
- package/dist/esm/stories/alert.stories.js +2 -0
- package/dist/esm/stories/alert.stories.js.map +7 -0
- package/dist/esm/stories/avatar.stories.d.ts +40 -0
- package/dist/esm/stories/avatar.stories.js +2 -0
- package/dist/esm/stories/avatar.stories.js.map +7 -0
- package/dist/esm/stories/badge.stories.d.ts +2 -12
- package/dist/esm/stories/badge.stories.js +1 -1
- package/dist/esm/stories/badge.stories.js.map +2 -2
- package/dist/esm/stories/brandEquity.stories.d.ts +16 -0
- package/dist/esm/stories/brandEquity.stories.js +2 -0
- package/dist/esm/stories/brandEquity.stories.js.map +7 -0
- package/dist/esm/stories/button.stories.d.ts +14 -0
- package/dist/esm/stories/button.stories.js +1 -1
- package/dist/esm/stories/button.stories.js.map +3 -3
- package/dist/esm/stories/card.stories.d.ts +27 -0
- package/dist/esm/stories/card.stories.js +2 -0
- package/dist/esm/stories/card.stories.js.map +7 -0
- package/dist/esm/stories/carousel.stories.d.ts +62 -0
- package/dist/esm/stories/carousel.stories.js +2 -0
- package/dist/esm/stories/carousel.stories.js.map +7 -0
- package/dist/esm/stories/category.stories.d.ts +13 -0
- package/dist/esm/stories/category.stories.js +2 -0
- package/dist/esm/stories/category.stories.js.map +7 -0
- package/dist/esm/stories/checkbox.stories.d.ts +2 -2
- package/dist/esm/stories/checkbox.stories.js +1 -1
- package/dist/esm/stories/checkbox.stories.js.map +2 -2
- package/dist/esm/stories/container.stories.d.ts +23 -0
- package/dist/esm/stories/container.stories.js +15 -0
- package/dist/esm/stories/container.stories.js.map +7 -0
- package/dist/esm/stories/dialog.stories.js +1 -1
- package/dist/esm/stories/dialog.stories.js.map +2 -2
- package/dist/esm/stories/drawer.stories.d.ts +20 -0
- package/dist/esm/stories/drawer.stories.js +2 -0
- package/dist/esm/stories/drawer.stories.js.map +7 -0
- package/dist/esm/stories/drop-down.stories.d.ts +16 -0
- package/dist/esm/stories/drop-down.stories.js +2 -0
- package/dist/esm/stories/drop-down.stories.js.map +7 -0
- package/dist/esm/stories/evaluate.stories.d.ts +13 -0
- package/dist/esm/stories/evaluate.stories.js +2 -0
- package/dist/esm/stories/evaluate.stories.js.map +7 -0
- package/dist/esm/stories/grid.stories.d.ts +22 -0
- package/dist/esm/stories/grid.stories.js +13 -0
- package/dist/esm/stories/grid.stories.js.map +7 -0
- package/dist/esm/stories/heading.stories.d.ts +2 -2
- package/dist/esm/stories/heading.stories.js +1 -1
- package/dist/esm/stories/heading.stories.js.map +2 -2
- package/dist/esm/stories/input-number.stories.d.ts +39 -0
- package/dist/esm/stories/input-number.stories.js +2 -0
- package/dist/esm/stories/input-number.stories.js.map +7 -0
- package/dist/esm/stories/input.stories.js +1 -1
- package/dist/esm/stories/input.stories.js.map +2 -2
- package/dist/esm/stories/link.stories.d.ts +82 -0
- package/dist/esm/stories/link.stories.js +2 -0
- package/dist/esm/stories/link.stories.js.map +7 -0
- package/dist/esm/stories/marquee.stories.d.ts +49 -0
- package/dist/esm/stories/marquee.stories.js +2 -0
- package/dist/esm/stories/marquee.stories.js.map +7 -0
- package/dist/esm/stories/picture.stories.d.ts +1 -1
- package/dist/esm/stories/picture.stories.js +2 -2
- package/dist/esm/stories/picture.stories.js.map +2 -2
- package/dist/esm/stories/popover.stories.d.ts +1 -1
- package/dist/esm/stories/popover.stories.js +1 -1
- package/dist/esm/stories/popover.stories.js.map +2 -2
- package/dist/esm/stories/radio.stories.js +1 -1
- package/dist/esm/stories/radio.stories.js.map +2 -2
- package/dist/esm/stories/shelf.stories.d.ts +15 -0
- package/dist/esm/stories/shelf.stories.js +2 -0
- package/dist/esm/stories/shelf.stories.js.map +7 -0
- package/dist/esm/stories/shelfDisplay.stories.d.ts +13 -0
- package/dist/esm/stories/shelfDisplay.stories.js +2 -0
- package/dist/esm/stories/shelfDisplay.stories.js.map +7 -0
- package/dist/esm/stories/skeleton.stories.js +1 -1
- package/dist/esm/stories/skeleton.stories.js.map +2 -2
- package/dist/esm/stories/slogan.stories.d.ts +21 -0
- package/dist/esm/stories/slogan.stories.js +26 -0
- package/dist/esm/stories/slogan.stories.js.map +7 -0
- package/dist/esm/stories/tabs.stories.d.ts +360 -0
- package/dist/esm/stories/tabs.stories.js +2 -0
- package/dist/esm/stories/tabs.stories.js.map +7 -0
- package/dist/esm/stories/text.stories.d.ts +2 -11
- package/dist/esm/stories/text.stories.js +2 -2
- package/dist/esm/stories/text.stories.js.map +3 -3
- package/dist/esm/types/index.d.ts +0 -0
- package/dist/esm/types/index.js +2 -0
- package/dist/esm/types/index.js.map +7 -0
- package/dist/esm/types/props.d.ts +5 -0
- package/dist/esm/types/props.js +1 -0
- package/dist/esm/types/props.js.map +7 -0
- package/package.json +28 -3
- package/src/biz-components/BrandEquity/BrandEquity.tsx +77 -0
- package/src/biz-components/BrandEquity/index.ts +1 -0
- package/src/biz-components/Category/index.tsx +57 -0
- package/src/biz-components/Evaluate/index.tsx +85 -0
- package/src/biz-components/HeroBanner/HeroBanner.tsx +103 -0
- package/src/biz-components/HeroBanner/index.tsx +1 -0
- package/src/biz-components/HeroBanner/types.ts +28 -0
- package/src/biz-components/Marquee/index.tsx +79 -0
- package/src/biz-components/MemberEquity/index.tsx +114 -0
- package/src/biz-components/MemberEquity/types.ts +26 -0
- package/src/biz-components/Shelf/Shelf.tsx +22 -0
- package/src/biz-components/Shelf/index.ts +1 -0
- package/src/biz-components/Shelf/types.ts +6 -0
- package/src/biz-components/ShelfDisplay/index.tsx +142 -0
- package/src/biz-components/Slogan/index.tsx +53 -0
- package/src/biz-components/Slogan/types.ts +25 -0
- package/src/biz-components/index.ts +11 -0
- package/src/components/alert.tsx +124 -0
- package/src/components/avatar.tsx +126 -0
- package/src/components/badge.tsx +9 -11
- package/src/components/button.tsx +40 -23
- package/src/components/card.tsx +51 -0
- package/src/components/carousel.tsx +352 -0
- package/src/components/checkbox.tsx +5 -7
- package/src/components/color.tsx +77 -0
- package/src/components/container.tsx +28 -0
- package/src/components/dialog.tsx +9 -12
- package/src/components/drawer.tsx +115 -0
- package/src/components/drop-down.tsx +182 -0
- package/src/components/gird.tsx +90 -0
- package/src/components/heading.tsx +21 -26
- package/src/components/index.ts +12 -5
- package/src/components/input-number.tsx +216 -0
- package/src/components/input.tsx +9 -9
- package/src/components/link.tsx +99 -0
- package/src/components/picture.tsx +3 -2
- package/src/components/popover.tsx +1 -1
- package/src/components/radio.tsx +6 -6
- package/src/components/skeleton.tsx +3 -3
- package/src/components/tabs.tsx +78 -0
- package/src/components/text.tsx +20 -34
- package/src/components/theme.tsx +1 -2
- package/src/helpers/constants.ts +0 -3
- package/src/helpers/utils.ts +9 -1
- package/src/icons/spinner.tsx +1 -1
- package/src/shared/Styles.tsx +94 -0
- package/src/stories/HeroBanner.stories.tsx +86 -0
- package/src/stories/MemberEquity.stories.tsx +107 -0
- package/src/stories/alert.stories.tsx +41 -0
- package/src/stories/avatar.stories.tsx +83 -0
- package/src/stories/badge.stories.tsx +10 -14
- package/src/stories/brandEquity.stories.tsx +73 -0
- package/src/stories/button.stories.tsx +24 -3
- package/src/stories/card.stories.tsx +97 -0
- package/src/stories/carousel.stories.tsx +161 -0
- package/src/stories/category.stories.tsx +52 -0
- package/src/stories/checkbox.stories.tsx +9 -9
- package/src/stories/container.stories.tsx +97 -0
- package/src/stories/dialog.stories.tsx +8 -8
- package/src/stories/drawer.stories.tsx +88 -0
- package/src/stories/drop-down.stories.tsx +83 -0
- package/src/stories/evaluate.stories.tsx +53 -0
- package/src/stories/grid.stories.tsx +190 -0
- package/src/stories/heading.stories.tsx +4 -8
- package/src/stories/input-number.stories.tsx +52 -0
- package/src/stories/input.stories.tsx +2 -2
- package/src/stories/link.stories.tsx +142 -0
- package/src/stories/marquee.stories.tsx +102 -0
- package/src/stories/picture.stories.tsx +2 -2
- package/src/stories/popover.stories.tsx +2 -2
- package/src/stories/radio.stories.tsx +2 -2
- package/src/stories/shelf.stories.tsx +35 -0
- package/src/stories/shelfDisplay.stories.tsx +69 -0
- package/src/stories/skeleton.stories.tsx +7 -7
- package/src/stories/slogan.stories.tsx +99 -0
- package/src/stories/tabs.stories.tsx +179 -0
- package/src/stories/text.stories.tsx +9 -33
- package/src/styles/global.css +0 -197
- package/src/types/index.ts +0 -0
- package/src/types/props.ts +5 -0
- package/style.css +1091 -734
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o,jsxs as r}from"react/jsx-runtime";import*as l from"react";import*as e from"@radix-ui/react-dialog";import{Cross2Icon as u}from"@radix-ui/react-icons";import{cn as s}from"../helpers/index.js";const d=e.Root;d.displayName="Dialog";const R=e.Trigger,m=e.Portal,v=e.Close,n=l.forwardRef(({className:t,...a},i)=>o(e.Overlay,{ref:i,className:s("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",t),...a}));n.displayName=e.Overlay.displayName;const c=l.forwardRef(({className:t,children:a,...i},y)=>r(m,{children:[o(n,{}),r(e.Content,{ref:y,className:s("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg",t),...i,children:[a,r(e.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none",children:[o(u,{className:"size-4"}),o("span",{className:"sr-only",children:"Close"})]})]})]}));c.displayName=e.Content.displayName;const f=({className:t,...a})=>o("div",{className:s("flex flex-col space-y-1.5 text-center sm:text-left",t),...a});f.displayName="DialogHeader";const p=({className:t,...a})=>o("div",{className:s("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a});p.displayName="DialogFooter";const g=l.forwardRef(({className:t,...a},i)=>o(e.Title,{ref:i,className:s("text-lg font-semibold leading-none tracking-tight",t),...a}));g.displayName=e.Title.displayName;const D=l.forwardRef(({className:t,...a},i)=>o(e.Description,{ref:i,className:s("text-muted-foreground text-sm",t),...a}));D.displayName=e.Description.displayName;export{d as Dialog,v as DialogClose,c as DialogContent,D as DialogDescription,p as DialogFooter,f as DialogHeader,n as DialogOverlay,m as DialogPortal,g as DialogTitle,R as DialogTrigger};
|
|
2
2
|
//# sourceMappingURL=dialog.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/dialog.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { Cross2Icon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\n\nconst Dialog = DialogPrimitive.Root\nDialog.displayName = 'Dialog'\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'data-[state=open]:
|
|
5
|
-
"mappings": "aAqBE,cAAAA,EA0BI,QAAAC,MA1BJ,oBAnBF,UAAYC,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBAE3B,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAASH,EAAgB,KAC/BG,EAAO,YAAc,SAErB,MAAMC,EAAgBJ,EAAgB,QAEhCK,EAAeL,EAAgB,OAE/BM,EAAcN,EAAgB,MAE9BO,EAAgBR,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { Cross2Icon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\n\nconst Dialog = DialogPrimitive.Root\nDialog.displayName = 'Dialog'\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute right-4 top-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none\">\n <Cross2Icon className=\"size-4\" />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-1.5 text-center sm:text-left', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"],
|
|
5
|
+
"mappings": "aAqBE,cAAAA,EA0BI,QAAAC,MA1BJ,oBAnBF,UAAYC,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBAE3B,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAASH,EAAgB,KAC/BG,EAAO,YAAc,SAErB,MAAMC,EAAgBJ,EAAgB,QAEhCK,EAAeL,EAAgB,OAE/BM,EAAcN,EAAgB,MAE9BO,EAAgBR,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,0JACAM,CACF,EACC,GAAGC,EACN,CACD,EACDF,EAAc,YAAcP,EAAgB,QAAQ,YAEpD,MAAMW,EAAgBZ,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,SAAAI,EAAU,GAAGH,CAAM,EAAGC,IACpCZ,EAACO,EAAA,CACC,UAAAR,EAACU,EAAA,EAAc,EACfT,EAACE,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,sfACAM,CACF,EACC,GAAGC,EAEH,UAAAG,EACDd,EAACE,EAAgB,MAAhB,CAAsB,UAAU,gRAC/B,UAAAH,EAACI,EAAA,CAAW,UAAU,SAAS,EAC/BJ,EAAC,QAAK,UAAU,UAAU,iBAAK,GACjC,GACF,GACF,CACD,EACDc,EAAc,YAAcX,EAAgB,QAAQ,YAEpD,MAAMa,EAAe,CAAC,CAAE,UAAAL,EAAW,GAAGC,CAAM,IAC1CZ,EAAC,OAAI,UAAWK,EAAG,qDAAsDM,CAAS,EAAI,GAAGC,EAAO,EAElGI,EAAa,YAAc,eAE3B,MAAMC,EAAe,CAAC,CAAE,UAAAN,EAAW,GAAGC,CAAM,IAC1CZ,EAAC,OAAI,UAAWK,EAAG,gEAAiEM,CAAS,EAAI,GAAGC,EAAO,EAE7GK,EAAa,YAAc,eAE3B,MAAMC,EAAchB,EAAM,WAGxB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,MAAhB,CACC,IAAKU,EACL,UAAWR,EAAG,oDAAqDM,CAAS,EAC3E,GAAGC,EACN,CACD,EACDM,EAAY,YAAcf,EAAgB,MAAM,YAEhD,MAAMgB,EAAoBjB,EAAM,WAG9B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,YAAhB,CAA4B,IAAKU,EAAK,UAAWR,EAAG,gCAAiCM,CAAS,EAAI,GAAGC,EAAO,CAC9G,EACDO,EAAkB,YAAchB,EAAgB,YAAY",
|
|
6
6
|
"names": ["jsx", "jsxs", "React", "DialogPrimitive", "Cross2Icon", "cn", "Dialog", "DialogTrigger", "DialogPortal", "DialogClose", "DialogOverlay", "className", "props", "ref", "DialogContent", "children", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Drawer as DrawerPrimitive } from 'vaul';
|
|
3
|
+
declare function Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare function DrawerHeader({ className, children, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function DrawerFooter({ className, ...props }: React.ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as r,jsxs as d}from"react/jsx-runtime";import"react";import{Drawer as e}from"vaul";import{Cross2Icon as s}from"@radix-ui/react-icons";import{cn as i}from"../helpers/utils.js";function w({...a}){return r(e.Root,{"data-slot":"drawer",...a})}function m({...a}){return r(e.Trigger,{"data-slot":"drawer-trigger",...a})}function n({...a}){return r(e.Portal,{"data-slot":"drawer-portal",...a})}function l({...a}){return r(e.Close,{"data-slot":"drawer-close",...a})}function c({className:a,...t}){return r(e.Overlay,{"data-slot":"drawer-overlay",className:i("data-[state=open]:ai-animate-in data-[state=closed]:ai-animate-out data-[state=closed]:ai-fade-out-0 data-[state=open]:ai-fade-in-0 ai-fixed ai-inset-0 ai-z-50 ai-bg-black/50",a),...t})}function p({className:a,children:t,...o}){return d(n,{"data-slot":"drawer-portal",children:[r(c,{}),d(e.Content,{"data-slot":"drawer-content",className:i("group/drawer-content ai-bg-background ai-fixed ai-z-50 ai-flex ai-px-6 ai-h-auto ai-flex-col","data-[vaul-drawer-direction=top]:ai-inset-x-0 data-[vaul-drawer-direction=top]:ai-top-0 data-[vaul-drawer-direction=top]:ai-mb-24 data-[vaul-drawer-direction=top]:ai-max-h-[80vh] data-[vaul-drawer-direction=top]:ai-border-b","data-[vaul-drawer-direction=bottom]:ai-inset-x-0 data-[vaul-drawer-direction=bottom]:ai-bottom-0 data-[vaul-drawer-direction=bottom]:ai-mt-24 data-[vaul-drawer-direction=bottom]:ai-max-h-[80vh] data-[vaul-drawer-direction=bottom]:ai-border-t","data-[vaul-drawer-direction=right]:ai-inset-y-0 data-[vaul-drawer-direction=right]:ai-right-0 data-[vaul-drawer-direction=right]:ai-w-3/4 data-[vaul-drawer-direction=right]:ai-border-l data-[vaul-drawer-direction=right]:ai-max-w-sm","data-[vaul-drawer-direction=left]:ai-inset-y-0 data-[vaul-drawer-direction=left]:ai-left-0 data-[vaul-drawer-direction=left]:ai-w-3/4 data-[vaul-drawer-direction=left]:ai-border-r data-[vaul-drawer-direction=left]:ai-max-w-sm",a),...o,children:[r("div",{className:"ai-bg-muted ai-mx-auto ai-mt-4 ai-hidden ai-h-2 ai-w-[100px] ai-shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:ai-block"}),t]})]})}function u({className:a,children:t,...o}){return d("div",{"data-slot":"drawer-header",className:i("gird-container ai-flex ai-justify-between ai-py-6 gap-1.5",a),...o,children:[r("div",{children:t}),r(l,{children:r(s,{className:"ai-size-4"})})]})}function v({className:a,...t}){return r("div",{"data-slot":"drawer-footer",className:i("ai-mt-auto ai-flex ai-flex-col ai-gap-2 ai-py-8",a),...t})}function f({className:a,...t}){return r(e.Title,{"data-slot":"drawer-title",className:i("text-foreground font-semibold",a),...t})}function D({className:a,...t}){return r(e.Description,{"data-slot":"drawer-description",className:i("ai-text-muted-foreground ai-text-sm",a),...t})}export{w as Drawer,l as DrawerClose,p as DrawerContent,D as DrawerDescription,v as DrawerFooter,u as DrawerHeader,c as DrawerOverlay,n as DrawerPortal,f as DrawerTitle,m as DrawerTrigger};
|
|
2
|
+
//# sourceMappingURL=drawer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/drawer.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport { Drawer as DrawerPrimitive } from 'vaul'\nimport { Cross2Icon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/utils.js'\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot=\"drawer\" {...props} />\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot=\"drawer-portal\" {...props} />\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n 'data-[state=open]:ai-animate-in data-[state=closed]:ai-animate-out data-[state=closed]:ai-fade-out-0 data-[state=open]:ai-fade-in-0 ai-fixed ai-inset-0 ai-z-50 ai-bg-black/50',\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n 'group/drawer-content ai-bg-background ai-fixed ai-z-50 ai-flex ai-px-6 ai-h-auto ai-flex-col',\n 'data-[vaul-drawer-direction=top]:ai-inset-x-0 data-[vaul-drawer-direction=top]:ai-top-0 data-[vaul-drawer-direction=top]:ai-mb-24 data-[vaul-drawer-direction=top]:ai-max-h-[80vh] data-[vaul-drawer-direction=top]:ai-border-b',\n 'data-[vaul-drawer-direction=bottom]:ai-inset-x-0 data-[vaul-drawer-direction=bottom]:ai-bottom-0 data-[vaul-drawer-direction=bottom]:ai-mt-24 data-[vaul-drawer-direction=bottom]:ai-max-h-[80vh] data-[vaul-drawer-direction=bottom]:ai-border-t',\n 'data-[vaul-drawer-direction=right]:ai-inset-y-0 data-[vaul-drawer-direction=right]:ai-right-0 data-[vaul-drawer-direction=right]:ai-w-3/4 data-[vaul-drawer-direction=right]:ai-border-l data-[vaul-drawer-direction=right]:ai-max-w-sm',\n 'data-[vaul-drawer-direction=left]:ai-inset-y-0 data-[vaul-drawer-direction=left]:ai-left-0 data-[vaul-drawer-direction=left]:ai-w-3/4 data-[vaul-drawer-direction=left]:ai-border-r data-[vaul-drawer-direction=left]:ai-max-w-sm',\n className\n )}\n {...props}\n >\n <div className=\"ai-bg-muted ai-mx-auto ai-mt-4 ai-hidden ai-h-2 ai-w-[100px] ai-shrink-0 group-data-[vaul-drawer-direction=bottom]/drawer-content:ai-block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, children, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn('gird-container ai-flex ai-justify-between ai-py-6 gap-1.5', className)}\n {...props}\n >\n <div>{children}</div>\n <DrawerClose>\n <Cross2Icon className=\"ai-size-4\" />\n </DrawerClose>\n </div>\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"drawer-footer\"\n className={cn('ai-mt-auto ai-flex ai-flex-col ai-gap-2 ai-py-8', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn('text-foreground font-semibold', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn('ai-text-muted-foreground ai-text-sm', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n"],
|
|
5
|
+
"mappings": "AAOS,cAAAA,EAgCH,QAAAC,MAhCG,oBAPT,MAAkB,QAClB,OAAS,UAAUC,MAAuB,OAC1C,OAAS,cAAAC,MAAkB,wBAE3B,OAAS,MAAAC,MAAU,sBAEnB,SAASC,EAAO,CAAE,GAAGC,CAAM,EAAsD,CAC/E,OAAON,EAACE,EAAgB,KAAhB,CAAqB,YAAU,SAAU,GAAGI,EAAO,CAC7D,CAEA,SAASC,EAAc,CAAE,GAAGD,CAAM,EAAyD,CACzF,OAAON,EAACE,EAAgB,QAAhB,CAAwB,YAAU,iBAAkB,GAAGI,EAAO,CACxE,CAEA,SAASE,EAAa,CAAE,GAAGF,CAAM,EAAwD,CACvF,OAAON,EAACE,EAAgB,OAAhB,CAAuB,YAAU,gBAAiB,GAAGI,EAAO,CACtE,CAEA,SAASG,EAAY,CAAE,GAAGH,CAAM,EAAuD,CACrF,OAAON,EAACE,EAAgB,MAAhB,CAAsB,YAAU,eAAgB,GAAGI,EAAO,CACpE,CAEA,SAASI,EAAc,CAAE,UAAAC,EAAW,GAAGL,CAAM,EAAyD,CACpG,OACEN,EAACE,EAAgB,QAAhB,CACC,YAAU,iBACV,UAAWE,EACT,iLACAO,CACF,EACC,GAAGL,EACN,CAEJ,CAEA,SAASM,EAAc,CAAE,UAAAD,EAAW,SAAAE,EAAU,GAAGP,CAAM,EAAyD,CAC9G,OACEL,EAACO,EAAA,CAAa,YAAU,gBACtB,UAAAR,EAACU,EAAA,EAAc,EACfT,EAACC,EAAgB,QAAhB,CACC,YAAU,iBACV,UAAWE,EACT,+FACA,kOACA,oPACA,0OACA,oOACAO,CACF,EACC,GAAGL,EAEJ,UAAAN,EAAC,OAAI,UAAU,6IAA6I,EAC3Ja,GACH,GACF,CAEJ,CAEA,SAASC,EAAa,CAAE,UAAAH,EAAW,SAAAE,EAAU,GAAGP,CAAM,EAAgC,CACpF,OACEL,EAAC,OACC,YAAU,gBACV,UAAWG,EAAG,4DAA6DO,CAAS,EACnF,GAAGL,EAEJ,UAAAN,EAAC,OAAK,SAAAa,EAAS,EACfb,EAACS,EAAA,CACC,SAAAT,EAACG,EAAA,CAAW,UAAU,YAAY,EACpC,GACF,CAEJ,CAEA,SAASY,EAAa,CAAE,UAAAJ,EAAW,GAAGL,CAAM,EAAgC,CAC1E,OACEN,EAAC,OACC,YAAU,gBACV,UAAWI,EAAG,kDAAmDO,CAAS,EACzE,GAAGL,EACN,CAEJ,CAEA,SAASU,EAAY,CAAE,UAAAL,EAAW,GAAGL,CAAM,EAAuD,CAChG,OACEN,EAACE,EAAgB,MAAhB,CACC,YAAU,eACV,UAAWE,EAAG,gCAAiCO,CAAS,EACvD,GAAGL,EACN,CAEJ,CAEA,SAASW,EAAkB,CAAE,UAAAN,EAAW,GAAGL,CAAM,EAA6D,CAC5G,OACEN,EAACE,EAAgB,YAAhB,CACC,YAAU,qBACV,UAAWE,EAAG,sCAAuCO,CAAS,EAC7D,GAAGL,EACN,CAEJ",
|
|
6
|
+
"names": ["jsx", "jsxs", "DrawerPrimitive", "Cross2Icon", "cn", "Drawer", "props", "DrawerTrigger", "DrawerPortal", "DrawerClose", "DrawerOverlay", "className", "DrawerContent", "children", "DrawerHeader", "DrawerFooter", "DrawerTitle", "DrawerDescription"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
3
|
+
declare const DropdownMenu: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuProps & React.RefAttributes<never>>;
|
|
4
|
+
declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
|
|
7
|
+
declare const DropdownMenuSub: React.FC<DropdownMenuPrimitive.DropdownMenuSubProps>;
|
|
8
|
+
declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DropdownMenuSubTrigger: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubTriggerProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
10
|
+
inset?: boolean;
|
|
11
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const DropdownMenuSubContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSubContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
+
declare const DropdownMenuItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
15
|
+
inset?: boolean;
|
|
16
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
17
|
+
declare const DropdownMenuCheckboxItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuCheckboxItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
declare const DropdownMenuRadioItem: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuRadioItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
19
|
+
declare const DropdownMenuLabel: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
20
|
+
inset?: boolean;
|
|
21
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
22
|
+
declare const DropdownMenuSeparator: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
23
|
+
declare const DropdownMenuShortcut: {
|
|
24
|
+
({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
export { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuGroup, DropdownMenuPortal, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuRadioGroup, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as a,jsxs as p}from"react/jsx-runtime";import i from"react";import*as e from"@radix-ui/react-dropdown-menu";import{CheckIcon as y,ChevronRightIcon as v,CircleIcon as M}from"@radix-ui/react-icons";import{cn as d}from"../helpers/index.js";const D=i.forwardRef(({children:o,...t})=>a(e.Root,{...t,children:o})),h=e.Trigger,P=e.Group,x=e.Portal,N=e.Sub,C=e.RadioGroup,m=i.forwardRef(({className:o,inset:t,children:n,...r},s)=>p(e.SubTrigger,{ref:s,className:d("flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",o),...r,children:[n,a(v,{className:"ml-auto"})]}));m.displayName=e.SubTrigger.displayName;const c=i.forwardRef(({className:o,...t},n)=>a(e.SubContent,{ref:n,className:d("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-primary-foreground p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",o),...t}));c.displayName=e.SubContent.displayName;const u=i.forwardRef(({className:o,sideOffset:t=4,...n},r)=>a(e.Portal,{children:a(e.Content,{ref:r,sideOffset:t,className:d("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-primary-foreground p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",o),...n})}));u.displayName=e.Content.displayName;const l=i.forwardRef(({className:o,inset:t,...n},r)=>a(e.Item,{ref:r,className:d("relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0 hover:text-brand-0",t&&"pl-8",o),...n}));l.displayName=e.Item.displayName;const f=i.forwardRef(({className:o,children:t,checked:n,...r},s)=>p(e.CheckboxItem,{ref:s,className:d("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o),checked:n,...r,children:[a("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a(e.ItemIndicator,{children:a(y,{className:"h-4 w-4"})})}),t]}));f.displayName=e.CheckboxItem.displayName;const w=i.forwardRef(({className:o,children:t,...n},r)=>p(e.RadioItem,{ref:r,className:d("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",o),...n,children:[a("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a(e.ItemIndicator,{children:a(M,{className:"h-2 w-2 fill-current"})})}),t]}));w.displayName=e.RadioItem.displayName;const R=i.forwardRef(({className:o,inset:t,...n},r)=>a(e.Label,{ref:r,className:d("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",o),...n}));R.displayName=e.Label.displayName;const b=i.forwardRef(({className:o,...t},n)=>a(e.Separator,{ref:n,className:d("-mx-1 my-1 h-px bg-muted",o),...t}));b.displayName=e.Separator.displayName;const g=({className:o,...t})=>a("span",{className:d("ml-auto text-xs tracking-widest opacity-60",o),...t});g.displayName="DropdownMenuShortcut";export{D as DropdownMenu,f as DropdownMenuCheckboxItem,u as DropdownMenuContent,P as DropdownMenuGroup,l as DropdownMenuItem,R as DropdownMenuLabel,x as DropdownMenuPortal,C as DropdownMenuRadioGroup,w as DropdownMenuRadioItem,b as DropdownMenuSeparator,g as DropdownMenuShortcut,N as DropdownMenuSub,c as DropdownMenuSubContent,m as DropdownMenuSubTrigger,h as DropdownMenuTrigger};
|
|
2
|
+
//# sourceMappingURL=drop-down.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/drop-down.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport React, { useState } from 'react'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport { CheckIcon, ChevronRightIcon, CircleIcon } from '@radix-ui/react-icons'\nimport { cn } from '../helpers/index.js'\n\nconst DropdownMenu = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Root>\n>(({ children, ...props }) => {\n return <DropdownMenuPrimitive.Root {...props}>{children}</DropdownMenuPrimitive.Root>\n})\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & { inset?: boolean }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-primary-foreground p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]',\n className\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-primary-foreground p-1 text-popover-foreground shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]',\n className\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0 hover:text-brand-0',\n inset && 'pl-8',\n className\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n className\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CircleIcon className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ElementRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('-mx-1 my-1 h-px bg-muted', className)} {...props} />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "DropdownMenuPrimitive", "CheckIcon", "ChevronRightIcon", "CircleIcon", "cn", "DropdownMenu", "children", "props", "DropdownMenuTrigger", "DropdownMenuGroup", "DropdownMenuPortal", "DropdownMenuSub", "DropdownMenuRadioGroup", "DropdownMenuSubTrigger", "className", "inset", "ref", "DropdownMenuSubContent", "DropdownMenuContent", "sideOffset", "DropdownMenuItem", "DropdownMenuCheckboxItem", "checked", "DropdownMenuRadioItem", "DropdownMenuLabel", "DropdownMenuSeparator", "DropdownMenuShortcut"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
interface GridProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
interface GridItemProps {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
className?: string;
|
|
10
|
+
span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
11
|
+
start?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
12
|
+
end?: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
|
|
13
|
+
}
|
|
14
|
+
declare const Grid: React.ForwardRefExoticComponent<GridProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
+
declare const GridItem: React.ForwardRefExoticComponent<GridItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
16
|
+
export { Grid, GridItem };
|
|
17
|
+
export type { GridProps, GridItemProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import a from"react";import{cn as l}from"../helpers/utils.js";const i={1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},m={1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4",5:"col-start-5",6:"col-start-6",7:"col-start-7",8:"col-start-8",9:"col-start-9",10:"col-start-10",11:"col-start-11",12:"col-start-12"},f={2:"col-end-2",3:"col-end-3",4:"col-end-4",5:"col-end-5",6:"col-end-6",7:"col-end-7",8:"col-end-8",9:"col-end-9",10:"col-end-10",11:"col-end-11",12:"col-end-12",13:"col-end-13"},r=a.forwardRef(({className:o,children:s},c)=>d("div",{ref:c,className:l("grid grid-cols-12 gap-3 md:gap-4",o),children:s}));r.displayName="Grid";const n=a.forwardRef(({className:o,children:s,span:c=12,start:t,end:e},p)=>d("div",{ref:p,className:l(i[c],t&&m[t],e&&f[e],o),children:s}));n.displayName="GridItem";export{r as Grid,n as GridItem};
|
|
2
|
+
//# sourceMappingURL=gird.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/gird.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport type { ReactNode } from 'react'\nimport { cn } from '../helpers/utils.js'\n\ntype Element = React.ElementRef<'div'>\n\ninterface GridProps {\n children?: ReactNode\n className?: string\n}\n\ninterface GridItemProps {\n children?: ReactNode\n className?: string\n span?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 // \u9650\u5236\u4E3A\u5177\u4F53\u7684\u6570\u5B57\u7C7B\u578B\n start?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 // \u8D77\u59CB\u5217\u4F4D\u7F6E\n end?: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 // \u7ED3\u675F\u5217\u4F4D\u7F6E\n}\n\nconst colSpanClasses = {\n 1: 'col-span-1',\n 2: 'col-span-2',\n 3: 'col-span-3',\n 4: 'col-span-4',\n 5: 'col-span-5',\n 6: 'col-span-6',\n 7: 'col-span-7',\n 8: 'col-span-8',\n 9: 'col-span-9',\n 10: 'col-span-10',\n 11: 'col-span-11',\n 12: 'col-span-12',\n} as const\n\nconst colStartClasses = {\n 1: 'col-start-1',\n 2: 'col-start-2',\n 3: 'col-start-3',\n 4: 'col-start-4',\n 5: 'col-start-5',\n 6: 'col-start-6',\n 7: 'col-start-7',\n 8: 'col-start-8',\n 9: 'col-start-9',\n 10: 'col-start-10',\n 11: 'col-start-11',\n 12: 'col-start-12',\n} as const\n\nconst colEndClasses = {\n 2: 'col-end-2',\n 3: 'col-end-3',\n 4: 'col-end-4',\n 5: 'col-end-5',\n 6: 'col-end-6',\n 7: 'col-end-7',\n 8: 'col-end-8',\n 9: 'col-end-9',\n 10: 'col-end-10',\n 11: 'col-end-11',\n 12: 'col-end-12',\n 13: 'col-end-13',\n} as const\n\nconst Grid = React.forwardRef<Element, GridProps>(({ className, children }, forwardedRef) => {\n return <div ref={forwardedRef} className={cn(\"grid grid-cols-12 gap-3 md:gap-4\", className)}>{children}</div>\n})\nGrid.displayName = 'Grid'\n\nconst GridItem = React.forwardRef<Element, GridItemProps>(\n ({ className, children, span = 12, start, end }, forwardedRef) => {\n return (\n <div\n ref={forwardedRef}\n className={cn(\n colSpanClasses[span],\n start && colStartClasses[start],\n end && colEndClasses[end],\n className\n )}\n >\n {children}\n </div>\n )\n }\n)\nGridItem.displayName = 'GridItem'\n\nexport { Grid, GridItem }\nexport type { GridProps, GridItemProps }\n"],
|
|
5
|
+
"mappings": "AAiES,cAAAA,MAAA,oBAjET,OAAOC,MAAW,QAElB,OAAS,MAAAC,MAAU,sBAiBnB,MAAMC,EAAiB,CACrB,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,EAAG,aACH,GAAI,cACJ,GAAI,cACJ,GAAI,aACN,EAEMC,EAAkB,CACtB,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,GAAI,eACJ,GAAI,eACJ,GAAI,cACN,EAEMC,EAAgB,CACpB,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,EAAG,YACH,GAAI,aACJ,GAAI,aACJ,GAAI,aACJ,GAAI,YACN,EAEMC,EAAOL,EAAM,WAA+B,CAAC,CAAE,UAAAM,EAAW,SAAAC,CAAS,EAAGC,IACnET,EAAC,OAAI,IAAKS,EAAc,UAAWP,EAAG,mCAAoCK,CAAS,EAAI,SAAAC,EAAS,CACxG,EACDF,EAAK,YAAc,OAEnB,MAAMI,EAAWT,EAAM,WACrB,CAAC,CAAE,UAAAM,EAAW,SAAAC,EAAU,KAAAG,EAAO,GAAI,MAAAC,EAAO,IAAAC,CAAI,EAAGJ,IAE7CT,EAAC,OACC,IAAKS,EACL,UAAWP,EACTC,EAAeQ,CAAI,EACnBC,GAASR,EAAgBQ,CAAK,EAC9BC,GAAOR,EAAcQ,CAAG,EACxBN,CACF,EAEC,SAAAC,EACH,CAGN,EACAE,EAAS,YAAc",
|
|
6
|
+
"names": ["jsx", "React", "cn", "colSpanClasses", "colStartClasses", "colEndClasses", "Grid", "className", "children", "forwardedRef", "GridItem", "span", "start", "end"]
|
|
7
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const headingVariants: (props?: ({
|
|
4
|
-
size?:
|
|
4
|
+
size?: 1 | 2 | 3 | 4 | 5 | null | undefined;
|
|
5
5
|
weight?: "bold" | "light" | "normal" | "medium" | null | undefined;
|
|
6
|
-
align?: "
|
|
6
|
+
align?: "left" | "right" | "center" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
8
8
|
interface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {
|
|
9
9
|
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{cn as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{cn as x}from"../helpers/index.js";import{Slot as y}from"@radix-ui/react-slot";import{cva as P}from"class-variance-authority";import u from"react";const H=P("leading-tight tracking text-info-primary",{variants:{size:{1:"text-heading-1",2:"text-heading-2",3:"text-heading-3",4:"text-hedaing-4",5:"text-heading-5"},weight:{light:"font-light",normal:"font-normal",medium:"font-medium",bold:"font-bold"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{size:5,weight:"normal"}}),i=u.forwardRef((r,l)=>{const{children:t,className:s,size:h=5,align:g,weight:d,asChild:m,as:p="h1",color:e,html:n,...f}=r,a=n?{dangerouslySetInnerHTML:{__html:n}}:null,c=e?{style:{color:e}}:null;return o(y,{...f,ref:l,className:x(H({size:h,weight:d,align:g}),s),...a,...c,children:m?t:o(p,{children:a?null:t})})});i.displayName="Heading";export{i as Heading};
|
|
2
2
|
//# sourceMappingURL=heading.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/heading.tsx"],
|
|
4
|
-
"sourcesContent": ["import { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\n\nconst headingVariants = cva('
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\n\nconst headingVariants = cva('leading-tight tracking text-info-primary', {\n variants: {\n size: {\n 1: 'text-heading-1',\n 2: 'text-heading-2',\n 3: 'text-heading-3',\n 4: 'text-hedaing-4',\n 5: 'text-heading-5',\n },\n weight: {\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n bold: 'font-bold',\n },\n align: {\n left: 'text-left',\n center: 'text-center',\n right: 'text-right',\n },\n },\n defaultVariants: {\n size: 5,\n weight: 'normal',\n },\n})\n\ntype HeadingElement = React.ElementRef<'h1'>\n\ninterface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n asChild?: boolean\n color?: string\n html?: string\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>((props, forwardedRef) => {\n const { children, className, size = 5, align, weight, asChild, as: Tag = 'h1', color, html, ...headingProps } = props\n const htmlContentProps = html\n ? {\n dangerouslySetInnerHTML: { __html: html },\n }\n : null\n\n const styleProps = color\n ? {\n style: {\n color,\n },\n }\n : null\n return (\n <Slot\n {...headingProps}\n ref={forwardedRef}\n className={cn(\n headingVariants({\n size,\n weight,\n align,\n }),\n className\n )}\n {...htmlContentProps}\n {...styleProps}\n >\n {asChild ? children : <Tag>{htmlContentProps ? null : children}</Tag>}\n </Slot>\n )\n})\n\nHeading.displayName = 'Heading'\n\nexport { Heading }\nexport type { HeadingProps }\n"],
|
|
5
|
+
"mappings": "AAuE4B,cAAAA,MAAA,oBAvE5B,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAW,QAElB,MAAMC,EAAkBF,EAAI,2CAA4C,CACtE,SAAU,CACR,KAAM,CACJ,EAAG,iBACH,EAAG,iBACH,EAAG,iBACH,EAAG,iBACH,EAAG,gBACL,EACA,OAAQ,CACN,MAAO,aACP,OAAQ,cACR,OAAQ,cACR,KAAM,WACR,EACA,MAAO,CACL,KAAM,YACN,OAAQ,cACR,MAAO,YACT,CACF,EACA,gBAAiB,CACf,KAAM,EACN,OAAQ,QACV,CACF,CAAC,EAWKG,EAAUF,EAAM,WAAyC,CAACG,EAAOC,IAAiB,CACtF,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,KAAAC,EAAO,EAAG,MAAAC,EAAO,OAAAC,EAAQ,QAAAC,EAAS,GAAIC,EAAM,KAAM,MAAAC,EAAO,KAAAC,EAAM,GAAGC,CAAa,EAAIX,EAC1GY,EAAmBF,EACrB,CACA,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACE,KAEEG,EAAaJ,EACf,CACA,MAAO,CACL,MAAAA,CACF,CACF,EACE,KACJ,OACEhB,EAACE,EAAA,CACE,GAAGgB,EACJ,IAAKV,EACL,UAAWP,EACTI,EAAgB,CACd,KAAAM,EACA,OAAAE,EACA,MAAAD,CACF,CAAC,EACDF,CACF,EACC,GAAGS,EACH,GAAGC,EAEH,SAAAN,EAAUL,EAAWT,EAACe,EAAA,CAAK,SAAAI,EAAmB,KAAOV,EAAS,EACjE,CAEJ,CAAC,EAEDH,EAAQ,YAAc",
|
|
6
6
|
"names": ["jsx", "cn", "Slot", "cva", "React", "headingVariants", "Heading", "props", "forwardedRef", "children", "className", "size", "align", "weight", "asChild", "Tag", "color", "html", "headingProps", "htmlContentProps", "styleProps"]
|
|
7
7
|
}
|
|
@@ -6,8 +6,19 @@ export { default as Skeleton } from './skeleton.js';
|
|
|
6
6
|
export * from './dialog.js';
|
|
7
7
|
export * from './popover.js';
|
|
8
8
|
export * from './radio.js';
|
|
9
|
-
export * from './dialog.js';
|
|
10
9
|
export * from './text.js';
|
|
10
|
+
export * from './gird.js';
|
|
11
11
|
export * from './heading.js';
|
|
12
|
+
export * from './container.js';
|
|
13
|
+
export * from './color.js';
|
|
14
|
+
export * from './drawer.js';
|
|
15
|
+
export * from './link.js';
|
|
16
|
+
export * from './avatar.js';
|
|
17
|
+
export * from './input-number.js';
|
|
18
|
+
export * from './drop-down.js';
|
|
19
|
+
export * from './card.js';
|
|
20
|
+
export * from './carousel.js';
|
|
21
|
+
export * from './tabs.js';
|
|
22
|
+
export * from './alert.js';
|
|
12
23
|
export { default as Picture } from './picture.js';
|
|
13
24
|
export { default as Theme } from './theme.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{default as e}from"./button.js";import{default as f}from"./badge.js";export*from"./input.js";import{default as
|
|
1
|
+
import{default as e}from"./button.js";import{default as f}from"./badge.js";export*from"./input.js";import{default as p}from"./checkbox.js";import{default as u}from"./skeleton.js";export*from"./dialog.js";export*from"./popover.js";export*from"./radio.js";export*from"./text.js";export*from"./gird.js";export*from"./heading.js";export*from"./container.js";export*from"./color.js";export*from"./drawer.js";export*from"./link.js";export*from"./avatar.js";export*from"./input-number.js";export*from"./drop-down.js";export*from"./card.js";export*from"./carousel.js";export*from"./tabs.js";export*from"./alert.js";import{default as w}from"./picture.js";import{default as z}from"./theme.js";export{f as Badge,e as Button,p as Checkbox,w as Picture,u as Skeleton,z as Theme};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport * from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport * from './dialog.js'\nexport * from './popover.js'\nexport * from './radio.js'\nexport * from './text.js'\nexport * from './gird.js'\nexport * from './heading.js'\nexport * from './container.js'\nexport * from './color.js'\nexport * from './drawer.js'\nexport * from './link.js'\nexport * from './avatar.js'\nexport * from './input-number.js'\nexport * from './drop-down.js'\nexport * from './card.js'\nexport * from './carousel.js'\nexport * from './tabs.js'\nexport * from './alert.js'\nexport { default as Picture } from './picture.js'\nexport { default as Theme } from './theme.js'\n"],
|
|
5
|
+
"mappings": "AAAA,OAAoB,WAAXA,MAAyB,cAClC,OAAoB,WAAXA,MAAwB,aACjC,WAAc,aAEd,OAAoB,WAAXA,MAA2B,gBAEpC,OAAoB,WAAXA,MAA2B,gBACpC,WAAc,cACd,WAAc,eACd,WAAc,aACd,WAAc,YACd,WAAc,YACd,WAAc,eACd,WAAc,iBACd,WAAc,aACd,WAAc,cACd,WAAc,YACd,WAAc,cACd,WAAc,oBACd,WAAc,iBACd,WAAc,YACd,WAAc,gBACd,WAAc,YACd,WAAc,aACd,OAAoB,WAAXA,MAA0B,eACnC,OAAoB,WAAXA,MAAwB",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { KeyboardEvent, FocusEvent } from 'react';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
5
|
+
declare const InputNumberVariants: (props?: ({
|
|
6
|
+
status?: "default" | "error" | "success" | "warning" | null | undefined;
|
|
7
|
+
disabled?: boolean | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
9
|
+
type ColorType = 'default' | 'success' | 'warning' | 'error' | null;
|
|
10
|
+
type InputNumberProps = {
|
|
11
|
+
/** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
/** 类名*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/** 输入框下方提示文本,会根据不同的 status 呈现不同的样式*/
|
|
16
|
+
tips?: string;
|
|
17
|
+
/** 文本框状态*/
|
|
18
|
+
status?: ColorType;
|
|
19
|
+
/** 数字输入框的值 */
|
|
20
|
+
value?: number;
|
|
21
|
+
/** 数字输入框的初始值 */
|
|
22
|
+
defaultValue?: number;
|
|
23
|
+
/** 数值改变步数 */
|
|
24
|
+
step?: number;
|
|
25
|
+
/** 最小值 */
|
|
26
|
+
min?: number;
|
|
27
|
+
/** 最大值 */
|
|
28
|
+
max?: number;
|
|
29
|
+
/** 是否禁用*/
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
/** 是否只读*/
|
|
32
|
+
readonly?: boolean;
|
|
33
|
+
/** 样式*/
|
|
34
|
+
style?: React.CSSProperties;
|
|
35
|
+
/** 值变化时触发*/
|
|
36
|
+
onChange?: (value: number) => void;
|
|
37
|
+
/** 失去焦点时触发*/
|
|
38
|
+
onBlur?: (value: number, e: FocusEvent) => void;
|
|
39
|
+
/** 按下回车键时触发*/
|
|
40
|
+
onEnter?: (value: number, e: KeyboardEvent) => void;
|
|
41
|
+
} & VariantProps<typeof InputNumberVariants> & ComponentPropsWithout<'div', RemovedProps>;
|
|
42
|
+
declare const InputNumber: React.ForwardRefExoticComponent<{
|
|
43
|
+
/** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
/** 类名*/
|
|
46
|
+
className?: string;
|
|
47
|
+
/** 输入框下方提示文本,会根据不同的 status 呈现不同的样式*/
|
|
48
|
+
tips?: string;
|
|
49
|
+
/** 文本框状态*/
|
|
50
|
+
status?: ColorType;
|
|
51
|
+
/** 数字输入框的值 */
|
|
52
|
+
value?: number;
|
|
53
|
+
/** 数字输入框的初始值 */
|
|
54
|
+
defaultValue?: number;
|
|
55
|
+
/** 数值改变步数 */
|
|
56
|
+
step?: number;
|
|
57
|
+
/** 最小值 */
|
|
58
|
+
min?: number;
|
|
59
|
+
/** 最大值 */
|
|
60
|
+
max?: number;
|
|
61
|
+
/** 是否禁用*/
|
|
62
|
+
disabled?: boolean;
|
|
63
|
+
/** 是否只读*/
|
|
64
|
+
readonly?: boolean;
|
|
65
|
+
/** 样式*/
|
|
66
|
+
style?: React.CSSProperties;
|
|
67
|
+
/** 值变化时触发*/
|
|
68
|
+
onChange?: (value: number) => void;
|
|
69
|
+
/** 失去焦点时触发*/
|
|
70
|
+
onBlur?: (value: number, e: FocusEvent) => void;
|
|
71
|
+
/** 按下回车键时触发*/
|
|
72
|
+
onEnter?: (value: number, e: KeyboardEvent) => void;
|
|
73
|
+
} & VariantProps<(props?: ({
|
|
74
|
+
status?: "default" | "error" | "success" | "warning" | null | undefined;
|
|
75
|
+
disabled?: boolean | null | undefined;
|
|
76
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string> & ComponentPropsWithout<"div", RemovedProps> & React.RefAttributes<HTMLDivElement>>;
|
|
77
|
+
export default InputNumber;
|
|
78
|
+
export type { InputNumberProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{Fragment as O,jsx as o,jsxs as x}from"react/jsx-runtime";import{cn as c}from"../helpers/index.js";import{Slot as q}from"@radix-ui/react-slot";import{PlusIcon as z,MinusIcon as B}from"@radix-ui/react-icons";import{useState as D,useEffect as H,forwardRef as L}from"react";import{cva as W}from"class-variance-authority";const j=W("size-full border bg-transparent text-center text-base outline-none",{variants:{status:{default:"border-lines-1 group-hover:border-lines-2",success:"border-lines-3 group-hover:border-lines-3",warning:"border-lines-4 group-hover:border-lines-4",error:"border-lines-5 group-hover:border-lines-5"},disabled:{true:"border-lines-1 group-hover:border-lines-1 text-info-quaternary cursor-not-allowed"}}}),h=L(({value:b,defaultValue:w=0,step:p=1,min:n=0,max:u,tips:d,style:v,children:E,asChild:m=!1,disabled:r=!1,readonly:s=!1,status:N="default",className:I,onChange:f,onBlur:g,onEnter:C},V)=>{const[l,a]=D(w),P=m?q:"div",y=c("border-lines-1 flex size-12 items-center justify-center border text-base",{"group-hover:border-lines-2":!r,"text-info-quaternary cursor-not-allowed":r}),R=(e,t)=>t?"text-lines-1":{default:"text-lines-1",success:"text-lines-3",warning:"text-lines-4",error:"text-lines-5"}[e||"default"],M=e=>e===""||/^[0-9]+$/.test(e),T=e=>{if(r||s)return;const t=e.target.value;if(M(t)&&(a(t),t!=="")){let i=Number(t);u!==void 0&&i>u&&(i=u),n!==void 0&&i<n&&(i=n),f?.(i)}},K=e=>{if(!(r||s))if(l===""||isNaN(Number(l))){const t=n!==void 0?n:0;a(t),g?.(t,e)}else{const t=Number(l);a(t),g?.(t,e)}},S=()=>{if(r||s)return;let e=Number(l)+(p?Math.ceil(Number(p)):1);u!==void 0&&e>u&&(e=u),a(e),f?.(e)},k=()=>{if(r||s)return;let e=Number(l)-(p?Math.ceil(Number(p)):1);n!==void 0&&e<n&&(e=n),a(e),f?.(e)},F=e=>{if(!(r||s)&&e.key==="Enter"){const t=e.target?.value;C?.(t,e)}};return H(()=>{a(b||0)},[b]),o(P,{ref:V,...v?{style:v}:null,className:c({"group flex items-center":!m},I),children:m?E:x(O,{children:[o("button",{onClick:S,className:y,children:o(z,{})}),x("div",{className:"relative mx-1.5 h-[52px] w-[105px]",children:[o("input",{type:"text",value:l,disabled:r,readOnly:s,onBlur:K,onKeyDown:F,onChange:T,className:c(j({status:N,disabled:r}))}),d?o("span",{className:c(R(N,r),"absolute -bottom-4 left-0 w-full truncate text-xs"),children:d}):null]}),o("button",{onClick:k,className:y,children:o(B,{})})]})})});h.displayName="InputNumber";var X=h;export{X as default};
|
|
2
|
+
//# sourceMappingURL=input-number.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/input-number.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { PlusIcon, MinusIcon } from '@radix-ui/react-icons'\nimport React, { useState, useEffect, forwardRef } from 'react'\nimport type { ChangeEvent, KeyboardEvent, FocusEvent } from 'react'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\n// \u5B9A\u4E49 InputNumber \u7684\u6837\u5F0F\u53D8\u4F53\nconst InputNumberVariants = cva('size-full border bg-transparent text-center text-base outline-none', {\n variants: {\n status: {\n default: 'border-lines-1 group-hover:border-lines-2',\n success: 'border-lines-3 group-hover:border-lines-3',\n warning: 'border-lines-4 group-hover:border-lines-4',\n error: 'border-lines-5 group-hover:border-lines-5',\n },\n disabled: {\n true: 'border-lines-1 group-hover:border-lines-1 text-info-quaternary cursor-not-allowed',\n },\n },\n})\n\ntype ColorType = 'default' | 'success' | 'warning' | 'error' | null\n\n// \u5B9A\u4E49\u7EC4\u4EF6\u7C7B\u578B\uFF0C\u7EE7\u627F div \u6807\u7B7E\u6807\u51C6\u5C5E\u6027\ntype InputNumberElement = React.ElementRef<'div'>\n\ntype InputNumberProps = {\n /** \u5B9A\u4E49\u5B50\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B,\u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n asChild?: boolean\n /** \u7C7B\u540D*/\n className?: string\n /** \u8F93\u5165\u6846\u4E0B\u65B9\u63D0\u793A\u6587\u672C\uFF0C\u4F1A\u6839\u636E\u4E0D\u540C\u7684 status \u5448\u73B0\u4E0D\u540C\u7684\u6837\u5F0F*/\n tips?: string\n /** \u6587\u672C\u6846\u72B6\u6001*/\n status?: ColorType\n /** \u6570\u5B57\u8F93\u5165\u6846\u7684\u503C */\n value?: number\n /** \u6570\u5B57\u8F93\u5165\u6846\u7684\u521D\u59CB\u503C */\n defaultValue?: number\n /** \u6570\u503C\u6539\u53D8\u6B65\u6570 */\n step?: number\n /** \u6700\u5C0F\u503C */\n min?: number\n /** \u6700\u5927\u503C */\n max?: number\n /** \u662F\u5426\u7981\u7528*/\n disabled?: boolean\n /** \u662F\u5426\u53EA\u8BFB*/\n readonly?: boolean\n /** \u6837\u5F0F*/\n style?: React.CSSProperties\n /** \u503C\u53D8\u5316\u65F6\u89E6\u53D1*/\n onChange?: (value: number) => void\n /** \u5931\u53BB\u7126\u70B9\u65F6\u89E6\u53D1*/\n onBlur?: (value: number, e: FocusEvent) => void\n /** \u6309\u4E0B\u56DE\u8F66\u952E\u65F6\u89E6\u53D1*/\n onEnter?: (value: number, e: KeyboardEvent) => void\n} & VariantProps<typeof InputNumberVariants> &\n ComponentPropsWithout<'div', RemovedProps>\n\nconst InputNumber = forwardRef<InputNumberElement, InputNumberProps>(\n (\n {\n value,\n defaultValue = 0,\n step = 1,\n min = 0,\n max,\n tips,\n style,\n children,\n asChild = false,\n disabled = false,\n readonly = false,\n status = 'default',\n className,\n onChange,\n onBlur,\n onEnter,\n },\n ref\n ) => {\n const [inputValue, setInputValue] = useState<number | string>(defaultValue)\n\n const Comp = asChild ? Slot : 'div'\n\n const baseClassName = cn('border-lines-1 flex size-12 items-center justify-center border text-base', {\n 'group-hover:border-lines-2': !disabled,\n 'text-info-quaternary cursor-not-allowed': disabled,\n })\n\n const textColor = (type: ColorType, flag: boolean) => {\n if (flag) return 'text-lines-1'\n return {\n default: 'text-lines-1',\n success: 'text-lines-3',\n warning: 'text-lines-4',\n error: 'text-lines-5',\n }[type || 'default']\n }\n\n const isValue = (params: string) => {\n return params === '' || /^[0-9]+$/.test(params)\n }\n\n const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n if (disabled || readonly) return\n const value = e.target.value\n // \u5141\u8BB8\u7A7A\u5B57\u7B26\u4E32\uFF0C\u6216\u4EC5\u5305\u542B\u6574\u6570\u7684\u5B57\u7B26\u4E32\n if (isValue(value)) {\n setInputValue(value)\n if (value !== '') {\n let newValue = Number(value)\n if (max !== undefined && newValue > max) {\n newValue = max\n }\n if (min !== undefined && newValue < min) {\n newValue = min\n }\n onChange?.(newValue)\n }\n }\n }\n\n const handleBlur = (e: FocusEvent<HTMLInputElement>) => {\n if (disabled || readonly) return\n if (inputValue === '' || isNaN(Number(inputValue))) {\n const newValue = min !== undefined ? min : 0\n setInputValue(newValue)\n onBlur?.(newValue, e)\n } else {\n const newValue = Number(inputValue)\n setInputValue(newValue)\n onBlur?.(newValue, e)\n }\n }\n\n const increment = () => {\n if (disabled || readonly) return\n let newValue = Number(inputValue) + (step ? Math.ceil(Number(step)) : 1)\n if (max !== undefined && newValue > max) {\n newValue = max\n }\n setInputValue(newValue)\n onChange?.(newValue)\n }\n\n const decrement = () => {\n if (disabled || readonly) return\n let newValue = Number(inputValue) - (step ? Math.ceil(Number(step)) : 1)\n if (min !== undefined && newValue < min) {\n newValue = min\n }\n setInputValue(newValue)\n onChange?.(newValue)\n }\n\n const handleKeyDown = (e: any) => {\n if (disabled || readonly) return\n if (e.key === 'Enter') {\n const initalValue = e.target?.value\n onEnter?.(initalValue, e)\n }\n }\n\n useEffect(() => {\n setInputValue(value || 0)\n }, [value])\n\n return (\n <Comp\n ref={ref}\n {...(style ? { style: style } : null)}\n className={cn({ 'group flex items-center': !asChild }, className)}\n >\n {asChild ? (\n children\n ) : (\n <>\n <button onClick={increment} className={baseClassName}>\n <PlusIcon />\n </button>\n <div className=\"relative mx-1.5 h-[52px] w-[105px]\">\n <input\n type=\"text\"\n value={inputValue}\n disabled={disabled}\n readOnly={readonly}\n onBlur={handleBlur}\n onKeyDown={handleKeyDown}\n onChange={handleInputChange}\n className={cn(InputNumberVariants({ status, disabled }))}\n />\n {tips ? (\n <span className={cn(textColor(status, disabled), 'absolute -bottom-4 left-0 w-full truncate text-xs')}>\n {tips}\n </span>\n ) : null}\n </div>\n <button onClick={decrement} className={baseClassName}>\n <MinusIcon />\n </button>\n </>\n )}\n </Comp>\n )\n }\n)\n\nInputNumber.displayName = 'InputNumber'\n\nexport default InputNumber\nexport type { InputNumberProps }\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "cn", "Slot", "PlusIcon", "MinusIcon", "useState", "useEffect", "forwardRef", "cva", "InputNumberVariants", "InputNumber", "value", "defaultValue", "step", "min", "max", "tips", "style", "children", "asChild", "disabled", "readonly", "status", "className", "onChange", "onBlur", "onEnter", "ref", "inputValue", "setInputValue", "Comp", "baseClassName", "textColor", "type", "flag", "isValue", "params", "handleInputChange", "newValue", "handleBlur", "increment", "decrement", "handleKeyDown", "initalValue", "input_number_default"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as l,jsxs as m}from"react/jsx-runtime";import*as p from"react";import{cn as s}from"../helpers/index.js";import{cva as f}from"class-variance-authority";const a=f("border-input w-full bg-background focus-visible:outline-none flex flex-row items-center overflow-hidden rounded-md border",{variants:{size:{sm:"h-8 text-sm",base:"h-10",lg:"h-12 text-lg"}},defaultVariants:{size:"base"}}),d=p.forwardRef((t,o)=>{const{className:r,side:e="right",children:n,...i}=t;return l("div",{ref:o,...i,className:s("flex h-full items-center",r,{"-order-1":e==="left","order-2":e==="right"}),children:n})}),u=p.forwardRef(({className:t,type:o,size:r,children:e,...n},i)=>p.isValidElement(e)?m("div",{className:s(a({size:r}),t),children:[l("input",{type:o,className:s("placeholder:text-muted-foreground flex size-full file:border-0 file:bg-transparent file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 px-3"),ref:i,...n}),e]}):l("input",{type:o,className:s(a({size:r}),"px-3",t),ref:i,...n}));u.displayName="Input",d.displayName="InputSlot";export{u as Input,d as InputSlot};
|
|
2
2
|
//# sourceMappingURL=input.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/input.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst inputVariants = cva(\n '
|
|
5
|
-
"mappings": "aA0CI,cAAAA,EAmBE,QAAAC,MAnBF,oBAxCJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAgBD,EACpB,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst inputVariants = cva(\n 'border-input w-full bg-background focus-visible:outline-none flex flex-row items-center overflow-hidden rounded-md border',\n {\n variants: {\n size: {\n sm: 'h-8 text-sm',\n base: 'h-10',\n lg: 'h-12 text-lg',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\nexport interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {}\n\ntype InputSlotElement = React.ElementRef<'div'>\ninterface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {\n /**\n * \u63D2\u69FD\u7684\u4F4D\u7F6E\n * default: right\n */\n side?: 'left' | 'right'\n}\n\n/**\n * InputSlot\n * \u7528\u6765\u5728 Input \u7EC4\u4EF6\u4E2D\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9\uFF0C\u6BD4\u5982icon \uFF0C\u6309\u94AE\n */\nconst InputSlot = React.forwardRef<InputSlotElement, InputSlotProps>((props, forwardedRef) => {\n const { className, side = 'right', children, ...slotProps } = props\n\n return (\n <div\n ref={forwardedRef}\n {...slotProps}\n className={cn('flex h-full items-center', className, {\n '-order-1': side === 'left',\n 'order-2': side === 'right',\n })}\n >\n {children}\n </div>\n )\n})\n\nconst Input = React.forwardRef<React.ElementRef<'input'>, InputProps>(\n ({ className, type, size, children, ...props }, ref) => {\n if (!React.isValidElement(children)) {\n return <input type={type} className={cn(inputVariants({ size }), 'px-3', className)} ref={ref} {...props} />\n }\n return (\n <div className={cn(inputVariants({ size }), className)}>\n <input\n type={type}\n className={cn(\n 'placeholder:text-muted-foreground flex size-full file:border-0 file:bg-transparent file:font-medium focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 px-3'\n )}\n ref={ref}\n {...props}\n />\n {children}\n </div>\n )\n }\n)\nInput.displayName = 'Input'\nInputSlot.displayName = 'InputSlot'\n\nexport { Input, InputSlot }\n"],
|
|
5
|
+
"mappings": "aA0CI,cAAAA,EAmBE,QAAAC,MAnBF,oBAxCJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAgBD,EACpB,4HACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,KAAM,OACN,GAAI,cACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAiBME,EAAYJ,EAAM,WAA6C,CAACK,EAAOC,IAAiB,CAC5F,KAAM,CAAE,UAAAC,EAAW,KAAAC,EAAO,QAAS,SAAAC,EAAU,GAAGC,CAAU,EAAIL,EAE9D,OACEP,EAAC,OACC,IAAKQ,EACJ,GAAGI,EACJ,UAAWT,EAAG,2BAA4BM,EAAW,CACnD,WAAYC,IAAS,OACrB,UAAWA,IAAS,OACtB,CAAC,EAEA,SAAAC,EACH,CAEJ,CAAC,EAEKE,EAAQX,EAAM,WAClB,CAAC,CAAE,UAAAO,EAAW,KAAAK,EAAM,KAAAC,EAAM,SAAAJ,EAAU,GAAGJ,CAAM,EAAGS,IACzCd,EAAM,eAAeS,CAAQ,EAIhCV,EAAC,OAAI,UAAWE,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAGN,CAAS,EACnD,UAAAT,EAAC,SACC,KAAMc,EACN,UAAWX,EACT,qLACF,EACA,IAAKa,EACJ,GAAGT,EACN,EACCI,GACH,EAbOX,EAAC,SAAM,KAAMc,EAAM,UAAWX,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAG,OAAQN,CAAS,EAAG,IAAKO,EAAM,GAAGT,EAAO,CAgBhH,EACAM,EAAM,YAAc,QACpBP,EAAU,YAAc",
|
|
6
6
|
"names": ["jsx", "jsxs", "React", "cn", "cva", "inputVariants", "InputSlot", "props", "forwardedRef", "className", "side", "children", "slotProps", "Input", "type", "size", "ref"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
5
|
+
declare const linkVariants: (props?: ({
|
|
6
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
7
|
+
underline?: "none" | "always" | "hover" | null | undefined;
|
|
8
|
+
hoverColor?: "none" | "hover" | null | undefined;
|
|
9
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
10
|
+
type LinkProps = {
|
|
11
|
+
/** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
|
|
12
|
+
asChild?: boolean;
|
|
13
|
+
/** 类名*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/** 禁用链接 */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** 后置图标*/
|
|
18
|
+
suffixIcon?: ReactNode;
|
|
19
|
+
/** 跳转链接*/
|
|
20
|
+
href?: string;
|
|
21
|
+
/** 样式*/
|
|
22
|
+
style?: React.CSSProperties;
|
|
23
|
+
/** 点击事件,禁用状态无法触发*/
|
|
24
|
+
onClick?: Function;
|
|
25
|
+
} & VariantProps<typeof linkVariants> & ComponentPropsWithout<'a', RemovedProps>;
|
|
26
|
+
declare const Link: React.ForwardRefExoticComponent<{
|
|
27
|
+
/** 定义子组件作为父组件的类型,详细使用方式请参考radix-ui */
|
|
28
|
+
asChild?: boolean;
|
|
29
|
+
/** 类名*/
|
|
30
|
+
className?: string;
|
|
31
|
+
/** 禁用链接 */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/** 后置图标*/
|
|
34
|
+
suffixIcon?: ReactNode;
|
|
35
|
+
/** 跳转链接*/
|
|
36
|
+
href?: string;
|
|
37
|
+
/** 样式*/
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
/** 点击事件,禁用状态无法触发*/
|
|
40
|
+
onClick?: Function;
|
|
41
|
+
} & VariantProps<(props?: ({
|
|
42
|
+
size?: "small" | "medium" | "large" | null | undefined;
|
|
43
|
+
underline?: "none" | "always" | "hover" | null | undefined;
|
|
44
|
+
hoverColor?: "none" | "hover" | null | undefined;
|
|
45
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string> & ComponentPropsWithout<"a", RemovedProps> & React.RefAttributes<HTMLAnchorElement>>;
|
|
46
|
+
export default Link;
|
|
47
|
+
export type { LinkProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Fragment as R,jsx as s,jsxs as x}from"react/jsx-runtime";import h from"react";import{Slot as C}from"@radix-ui/react-slot";import{cn as v}from"../helpers/index.js";import{cva as y}from"class-variance-authority";const P=y("tracking transition-colors",{variants:{size:{small:"text-xs",medium:"text-sm",large:"text-base"},underline:{none:"no-underline",hover:"hover:underline",always:"underline"},hoverColor:{none:"text-current",hover:"hover:text-brand-0"}}}),a=h.forwardRef(({children:i,size:l="small",hoverColor:p,className:m,asChild:c=!1,href:o,style:t,underline:f,disabled:e=!1,suffixIcon:n,onClick:u,...k},d)=>s(c?C:"a",{ref:d,onClick:r=>{if(!e&&u?.(r),e||!o){r.preventDefault();return}},href:e?void 0:o,className:v(P({size:l,underline:f,hoverColor:p}),m,{"flex items-center":n,"cursor-pointer":!e,"text-info-quaternary cursor-not-allowed":e}),...t?{style:t}:null,...k,children:x(R,{children:[i,s("span",{className:"svg",children:n})]})}));a.displayName="Link";var S=a;export{S as default};
|
|
2
|
+
//# sourceMappingURL=link.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/link.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport type { ReactNode } from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../helpers/index.js'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\n// \u5B9A\u4E49 link \u7684\u6837\u5F0F\u53D8\u4F53\nconst linkVariants = cva('tracking transition-colors', {\n variants: {\n size: {\n small: 'text-xs', // \u5C0F\n medium: 'text-sm', // \u4E2D\n large: 'text-base', // \u5927\n },\n underline: {\n none: 'no-underline', // \u4E0D\u5C55\u793A\n hover: 'hover:underline', // hover\u5C55\u793A\u4E0B\u5212\u7EBF\n always: 'underline', // \u6C38\u4E45\u5C55\u793A\n },\n hoverColor: {\n none: 'text-current', // \u9F20\u6807\u8FDB\u5165\u65E0\u53D8\u5316\n hover: 'hover:text-brand-0', // \u9F20\u6807\u8FDB\u5165\u6539\u53D8\u5B57\u4F53\u989C\u8272\n },\n },\n})\n// \u5B9A\u4E49\u7EC4\u4EF6\u7C7B\u578B\uFF0C\u7EE7\u627F a \u6807\u7B7E\u6807\u51C6\u5C5E\u6027\ntype LinkElement = React.ElementRef<'a'>\ntype LinkProps = {\n /** \u5B9A\u4E49\u5B50\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B,\u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n asChild?: boolean\n /** \u7C7B\u540D*/\n className?: string\n /** \u7981\u7528\u94FE\u63A5 */\n disabled?: boolean\n /** \u540E\u7F6E\u56FE\u6807*/\n suffixIcon?: ReactNode\n /** \u8DF3\u8F6C\u94FE\u63A5*/\n href?: string\n /** \u6837\u5F0F*/\n style?: React.CSSProperties\n /** \u70B9\u51FB\u4E8B\u4EF6\uFF0C\u7981\u7528\u72B6\u6001\u65E0\u6CD5\u89E6\u53D1*/\n onClick?: Function\n} & VariantProps<typeof linkVariants> &\n ComponentPropsWithout<'a', RemovedProps>\n\nconst Link = React.forwardRef<LinkElement, LinkProps>(\n (\n {\n children,\n size = 'small',\n hoverColor,\n className,\n asChild = false,\n href,\n style,\n underline,\n disabled = false,\n suffixIcon,\n onClick,\n ...props // \u8FD9\u91CC\u4F1A\u5305\u542B href\u3001target\u3001rel \u7B49\u6807\u51C6 anchor \u5C5E\u6027\n }: LinkProps,\n forwardedRef\n ) => {\n const Comp = asChild ? Slot : 'a'\n\n const handleClick = (event: React.MouseEvent<HTMLAnchorElement>) => {\n !disabled && onClick?.(event)\n if (disabled || !href) {\n event.preventDefault()\n return\n }\n }\n\n return (\n <Comp\n ref={forwardedRef}\n onClick={handleClick}\n href={disabled ? undefined : href}\n className={cn(linkVariants({ size, underline, hoverColor }), className, {\n 'flex items-center': suffixIcon,\n 'cursor-pointer': !disabled,\n 'text-info-quaternary cursor-not-allowed': disabled,\n })}\n {...(style ? { style: style } : null)}\n {...props}\n >\n <>\n {children}\n <span className=\"svg\">{suffixIcon}</span>\n </>\n </Comp>\n )\n }\n)\nLink.displayName = 'Link'\n\nexport default Link\nexport type { LinkProps }\n"],
|
|
5
|
+
"mappings": "AAuFQ,mBAAAA,EAEE,OAAAC,EAFF,QAAAC,MAAA,oBAvFR,OAAOC,MAAW,QAElB,OAAS,QAAAC,MAAY,uBACrB,OAAS,MAAAC,MAAU,sBACnB,OAA4B,OAAAC,MAAW,2BAIvC,MAAMC,EAAeD,EAAI,6BAA8B,CACrD,SAAU,CACR,KAAM,CACJ,MAAO,UACP,OAAQ,UACR,MAAO,WACT,EACA,UAAW,CACT,KAAM,eACN,MAAO,kBACP,OAAQ,WACV,EACA,WAAY,CACV,KAAM,eACN,MAAO,oBACT,CACF,CACF,CAAC,EAqBKE,EAAOL,EAAM,WACjB,CACE,CACE,SAAAM,EACA,KAAAC,EAAO,QACP,WAAAC,EACA,UAAAC,EACA,QAAAC,EAAU,GACV,KAAAC,EACA,MAAAC,EACA,UAAAC,EACA,SAAAC,EAAW,GACX,WAAAC,EACA,QAAAC,EACA,GAAGC,CACL,EACAC,IAaEpB,EAXWY,EAAUT,EAAO,IAW3B,CACC,IAAKiB,EACL,QAXiBC,GAA+C,CAElE,GADA,CAACL,GAAYE,IAAUG,CAAK,EACxBL,GAAY,CAACH,EAAM,CACrBQ,EAAM,eAAe,EACrB,MACF,CACF,EAMI,KAAML,EAAW,OAAYH,EAC7B,UAAWT,EAAGE,EAAa,CAAE,KAAAG,EAAM,UAAAM,EAAW,WAAAL,CAAW,CAAC,EAAGC,EAAW,CACtE,oBAAqBM,EACrB,iBAAkB,CAACD,EACnB,0CAA2CA,CAC7C,CAAC,EACA,GAAIF,EAAQ,CAAE,MAAOA,CAAM,EAAI,KAC/B,GAAGK,EAEJ,SAAAlB,EAAAF,EAAA,CACG,UAAAS,EACDR,EAAC,QAAK,UAAU,MAAO,SAAAiB,EAAW,GACpC,EACF,CAGN,EACAV,EAAK,YAAc,OAEnB,IAAOe,EAAQf",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "React", "Slot", "cn", "cva", "linkVariants", "Link", "children", "size", "hoverColor", "className", "asChild", "href", "style", "underline", "disabled", "suffixIcon", "onClick", "props", "forwardedRef", "event", "link_default"]
|
|
7
|
+
}
|
|
@@ -9,5 +9,5 @@ export interface PictureProps extends React.ImgHTMLAttributes<HTMLImageElement>
|
|
|
9
9
|
/** 响应式图片,对应picture 下source 的max-width */
|
|
10
10
|
deviceSizes?: number[];
|
|
11
11
|
}
|
|
12
|
-
declare const Picture: ({ imgClassName, source, quality, deviceSizes, ...rest }: PictureProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare const Picture: ({ imgClassName, source, quality, deviceSizes, className, ...rest }: PictureProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default Picture;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as d,jsxs as
|
|
1
|
+
"use client";import{jsx as d,jsxs as A}from"react/jsx-runtime";import{useCallback as f,useMemo as I}from"react";const M=["cdn.shopify.com","cdn.shopifycdn.net","www.facebook.com"],_=3960,x=3980,E=n=>M.some(c=>n==c),S=(n="")=>/\.(png|apng|jpg|jpeg|gif|svg|webp|tif)/.test(n),$=({imgClassName:n="",source:c="",quality:p=2,deviceSizes:u=[375,767,1023,1279,1439,1539,1919],className:h,...m})=>{const i=f(({src:e,width:r})=>{const s=r;try{const t=new URL(e);if(!E(t.hostname))return e;const o=t.pathname.split("/").pop()||"";if(S(o)&&!/_[0-9]{2,4}x/.test(e)){const[g,a]=o.split(".");return`${t.origin}${t.pathname.replace(o,`${g}_${s<_?s:x}x.${a}`)}`}}catch{return e}},[]),l=f(({srcArr:e,width:r})=>{const s=r*p,t=i({src:e[0][0],width:s});let o;return e.forEach(a=>{var b=a[0];a.length>1&&parseInt(a[1],10)>=r&&(o=i({src:b,width:s}))}),d("source",{srcSet:o||t,media:`(max-width: ${r}px)`},r)},[i,p]),w=I(()=>{if(typeof c!="string"||!c)return[];let e;try{e=c.replace(/[\r\n]/g,"").replace(/\s\s+/g," ").split(",").map(t=>t.split(" ").filter(Boolean))}catch(t){return console.log(t),[]}const r=u.map(t=>l({srcArr:e,width:t})),s=i({src:e[0][0],width:1920*p});return r.push(d("img",{src:s,className:`w-full ${n}`,...m},"default")),r},[u,n,i,p,m,c,l]);return A("picture",{className:`block overflow-hidden ${h}`,children:[w,m.children]})};var k=$;export{k as default};
|
|
2
2
|
//# sourceMappingURL=picture.js.map
|