@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
|
@@ -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 strict";"use client";var g=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var j=(s,o)=>{for(var a in o)g(s,a,{get:o[a],enumerable:!0})},O=(s,o,a,u)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of L(o))!W.call(s,n)&&n!==a&&g(s,n,{get:()=>o[n],enumerable:!(u=H(o,n))||u.enumerable});return s};var $=s=>O(g({},"__esModule",{value:!0}),s);var J={};j(J,{default:()=>G});module.exports=$(J);var r=require("react/jsx-runtime"),b=require("../helpers/index.js"),C=require("@radix-ui/react-slot"),d=require("@radix-ui/react-icons"),m=require("react"),V=require("class-variance-authority");const A=(0,V.cva)("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"}}}),I=(0,m.forwardRef)(({value:s,defaultValue:o=0,step:a=1,min:u=0,max:n,tips:y,style:h,children:P,asChild:v=!1,disabled:l=!1,readonly:i=!1,status:x="default",className:R,onChange:N,onBlur:w,onEnter:M},T)=>{const[p,c]=(0,m.useState)(o),K=v?C.Slot:"div",E=(0,b.cn)("border-lines-1 flex size-12 items-center justify-center border text-base",{"group-hover:border-lines-2":!l,"text-info-quaternary cursor-not-allowed":l}),S=(e,t)=>t?"text-lines-1":{default:"text-lines-1",success:"text-lines-3",warning:"text-lines-4",error:"text-lines-5"}[e||"default"],k=e=>e===""||/^[0-9]+$/.test(e),F=e=>{if(l||i)return;const t=e.target.value;if(k(t)&&(c(t),t!=="")){let f=Number(t);n!==void 0&&f>n&&(f=n),u!==void 0&&f<u&&(f=u),N?.(f)}},q=e=>{if(!(l||i))if(p===""||isNaN(Number(p))){const t=u!==void 0?u:0;c(t),w?.(t,e)}else{const t=Number(p);c(t),w?.(t,e)}},z=()=>{if(l||i)return;let e=Number(p)+(a?Math.ceil(Number(a)):1);n!==void 0&&e>n&&(e=n),c(e),N?.(e)},B=()=>{if(l||i)return;let e=Number(p)-(a?Math.ceil(Number(a)):1);u!==void 0&&e<u&&(e=u),c(e),N?.(e)},D=e=>{if(!(l||i)&&e.key==="Enter"){const t=e.target?.value;M?.(t,e)}};return(0,m.useEffect)(()=>{c(s||0)},[s]),(0,r.jsx)(K,{ref:T,...h?{style:h}:null,className:(0,b.cn)({"group flex items-center":!v},R),children:v?P:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:z,className:E,children:(0,r.jsx)(d.PlusIcon,{})}),(0,r.jsxs)("div",{className:"relative mx-1.5 h-[52px] w-[105px]",children:[(0,r.jsx)("input",{type:"text",value:p,disabled:l,readOnly:i,onBlur:q,onKeyDown:D,onChange:F,className:(0,b.cn)(A({status:x,disabled:l}))}),y?(0,r.jsx)("span",{className:(0,b.cn)(S(x,l),"absolute -bottom-4 left-0 w-full truncate text-xs"),children:y}):null]}),(0,r.jsx)("button",{onClick:B,className:E,children:(0,r.jsx)(d.MinusIcon,{})})]})})});I.displayName="InputNumber";var G=I;
|
|
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": ["input_number_exports", "__export", "input_number_default", "__toCommonJS", "import_jsx_runtime", "import_helpers", "import_react_slot", "import_react_icons", "import_react", "import_class_variance_authority", "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"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var h=Object.create;var
|
|
1
|
+
"use strict";"use client";var h=Object.create;var l=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var o in t)l(e,o,{get:t[o],enumerable:!0})},f=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of b(t))!P.call(e,r)&&r!==o&&l(e,r,{get:()=>t[r],enumerable:!(n=v(t,r))||n.enumerable});return e};var g=(e,t,o)=>(o=e!=null?h(x(e)):{},f(t||!e||!e.__esModule?l(o,"default",{value:e,enumerable:!0}):o,e)),R=e=>f(l({},"__esModule",{value:!0}),e);var y={};I(y,{Input:()=>u,InputSlot:()=>d});module.exports=R(y);var i=require("react/jsx-runtime"),a=g(require("react")),s=require("../helpers/index.js"),c=require("class-variance-authority");const m=(0,c.cva)("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=a.forwardRef((e,t)=>{const{className:o,side:n="right",children:r,...p}=e;return(0,i.jsx)("div",{ref:t,...p,className:(0,s.cn)("flex h-full items-center",o,{"-order-1":n==="left","order-2":n==="right"}),children:r})}),u=a.forwardRef(({className:e,type:t,size:o,children:n,...r},p)=>a.isValidElement(n)?(0,i.jsxs)("div",{className:(0,s.cn)(m({size:o}),e),children:[(0,i.jsx)("input",{type:t,className:(0,s.cn)("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:p,...r}),n]}):(0,i.jsx)("input",{type:t,className:(0,s.cn)(m({size:o}),"px-3",e),ref:p,...r}));u.displayName="Input",d.displayName="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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,cAAAC,IAAA,eAAAC,EAAAJ,GA0CI,IAAAK,EAAA,6BAxCJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAAuC,oCAEvC,MAAMC,KAAgB,OACpB,
|
|
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,cAAAC,IAAA,eAAAC,EAAAJ,GA0CI,IAAAK,EAAA,6BAxCJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAAuC,oCAEvC,MAAMC,KAAgB,OACpB,4HACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,KAAM,OACN,GAAI,cACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAiBMN,EAAYG,EAAM,WAA6C,CAACI,EAAOC,IAAiB,CAC5F,KAAM,CAAE,UAAAC,EAAW,KAAAC,EAAO,QAAS,SAAAC,EAAU,GAAGC,CAAU,EAAIL,EAE9D,SACE,OAAC,OACC,IAAKC,EACJ,GAAGI,EACJ,aAAW,MAAG,2BAA4BH,EAAW,CACnD,WAAYC,IAAS,OACrB,UAAWA,IAAS,OACtB,CAAC,EAEA,SAAAC,EACH,CAEJ,CAAC,EAEKZ,EAAQI,EAAM,WAClB,CAAC,CAAE,UAAAM,EAAW,KAAAI,EAAM,KAAAC,EAAM,SAAAH,EAAU,GAAGJ,CAAM,EAAGQ,IACzCZ,EAAM,eAAeQ,CAAQ,KAIhC,QAAC,OAAI,aAAW,MAAGL,EAAc,CAAE,KAAAQ,CAAK,CAAC,EAAGL,CAAS,EACnD,oBAAC,SACC,KAAMI,EACN,aAAW,MACT,qLACF,EACA,IAAKE,EACJ,GAAGR,EACN,EACCI,GACH,KAbO,OAAC,SAAM,KAAME,EAAM,aAAW,MAAGP,EAAc,CAAE,KAAAQ,CAAK,CAAC,EAAG,OAAQL,CAAS,EAAG,IAAKM,EAAM,GAAGR,EAAO,CAgBhH,EACAR,EAAM,YAAc,QACpBC,EAAU,YAAc",
|
|
6
6
|
"names": ["input_exports", "__export", "Input", "InputSlot", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_class_variance_authority", "inputVariants", "props", "forwardedRef", "className", "side", "children", "slotProps", "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
|
+
"use strict";var x=Object.create;var i=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var V=(e,o)=>{for(var t in o)i(e,t,{get:o[t],enumerable:!0})},f=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of N(o))!E.call(e,n)&&n!==t&&i(e,n,{get:()=>o[n],enumerable:!(s=L(o,n))||s.enumerable});return e};var w=(e,o,t)=>(t=e!=null?x(g(e)):{},f(o||!e||!e.__esModule?i(t,"default",{value:e,enumerable:!0}):t,e)),S=e=>f(i({},"__esModule",{value:!0}),e);var b={};V(b,{default:()=>W});module.exports=S(b);var r=require("react/jsx-runtime"),k=w(require("react")),d=require("@radix-ui/react-slot"),h=require("../helpers/index.js"),C=require("class-variance-authority");const M=(0,C.cva)("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"}}}),u=k.default.forwardRef(({children:e,size:o="small",hoverColor:t,className:s,asChild:n=!1,href:l,style:p,underline:v,disabled:a=!1,suffixIcon:m,onClick:y,...P},R)=>(0,r.jsx)(n?d.Slot:"a",{ref:R,onClick:c=>{if(!a&&y?.(c),a||!l){c.preventDefault();return}},href:a?void 0:l,className:(0,h.cn)(M({size:o,underline:v,hoverColor:t}),s,{"flex items-center":m,"cursor-pointer":!a,"text-info-quaternary cursor-not-allowed":a}),...p?{style:p}:null,...P,children:(0,r.jsxs)(r.Fragment,{children:[e,(0,r.jsx)("span",{className:"svg",children:m})]})}));u.displayName="Link";var W=u;
|
|
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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuFQ,IAAAI,EAAA,6BAvFRC,EAAkB,oBAElBC,EAAqB,gCACrBC,EAAmB,+BACnBC,EAAuC,oCAIvC,MAAMC,KAAe,OAAI,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,EAqBKC,EAAO,EAAAC,QAAM,WACjB,CACE,CACE,SAAAC,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,OAaE,OAXWR,EAAU,OAAO,IAW3B,CACC,IAAKQ,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,aAAW,MAAGR,EAAa,CAAE,KAAAI,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,gCACG,UAAAX,KACD,OAAC,QAAK,UAAU,MAAO,SAAAS,EAAW,GACpC,EACF,CAGN,EACAX,EAAK,YAAc,OAEnB,IAAOR,EAAQQ",
|
|
6
|
+
"names": ["link_exports", "__export", "link_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_react_slot", "import_helpers", "import_class_variance_authority", "linkVariants", "Link", "React", "children", "size", "hoverColor", "className", "asChild", "href", "style", "underline", "disabled", "suffixIcon", "onClick", "props", "forwardedRef", "event"]
|
|
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 strict";"use client";var
|
|
1
|
+
"use strict";"use client";var d=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var E=(e,t)=>{for(var n in t)d(e,n,{get:t[n],enumerable:!0})},S=(e,t,n,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of _(t))!x.call(e,o)&&o!==n&&d(e,o,{get:()=>t[o],enumerable:!(p=M(t,o))||p.enumerable});return e};var $=e=>S(d({},"__esModule",{value:!0}),e);var D={};E(D,{default:()=>N});module.exports=$(D);var g=require("react/jsx-runtime"),l=require("react");const A=["cdn.shopify.com","cdn.shopifycdn.net","www.facebook.com"],P=3960,L=3980,k=e=>A.some(t=>e==t),y=(e="")=>/\.(png|apng|jpg|jpeg|gif|svg|webp|tif)/.test(e),F=({imgClassName:e="",source:t="",quality:n=2,deviceSizes:p=[375,767,1023,1279,1439,1539,1919],className:o,...f})=>{const m=(0,l.useCallback)(({src:s,width:c})=>{const i=c;try{const r=new URL(s);if(!k(r.hostname))return s;const a=r.pathname.split("/").pop()||"";if(y(a)&&!/_[0-9]{2,4}x/.test(s)){const[w,u]=a.split(".");return`${r.origin}${r.pathname.replace(a,`${w}_${i<P?i:L}x.${u}`)}`}}catch{return s}},[]),h=(0,l.useCallback)(({srcArr:s,width:c})=>{const i=c*n,r=m({src:s[0][0],width:i});let a;return s.forEach(u=>{var I=u[0];u.length>1&&parseInt(u[1],10)>=c&&(a=m({src:I,width:i}))}),(0,g.jsx)("source",{srcSet:a||r,media:`(max-width: ${c}px)`},c)},[m,n]),b=(0,l.useMemo)(()=>{if(typeof t!="string"||!t)return[];let s;try{s=t.replace(/[\r\n]/g,"").replace(/\s\s+/g," ").split(",").map(r=>r.split(" ").filter(Boolean))}catch(r){return console.log(r),[]}const c=p.map(r=>h({srcArr:s,width:r})),i=m({src:s[0][0],width:1920*n});return c.push((0,g.jsx)("img",{src:i,className:`w-full ${e}`,...f},"default")),c},[p,e,m,n,f,t,h]);return(0,g.jsxs)("picture",{className:`block overflow-hidden ${o}`,children:[b,f.children]})};var N=F;
|
|
2
2
|
//# sourceMappingURL=picture.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/picture.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport React, { useCallback, useMemo } from 'react'\n\nconst APPEND_FILE_SUFFIX_MATCH_DOMAIN = ['cdn.shopify.com', 'cdn.shopifycdn.net', 'www.facebook.com']\n\nconst MAX_SIZE = 3960\nconst FIXED_MAX_SIZE = 3980\n\nexport interface PictureProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n /** picture \u5185\u90E8img \u6807\u7B7E\u7684\u7C7B\u540D */\n imgClassName?: string\n /** \u56FE\u7247url , \u652F\u6301\u4F20\u5165\u4E0D\u540C\u5206\u8FA8\u7387\u4E0B\u7684\u56FE\u7247\uFF0C\u6BD4\u5982\uFF0C\u683C\u5F0F \"url1 1920\uFF0C url2 1080, url3 767\" */\n source?: string\n /** \u56FE\u7247\u8D28\u91CF */\n quality?: number\n /** \u54CD\u5E94\u5F0F\u56FE\u7247\uFF0C\u5BF9\u5E94picture \u4E0Bsource \u7684max-width */\n deviceSizes?: number[]\n}\n\nconst isMatchDomain = (srcDomain: string) => {\n return APPEND_FILE_SUFFIX_MATCH_DOMAIN.some(domain => srcDomain == domain)\n}\nconst idMatchFileExtensions = (fileName: string = '') => /\\.(png|apng|jpg|jpeg|gif|svg|webp|tif)/.test(fileName)\n\nconst Picture = ({\n imgClassName = '',\n source = '',\n quality = 2,\n deviceSizes = [375, 767, 1023, 1279, 1439, 1539, 1919],\n ...rest\n}: PictureProps) => {\n const imgSrcSetsize = useCallback(({ src, width }: { src: string; width: number }) => {\n const size = width\n try {\n const parsedUrl = new URL(src)\n if (!isMatchDomain(parsedUrl.hostname)) {\n return src\n }\n const fileName = parsedUrl.pathname.split('/').pop() || ''\n if (idMatchFileExtensions(fileName) && !/_[0-9]{2,4}x/.test(src)) {\n const [name, extension] = fileName.split('.')\n return `${parsedUrl.origin}${parsedUrl.pathname.replace(\n fileName,\n `${name}_${size < MAX_SIZE ? size : FIXED_MAX_SIZE}x.${extension}`\n )}`\n }\n } catch (error) {\n return src\n }\n }, [])\n\n const sourceSrcSet = useCallback(\n ({ srcArr, width }: { srcArr: string[][]; width: number }) => {\n const computedWidth = width * quality\n const def = imgSrcSetsize({ src: srcArr[0][0], width: computedWidth })\n let result\n srcArr.forEach(ele => {\n var img = ele[0]\n if (ele.length > 1 && parseInt(ele[1], 10) >= width) {\n result = imgSrcSetsize({ src: img, width: computedWidth })\n }\n })\n const srcset = result || def\n return <source key={width} srcSet={srcset} media={`(max-width: ${width}px)`} />\n },\n [imgSrcSetsize, quality]\n )\n\n const sourceList = useMemo(() => {\n if (typeof source !== 'string' || !source) return []\n let srcArr\n try {\n srcArr = source\n .replace(/[\\r\\n]/g, '')\n .replace(/\\s\\s+/g, ' ')\n .split(',')\n .map(item => item.split(' ').filter(Boolean))\n } catch (error) {\n console.log(error)\n return []\n }\n const sourceList = deviceSizes.map(width => {\n return sourceSrcSet({ srcArr, width })\n })\n\n const img = imgSrcSetsize({ src: srcArr[0][0], width: 1920 * quality })\n\n sourceList.push(<img key=\"default\" src={img} className={`
|
|
5
|
-
"mappings": "sbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["picture_exports", "__export", "picture_default", "__toCommonJS", "import_jsx_runtime", "import_react", "APPEND_FILE_SUFFIX_MATCH_DOMAIN", "MAX_SIZE", "FIXED_MAX_SIZE", "isMatchDomain", "srcDomain", "domain", "idMatchFileExtensions", "fileName", "Picture", "imgClassName", "source", "quality", "deviceSizes", "rest", "imgSrcSetsize", "src", "width", "size", "parsedUrl", "name", "extension", "sourceSrcSet", "srcArr", "computedWidth", "def", "result", "ele", "img", "sourceList", "item", "error"]
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useCallback, useMemo } from 'react'\n\nconst APPEND_FILE_SUFFIX_MATCH_DOMAIN = ['cdn.shopify.com', 'cdn.shopifycdn.net', 'www.facebook.com']\n\nconst MAX_SIZE = 3960\nconst FIXED_MAX_SIZE = 3980\n\nexport interface PictureProps extends React.ImgHTMLAttributes<HTMLImageElement> {\n /** picture \u5185\u90E8img \u6807\u7B7E\u7684\u7C7B\u540D */\n imgClassName?: string\n /** \u56FE\u7247url , \u652F\u6301\u4F20\u5165\u4E0D\u540C\u5206\u8FA8\u7387\u4E0B\u7684\u56FE\u7247\uFF0C\u6BD4\u5982\uFF0C\u683C\u5F0F \"url1 1920\uFF0C url2 1080, url3 767\" */\n source?: string\n /** \u56FE\u7247\u8D28\u91CF */\n quality?: number\n /** \u54CD\u5E94\u5F0F\u56FE\u7247\uFF0C\u5BF9\u5E94picture \u4E0Bsource \u7684max-width */\n deviceSizes?: number[]\n}\n\nconst isMatchDomain = (srcDomain: string) => {\n return APPEND_FILE_SUFFIX_MATCH_DOMAIN.some(domain => srcDomain == domain)\n}\nconst idMatchFileExtensions = (fileName: string = '') => /\\.(png|apng|jpg|jpeg|gif|svg|webp|tif)/.test(fileName)\n\nconst Picture = ({\n imgClassName = '',\n source = '',\n quality = 2,\n deviceSizes = [375, 767, 1023, 1279, 1439, 1539, 1919],\n className,\n ...rest\n}: PictureProps) => {\n const imgSrcSetsize = useCallback(({ src, width }: { src: string; width: number }) => {\n const size = width\n try {\n const parsedUrl = new URL(src)\n if (!isMatchDomain(parsedUrl.hostname)) {\n return src\n }\n const fileName = parsedUrl.pathname.split('/').pop() || ''\n if (idMatchFileExtensions(fileName) && !/_[0-9]{2,4}x/.test(src)) {\n const [name, extension] = fileName.split('.')\n return `${parsedUrl.origin}${parsedUrl.pathname.replace(\n fileName,\n `${name}_${size < MAX_SIZE ? size : FIXED_MAX_SIZE}x.${extension}`\n )}`\n }\n } catch (error) {\n return src\n }\n }, [])\n\n const sourceSrcSet = useCallback(\n ({ srcArr, width }: { srcArr: string[][]; width: number }) => {\n const computedWidth = width * quality\n const def = imgSrcSetsize({ src: srcArr[0][0], width: computedWidth })\n let result\n srcArr.forEach(ele => {\n var img = ele[0]\n if (ele.length > 1 && parseInt(ele[1], 10) >= width) {\n result = imgSrcSetsize({ src: img, width: computedWidth })\n }\n })\n const srcset = result || def\n return <source key={width} srcSet={srcset} media={`(max-width: ${width}px)`} />\n },\n [imgSrcSetsize, quality]\n )\n\n const sourceList = useMemo(() => {\n if (typeof source !== 'string' || !source) return []\n let srcArr\n try {\n srcArr = source\n .replace(/[\\r\\n]/g, '')\n .replace(/\\s\\s+/g, ' ')\n .split(',')\n .map(item => item.split(' ').filter(Boolean))\n } catch (error) {\n console.log(error)\n return []\n }\n const sourceList = deviceSizes.map(width => {\n return sourceSrcSet({ srcArr, width })\n })\n\n const img = imgSrcSetsize({ src: srcArr[0][0], width: 1920 * quality })\n\n sourceList.push(<img key=\"default\" src={img} className={`w-full ${imgClassName}`} {...rest} />)\n return sourceList\n }, [deviceSizes, imgClassName, imgSrcSetsize, quality, rest, source, sourceSrcSet])\n\n return (\n <picture className={`block overflow-hidden ${className}`}>\n {sourceList}\n {rest.children}\n </picture>\n )\n}\nexport default Picture\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["picture_exports", "__export", "picture_default", "__toCommonJS", "import_jsx_runtime", "import_react", "APPEND_FILE_SUFFIX_MATCH_DOMAIN", "MAX_SIZE", "FIXED_MAX_SIZE", "isMatchDomain", "srcDomain", "domain", "idMatchFileExtensions", "fileName", "Picture", "imgClassName", "source", "quality", "deviceSizes", "className", "rest", "imgSrcSetsize", "src", "width", "size", "parsedUrl", "name", "extension", "sourceSrcSet", "srcArr", "computedWidth", "def", "result", "ele", "img", "sourceList", "item", "error"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var v=Object.create;var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var C=(o,t)=>{for(var e in t)n(o,e,{get:t[e],enumerable:!0})},p=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of g(t))!R.call(o,a)&&a!==e&&n(o,a,{get:()=>t[a],enumerable:!(r=c(t,a))||r.enumerable});return o};var m=(o,t,e)=>(e=o!=null?v(u(o)):{},p(t||!o||!o.__esModule?n(e,"default",{value:o,enumerable:!0}):e,o)),b=o=>p(n({},"__esModule",{value:!0}),o);var y={};C(y,{Popover:()=>l,PopoverContent:()=>d,PopoverTrigger:()=>P});module.exports=b(y);var s=require("react/jsx-runtime"),h=m(require("react")),i=m(require("@radix-ui/react-popover")),f=require("../helpers/utils.js");const l=i.Root,P=i.Trigger,d=h.forwardRef(({className:o,align:t="center",sideOffset:e=4,...r},a)=>(0,s.jsx)(i.Portal,{children:(0,s.jsx)(i.Content,{ref:a,align:t,sideOffset:e,className:(0,f.cn)("
|
|
1
|
+
"use strict";"use client";var v=Object.create;var n=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var C=(o,t)=>{for(var e in t)n(o,e,{get:t[e],enumerable:!0})},p=(o,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of g(t))!R.call(o,a)&&a!==e&&n(o,a,{get:()=>t[a],enumerable:!(r=c(t,a))||r.enumerable});return o};var m=(o,t,e)=>(e=o!=null?v(u(o)):{},p(t||!o||!o.__esModule?n(e,"default",{value:o,enumerable:!0}):e,o)),b=o=>p(n({},"__esModule",{value:!0}),o);var y={};C(y,{Popover:()=>l,PopoverContent:()=>d,PopoverTrigger:()=>P});module.exports=b(y);var s=require("react/jsx-runtime"),h=m(require("react")),i=m(require("@radix-ui/react-popover")),f=require("../helpers/utils.js");const l=i.Root,P=i.Trigger,d=h.forwardRef(({className:o,align:t="center",sideOffset:e=4,...r},a)=>(0,s.jsx)(i.Portal,{children:(0,s.jsx)(i.Content,{ref:a,align:t,sideOffset:e,className:(0,f.cn)("bg-popover text-popover-foreground 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 z-50 w-72 rounded-md border p-4 shadow-md outline-none",o),...r})}));d.displayName=i.Content.displayName;
|
|
2
2
|
//# sourceMappingURL=popover.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/popover.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\n\nimport { cn } from '../helpers/utils.js'\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n '
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,mBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAL,GAgBI,IAAAM,EAAA,6BAdJC,EAAuB,oBACvBC,EAAkC,sCAElCC,EAAmB,+BAEnB,MAAMP,EAAUM,EAAiB,KAE3BJ,EAAiBI,EAAiB,QAElCL,EAAiBI,EAAM,WAG3B,CAAC,CAAE,UAAAG,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,OAC5D,OAACN,EAAiB,OAAjB,CACC,mBAACA,EAAiB,QAAjB,CACC,IAAKM,EACL,MAAOH,EACP,WAAYC,EACZ,aAAW,MACT,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\n\nimport { cn } from '../helpers/utils.js'\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'bg-popover text-popover-foreground 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 z-50 w-72 rounded-md border p-4 shadow-md outline-none',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent }\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,mBAAAC,EAAA,mBAAAC,IAAA,eAAAC,EAAAL,GAgBI,IAAAM,EAAA,6BAdJC,EAAuB,oBACvBC,EAAkC,sCAElCC,EAAmB,+BAEnB,MAAMP,EAAUM,EAAiB,KAE3BJ,EAAiBI,EAAiB,QAElCL,EAAiBI,EAAM,WAG3B,CAAC,CAAE,UAAAG,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,OAC5D,OAACN,EAAiB,OAAjB,CACC,mBAACA,EAAiB,QAAjB,CACC,IAAKM,EACL,MAAOH,EACP,WAAYC,EACZ,aAAW,MACT,6aACAF,CACF,EACC,GAAGG,EACN,EACF,CACD,EACDV,EAAe,YAAcK,EAAiB,QAAQ",
|
|
6
6
|
"names": ["popover_exports", "__export", "Popover", "PopoverContent", "PopoverTrigger", "__toCommonJS", "import_jsx_runtime", "React", "PopoverPrimitive", "import_utils", "className", "align", "sideOffset", "props", "ref"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var x=Object.create;var s=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var C=(e,
|
|
1
|
+
"use strict";"use client";var x=Object.create;var s=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var C=(e,o)=>{for(var r in o)s(e,r,{get:o[r],enumerable:!0})},c=(e,o,r,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of g(o))!z.call(e,t)&&t!==r&&s(e,t,{get:()=>o[t],enumerable:!(a=y(o,t))||a.enumerable});return e};var R=(e,o,r)=>(r=e!=null?x(I(e)):{},c(o||!e||!e.__esModule?s(r,"default",{value:e,enumerable:!0}):r,e)),h=e=>c(s({},"__esModule",{value:!0}),e);var V={};C(V,{RadioGroup:()=>m,RadioGroupItem:()=>u});module.exports=h(V);var i=require("react/jsx-runtime"),p=R(require("react")),n=R(require("@radix-ui/react-radio-group")),P=require("./text.js"),G=require("@radix-ui/react-icons"),v=require("class-variance-authority"),d=require("../helpers/index.js");const l=p.createContext({size:"base"}),N=(0,v.cva)("border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",{variants:{size:{sm:"size-[14px]",base:"size-4",lg:"size-5"}},defaultVariants:{size:"base"}}),m=p.forwardRef(({className:e,children:o,size:r,...a},t)=>(0,i.jsx)(n.Root,{className:(0,d.cn)("grid gap-2",e),...a,ref:t,children:(0,i.jsx)(l.Provider,{value:{size:r},children:o})}));m.displayName="RadioGroup";const u=p.forwardRef(({className:e,size:o,children:r,...a},t)=>{const{size:b}=p.useContext(l),f=(0,i.jsx)(n.Item,{ref:t,className:(0,d.cn)(N({size:o??b}),e),...a,children:(0,i.jsx)(n.Indicator,{className:"flex items-center justify-center text-current w-full h-full",children:(0,i.jsx)(G.CheckIcon,{})})});return r?(0,i.jsxs)(P.Text,{as:"label",className:(0,d.cn)("flex items-center gap-1",e),children:[f,r]}):f});u.displayName="RadioGroupItem";
|
|
2
2
|
//# sourceMappingURL=radio.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/radio.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport { Text } from './text.js'\nimport { CheckIcon } from '@radix-ui/react-icons'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\nconst RadioContext = React.createContext<{ size?: 'sm' | 'base' | 'lg' }>({\n size: 'base',\n})\n\nconst radioGroupVariants = cva(\n '
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAsCQ,IAAAK,EAAA,6BApCRC,EAAuB,oBACvBC,EAAqC,0CACrCC,EAAqB,qBACrBC,EAA0B,iCAC1BC,EAAuC,oCACvCC,EAAmB,+BAEnB,MAAMC,EAAeN,EAAM,cAA+C,CACxE,KAAM,MACR,CAAC,EAEKO,KAAqB,OACzB,
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport { Text } from './text.js'\nimport { CheckIcon } from '@radix-ui/react-icons'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\nconst RadioContext = React.createContext<{ size?: 'sm' | 'base' | 'lg' }>({\n size: 'base',\n})\n\nconst radioGroupVariants = cva(\n 'border-primary text-primary ring-offset-background focus-visible:ring-ring aspect-square rounded-full border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',\n {\n variants: {\n size: {\n sm: 'size-[14px]',\n base: 'size-4',\n lg: 'size-5',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\ninterface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {\n /** \u5C3A\u5BF8 */\n size?: 'sm' | 'base' | 'lg'\n}\n\nconst RadioGroup = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Root>, RadioGroupProps>(\n ({ className, children, size, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref}>\n <RadioContext.Provider value={{ size }}>{children}</RadioContext.Provider>\n </RadioGroupPrimitive.Root>\n )\n }\n)\nRadioGroup.displayName = 'RadioGroup'\n\ninterface RadioGroupItemProps\n extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n VariantProps<typeof radioGroupVariants> {}\n\nconst RadioGroupItem = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Item>, RadioGroupItemProps>(\n ({ className, size, children, ...props }, ref) => {\n const { size: sizeFromParent } = React.useContext(RadioContext)\n\n const ItemRadio = (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n radioGroupVariants({\n size: size ?? sizeFromParent,\n }),\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"flex items-center justify-center text-current w-full h-full\">\n <CheckIcon />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n\n if (children) {\n return (\n <Text as=\"label\" className={cn('flex items-center gap-1', className)}>\n {ItemRadio}\n {children}\n </Text>\n )\n }\n return ItemRadio\n }\n)\nRadioGroupItem.displayName = 'RadioGroupItem'\n\nexport { RadioGroup, RadioGroupItem }\nexport type { RadioGroupProps, RadioGroupItemProps }\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAsCQ,IAAAK,EAAA,6BApCRC,EAAuB,oBACvBC,EAAqC,0CACrCC,EAAqB,qBACrBC,EAA0B,iCAC1BC,EAAuC,oCACvCC,EAAmB,+BAEnB,MAAMC,EAAeN,EAAM,cAA+C,CACxE,KAAM,MACR,CAAC,EAEKO,KAAqB,OACzB,gTACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,cACJ,KAAM,SACN,GAAI,QACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAOMX,EAAaI,EAAM,WACvB,CAAC,CAAE,UAAAQ,EAAW,SAAAC,EAAU,KAAAC,EAAM,GAAGC,CAAM,EAAGC,OAEtC,OAACX,EAAoB,KAApB,CAAyB,aAAW,MAAG,aAAcO,CAAS,EAAI,GAAGG,EAAO,IAAKC,EAChF,mBAACN,EAAa,SAAb,CAAsB,MAAO,CAAE,KAAAI,CAAK,EAAI,SAAAD,EAAS,EACpD,CAGN,EACAb,EAAW,YAAc,aAMzB,MAAMC,EAAiBG,EAAM,WAC3B,CAAC,CAAE,UAAAQ,EAAW,KAAAE,EAAM,SAAAD,EAAU,GAAGE,CAAM,EAAGC,IAAQ,CAChD,KAAM,CAAE,KAAMC,CAAe,EAAIb,EAAM,WAAWM,CAAY,EAExDQ,KACJ,OAACb,EAAoB,KAApB,CACC,IAAKW,EACL,aAAW,MACTL,EAAmB,CACjB,KAAMG,GAAQG,CAChB,CAAC,EACDL,CACF,EACC,GAAGG,EAEJ,mBAACV,EAAoB,UAApB,CAA8B,UAAU,8DACvC,mBAAC,cAAU,EACb,EACF,EAGF,OAAIQ,KAEA,QAAC,QAAK,GAAG,QAAQ,aAAW,MAAG,0BAA2BD,CAAS,EAChE,UAAAM,EACAL,GACH,EAGGK,CACT,CACF,EACAjB,EAAe,YAAc",
|
|
6
6
|
"names": ["radio_exports", "__export", "RadioGroup", "RadioGroupItem", "__toCommonJS", "import_jsx_runtime", "React", "RadioGroupPrimitive", "import_text", "import_react_icons", "import_class_variance_authority", "import_helpers", "RadioContext", "radioGroupVariants", "className", "children", "size", "props", "ref", "sizeFromParent", "ItemRadio"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";var b=Object.create;var
|
|
2
|
-
!
|
|
3
|
-
after:!
|
|
4
|
-
`,
|
|
1
|
+
"use strict";var b=Object.create;var l=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var S=(e,n)=>{for(var o in n)l(e,o,{get:n[o],enumerable:!0})},a=(e,n,o,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of u(n))!P.call(e,t)&&t!==o&&l(e,t,{get:()=>n[t],enumerable:!(r=k(n,t))||r.enumerable});return e};var v=(e,n,o)=>(o=e!=null?b(g(e)):{},a(n||!e||!e.__esModule?l(o,"default",{value:e,enumerable:!0}):o,e)),R=e=>a(l({},"__esModule",{value:!0}),e);var y={};S(y,{default:()=>h});module.exports=R(y);var m=require("react/jsx-runtime"),s=v(require("react")),p=require("../helpers/index.js"),d=require("@radix-ui/react-slot");const i=s.forwardRef((e,n)=>{const{children:o,className:r,loading:t=!0,...c}=e;if(!t)return o;const f=s.isValidElement(o)?d.Slot:"span";return(0,m.jsx)(f,{ref:n,className:(0,p.cn)(`bg-skeleton animate-pulse empty:block data-[inline-skeleton=true]:leading-[0] !bg-none !bg-clip-border !border-none !shadow-none
|
|
2
|
+
!text-transparent !outline-none !select-none !cursor-default !pointer-events-none !decoration-clone
|
|
3
|
+
after:!invisible before:!invisible [&>*]:!invisible
|
|
4
|
+
`,r),"data-inline-skeleton":s.isValidElement(o)?void 0:!0,tabIndex:-1,...c,children:o})});i.displayName="Skeleton";var h=i;
|
|
5
5
|
//# sourceMappingURL=skeleton.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/skeleton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\ntype SkeletonElement = React.ElementRef<'span'>\n\ninterface SkeletonProps extends ComponentPropsWithout<'span', RemovedProps> {\n /** \u662F\u5426\u6B63\u5728\u52A0\u8F7D , \u9ED8\u8BA4\u662Ftrue*/\n loading?: boolean\n}\n\nconst Skeleton = React.forwardRef<SkeletonElement, SkeletonProps>((props, forwardedRef) => {\n const { children, className, loading = true, ...skeletonProps } = props\n\n if (!loading) return children\n const Tag = React.isValidElement(children) ? Slot : 'span'\n\n return (\n <Tag\n ref={forwardedRef}\n className={cn(\n `
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\ntype SkeletonElement = React.ElementRef<'span'>\n\ninterface SkeletonProps extends ComponentPropsWithout<'span', RemovedProps> {\n /** \u662F\u5426\u6B63\u5728\u52A0\u8F7D , \u9ED8\u8BA4\u662Ftrue*/\n loading?: boolean\n}\n\nconst Skeleton = React.forwardRef<SkeletonElement, SkeletonProps>((props, forwardedRef) => {\n const { children, className, loading = true, ...skeletonProps } = props\n\n if (!loading) return children\n const Tag = React.isValidElement(children) ? Slot : 'span'\n\n return (\n <Tag\n ref={forwardedRef}\n className={cn(\n `bg-skeleton animate-pulse empty:block data-[inline-skeleton=true]:leading-[0] !bg-none !bg-clip-border !border-none !shadow-none \n !text-transparent !outline-none !select-none !cursor-default !pointer-events-none !decoration-clone\n after:!invisible before:!invisible [&>*]:!invisible\n `,\n className\n )}\n data-inline-skeleton={React.isValidElement(children) ? undefined : true}\n tabIndex={-1}\n {...skeletonProps}\n >\n {children}\n </Tag>\n )\n})\n\nSkeleton.displayName = 'Skeleton'\n\nexport default Skeleton\nexport type { SkeletonProps }\n"],
|
|
5
5
|
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmBI,IAAAI,EAAA,6BAnBJC,EAAuB,oBACvBC,EAAmB,+BACnBC,EAAqB,gCAUrB,MAAMC,EAAWH,EAAM,WAA2C,CAACI,EAAOC,IAAiB,CACzF,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,GAAM,GAAGC,CAAc,EAAIL,EAElE,GAAI,CAACI,EAAS,OAAOF,EACrB,MAAMI,EAAMV,EAAM,eAAeM,CAAQ,EAAI,OAAO,OAEpD,SACE,OAACI,EAAA,CACC,IAAKL,EACL,aAAW,MACT;AAAA;AAAA;AAAA,UAIAE,CACF,EACA,uBAAsBP,EAAM,eAAeM,CAAQ,EAAI,OAAY,GACnE,SAAU,GACT,GAAGG,EAEH,SAAAH,EACH,CAEJ,CAAC,EAEDH,EAAS,YAAc,WAEvB,IAAON,EAAQM",
|
|
6
6
|
"names": ["skeleton_exports", "__export", "skeleton_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_react_slot", "Skeleton", "props", "forwardedRef", "children", "className", "loading", "skeletonProps", "Tag"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TabsPrimitive from '@radix-ui/react-tabs';
|
|
3
|
+
declare const Tabs: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
4
|
+
algin?: "left" | "center" | "right";
|
|
5
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const TabsList: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsListProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const TabsContent: React.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";var y=Object.create;var f=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var x=(t,e)=>{for(var a in e)f(t,a,{get:e[a],enumerable:!0})},d=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of v(e))!u.call(t,n)&&n!==a&&f(t,n,{get:()=>e[n],enumerable:!(r=P(e,n))||r.enumerable});return t};var R=(t,e,a)=>(a=t!=null?y(C(t)):{},d(e||!t||!t.__esModule?f(a,"default",{value:t,enumerable:!0}):a,t)),N=t=>d(f({},"__esModule",{value:!0}),t);var L={};x(L,{Tabs:()=>m,TabsContent:()=>c,TabsList:()=>p,TabsTrigger:()=>b});module.exports=N(L);var s=require("react/jsx-runtime"),o=R(require("react")),l=require("../helpers/index.js"),i=R(require("@radix-ui/react-tabs")),T=require("class-variance-authority");const g=o.createContext({algin:"left"}),m=o.forwardRef(({children:t,algin:e="left",...a},r)=>(0,s.jsx)(i.Root,{ref:r,...a,children:(0,s.jsx)(g.Provider,{value:{algin:e},children:t})}));m.displayName="Tabs";const h=(0,T.cva)("",{variants:{algin:{left:"justify-left",center:"justify-center",right:"justify-end"}},defaultVariants:{algin:"left"}}),p=o.forwardRef(({className:t,...e},a)=>{const{algin:r}=o.useContext(g);return(0,s.jsx)(i.List,{ref:a,className:(0,l.cn)("border-b-lines flex gap-[24px] overflow-x-auto border-b",h({algin:r}),t),...e})});p.displayName=i.List.displayName;const b=o.forwardRef(({className:t,...e},a)=>(0,s.jsx)(i.Trigger,{ref:a,className:(0,l.cn)("border-b-brand-0 disabled:text-btn-secondary-disabled shrink-0 text-base font-bold data-[state=active]:border-b-[3px]",t),...e}));b.displayName=i.Trigger.displayName;const c=o.forwardRef(({className:t,...e},a)=>(0,s.jsx)(i.Content,{ref:a,className:(0,l.cn)(t),...e}));c.displayName=i.Content.displayName;
|
|
2
|
+
//# sourceMappingURL=tabs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/tabs.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\nimport * as TabsPrimitive from '@radix-ui/react-tabs'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst TabListContext = React.createContext<{ algin?: 'left' | 'center' | 'right' }>({\n algin: 'left',\n})\n\nconst Tabs = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> & { algin?: 'left' | 'center' | 'right' }\n>(({ children, algin = 'left', ...props }, ref) => (\n <TabsPrimitive.Root ref={ref} {...props}>\n <TabListContext.Provider value={{ algin }}>{children}</TabListContext.Provider>\n </TabsPrimitive.Root>\n))\nTabs.displayName = 'Tabs'\n\nconst tabsListVariants = cva('', {\n variants: {\n algin: {\n left: 'justify-left',\n center: 'justify-center',\n right: 'justify-end',\n },\n },\n defaultVariants: {\n algin: 'left',\n },\n})\n\nconst TabsList = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.List>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>\n>(({ className, ...props }, ref) => {\n const { algin: alginFromParent } = React.useContext(TabListContext)\n return (\n <TabsPrimitive.List\n ref={ref}\n className={cn(\n 'border-b-lines flex gap-[24px] overflow-x-auto border-b',\n tabsListVariants({\n algin: alginFromParent,\n }),\n className\n )}\n {...props}\n />\n )\n})\nTabsList.displayName = TabsPrimitive.List.displayName\n\nconst TabsTrigger = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>\n>(({ className, ...props }, ref) => (\n <TabsPrimitive.Trigger\n ref={ref}\n className={cn(\n 'border-b-brand-0 disabled:text-btn-secondary-disabled shrink-0 text-base font-bold data-[state=active]:border-b-[3px]',\n className\n )}\n {...props}\n />\n))\nTabsTrigger.displayName = TabsPrimitive.Trigger.displayName\n\nconst TabsContent = React.forwardRef<\n React.ElementRef<typeof TabsPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>\n>(({ className, ...props }, ref) => <TabsPrimitive.Content ref={ref} className={cn(className)} {...props} />)\nTabsContent.displayName = TabsPrimitive.Content.displayName\n\nexport { Tabs, TabsList, TabsTrigger, TabsContent }\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,EAAA,gBAAAC,EAAA,aAAAC,EAAA,gBAAAC,IAAA,eAAAC,EAAAN,GAiBI,IAAAO,EAAA,6BAfJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAA+B,mCAC/BC,EAAuC,oCAEvC,MAAMC,EAAiBJ,EAAM,cAAuD,CAClF,MAAO,MACT,CAAC,EAEKN,EAAOM,EAAM,WAGjB,CAAC,CAAE,SAAAK,EAAU,MAAAC,EAAQ,OAAQ,GAAGC,CAAM,EAAGC,OACzC,OAACN,EAAc,KAAd,CAAmB,IAAKM,EAAM,GAAGD,EAChC,mBAACH,EAAe,SAAf,CAAwB,MAAO,CAAE,MAAAE,CAAM,EAAI,SAAAD,EAAS,EACvD,CACD,EACDX,EAAK,YAAc,OAEnB,MAAMe,KAAmB,OAAI,GAAI,CAC/B,SAAU,CACR,MAAO,CACL,KAAM,eACN,OAAQ,iBACR,MAAO,aACT,CACF,EACA,gBAAiB,CACf,MAAO,MACT,CACF,CAAC,EAEKb,EAAWI,EAAM,WAGrB,CAAC,CAAE,UAAAU,EAAW,GAAGH,CAAM,EAAGC,IAAQ,CAClC,KAAM,CAAE,MAAOG,CAAgB,EAAIX,EAAM,WAAWI,CAAc,EAClE,SACE,OAACF,EAAc,KAAd,CACC,IAAKM,EACL,aAAW,MACT,0DACAC,EAAiB,CACf,MAAOE,CACT,CAAC,EACDD,CACF,EACC,GAAGH,EACN,CAEJ,CAAC,EACDX,EAAS,YAAcM,EAAc,KAAK,YAE1C,MAAML,EAAcG,EAAM,WAGxB,CAAC,CAAE,UAAAU,EAAW,GAAGH,CAAM,EAAGC,OAC1B,OAACN,EAAc,QAAd,CACC,IAAKM,EACL,aAAW,MACT,wHACAE,CACF,EACC,GAAGH,EACN,CACD,EACDV,EAAY,YAAcK,EAAc,QAAQ,YAEhD,MAAMP,EAAcK,EAAM,WAGxB,CAAC,CAAE,UAAAU,EAAW,GAAGH,CAAM,EAAGC,OAAQ,OAACN,EAAc,QAAd,CAAsB,IAAKM,EAAK,aAAW,MAAGE,CAAS,EAAI,GAAGH,EAAO,CAAE,EAC5GZ,EAAY,YAAcO,EAAc,QAAQ",
|
|
6
|
+
"names": ["tabs_exports", "__export", "Tabs", "TabsContent", "TabsList", "TabsTrigger", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "TabsPrimitive", "import_class_variance_authority", "TabListContext", "children", "algin", "props", "ref", "tabsListVariants", "className", "alginFromParent"]
|
|
7
|
+
}
|
|
@@ -2,10 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
3
|
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
4
4
|
declare const textVariants: (props?: ({
|
|
5
|
-
size?:
|
|
5
|
+
size?: 1 | 2 | 3 | null | undefined;
|
|
6
6
|
weight?: "bold" | "light" | "normal" | "medium" | "semibold" | null | undefined;
|
|
7
|
-
|
|
8
|
-
align?: "center" | "left" | "right" | null | undefined;
|
|
7
|
+
align?: "left" | "right" | "center" | null | undefined;
|
|
9
8
|
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
10
9
|
type TextSpanProps = {
|
|
11
10
|
as?: 'span';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var v=Object.create;var p=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var V=(t,e)=>{for(var o in e)p(t,o,{get:e[o],enumerable:!0})},x=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of C(e))!S.call(t,r)&&r!==o&&p(t,r,{get:()=>e[r],enumerable:!(s=b(e,r))||s.enumerable});return t};var W=(t,e,o)=>(o=t!=null?v(R(t)):{},x(e||!t||!t.__esModule?p(o,"default",{value:t,enumerable:!0}):o,t)),w=t=>x(p({},"__esModule",{value:!0}),t);var L={};V(L,{Text:()=>n});module.exports=w(L);var a=require("react/jsx-runtime"),z=W(require("react")),P=require("@radix-ui/react-slot"),d=require("../helpers/index.js"),f=require("class-variance-authority");const E=(0,f.cva)("tracking font-body",{variants:{size:{1:"text-text-1 text-info-primary",2:"text-text-2 text-info-primary",3:"text-text-3 text-info-primary"},weight:{light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},align:{left:"text-left",center:"text-center",right:"text-right"}},defaultVariants:{size:3,weight:"normal"}}),n=z.forwardRef((t,e)=>{const{children:o,size:s=3,weight:r,align:h,className:T,asChild:c,as:y="span",color:i,html:l,...g}=t,m=l?{dangerouslySetInnerHTML:{__html:l}}:null,u=i?{style:{color:i}}:null;return(0,a.jsx)(P.Slot,{...g,ref:e,className:(0,d.cn)(E({size:s,weight:r,align:h}),T),...m,...u,children:c?o:(0,a.jsx)(y,{children:m?null:o})})});n.displayName="Text";
|
|
2
2
|
//# sourceMappingURL=text.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/text.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React 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\nconst textVariants = cva('
|
|
5
|
-
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["text_exports", "__export", "Text", "__toCommonJS", "import_jsx_runtime", "React", "import_react_slot", "import_helpers", "import_class_variance_authority", "textVariants", "props", "forwardedRef", "children", "
|
|
4
|
+
"sourcesContent": ["import * as React 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\nconst textVariants = cva('tracking font-body', {\n variants: {\n size: {\n 1: 'text-text-1 text-info-primary',\n 2: 'text-text-2 text-info-primary',\n 3: 'text-text-3 text-info-primary',\n },\n weight: {\n light: 'font-light',\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\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: 3,\n weight: 'normal',\n },\n})\n\ntype TextElement = React.ElementRef<'span'>\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>\n\ninterface CommonTextProps extends VariantProps<typeof textVariants> {\n as?: 'div' | 'label' | 'p' | 'span'\n asChild?: boolean\n color?: string\n /** \u76F8\u5F53\u4E8E dangerouslySetInnerHTML */\n html?: string\n}\n\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps)\n\nconst Text = React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const {\n children,\n size = 3,\n weight,\n align,\n className,\n asChild,\n as: Tag = 'span',\n color,\n html,\n ...textProps\n } = props\n\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\n return (\n <Slot\n {...textProps}\n ref={forwardedRef}\n className={cn(\n textVariants({\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})\nText.displayName = 'Text'\n\nexport { Text }\nexport type { TextProps }\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GA2F4B,IAAAI,EAAA,6BA3F5BC,EAAuB,oBACvBC,EAAqB,gCACrBC,EAAmB,+BACnBC,EAAuC,oCAGvC,MAAMC,KAAe,OAAI,qBAAsB,CAC7C,SAAU,CACR,KAAM,CACJ,EAAG,gCACH,EAAG,gCACH,EAAG,+BACL,EACA,OAAQ,CACN,MAAO,aACP,OAAQ,cACR,OAAQ,cACR,SAAU,gBACV,KAAM,WACR,EACA,MAAO,CACL,KAAM,YACN,OAAQ,cACR,MAAO,YACT,CACF,EACA,gBAAiB,CACf,KAAM,EACN,OAAQ,QACV,CACF,CAAC,EAkBKP,EAAOG,EAAM,WAAmC,CAACK,EAAOC,IAAiB,CAC7E,KAAM,CACJ,SAAAC,EACA,KAAAC,EAAO,EACP,OAAAC,EACA,MAAAC,EACA,UAAAC,EACA,QAAAC,EACA,GAAIC,EAAM,OACV,MAAAC,EACA,KAAAC,EACA,GAAGC,CACL,EAAIX,EAEEY,EAAmBF,EACrB,CACA,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACE,KAEEG,EAAaJ,EACf,CACA,MAAO,CACL,MAAAA,CACF,CACF,EACE,KAEJ,SACE,OAAC,QACE,GAAGE,EACJ,IAAKV,EACL,aAAW,MACTF,EAAa,CACX,KAAAI,EACA,OAAAC,EACA,MAAAC,CACF,CAAC,EACDC,CACF,EACC,GAAGM,EACH,GAAGC,EAEH,SAAAN,EAAUL,KAAW,OAACM,EAAA,CAAK,SAAAI,EAAmB,KAAOV,EAAS,EACjE,CAEJ,CAAC,EACDV,EAAK,YAAc",
|
|
6
|
+
"names": ["text_exports", "__export", "Text", "__toCommonJS", "import_jsx_runtime", "React", "import_react_slot", "import_helpers", "import_class_variance_authority", "textVariants", "props", "forwardedRef", "children", "size", "weight", "align", "className", "asChild", "Tag", "color", "html", "textProps", "htmlContentProps", "styleProps"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Brand } from '../helpers/constants.js';
|
|
3
2
|
interface ThemeProps {
|
|
4
|
-
brand:
|
|
3
|
+
brand: string;
|
|
5
4
|
children: React.ReactNode;
|
|
6
5
|
}
|
|
7
6
|
/**
|
|
@@ -9,5 +8,5 @@ interface ThemeProps {
|
|
|
9
8
|
* @param param
|
|
10
9
|
* @returns
|
|
11
10
|
*/
|
|
12
|
-
declare const Theme: ({ brand, children }: ThemeProps) => import("react/jsx-runtime
|
|
11
|
+
declare const Theme: ({ brand, children }: ThemeProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export default Theme;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var m=Object.create;var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var i=(e,t)=>{for(var r in t)o(e,r,{get:t[r],enumerable:!0})},d=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of u(t))!f.call(e,a)&&a!==r&&o(e,a,{get:()=>t[a],enumerable:!(n=s(t,a))||n.enumerable});return e};var l=(e,t,r)=>(r=e!=null?m(h(e)):{},d(t||!e||!e.__esModule?o(r,"default",{value:e,enumerable:!0}):r,e)),p=e=>d(o({},"__esModule",{value:!0}),e);var y={};i(y,{default:()=>T});module.exports=p(y);var c=require("react/jsx-runtime"),b=l(require("react"));const R=({brand:e,children:t})=>(b.useLayoutEffect(()=>{document.querySelector("html")?.setAttribute("data-brand-theme",e)},[]),(0,c.jsx)(c.Fragment,{children:t}));var T=R;
|
|
2
2
|
//# sourceMappingURL=theme.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/theme.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\nimport * as React from 'react'\
|
|
5
|
-
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
4
|
+
"sourcesContent": ["'use client'\nimport * as React from 'react'\n\ninterface ThemeProps {\n brand: string\n children: React.ReactNode\n}\n/**\n *\n * @param param\n * @returns\n */\nconst Theme = ({ brand, children }: ThemeProps) => {\n React.useLayoutEffect(() => {\n document.querySelector('html')?.setAttribute('data-brand-theme', brand)\n }, [])\n return <>{children}</>\n}\n\nexport default Theme\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAgBS,IAAAI,EAAA,6BAfTC,EAAuB,oBAWvB,MAAMC,EAAQ,CAAC,CAAE,MAAAC,EAAO,SAAAC,CAAS,KAC/BH,EAAM,gBAAgB,IAAM,CAC1B,SAAS,cAAc,MAAM,GAAG,aAAa,mBAAoBE,CAAK,CACxE,EAAG,CAAC,CAAC,KACE,mBAAG,SAAAC,EAAS,GAGrB,IAAON,EAAQI",
|
|
6
6
|
"names": ["theme_exports", "__export", "theme_default", "__toCommonJS", "import_jsx_runtime", "React", "Theme", "brand", "children"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|