@sima-land/moleculas 16.0.0-alpha.2 → 16.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/common/components/badge/badge.d.ts +8 -0
- package/common/components/badge/badge.js +55 -0
- package/common/components/badge/badge.js.map +1 -0
- package/common/components/badge/badge.m.scss +81 -0
- package/common/components/badge/index.d.ts +2 -19
- package/common/components/badge/index.js +3 -80
- package/common/components/badge/index.js.map +1 -0
- package/common/components/badge/types.d.ts +26 -0
- package/common/components/{intractive-image → badge}/types.js +1 -0
- package/common/components/badge/types.js.map +1 -0
- package/common/components/badge-list/badge-list.d.ts +29 -0
- package/common/components/badge-list/badge-list.js +38 -0
- package/common/components/badge-list/badge-list.js.map +1 -0
- package/common/components/badge-list/index.d.ts +1 -29
- package/common/components/badge-list/index.js +3 -56
- package/common/components/badge-list/index.js.map +1 -0
- package/common/components/breadcrumbs/breadcrumbs.d.ts +46 -0
- package/common/components/breadcrumbs/breadcrumbs.js +83 -0
- package/common/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/common/components/breadcrumbs/breadcrumbs.m.scss +113 -0
- package/common/components/breadcrumbs/index.d.ts +2 -0
- package/common/components/breadcrumbs/index.js +7 -0
- package/common/components/breadcrumbs/index.js.map +1 -0
- package/common/components/breadcrumbs/types.d.ts +8 -0
- package/common/{types.js → components/breadcrumbs/types.js} +1 -0
- package/common/components/breadcrumbs/types.js.map +1 -0
- package/common/components/img-stub/img-stub.d.ts +14 -0
- package/common/components/img-stub/img-stub.js +21 -0
- package/common/components/img-stub/img-stub.js.map +1 -0
- package/common/components/img-stub/img-stub.m.scss +36 -0
- package/common/components/img-stub/index.d.ts +1 -0
- package/common/components/img-stub/index.js +6 -0
- package/common/components/img-stub/index.js.map +1 -0
- package/common/components/{intractive-image → interactive-image}/index.js +1 -0
- package/common/components/interactive-image/index.js.map +1 -0
- package/common/components/interactive-image/interactive-image.d.ts +15 -0
- package/common/components/interactive-image/interactive-image.js +56 -0
- package/common/components/interactive-image/interactive-image.js.map +1 -0
- package/common/components/{intractive-image → interactive-image}/types.d.ts +4 -4
- package/common/components/interactive-image/types.js +3 -0
- package/common/components/interactive-image/types.js.map +1 -0
- package/common/components/media-gallery/index.d.ts +2 -0
- package/common/components/media-gallery/index.js +7 -0
- package/common/components/media-gallery/index.js.map +1 -0
- package/common/components/media-gallery/media-gallery.d.ts +16 -0
- package/common/components/media-gallery/media-gallery.js +90 -0
- package/common/components/media-gallery/media-gallery.js.map +1 -0
- package/common/components/media-gallery/media-gallery.m.scss +35 -0
- package/common/components/media-gallery/types.d.ts +12 -0
- package/common/components/media-gallery/types.js +3 -0
- package/common/components/media-gallery/types.js.map +1 -0
- package/common/components/media-gallery/utils.d.ts +38 -0
- package/common/components/media-gallery/utils.js +102 -0
- package/common/components/media-gallery/utils.js.map +1 -0
- package/common/components/media-modal/__mocks__/images/armchair.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/cup.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/plant.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/stump.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/table.jpg +0 -0
- package/common/components/media-modal/__mocks__/images/vase.jpg +0 -0
- package/common/components/media-modal/__mocks__/index.d.ts +3 -0
- package/common/components/media-modal/__mocks__/index.js +251 -0
- package/common/components/media-modal/__mocks__/index.js.map +1 -0
- package/common/components/media-modal/__mocks__/thumbnails/armchair.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/cup.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/plant.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/stump.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/table.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/vase.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video3404953.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video3619217.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video4093038.jpg +0 -0
- package/common/components/media-modal/__mocks__/thumbnails/video6907296.jpg +0 -0
- package/common/components/media-modal/index.d.ts +11 -0
- package/common/components/media-modal/index.js +29 -0
- package/common/components/media-modal/index.js.map +1 -0
- package/common/components/media-modal/layout.d.ts +36 -0
- package/common/components/media-modal/layout.js +81 -0
- package/common/components/media-modal/layout.js.map +1 -0
- package/common/components/media-modal/layout.m.scss +78 -0
- package/common/components/media-modal/parts/all-round-view.d.ts +7 -0
- package/common/components/media-modal/parts/all-round-view.js +42 -0
- package/common/components/media-modal/parts/all-round-view.js.map +1 -0
- package/common/components/media-modal/parts/all-round-view.m.scss +30 -0
- package/common/components/media-modal/parts/index.d.ts +36 -0
- package/common/components/media-modal/parts/index.js +65 -0
- package/common/components/media-modal/parts/index.js.map +1 -0
- package/common/components/media-modal/parts/media-area.d.ts +25 -0
- package/common/components/media-modal/parts/media-area.js +61 -0
- package/common/components/media-modal/parts/media-area.js.map +1 -0
- package/common/components/media-modal/parts/media-area.m.scss +21 -0
- package/common/components/media-modal/parts/media-view.d.ts +20 -0
- package/common/components/media-modal/parts/media-view.js +46 -0
- package/common/components/media-modal/parts/media-view.js.map +1 -0
- package/common/components/media-modal/parts/media-view.m.scss +34 -0
- package/common/components/media-modal/parts/parts.m.scss +21 -0
- package/common/components/media-modal/parts/product-brief.d.ts +20 -0
- package/common/components/media-modal/parts/product-brief.js +40 -0
- package/common/components/media-modal/parts/product-brief.js.map +1 -0
- package/common/components/media-modal/parts/product-brief.m.scss +149 -0
- package/common/components/media-modal/parts/review.d.ts +15 -0
- package/common/components/media-modal/parts/review.js +32 -0
- package/common/components/media-modal/parts/review.js.map +1 -0
- package/common/components/media-modal/parts/review.m.scss +86 -0
- package/common/components/media-modal/parts/scroll-section.d.ts +11 -0
- package/common/components/media-modal/parts/scroll-section.js +20 -0
- package/common/components/media-modal/parts/scroll-section.js.map +1 -0
- package/common/components/media-modal/parts/scroll-section.m.scss +32 -0
- package/common/components/media-modal/parts/thumbnail.d.ts +22 -0
- package/common/components/media-modal/parts/thumbnail.js +36 -0
- package/common/components/media-modal/parts/thumbnail.js.map +1 -0
- package/common/components/media-modal/parts/thumbnail.m.scss +156 -0
- package/common/components/media-modal/parts/thumbnails.d.ts +13 -0
- package/common/components/media-modal/parts/thumbnails.js +60 -0
- package/common/components/media-modal/parts/thumbnails.js.map +1 -0
- package/common/components/media-modal/parts/thumbnails.m.scss +16 -0
- package/common/components/media-modal/types.d.ts +18 -0
- package/common/components/media-modal/types.js +3 -0
- package/common/components/media-modal/types.js.map +1 -0
- package/common/components/media-modal/utils.d.ts +42 -0
- package/common/components/media-modal/utils.js +110 -0
- package/common/components/media-modal/utils.js.map +1 -0
- package/common/components/modifier/index.d.ts +2 -46
- package/common/components/modifier/index.js +4 -99
- package/common/components/modifier/index.js.map +1 -0
- package/common/components/modifier/modifier.d.ts +13 -0
- package/common/components/modifier/modifier.js +74 -0
- package/common/components/modifier/modifier.js.map +1 -0
- package/common/components/modifier/{modifiers.module.scss → modifier.m.scss} +61 -0
- package/common/components/modifier/types.d.ts +35 -0
- package/common/components/modifier/types.js +3 -0
- package/common/components/modifier/types.js.map +1 -0
- package/common/components/pagination-controls/index.d.ts +2 -0
- package/common/components/pagination-controls/index.js +9 -0
- package/common/components/pagination-controls/index.js.map +1 -0
- package/common/components/pagination-controls/pagination-controls.d.ts +30 -0
- package/common/components/pagination-controls/pagination-controls.js +72 -0
- package/common/components/pagination-controls/pagination-controls.js.map +1 -0
- package/common/components/pagination-controls/pagination-controls.m.scss +70 -0
- package/common/components/pagination-controls/types.d.ts +20 -0
- package/common/components/pagination-controls/types.js +3 -0
- package/common/components/pagination-controls/types.js.map +1 -0
- package/common/components/product-info/index.d.ts +1 -16
- package/common/components/product-info/index.js +5 -41
- package/common/components/product-info/index.js.map +1 -0
- package/common/components/product-info/parts.d.ts +22 -21
- package/common/components/product-info/parts.js +35 -83
- package/common/components/product-info/parts.js.map +1 -0
- package/common/components/product-info/product-info.d.ts +15 -0
- package/common/components/product-info/product-info.js +33 -0
- package/common/components/product-info/product-info.js.map +1 -0
- package/common/components/product-info/{product-info.module.scss → product-info.m.scss} +9 -0
- package/common/components/product-info/types.d.ts +2 -2
- package/common/components/product-info/types.js +1 -0
- package/common/components/product-info/types.js.map +1 -0
- package/common/components/product-info/utils.js +1 -0
- package/common/components/product-info/utils.js.map +1 -0
- package/common/components/rating-counter/index.d.ts +1 -25
- package/common/components/rating-counter/index.js +3 -35
- package/common/components/rating-counter/index.js.map +1 -0
- package/common/components/rating-counter/rating-counter-util.scss +1 -1
- package/common/components/rating-counter/rating-counter.d.ts +35 -0
- package/common/components/rating-counter/rating-counter.js +24 -0
- package/common/components/rating-counter/rating-counter.js.map +1 -0
- package/common/hooks/index.d.ts +19 -0
- package/common/hooks/index.js +39 -0
- package/common/hooks/index.js.map +1 -0
- package/desktop/components/breadcrumbs/breadcrumbs.d.ts +31 -0
- package/desktop/components/breadcrumbs/breadcrumbs.js +56 -0
- package/desktop/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/desktop/components/breadcrumbs/{breadcrumbs.module.scss → breadcrumbs.m.scss} +36 -1
- package/desktop/components/breadcrumbs/index.d.ts +1 -28
- package/desktop/components/breadcrumbs/index.js +3 -80
- package/desktop/components/breadcrumbs/index.js.map +1 -0
- package/desktop/components/gallery-modal/__mocks__/index.js +1 -0
- package/desktop/components/gallery-modal/__mocks__/index.js.map +1 -0
- package/desktop/components/gallery-modal/components/all-round-view.d.ts +5 -2
- package/desktop/components/gallery-modal/components/all-round-view.js +47 -62
- package/desktop/components/gallery-modal/components/all-round-view.js.map +1 -0
- package/desktop/components/gallery-modal/components/{all-round-view.module.scss → all-round-view.m.scss} +5 -0
- package/desktop/components/gallery-modal/components/gallery-modal.d.ts +4 -5
- package/desktop/components/gallery-modal/components/gallery-modal.js +16 -66
- package/desktop/components/gallery-modal/components/gallery-modal.js.map +1 -0
- package/desktop/components/gallery-modal/components/{gallery-modal.module.scss → gallery-modal.m.scss} +5 -3
- package/desktop/components/gallery-modal/components/image-overlay.d.ts +3 -3
- package/desktop/components/gallery-modal/components/image-overlay.js +4 -17
- package/desktop/components/gallery-modal/components/image-overlay.js.map +1 -0
- package/desktop/components/gallery-modal/components/{image-overlay.module.scss → image-overlay.m.scss} +1 -0
- package/desktop/components/gallery-modal/components/review-info.d.ts +1 -1
- package/desktop/components/gallery-modal/components/review-info.js +11 -52
- package/desktop/components/gallery-modal/components/review-info.js.map +1 -0
- package/desktop/components/gallery-modal/components/thumbnail.d.ts +3 -3
- package/desktop/components/gallery-modal/components/thumbnail.js +7 -10
- package/desktop/components/gallery-modal/components/thumbnail.js.map +1 -0
- package/desktop/components/gallery-modal/index.js +1 -0
- package/desktop/components/gallery-modal/index.js.map +1 -0
- package/desktop/components/gallery-modal/types.js +1 -0
- package/desktop/components/gallery-modal/types.js.map +1 -0
- package/desktop/components/gallery-modal/utils.d.ts +5 -3
- package/desktop/components/gallery-modal/utils.js +18 -8
- package/desktop/components/gallery-modal/utils.js.map +1 -0
- package/desktop/components/person-info/index.d.ts +1 -41
- package/desktop/components/person-info/index.js +3 -43
- package/desktop/components/person-info/index.js.map +1 -0
- package/desktop/components/person-info/person-info.d.ts +42 -0
- package/desktop/components/person-info/person-info.js +24 -0
- package/desktop/components/person-info/person-info.js.map +1 -0
- package/desktop/components/person-info/{person-info.module.scss → person-info.m.scss} +1 -1
- package/desktop/components/product-card/index.d.ts +2 -26
- package/desktop/components/product-card/index.js +7 -103
- package/desktop/components/product-card/index.js.map +1 -0
- package/desktop/components/product-card/product-card.d.ts +23 -0
- package/desktop/components/product-card/product-card.js +94 -0
- package/desktop/components/product-card/product-card.js.map +1 -0
- package/desktop/components/product-card/types.d.ts +19 -0
- package/desktop/components/product-card/types.js +3 -0
- package/desktop/components/product-card/types.js.map +1 -0
- package/desktop/components/product-carousel/hover-card.d.ts +2 -7
- package/desktop/components/product-carousel/hover-card.js +13 -49
- package/desktop/components/product-carousel/hover-card.js.map +1 -0
- package/desktop/components/product-carousel/{hover-card.module.scss → hover-card.m.scss} +2 -2
- package/desktop/components/product-carousel/index.d.ts +2 -31
- package/desktop/components/product-carousel/index.js +3 -133
- package/desktop/components/product-carousel/index.js.map +1 -0
- package/desktop/components/product-carousel/product-carousel.d.ts +7 -0
- package/desktop/components/product-carousel/product-carousel.js +95 -0
- package/desktop/components/product-carousel/product-carousel.js.map +1 -0
- package/desktop/components/product-carousel/{product-carousel.module.scss → product-carousel.m.scss} +1 -1
- package/desktop/components/product-carousel/types.d.ts +33 -0
- package/desktop/components/product-carousel/types.js +3 -0
- package/desktop/components/product-carousel/types.js.map +1 -0
- package/desktop/components/product-carousel/utils.d.ts +4 -4
- package/desktop/components/product-carousel/utils.js +8 -7
- package/desktop/components/product-carousel/utils.js.map +1 -0
- package/desktop/components/promotion-card/banner-title.d.ts +2 -3
- package/desktop/components/promotion-card/banner-title.js +9 -19
- package/desktop/components/promotion-card/banner-title.js.map +1 -0
- package/desktop/components/promotion-card/estimate.d.ts +1 -2
- package/desktop/components/promotion-card/estimate.js +3 -5
- package/desktop/components/promotion-card/estimate.js.map +1 -0
- package/desktop/components/promotion-card/index.d.ts +4 -31
- package/desktop/components/promotion-card/index.js +10 -83
- package/desktop/components/promotion-card/index.js.map +1 -0
- package/desktop/components/promotion-card/placeholder.d.ts +4 -2
- package/desktop/components/promotion-card/placeholder.js +4 -6
- package/desktop/components/promotion-card/placeholder.js.map +1 -0
- package/desktop/components/promotion-card/promotion-card.d.ts +32 -0
- package/desktop/components/promotion-card/promotion-card.js +39 -0
- package/desktop/components/promotion-card/promotion-card.js.map +1 -0
- package/desktop/components/promotion-card/{index.module.scss → promotion-card.m.scss} +8 -6
- package/desktop/components/promotion-card/types.js +1 -0
- package/desktop/components/promotion-card/types.js.map +1 -0
- package/mobile/components/action-circles/action-circles.d.ts +22 -0
- package/mobile/components/action-circles/action-circles.js +31 -0
- package/mobile/components/action-circles/action-circles.js.map +1 -0
- package/mobile/components/action-circles/index.d.ts +1 -22
- package/mobile/components/action-circles/index.js +3 -29
- package/mobile/components/action-circles/index.js.map +1 -0
- package/mobile/components/action-list/action-list.d.ts +29 -0
- package/mobile/components/action-list/action-list.js +40 -0
- package/mobile/components/action-list/action-list.js.map +1 -0
- package/mobile/components/action-list/index.d.ts +1 -23
- package/mobile/components/action-list/index.js +5 -34
- package/mobile/components/action-list/index.js.map +1 -0
- package/mobile/components/breadcrumbs/breadcrumbs.d.ts +12 -0
- package/mobile/components/breadcrumbs/breadcrumbs.js +17 -0
- package/mobile/components/breadcrumbs/breadcrumbs.js.map +1 -0
- package/mobile/components/breadcrumbs/index.d.ts +1 -13
- package/mobile/components/breadcrumbs/index.js +3 -13
- package/mobile/components/breadcrumbs/index.js.map +1 -0
- package/mobile/components/person-info/index.d.ts +1 -44
- package/mobile/components/person-info/index.js +4 -55
- package/mobile/components/person-info/index.js.map +1 -0
- package/mobile/components/person-info/person-info.d.ts +46 -0
- package/mobile/components/person-info/person-info.js +41 -0
- package/mobile/components/person-info/person-info.js.map +1 -0
- package/mobile/components/person-info/{person-info.module.scss → person-info.m.scss} +9 -16
- package/mobile/components/product-row/index.d.ts +1 -41
- package/mobile/components/product-row/index.js +3 -56
- package/mobile/components/product-row/index.js.map +1 -0
- package/mobile/components/product-row/product-row.d.ts +40 -0
- package/mobile/components/product-row/product-row.js +29 -0
- package/mobile/components/product-row/product-row.js.map +1 -0
- package/mobile/components/product-slider/index.d.ts +1 -17
- package/mobile/components/product-slider/index.js +3 -57
- package/mobile/components/product-slider/index.js.map +1 -0
- package/mobile/components/product-slider/product-slider.d.ts +17 -0
- package/mobile/components/product-slider/product-slider.js +37 -0
- package/mobile/components/product-slider/product-slider.js.map +1 -0
- package/mobile/components/search-bar/index.d.ts +1 -39
- package/mobile/components/search-bar/index.js +4 -104
- package/mobile/components/search-bar/index.js.map +1 -0
- package/mobile/components/search-bar/search-bar.d.ts +39 -0
- package/mobile/components/search-bar/search-bar.js +64 -0
- package/mobile/components/search-bar/search-bar.js.map +1 -0
- package/mobile/components/search-bar/{search-bar.module.scss → search-bar.m.scss} +6 -6
- package/mobile/components/select-screen/index.d.ts +1 -20
- package/mobile/components/select-screen/index.js +4 -65
- package/mobile/components/select-screen/index.js.map +1 -0
- package/mobile/components/select-screen/select-screen.d.ts +20 -0
- package/mobile/components/select-screen/select-screen.js +31 -0
- package/mobile/components/select-screen/select-screen.js.map +1 -0
- package/package.json +40 -52
- package/common/components/badge/badge.module.scss +0 -40
- package/common/components/intractive-image/interactive-image.d.ts +0 -15
- package/common/components/intractive-image/interactive-image.js +0 -96
- package/common/components/rating-counter/star.svg +0 -5
- package/common/constants.d.ts +0 -2
- package/common/constants.js +0 -8
- package/common/icons/eighteen-plus.svg +0 -5
- package/common/types.d.ts +0 -1
- package/desktop/components/breadcrumbs/square-arrow-down.svg +0 -8
- package/desktop/components/gallery-modal/icons/360.svg +0 -3
- package/desktop/components/gallery-modal/icons/pause.svg +0 -3
- package/desktop/components/gallery-modal/icons/turn-left.svg +0 -10
- package/desktop/components/gallery-modal/icons/turn-right.svg +0 -10
- package/desktop/components/modifiers/button/index.d.ts +0 -22
- package/desktop/components/modifiers/button/index.js +0 -48
- package/desktop/components/modifiers/button/modifier-button.module.scss +0 -85
- package/desktop/components/modifiers/group/index.d.ts +0 -15
- package/desktop/components/modifiers/group/index.js +0 -70
- package/desktop/components/modifiers/group/modifiers-group.module.scss +0 -33
- package/desktop/components/modifiers/group/utils.d.ts +0 -20
- package/desktop/components/modifiers/group/utils.js +0 -73
- package/desktop/components/modifiers/modifiers.scss +0 -8
- package/mobile/components/modifiers-list/index.d.ts +0 -22
- package/mobile/components/modifiers-list/index.js +0 -25
- package/mobile/components/modifiers-list/modifier-item/index.d.ts +0 -29
- package/mobile/components/modifiers-list/modifier-item/index.js +0 -38
- package/mobile/components/modifiers-list/modifier-item/modifier-item.module.scss +0 -70
- package/mobile/components/modifiers-list/modifiers-list.module.scss +0 -21
- package/mobile/components/pseudo-input/index.d.ts +0 -11
- package/mobile/components/pseudo-input/index.js +0 -34
- package/mobile/components/pseudo-input/pseudo-input.module.scss +0 -24
- /package/common/components/badge-list/{badge-list.module.scss → badge-list.m.scss} +0 -0
- /package/common/components/{intractive-image → interactive-image}/index.d.ts +0 -0
- /package/common/components/{intractive-image → interactive-image}/interactive-image-util.scss +0 -0
- /package/common/components/{intractive-image/interactive-image.module.scss → interactive-image/interactive-image.m.scss} +0 -0
- /package/common/components/rating-counter/{rating-counter.module.scss → rating-counter.m.scss} +0 -0
- /package/desktop/components/gallery-modal/components/{review-info.module.scss → review-info.m.scss} +0 -0
- /package/desktop/components/gallery-modal/components/{thumbnail.module.scss → thumbnail.m.scss} +0 -0
- /package/desktop/components/product-card/{product-card.module.scss → product-card.m.scss} +0 -0
- /package/desktop/components/promotion-card/{banner-title.module.scss → banner-title.m.scss} +0 -0
- /package/desktop/components/promotion-card/{placeholder.module.scss → placeholder.m.scss} +0 -0
- /package/mobile/components/action-circles/{action-circles.module.scss → action-circles.m.scss} +0 -0
- /package/mobile/components/action-list/{action-list.module.scss → action-list.m.scss} +0 -0
- /package/mobile/components/breadcrumbs/{breadcrumbs.module.scss → breadcrumbs.m.scss} +0 -0
- /package/mobile/components/product-row/{product-row.module.scss → product-row.m.scss} +0 -0
- /package/mobile/components/product-slider/{product-slider.module.scss → product-slider.m.scss} +0 -0
- /package/mobile/components/select-screen/{select-screen.module.scss → select-screen.m.scss} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Parts = exports.ProductInfo = exports.UNAVAILABLE_REASON = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const helpers_1 = require("@sima-land/ui-nucleons/helpers");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const parts_1 = require("./parts");
|
|
8
|
+
Object.defineProperty(exports, "Parts", { enumerable: true, get: function () { return parts_1.Parts; } });
|
|
9
|
+
exports.UNAVAILABLE_REASON = {
|
|
10
|
+
notEnough: 'Нет в наличии',
|
|
11
|
+
unavailableInRegion: 'Товар недоступен в вашем регионе',
|
|
12
|
+
onlyForLegalEntities: 'Товар доступен только для юридических лиц',
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Блок информации о товаре по дизайн-гайдам.
|
|
16
|
+
* @param props Свойства.
|
|
17
|
+
* @return Элемент.
|
|
18
|
+
*/
|
|
19
|
+
const ProductInfo = ({ restriction, children }) => {
|
|
20
|
+
const { image, badges, prices, title, trademark, footer, secondaryInfo, ratingCounter } = (0, helpers_1.defineSlots)(children, {
|
|
21
|
+
image: parts_1.Parts.Image,
|
|
22
|
+
badges: parts_1.Parts.Badges,
|
|
23
|
+
prices: parts_1.Parts.Prices,
|
|
24
|
+
title: parts_1.Parts.Title,
|
|
25
|
+
trademark: parts_1.Parts.TrademarkLink,
|
|
26
|
+
footer: parts_1.Parts.Footer,
|
|
27
|
+
secondaryInfo: parts_1.Parts.SecondaryInfo,
|
|
28
|
+
ratingCounter: parts_1.Parts.RatingCounter,
|
|
29
|
+
});
|
|
30
|
+
return ((0, jsx_runtime_1.jsxs)(utils_1.ProductInfoContext.Provider, { value: { restriction }, children: [image, restriction !== 'adult' && badges, prices, title, restriction !== 'adult' && secondaryInfo, !restriction && trademark, restriction !== 'adult' && ratingCounter, footer] }));
|
|
31
|
+
};
|
|
32
|
+
exports.ProductInfo = ProductInfo;
|
|
33
|
+
//# sourceMappingURL=product-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-info.js","sourceRoot":"","sources":["../../../../src/common/components/product-info/product-info.tsx"],"names":[],"mappings":";;;;AAAA,4DAA6D;AAE7D,mCAA6C;AAC7C,mCAAgC;AA0CvB,sFA1CA,aAAK,OA0CA;AAtCD,QAAA,kBAAkB,GAAG;IAChC,SAAS,EAAE,eAAe;IAC1B,mBAAmB,EAAE,kCAAkC;IACvD,oBAAoB,EAAE,2CAA2C;CACzD,CAAC;AAEX;;;;GAIG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAoB,EAAE,EAAE;IACzE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GACrF,IAAA,qBAAW,EAAC,QAAQ,EAAE;QACpB,KAAK,EAAE,aAAK,CAAC,KAAK;QAClB,MAAM,EAAE,aAAK,CAAC,MAAM;QACpB,MAAM,EAAE,aAAK,CAAC,MAAM;QACpB,KAAK,EAAE,aAAK,CAAC,KAAK;QAClB,SAAS,EAAE,aAAK,CAAC,aAAa;QAC9B,MAAM,EAAE,aAAK,CAAC,MAAM;QACpB,aAAa,EAAE,aAAK,CAAC,aAAa;QAClC,aAAa,EAAE,aAAK,CAAC,aAAa;KACnC,CAAC,CAAC;IAEL,OAAO,CACL,wBAAC,0BAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,WAAW,EAAE,aAChD,KAAK,EACL,WAAW,KAAK,OAAO,IAAI,MAAM,EACjC,MAAM,EACN,KAAK,EACL,WAAW,KAAK,OAAO,IAAI,aAAa,EACxC,CAAC,WAAW,IAAI,SAAS,EACzB,WAAW,KAAK,OAAO,IAAI,aAAa,EACxC,MAAM,IACqB,CAC/B,CAAC;AACJ,CAAC,CAAC;AAzBW,QAAA,WAAW,eAyBtB"}
|
|
@@ -31,6 +31,9 @@
|
|
|
31
31
|
object-fit: contain;
|
|
32
32
|
width: 100%;
|
|
33
33
|
height: 100%;
|
|
34
|
+
&.broken {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
34
37
|
&.adult {
|
|
35
38
|
position: absolute;
|
|
36
39
|
top: 0;
|
|
@@ -51,6 +54,12 @@
|
|
|
51
54
|
fill: colors.$basic-gray38;
|
|
52
55
|
}
|
|
53
56
|
|
|
57
|
+
.broken-icon {
|
|
58
|
+
position: absolute;
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: 100%;
|
|
61
|
+
}
|
|
62
|
+
|
|
54
63
|
.image-buttons {
|
|
55
64
|
position: absolute;
|
|
56
65
|
top: 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
export interface ProductInfoProps {
|
|
3
3
|
/** Ограничение товара. Влияет на отображение информации. */
|
|
4
4
|
restriction?: 'adult' | 'unavailable';
|
|
5
5
|
/** Содержимое. */
|
|
6
|
-
children?:
|
|
6
|
+
children?: ReactNode;
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/common/components/product-info/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/common/components/product-info/utils.ts"],"names":[],"mappings":";;;AAAA,iCAAsC;AAGzB,QAAA,kBAAkB,GAAG,IAAA,qBAAa,EAAwC,EAAE,CAAC,CAAC"}
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export type RatingCounterSize = 's' | 'm' | 'unset';
|
|
3
|
-
interface CustomProps {
|
|
4
|
-
/**
|
|
5
|
-
* Размер.
|
|
6
|
-
* При указании "unset" необходимо определить стили самостоятельно с помощью миксина из rating-counter-util.scss.
|
|
7
|
-
*/
|
|
8
|
-
size?: RatingCounterSize;
|
|
9
|
-
/** Значение рейтинга. */
|
|
10
|
-
value: number;
|
|
11
|
-
/** Количество отзывов. */
|
|
12
|
-
reviewCount: number;
|
|
13
|
-
/** Нужно ли отключить эффект при наведении. */
|
|
14
|
-
hoverDisabled?: boolean;
|
|
15
|
-
/** Идентификатор для систем автоматизированного тестирования. */
|
|
16
|
-
'data-testid'?: string;
|
|
17
|
-
}
|
|
18
|
-
export type RatingCounterProps = CustomProps & Omit<HTMLAttributes<HTMLDivElement>, keyof CustomProps>;
|
|
19
|
-
/**
|
|
20
|
-
* Счетчик рейтинга.
|
|
21
|
-
* @param props Свойства.
|
|
22
|
-
* @return Элемент.
|
|
23
|
-
*/
|
|
24
|
-
export declare function RatingCounter({ size, value, reviewCount, className, hoverDisabled, 'data-testid': testId, ...restProps }: RatingCounterProps): JSX.Element;
|
|
25
|
-
export {};
|
|
1
|
+
export { type RatingCounterSize, type RatingCounterStyle, type RatingCounterProps, RatingCounter, } from './rating-counter';
|
|
@@ -1,38 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.RatingCounter = void 0;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
22
|
-
const rating_counter_module_scss_1 = __importDefault(require("./rating-counter.module.scss"));
|
|
23
|
-
const cx = bind_1.default.bind(rating_counter_module_scss_1.default);
|
|
24
|
-
/**
|
|
25
|
-
* Счетчик рейтинга.
|
|
26
|
-
* @param props Свойства.
|
|
27
|
-
* @return Элемент.
|
|
28
|
-
*/
|
|
29
|
-
function RatingCounter(_a) {
|
|
30
|
-
var { size = 's', value, reviewCount, className, hoverDisabled, 'data-testid': testId = 'rating-counter' } = _a, restProps = __rest(_a, ["size", "value", "reviewCount", "className", "hoverDisabled", 'data-testid']);
|
|
31
|
-
return (react_1.default.createElement("div", Object.assign({ className: cx('root', `size-${size}`, !(value > 0) && 'empty', hoverDisabled && 'hover-disabled', className), "data-testid": testId }, restProps),
|
|
32
|
-
react_1.default.createElement(star_svg_1.default, { className: cx('star') }),
|
|
33
|
-
value > 0 && react_1.default.createElement("span", { className: cx('value') }, String(value).replace('.', ',')),
|
|
34
|
-
react_1.default.createElement("span", { className: cx('count') }, reviewCount > 0
|
|
35
|
-
? `${reviewCount} ${(0, get_declination_1.default)(reviewCount, ['отзыв', 'отзыва', 'отзывов'])}`
|
|
36
|
-
: 'Нет отзывов')));
|
|
37
|
-
}
|
|
38
|
-
exports.RatingCounter = RatingCounter;
|
|
4
|
+
var rating_counter_1 = require("./rating-counter");
|
|
5
|
+
Object.defineProperty(exports, "RatingCounter", { enumerable: true, get: function () { return rating_counter_1.RatingCounter; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/components/rating-counter/index.ts"],"names":[],"mappings":";;;AAAA,mDAK0B;AADxB,+GAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CSSProperties, HTMLAttributes } from 'react';
|
|
2
|
+
export type RatingCounterSize = 's' | 'm' | 'unset';
|
|
3
|
+
export interface RatingCounterStyle extends CSSProperties {
|
|
4
|
+
'--rating-icon-size'?: string;
|
|
5
|
+
'--rating-value-size'?: string;
|
|
6
|
+
'--rating-value-height'?: string;
|
|
7
|
+
'--rating-count-gutter'?: string;
|
|
8
|
+
'--rating-count-size'?: string;
|
|
9
|
+
'--rating-count-height'?: string;
|
|
10
|
+
}
|
|
11
|
+
interface CustomProps {
|
|
12
|
+
/**
|
|
13
|
+
* Размер.
|
|
14
|
+
* При указании "unset" необходимо определить стили самостоятельно с помощью миксина из rating-counter-util.scss.
|
|
15
|
+
*/
|
|
16
|
+
size?: RatingCounterSize;
|
|
17
|
+
/** Значение рейтинга. */
|
|
18
|
+
value: number;
|
|
19
|
+
/** Количество отзывов. */
|
|
20
|
+
reviewCount: number;
|
|
21
|
+
/** Нужно ли отключить эффект при наведении. */
|
|
22
|
+
hoverDisabled?: boolean;
|
|
23
|
+
/** Стили корневого элемента. */
|
|
24
|
+
style?: RatingCounterStyle;
|
|
25
|
+
/** Идентификатор для систем автоматизированного тестирования. */
|
|
26
|
+
'data-testid'?: string;
|
|
27
|
+
}
|
|
28
|
+
export type RatingCounterProps = CustomProps & Omit<HTMLAttributes<HTMLDivElement>, keyof CustomProps>;
|
|
29
|
+
/**
|
|
30
|
+
* Счетчик рейтинга.
|
|
31
|
+
* @param props Свойства.
|
|
32
|
+
* @return Элемент.
|
|
33
|
+
*/
|
|
34
|
+
export declare function RatingCounter({ size, value, reviewCount, className, hoverDisabled, 'data-testid': testId, ...restProps }: RatingCounterProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RatingCounter = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const Star_1 = __importDefault(require("@sima-land/ui-quarks/icons/16x16/Filled/Star"));
|
|
9
|
+
const helpers_1 = require("@sima-land/ui-nucleons/helpers");
|
|
10
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
11
|
+
const rating_counter_m_scss_1 = __importDefault(require("./rating-counter.m.scss"));
|
|
12
|
+
const cx = bind_1.default.bind(rating_counter_m_scss_1.default);
|
|
13
|
+
/**
|
|
14
|
+
* Счетчик рейтинга.
|
|
15
|
+
* @param props Свойства.
|
|
16
|
+
* @return Элемент.
|
|
17
|
+
*/
|
|
18
|
+
function RatingCounter({ size = 's', value, reviewCount, className, hoverDisabled, 'data-testid': testId = 'rating-counter', ...restProps }) {
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: cx('root', `size-${size}`, !(value > 0) && 'empty', hoverDisabled && 'hover-disabled', className), "data-testid": testId, ...restProps, children: [(0, jsx_runtime_1.jsx)(Star_1.default, { className: cx('star') }), value > 0 && (0, jsx_runtime_1.jsx)("span", { className: cx('value'), children: String(value).replace('.', ',') }), (0, jsx_runtime_1.jsx)("span", { className: cx('count'), children: reviewCount > 0
|
|
20
|
+
? `${reviewCount} ${(0, helpers_1.getDeclination)(reviewCount, ['отзыв', 'отзыва', 'отзывов'])}`
|
|
21
|
+
: 'Нет отзывов' })] }));
|
|
22
|
+
}
|
|
23
|
+
exports.RatingCounter = RatingCounter;
|
|
24
|
+
//# sourceMappingURL=rating-counter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rating-counter.js","sourceRoot":"","sources":["../../../../src/common/components/rating-counter/rating-counter.tsx"],"names":[],"mappings":";;;;;;;AACA,wFAAmE;AACnE,4DAAgE;AAChE,2DAAyC;AACzC,oFAA6C;AAuC7C,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,+BAAM,CAAC,CAAC;AAEnC;;;;GAIG;AACH,SAAgB,aAAa,CAAC,EAC5B,IAAI,GAAG,GAAG,EACV,KAAK,EACL,WAAW,EACX,SAAS,EACT,aAAa,EACb,aAAa,EAAE,MAAM,GAAG,gBAAgB,EACxC,GAAG,SAAS,EACO;IACnB,OAAO,CACL,iCACE,SAAS,EAAE,EAAE,CACX,MAAM,EACN,QAAQ,IAAI,EAAE,EACd,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,OAAO,EACvB,aAAa,IAAI,gBAAgB,EACjC,SAAS,CACV,iBACY,MAAM,KACf,SAAS,aAEb,uBAAC,cAAO,IAAC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,GAAI,EAEjC,KAAK,GAAG,CAAC,IAAI,iCAAM,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,YAAG,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAQ,EAEpF,iCAAM,SAAS,EAAE,EAAE,CAAC,OAAO,CAAC,YACzB,WAAW,GAAG,CAAC;oBACd,CAAC,CAAC,GAAG,WAAW,IAAI,IAAA,wBAAc,EAAC,WAAW,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,EAAE;oBACjF,CAAC,CAAC,aAAa,GACZ,IACH,CACP,CAAC;AACJ,CAAC;AAhCD,sCAgCC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactEventHandler } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Возвращает true если компонент смонтирован.
|
|
4
|
+
* @return True если компонент смонтирован.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useMounted(): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Хук состояния ошибки загрузки изображения.
|
|
9
|
+
* @param src Ссылка на картинку.
|
|
10
|
+
* @param onError Обработчик ошибки.
|
|
11
|
+
* @return Управление состоянием.
|
|
12
|
+
* @todo Переименовать в useImageError?
|
|
13
|
+
* @todo Объединить с тем что есть в AllRoundView!
|
|
14
|
+
*/
|
|
15
|
+
export declare function useImageStub(src?: string, onError?: ReactEventHandler<HTMLImageElement>): {
|
|
16
|
+
failed: boolean;
|
|
17
|
+
setFailed: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
18
|
+
handleError: ReactEventHandler<HTMLImageElement>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useImageStub = exports.useMounted = void 0;
|
|
4
|
+
const hooks_1 = require("@sima-land/ui-nucleons/hooks");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
/**
|
|
7
|
+
* Возвращает true если компонент смонтирован.
|
|
8
|
+
* @return True если компонент смонтирован.
|
|
9
|
+
*/
|
|
10
|
+
function useMounted() {
|
|
11
|
+
const [mounted, setMounted] = (0, react_1.useState)(false);
|
|
12
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
13
|
+
setMounted(true);
|
|
14
|
+
return () => setMounted(false);
|
|
15
|
+
}, []);
|
|
16
|
+
return mounted;
|
|
17
|
+
}
|
|
18
|
+
exports.useMounted = useMounted;
|
|
19
|
+
/**
|
|
20
|
+
* Хук состояния ошибки загрузки изображения.
|
|
21
|
+
* @param src Ссылка на картинку.
|
|
22
|
+
* @param onError Обработчик ошибки.
|
|
23
|
+
* @return Управление состоянием.
|
|
24
|
+
* @todo Переименовать в useImageError?
|
|
25
|
+
* @todo Объединить с тем что есть в AllRoundView!
|
|
26
|
+
*/
|
|
27
|
+
function useImageStub(src, onError) {
|
|
28
|
+
const [failed, setFailed] = (0, react_1.useState)(false);
|
|
29
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
30
|
+
setFailed(false);
|
|
31
|
+
}, [src]);
|
|
32
|
+
const handleError = (0, react_1.useCallback)(event => {
|
|
33
|
+
setFailed(true);
|
|
34
|
+
onError === null || onError === void 0 ? void 0 : onError(event);
|
|
35
|
+
}, [onError]);
|
|
36
|
+
return { failed, setFailed, handleError };
|
|
37
|
+
}
|
|
38
|
+
exports.useImageStub = useImageStub;
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/hooks/index.ts"],"names":[],"mappings":";;;AAAA,wDAAyE;AACzE,iCAAiE;AAEjE;;;GAGG;AACH,SAAgB,UAAU;IACxB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE9C,IAAA,iCAAyB,EAAC,GAAG,EAAE;QAC7B,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC;AATD,gCASC;AAED;;;;;;;GAOG;AACH,SAAgB,YAAY,CAAC,GAAY,EAAE,OAA6C;IACtF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAE5C,IAAA,iCAAyB,EAAC,GAAG,EAAE;QAC7B,SAAS,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAEV,MAAM,WAAW,GAAG,IAAA,mBAAW,EAC7B,KAAK,CAAC,EAAE;QACN,SAAS,CAAC,IAAI,CAAC,CAAC;QAChB,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,KAAK,CAAC,CAAC;IACnB,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;AAC5C,CAAC;AAhBD,oCAgBC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @deprecated */
|
|
2
|
+
export interface Sibling {
|
|
3
|
+
name: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
/** @deprecated */
|
|
8
|
+
export interface Breadcrumb extends Sibling {
|
|
9
|
+
siblings?: {
|
|
10
|
+
state: 'initial' | 'fetching' | 'ready';
|
|
11
|
+
data?: Sibling[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** @deprecated */
|
|
15
|
+
export interface BreadcrumbsProps {
|
|
16
|
+
/** Список хлебных крошек. */
|
|
17
|
+
items: Breadcrumb[];
|
|
18
|
+
/** Получив хлебную крошку должна вернуть true если крошка выбрана. */
|
|
19
|
+
isSiblingActive?: (sibling: Sibling) => boolean;
|
|
20
|
+
/** Сработает при открытии попапа со смежными ссылками. */
|
|
21
|
+
onSiblingsPopupOpen?: (item: Breadcrumb) => void;
|
|
22
|
+
/** Идентификатор для систем автоматизированного тестирования. */
|
|
23
|
+
'data-testid'?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Список "хлебных крошек".
|
|
27
|
+
* @param props Свойства.
|
|
28
|
+
* @return Элемент.
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
31
|
+
export declare const Breadcrumbs: ({ items, onSiblingsPopupOpen, isSiblingActive, "data-testid": testId, }: BreadcrumbsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Breadcrumbs = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const CSSTransition_1 = __importDefault(require("react-transition-group/CSSTransition"));
|
|
10
|
+
const plate_1 = require("@sima-land/ui-nucleons/plate");
|
|
11
|
+
const link_1 = require("@sima-land/ui-nucleons/link");
|
|
12
|
+
const helpers_1 = require("@sima-land/ui-nucleons/helpers");
|
|
13
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
14
|
+
const breadcrumbs_m_scss_1 = __importDefault(require("./breadcrumbs.m.scss"));
|
|
15
|
+
const cx = bind_1.default.bind(breadcrumbs_m_scss_1.default);
|
|
16
|
+
/** @inheritdoc */
|
|
17
|
+
function DownSVG(props) {
|
|
18
|
+
return ((0, jsx_runtime_1.jsx)("svg", { width: '16', height: '16', viewBox: '0 0 16 16', fill: 'none', ...props, children: (0, jsx_runtime_1.jsx)("path", { d: 'M4 6L8 10L12 6', strokeLinecap: 'round', strokeLinejoin: 'round' }) }));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Список "хлебных крошек".
|
|
22
|
+
* @param props Свойства.
|
|
23
|
+
* @return Элемент.
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
26
|
+
const Breadcrumbs = ({ items, onSiblingsPopupOpen, isSiblingActive, 'data-testid': testId = 'breadcrumbs', }) => ((0, jsx_runtime_1.jsx)("nav", { className: cx('root'), "data-testid": testId, children: items.map((breadcrumb, index) => ((0, jsx_runtime_1.jsx)(Breadcrumb, { data: breadcrumb, onSiblingsPopupOpen: () => onSiblingsPopupOpen === null || onSiblingsPopupOpen === void 0 ? void 0 : onSiblingsPopupOpen(breadcrumb), isSiblingActive: sibling => Boolean(isSiblingActive === null || isSiblingActive === void 0 ? void 0 : isSiblingActive(sibling)) }, index))) }));
|
|
27
|
+
exports.Breadcrumbs = Breadcrumbs;
|
|
28
|
+
/**
|
|
29
|
+
* Элемент списка "хлебных крошек".
|
|
30
|
+
* @param props Свойства.
|
|
31
|
+
* @return Элемент.
|
|
32
|
+
*/
|
|
33
|
+
const Breadcrumb = ({ data, onSiblingsPopupOpen, isSiblingActive, }) => {
|
|
34
|
+
var _a;
|
|
35
|
+
const popupRef = (0, react_1.useRef)(null);
|
|
36
|
+
const [withPopup, togglePopup] = (0, react_1.useState)(false);
|
|
37
|
+
// с useOutsideClick не работает после обновления React до 17 версии, пока так
|
|
38
|
+
(0, react_1.useEffect)(() => {
|
|
39
|
+
if (withPopup) {
|
|
40
|
+
return (0, helpers_1.on)(window, 'mousedown', togglePopup.bind(null, false));
|
|
41
|
+
}
|
|
42
|
+
}, [withPopup]);
|
|
43
|
+
const selfName = ((0, jsx_runtime_1.jsx)(link_1.Link, { color: 'basic-gray87', href: data.url, pseudo: !data.url, className: cx('breadcrumb-name', data.siblings && 'with-siblings'), children: data.name }));
|
|
44
|
+
return ((0, jsx_runtime_1.jsxs)("div", { "data-testid": 'breadcrumb', className: cx('breadcrumb'), children: [selfName, data.siblings && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("span", { "data-testid": 'breadcrumb:siblings-opener', className: cx('toggle-icon'), onClick: () => {
|
|
45
|
+
togglePopup(true);
|
|
46
|
+
onSiblingsPopupOpen();
|
|
47
|
+
}, children: (0, jsx_runtime_1.jsx)(DownSVG, {}) }), (0, jsx_runtime_1.jsx)(CSSTransition_1.default, { in: withPopup, timeout: 200, unmountOnExit: true, classNames: {
|
|
48
|
+
enter: cx('fade-enter'),
|
|
49
|
+
enterActive: cx('fade-enter-active'),
|
|
50
|
+
exit: cx('fade-exit'),
|
|
51
|
+
exitActive: cx('fade-exit-active'),
|
|
52
|
+
}, children: (0, jsx_runtime_1.jsxs)(plate_1.Plate, { ref: popupRef, shadow: 'z3', rounds: 'm', className: cx('popup'), children: [(0, jsx_runtime_1.jsxs)("div", { className: cx('popup-header'), children: [selfName, (0, jsx_runtime_1.jsx)("span", { "data-testid": 'breadcrumb:siblings-closer', className: cx('toggle-icon', 'close'), onClick: () => togglePopup(false), children: (0, jsx_runtime_1.jsx)(DownSVG, {}) })] }), (0, jsx_runtime_1.jsxs)("ul", { className: cx('siblings'), children: [data.siblings.state === 'fetching' && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: Array(8)
|
|
53
|
+
.fill(0)
|
|
54
|
+
.map((zero, index) => ((0, jsx_runtime_1.jsx)("div", { className: cx('sibling-placeholder') }, index))) })), data.siblings.state === 'ready' && ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (_a = data.siblings.data) === null || _a === void 0 ? void 0 : _a.map((sibling, index) => ((0, jsx_runtime_1.jsx)("li", { className: cx('sibling'), "data-testid": 'breadcrumb-sibling', children: isSiblingActive(sibling) ? ((0, jsx_runtime_1.jsx)("span", { className: cx('active'), children: sibling.name })) : ((0, jsx_runtime_1.jsx)(link_1.Link, { color: 'basic-gray87', className: cx('link'), href: sibling.url, children: sibling.name })) }, index))) }))] })] }) })] }))] }));
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.js","sourceRoot":"","sources":["../../../../src/desktop/components/breadcrumbs/breadcrumbs.tsx"],"names":[],"mappings":"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"}
|
|
@@ -25,15 +25,50 @@ $line-gutter: 12px;
|
|
|
25
25
|
&:not(:last-child)::after {
|
|
26
26
|
content: '/';
|
|
27
27
|
display: block;
|
|
28
|
-
margin: 0
|
|
28
|
+
margin: 0 8px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.breadcrumb-name {
|
|
33
|
+
position: relative;
|
|
34
|
+
&::before {
|
|
35
|
+
content: '';
|
|
36
|
+
display: block;
|
|
37
|
+
position: absolute;
|
|
38
|
+
top: -4px;
|
|
39
|
+
bottom: -4px;
|
|
40
|
+
left: 0;
|
|
41
|
+
right: 0;
|
|
42
|
+
}
|
|
43
|
+
&.with-siblings::before {
|
|
44
|
+
right: -2px;
|
|
45
|
+
}
|
|
46
|
+
&:not(.with-siblings)::before {
|
|
47
|
+
right: -8px;
|
|
29
48
|
}
|
|
30
49
|
}
|
|
31
50
|
|
|
32
51
|
.toggle-icon {
|
|
52
|
+
position: relative;
|
|
53
|
+
margin-left: 2px;
|
|
54
|
+
stroke: colors.$basic-gray87;
|
|
33
55
|
display: block;
|
|
34
56
|
cursor: pointer;
|
|
35
57
|
&.close {
|
|
36
58
|
transform: scaleY(-1);
|
|
59
|
+
stroke: colors.$basic-gray38;
|
|
60
|
+
}
|
|
61
|
+
&::before {
|
|
62
|
+
content: '';
|
|
63
|
+
display: block;
|
|
64
|
+
position: absolute;
|
|
65
|
+
top: -4px;
|
|
66
|
+
bottom: -4px;
|
|
67
|
+
left: 0;
|
|
68
|
+
right: -8px;
|
|
69
|
+
}
|
|
70
|
+
> svg {
|
|
71
|
+
display: block;
|
|
37
72
|
}
|
|
38
73
|
}
|
|
39
74
|
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface Sibling {
|
|
3
|
-
name: string;
|
|
4
|
-
url?: string;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
}
|
|
7
|
-
export interface Breadcrumb extends Sibling {
|
|
8
|
-
siblings?: {
|
|
9
|
-
state: 'initial' | 'fetching' | 'ready';
|
|
10
|
-
data?: Sibling[];
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export interface BreadcrumbsProps {
|
|
14
|
-
/** Список хлебных крошек. */
|
|
15
|
-
items: Breadcrumb[];
|
|
16
|
-
/** Получив хлебную крошку должна вернуть true если крошка выбрана. */
|
|
17
|
-
isSiblingActive?: (sibling: Sibling) => boolean;
|
|
18
|
-
/** Сработает при открытии попапа со смежными ссылками. */
|
|
19
|
-
onSiblingsPopupOpen?: (item: Breadcrumb) => void;
|
|
20
|
-
/** Идентификатор для систем автоматизированного тестирования. */
|
|
21
|
-
'data-testid'?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Список "хлебных крошек".
|
|
25
|
-
* @param props Свойства.
|
|
26
|
-
* @return Элемент.
|
|
27
|
-
*/
|
|
28
|
-
export declare const Breadcrumbs: ({ items, onSiblingsPopupOpen, isSiblingActive, "data-testid": testId, }: BreadcrumbsProps) => JSX.Element;
|
|
1
|
+
export { type Breadcrumb, type BreadcrumbsProps, Breadcrumbs } from './breadcrumbs';
|
|
@@ -1,83 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
3
|
exports.Breadcrumbs = void 0;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const link_1 = require("@sima-land/ui-nucleons/link");
|
|
34
|
-
const lodash_1 = require("lodash");
|
|
35
|
-
const bind_1 = __importDefault(require("classnames/bind"));
|
|
36
|
-
const breadcrumbs_module_scss_1 = __importDefault(require("./breadcrumbs.module.scss"));
|
|
37
|
-
const square_arrow_down_svg_1 = __importDefault(require("./square-arrow-down.svg"));
|
|
38
|
-
const on_1 = __importDefault(require("@sima-land/ui-nucleons/helpers/on"));
|
|
39
|
-
const cx = bind_1.default.bind(breadcrumbs_module_scss_1.default);
|
|
40
|
-
/**
|
|
41
|
-
* Список "хлебных крошек".
|
|
42
|
-
* @param props Свойства.
|
|
43
|
-
* @return Элемент.
|
|
44
|
-
*/
|
|
45
|
-
const Breadcrumbs = ({ items, onSiblingsPopupOpen, isSiblingActive, 'data-testid': testId = 'breadcrumbs', }) => (react_1.default.createElement("nav", { className: cx('root'), "data-testid": testId }, items.map((breadcrumb, index) => (react_1.default.createElement(Breadcrumb, { key: index, data: breadcrumb, onSiblingsPopupOpen: () => onSiblingsPopupOpen === null || onSiblingsPopupOpen === void 0 ? void 0 : onSiblingsPopupOpen(breadcrumb), isSiblingActive: sibling => Boolean(isSiblingActive === null || isSiblingActive === void 0 ? void 0 : isSiblingActive(sibling)) })))));
|
|
46
|
-
exports.Breadcrumbs = Breadcrumbs;
|
|
47
|
-
/**
|
|
48
|
-
* Элемент списка "хлебных крошек".
|
|
49
|
-
* @param props Свойства.
|
|
50
|
-
* @return Элемент.
|
|
51
|
-
*/
|
|
52
|
-
const Breadcrumb = ({ data, onSiblingsPopupOpen, isSiblingActive, }) => {
|
|
53
|
-
var _a;
|
|
54
|
-
const popupRef = (0, react_1.useRef)(null);
|
|
55
|
-
const [withPopup, togglePopup] = (0, react_1.useState)(false);
|
|
56
|
-
// с useOutsideClick не работает после обновления React до 17 версии, пока так
|
|
57
|
-
(0, react_1.useEffect)(() => {
|
|
58
|
-
if (withPopup) {
|
|
59
|
-
return (0, on_1.default)(window, 'mousedown', togglePopup.bind(null, false));
|
|
60
|
-
}
|
|
61
|
-
}, [withPopup]);
|
|
62
|
-
const selfName = (react_1.default.createElement(link_1.Link, { color: 'basic-gray87', href: data.url, pseudo: !data.url }, data.name));
|
|
63
|
-
return (react_1.default.createElement("div", { "data-testid": 'breadcrumb', className: cx('breadcrumb') },
|
|
64
|
-
selfName,
|
|
65
|
-
data.siblings && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
66
|
-
react_1.default.createElement(square_arrow_down_svg_1.default, { "data-testid": 'breadcrumb:siblings-opener', className: cx('toggle-icon'), onClick: () => {
|
|
67
|
-
togglePopup(true);
|
|
68
|
-
onSiblingsPopupOpen();
|
|
69
|
-
} }),
|
|
70
|
-
react_1.default.createElement(CSSTransition_1.default, { in: withPopup, timeout: 200, unmountOnExit: true, classNames: {
|
|
71
|
-
enter: cx('fade-enter'),
|
|
72
|
-
enterActive: cx('fade-enter-active'),
|
|
73
|
-
exit: cx('fade-exit'),
|
|
74
|
-
exitActive: cx('fade-exit-active'),
|
|
75
|
-
} },
|
|
76
|
-
react_1.default.createElement(plate_1.Plate, { ref: popupRef, shadow: 'z3', rounds: 'm', className: cx('popup') },
|
|
77
|
-
react_1.default.createElement("div", { className: cx('popup-header') },
|
|
78
|
-
selfName,
|
|
79
|
-
react_1.default.createElement(square_arrow_down_svg_1.default, { "data-testid": 'breadcrumb:siblings-closer', className: cx('toggle-icon', 'close'), onClick: () => togglePopup(false) })),
|
|
80
|
-
react_1.default.createElement("ul", { className: cx('siblings') },
|
|
81
|
-
data.siblings.state === 'fetching' && (react_1.default.createElement(react_1.default.Fragment, null, (0, lodash_1.times)(8).map(index => (react_1.default.createElement("div", { key: index, className: cx('sibling-placeholder') }))))),
|
|
82
|
-
data.siblings.state === 'ready' && (react_1.default.createElement(react_1.default.Fragment, null, (_a = data.siblings.data) === null || _a === void 0 ? void 0 : _a.map((sibling, index) => (react_1.default.createElement("li", { key: index, className: cx('sibling'), "data-testid": 'breadcrumb-sibling' }, isSiblingActive(sibling) ? (react_1.default.createElement("span", { className: cx('active') }, sibling.name)) : (react_1.default.createElement(link_1.Link, { color: 'basic-gray87', className: cx('link'), href: sibling.url, children: sibling.name }))))))))))))));
|
|
83
|
-
};
|
|
4
|
+
var breadcrumbs_1 = require("./breadcrumbs");
|
|
5
|
+
Object.defineProperty(exports, "Breadcrumbs", { enumerable: true, get: function () { return breadcrumbs_1.Breadcrumbs; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/desktop/components/breadcrumbs/index.ts"],"names":[],"mappings":";;;AAAA,6CAAoF;AAAnC,0GAAA,WAAW,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/desktop/components/gallery-modal/__mocks__/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface AllRoundViewProps {
|
|
3
2
|
photos: string[];
|
|
3
|
+
controls?: boolean;
|
|
4
|
+
state?: ViewState;
|
|
5
|
+
onStateChange?: (state: ViewState) => void;
|
|
4
6
|
}
|
|
7
|
+
export type ViewState = 'default' | 'autoplay' | 'turn-right' | 'turn-left';
|
|
5
8
|
/**
|
|
6
9
|
* 3д-просмотр.
|
|
7
10
|
* @param props Свойства.
|
|
8
11
|
* @return Элемент.
|
|
9
12
|
*/
|
|
10
|
-
export declare const AllRoundView: ({ photos }: AllRoundViewProps) => JSX.Element;
|
|
13
|
+
export declare const AllRoundView: ({ photos, controls, state: stateProp, onStateChange, }: AllRoundViewProps) => import("react/jsx-runtime").JSX.Element;
|