@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,18 @@
|
|
|
1
|
+
export type MediaType = 'image' | 'video' | '360';
|
|
2
|
+
export interface MediaShape<T extends string, D extends Record<string, any>> {
|
|
3
|
+
type: T;
|
|
4
|
+
data: D;
|
|
5
|
+
}
|
|
6
|
+
export type MediaImage = MediaShape<'image', {
|
|
7
|
+
src: string;
|
|
8
|
+
alt?: string;
|
|
9
|
+
thumbnail?: string;
|
|
10
|
+
}>;
|
|
11
|
+
export type MediaVideo = MediaShape<'video', {
|
|
12
|
+
src: string;
|
|
13
|
+
thumbnail?: string;
|
|
14
|
+
}>;
|
|
15
|
+
export type Media360 = MediaShape<'360', {
|
|
16
|
+
photos: string[];
|
|
17
|
+
}>;
|
|
18
|
+
export type MediaData = MediaImage | MediaVideo | Media360;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/common/components/media-modal/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
export interface IRange {
|
|
3
|
+
start: number;
|
|
4
|
+
finish: number;
|
|
5
|
+
}
|
|
6
|
+
/** Диапазон. */
|
|
7
|
+
export declare class Range {
|
|
8
|
+
/**
|
|
9
|
+
* Возвращает диапазон на основе вертикального размера элемента.
|
|
10
|
+
* @param el Элемент.
|
|
11
|
+
* @return Диапазон.
|
|
12
|
+
*/
|
|
13
|
+
static fromRectVertical(el: Element): IRange;
|
|
14
|
+
/**
|
|
15
|
+
* Возвращает диапазон на основе вертикального размера элемента.
|
|
16
|
+
* @param el Элемент.
|
|
17
|
+
* @return Диапазон.
|
|
18
|
+
*/
|
|
19
|
+
static fromRectHorizontal(el: Element): IRange;
|
|
20
|
+
/**
|
|
21
|
+
* Возвращает кратчайшее расстояние от диапазона до другого диапазона на которое нужно сместиться.
|
|
22
|
+
* @param range Диапазон.
|
|
23
|
+
* @param target Диапазон.
|
|
24
|
+
* @return Расстояние.
|
|
25
|
+
*/
|
|
26
|
+
static getShiftDistance(range: IRange, target: IRange): number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Возвращает ограничивающий прямоугольник элемента в виде состояния.
|
|
30
|
+
* @param ref Ref элемента.
|
|
31
|
+
* @return Прямоугольник.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useClientRect(ref: RefObject<HTMLElement>): {
|
|
34
|
+
ready: boolean;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Хук получения доступа к visualViewport.
|
|
40
|
+
* @param handle Получит visualViewport.
|
|
41
|
+
*/
|
|
42
|
+
export declare function useVisualViewport(handle: (viewport: VisualViewport) => void): void;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useVisualViewport = exports.useClientRect = exports.Range = void 0;
|
|
4
|
+
const hooks_1 = require("@sima-land/ui-nucleons/hooks");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
/** Диапазон. */
|
|
7
|
+
class Range {
|
|
8
|
+
/**
|
|
9
|
+
* Возвращает диапазон на основе вертикального размера элемента.
|
|
10
|
+
* @param el Элемент.
|
|
11
|
+
* @return Диапазон.
|
|
12
|
+
*/
|
|
13
|
+
static fromRectVertical(el) {
|
|
14
|
+
const rect = el.getBoundingClientRect();
|
|
15
|
+
return {
|
|
16
|
+
start: rect.top,
|
|
17
|
+
finish: rect.bottom,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Возвращает диапазон на основе вертикального размера элемента.
|
|
22
|
+
* @param el Элемент.
|
|
23
|
+
* @return Диапазон.
|
|
24
|
+
*/
|
|
25
|
+
static fromRectHorizontal(el) {
|
|
26
|
+
const rect = el.getBoundingClientRect();
|
|
27
|
+
return {
|
|
28
|
+
start: rect.left,
|
|
29
|
+
finish: rect.right,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Возвращает кратчайшее расстояние от диапазона до другого диапазона на которое нужно сместиться.
|
|
34
|
+
* @param range Диапазон.
|
|
35
|
+
* @param target Диапазон.
|
|
36
|
+
* @return Расстояние.
|
|
37
|
+
*/
|
|
38
|
+
static getShiftDistance(range, target) {
|
|
39
|
+
let result = 0;
|
|
40
|
+
if (target.finish > range.finish) {
|
|
41
|
+
result = target.finish - range.finish;
|
|
42
|
+
}
|
|
43
|
+
else if (target.start < range.start) {
|
|
44
|
+
result = -(range.start - target.start);
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Range = Range;
|
|
50
|
+
/**
|
|
51
|
+
* Возвращает ограничивающий прямоугольник элемента в виде состояния.
|
|
52
|
+
* @param ref Ref элемента.
|
|
53
|
+
* @return Прямоугольник.
|
|
54
|
+
*/
|
|
55
|
+
function useClientRect(ref) {
|
|
56
|
+
const [rect, setRect] = (0, react_1.useState)(() => ({
|
|
57
|
+
ready: false,
|
|
58
|
+
width: 0,
|
|
59
|
+
height: 0,
|
|
60
|
+
}));
|
|
61
|
+
(0, hooks_1.useIsomorphicLayoutEffect)(() => {
|
|
62
|
+
if (ref.current) {
|
|
63
|
+
const element = ref.current;
|
|
64
|
+
setRect({
|
|
65
|
+
ready: true,
|
|
66
|
+
width: element.getBoundingClientRect().width,
|
|
67
|
+
height: element.getBoundingClientRect().height,
|
|
68
|
+
});
|
|
69
|
+
const observer = new ResizeObserver(() => {
|
|
70
|
+
setRect({
|
|
71
|
+
ready: true,
|
|
72
|
+
width: element.getBoundingClientRect().width,
|
|
73
|
+
height: element.getBoundingClientRect().height,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
observer.observe(element);
|
|
77
|
+
return () => observer.disconnect();
|
|
78
|
+
}
|
|
79
|
+
}, [ref]);
|
|
80
|
+
return rect;
|
|
81
|
+
}
|
|
82
|
+
exports.useClientRect = useClientRect;
|
|
83
|
+
/**
|
|
84
|
+
* Хук получения доступа к visualViewport.
|
|
85
|
+
* @param handle Получит visualViewport.
|
|
86
|
+
*/
|
|
87
|
+
function useVisualViewport(handle) {
|
|
88
|
+
const ref = (0, hooks_1.useIdentityRef)(handle);
|
|
89
|
+
(0, react_1.useEffect)(() => {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
const viewport = window.visualViewport;
|
|
92
|
+
if (!viewport) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
// eslint-disable-next-line require-jsdoc
|
|
96
|
+
const update = () => ref.current(viewport);
|
|
97
|
+
window.addEventListener('resize', update);
|
|
98
|
+
(_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.addEventListener('resize', update);
|
|
99
|
+
(_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.addEventListener('scroll', update);
|
|
100
|
+
update();
|
|
101
|
+
return () => {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
window.removeEventListener('resize', update);
|
|
104
|
+
(_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.removeEventListener('resize', update);
|
|
105
|
+
(_b = window.visualViewport) === null || _b === void 0 ? void 0 : _b.removeEventListener('scroll', update);
|
|
106
|
+
};
|
|
107
|
+
}, []);
|
|
108
|
+
}
|
|
109
|
+
exports.useVisualViewport = useVisualViewport;
|
|
110
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/common/components/media-modal/utils.ts"],"names":[],"mappings":";;;AAAA,wDAAyF;AACzF,iCAAuD;AAOvD,gBAAgB;AAChB,MAAa,KAAK;IAChB;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,EAAW;QACjC,MAAM,IAAI,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;QAExC,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,GAAG;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,EAAW;QACnC,MAAM,IAAI,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;QAExC,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,IAAI;YAChB,MAAM,EAAE,IAAI,CAAC,KAAK;SACnB,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAa,EAAE,MAAc;QACnD,IAA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
}
|
|
6
|
-
interface ColorContent {
|
|
7
|
-
type: 'color';
|
|
8
|
-
color: string;
|
|
9
|
-
}
|
|
10
|
-
interface ImageContent {
|
|
11
|
-
type: 'image';
|
|
12
|
-
src: string;
|
|
13
|
-
}
|
|
14
|
-
export type ModifierContent = TextContent | ColorContent | ImageContent;
|
|
15
|
-
export interface ModifierProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
16
|
-
/** Вывести выбранным. */
|
|
17
|
-
active?: boolean;
|
|
18
|
-
/** Вывести отключенным. */
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/** Вывести зачеркнутым. */
|
|
21
|
-
crossedOut?: boolean;
|
|
22
|
-
/** Содержимое. */
|
|
23
|
-
content: ModifierContent;
|
|
24
|
-
/** Высота по дизайн-гайдам. */
|
|
25
|
-
size?: 's' | 'm';
|
|
26
|
-
/** Кол-во. */
|
|
27
|
-
count?: number;
|
|
28
|
-
/** Идентификатор для систем автоматизированного тестирования. */
|
|
29
|
-
'data-testid'?: string;
|
|
30
|
-
}
|
|
31
|
-
export type MoreButtonProps = Omit<ModifierProps, 'content' | 'crossedOut' | 'active' | 'count'> & {
|
|
32
|
-
count: number;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Кнопка модификатора (аналога товара).
|
|
36
|
-
* @param props Свойства.
|
|
37
|
-
* @return Элемент.
|
|
38
|
-
*/
|
|
39
|
-
export declare function Modifier({ size, active, crossedOut, disabled, content, count, className, 'data-testid': testId, ...props }: ModifierProps): JSX.Element;
|
|
40
|
-
/**
|
|
41
|
-
* Кнопка "+N" для показа полного списка модификаторов.
|
|
42
|
-
* @param props Свойства.
|
|
43
|
-
* @return Элемент.
|
|
44
|
-
*/
|
|
45
|
-
export declare function MoreButton({ count, className, 'data-testid': testId, ...rest }: MoreButtonProps): JSX.Element;
|
|
46
|
-
export {};
|
|
1
|
+
export type { TextContent, ImageContent, ColorContent, ModifierContent, ModifierProps, MoreButtonProps, } from './types';
|
|
2
|
+
export { Modifier, MoreButton } from './modifier';
|
|
@@ -1,102 +1,7 @@
|
|
|
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 __rest = (this && this.__rest) || function (s, e) {
|
|
26
|
-
var t = {};
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
28
|
-
t[p] = s[p];
|
|
29
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
30
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
31
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
32
|
-
t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
3
|
exports.MoreButton = exports.Modifier = void 0;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const cx = bind_1.default.bind(modifiers_module_scss_1.default);
|
|
46
|
-
/**
|
|
47
|
-
* Кнопка модификатора (аналога товара).
|
|
48
|
-
* @param props Свойства.
|
|
49
|
-
* @return Элемент.
|
|
50
|
-
*/
|
|
51
|
-
function Modifier(_a) {
|
|
52
|
-
var { size = 'm', active, crossedOut, disabled, content, count, className, 'data-testid': testId = 'modifier' } = _a, props = __rest(_a, ["size", "active", "crossedOut", "disabled", "content", "count", "className", 'data-testid']);
|
|
53
|
-
// текст хинта
|
|
54
|
-
const [hint, setHint] = (0, react_1.useState)('');
|
|
55
|
-
// состояние хинта
|
|
56
|
-
const [open, setOpen] = (0, react_1.useState)(false);
|
|
57
|
-
// позиционирование хинта
|
|
58
|
-
const _b = (0, hint_1.useHintFloating)({ open, onOpenChange: setOpen }), { refs } = _b, floating = __rest(_b, ["refs"]);
|
|
59
|
-
// пользовательское взаимодействие для хинта
|
|
60
|
-
const { getReferenceProps, getFloatingProps } = (0, hint_1.useHintOnHover)(floating);
|
|
61
|
-
// определение необходимости активации хинта
|
|
62
|
-
(0, react_1.useEffect)(() => {
|
|
63
|
-
const textElement = refs.reference.current;
|
|
64
|
-
if (!(textElement instanceof HTMLElement) || content.type !== 'text') {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
// eslint-disable-next-line require-jsdoc
|
|
68
|
-
const defineHint = () => setHint(isTruncated(textElement) ? content.text : '');
|
|
69
|
-
defineHint();
|
|
70
|
-
const observer = new ResizeObserver(defineHint);
|
|
71
|
-
observer.observe(textElement);
|
|
72
|
-
return () => observer.disconnect();
|
|
73
|
-
}, [content.text]);
|
|
74
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
75
|
-
react_1.default.createElement("a", Object.assign({}, props, { className: cx('root', `size-${size}`, { active, disabled }, className), "data-testid": testId }),
|
|
76
|
-
content.type === 'color' && (react_1.default.createElement("span", { className: cx('color'), role: 'banner', style: { background: content.color } })),
|
|
77
|
-
content.type === 'image' && (react_1.default.createElement("span", { className: cx('image'), role: 'banner', style: { backgroundImage: `url(${content.src})` } })),
|
|
78
|
-
content.type === 'text' && (react_1.default.createElement("span", Object.assign({ ref: refs.setReference, className: cx('text') }, getReferenceProps()), content.text)),
|
|
79
|
-
typeof count === 'number' && (react_1.default.createElement("span", { className: cx('counter') }, count > 99 ? '99+' : count)),
|
|
80
|
-
crossedOut && (react_1.default.createElement("svg", { width: '100%', height: '100%', className: cx('diagonal') },
|
|
81
|
-
react_1.default.createElement("line", { x1: '0', y1: '100%', x2: '100%', y2: '0', stroke: 'var(--modifier-border-color)' })))),
|
|
82
|
-
hint && (react_1.default.createElement(hint_1.Hint, Object.assign({ open: open, hintRef: refs.setFloating, arrowRef: refs.setArrow }, getFloatingProps()), hint))));
|
|
83
|
-
}
|
|
84
|
-
exports.Modifier = Modifier;
|
|
85
|
-
/**
|
|
86
|
-
* Кнопка "+N" для показа полного списка модификаторов.
|
|
87
|
-
* @param props Свойства.
|
|
88
|
-
* @return Элемент.
|
|
89
|
-
*/
|
|
90
|
-
function MoreButton(_a) {
|
|
91
|
-
var { count, className, 'data-testid': testId = 'more-modifiers' } = _a, rest = __rest(_a, ["count", "className", 'data-testid']);
|
|
92
|
-
return (react_1.default.createElement(Modifier, Object.assign({ role: 'button', "aria-label": '\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432\u0441\u0435 \u0430\u043D\u0430\u043B\u043E\u0433\u0438' }, rest, { className: cx('more', className), content: { type: 'text', text: `+${count}` }, "data-testid": testId })));
|
|
93
|
-
}
|
|
94
|
-
exports.MoreButton = MoreButton;
|
|
95
|
-
/**
|
|
96
|
-
* Определяет, обрезан ли текст в элементе.
|
|
97
|
-
* @param el Элемент.
|
|
98
|
-
* @return Обрезан ли текст в элементе.
|
|
99
|
-
*/
|
|
100
|
-
function isTruncated(el) {
|
|
101
|
-
return el.scrollWidth > el.clientWidth;
|
|
102
|
-
}
|
|
4
|
+
var modifier_1 = require("./modifier");
|
|
5
|
+
Object.defineProperty(exports, "Modifier", { enumerable: true, get: function () { return modifier_1.Modifier; } });
|
|
6
|
+
Object.defineProperty(exports, "MoreButton", { enumerable: true, get: function () { return modifier_1.MoreButton; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/components/modifier/index.ts"],"names":[],"mappings":";;;AAQA,uCAAkD;AAAzC,oGAAA,QAAQ,OAAA;AAAE,sGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ModifierProps, MoreButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Кнопка модификатора (аналога товара).
|
|
4
|
+
* @param props Свойства.
|
|
5
|
+
* @return Элемент.
|
|
6
|
+
*/
|
|
7
|
+
export declare function Modifier({ size, active, crossedOut, disabled, content, count, className, markdown, 'data-testid': testId, ...props }: ModifierProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Кнопка "+N" для показа полного списка модификаторов.
|
|
10
|
+
* @param props Свойства.
|
|
11
|
+
* @return Элемент.
|
|
12
|
+
*/
|
|
13
|
+
export declare function MoreButton({ count, className, 'data-testid': testId, ...rest }: MoreButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
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.MoreButton = exports.Modifier = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const hint_1 = require("@sima-land/ui-nucleons/hint");
|
|
10
|
+
const hooks_1 = require("../../hooks");
|
|
11
|
+
const ImageBroken_1 = __importDefault(require("@sima-land/ui-quarks/icons/40x40/Stroked/ImageBroken"));
|
|
12
|
+
const Cross_1 = __importDefault(require("@sima-land/ui-quarks/icons/24x24/Stroked/Cross"));
|
|
13
|
+
const bind_1 = __importDefault(require("classnames/bind"));
|
|
14
|
+
const modifier_m_scss_1 = __importDefault(require("./modifier.m.scss"));
|
|
15
|
+
const cx = bind_1.default.bind(modifier_m_scss_1.default);
|
|
16
|
+
/**
|
|
17
|
+
* Кнопка модификатора (аналога товара).
|
|
18
|
+
* @param props Свойства.
|
|
19
|
+
* @return Элемент.
|
|
20
|
+
*/
|
|
21
|
+
function Modifier({ size = 'm', active, crossedOut, disabled, content, count, className, markdown, 'data-testid': testId = 'modifier', ...props }) {
|
|
22
|
+
// текст хинта
|
|
23
|
+
const [hint, setHint] = (0, react_1.useState)('');
|
|
24
|
+
// состояние хинта
|
|
25
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
26
|
+
// позиционирование хинта
|
|
27
|
+
const { refs, ...floating } = (0, hint_1.useHintFloating)({ open, onOpenChange: setOpen });
|
|
28
|
+
// пользовательское взаимодействие для хинта
|
|
29
|
+
const { getReferenceProps, getFloatingProps } = (0, hint_1.useHintOnHover)(floating);
|
|
30
|
+
// определение необходимости активации хинта
|
|
31
|
+
(0, react_1.useEffect)(() => {
|
|
32
|
+
const textElement = refs.reference.current;
|
|
33
|
+
if (!(textElement instanceof HTMLElement) || content.type !== 'text') {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// eslint-disable-next-line require-jsdoc
|
|
37
|
+
const defineHint = () => setHint(isTruncated(textElement) ? content.text : '');
|
|
38
|
+
defineHint();
|
|
39
|
+
const observer = new ResizeObserver(defineHint);
|
|
40
|
+
observer.observe(textElement);
|
|
41
|
+
return () => observer.disconnect();
|
|
42
|
+
}, [content.text]);
|
|
43
|
+
// ВАЖНО: по дизайн-гайдам disabled не может быть перечеркнут
|
|
44
|
+
const canStrike = !disabled;
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("a", { ...props, className: cx('root', `size-${size}`, { active, disabled }, className), "data-testid": testId, children: [content.type === 'color' && ((0, jsx_runtime_1.jsx)("span", { className: cx('color'), role: 'banner', style: { background: content.color }, children: disabled && (0, jsx_runtime_1.jsx)(Cross_1.default, { className: cx('cross') }) })), content.type === 'image' && (0, jsx_runtime_1.jsx)(Image, { src: content.src }), content.type === 'text' && ((0, jsx_runtime_1.jsx)("span", { ref: refs.setReference, className: cx('text'), ...getReferenceProps(), children: content.text })), typeof count === 'number' && ((0, jsx_runtime_1.jsx)("span", { className: cx('counter'), children: count > 99 ? '99+' : count })), canStrike && crossedOut && ((0, jsx_runtime_1.jsx)("svg", { width: '100%', height: '100%', className: cx('diagonal'), children: (0, jsx_runtime_1.jsx)("line", { x1: '0', y1: '100%', x2: '100%', y2: '0', stroke: 'var(--modifier-border-color)', strokeWidth: 2 }) })), markdown && (0, jsx_runtime_1.jsx)("span", { className: modifier_m_scss_1.default.corner, children: "\u0423" })] }), hint && ((0, jsx_runtime_1.jsx)(hint_1.Hint, { open: open, hintRef: refs.setFloating, arrowRef: refs.setArrow, ...getFloatingProps(), children: hint }))] }));
|
|
46
|
+
}
|
|
47
|
+
exports.Modifier = Modifier;
|
|
48
|
+
/**
|
|
49
|
+
* Картинка с заглушкой в случае ошибки загрузки.
|
|
50
|
+
* @param props Свойства.
|
|
51
|
+
* @return Элемент.
|
|
52
|
+
*/
|
|
53
|
+
function Image({ src, onError, ...rest }) {
|
|
54
|
+
const { failed, handleError } = (0, hooks_1.useImageStub)(src, onError);
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: cx('image-wrapper', { fail: failed }), children: [failed && (0, jsx_runtime_1.jsx)(ImageBroken_1.default, {}), (0, jsx_runtime_1.jsx)("img", { className: cx('image'), ...rest, src: src, onError: handleError })] }));
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Кнопка "+N" для показа полного списка модификаторов.
|
|
59
|
+
* @param props Свойства.
|
|
60
|
+
* @return Элемент.
|
|
61
|
+
*/
|
|
62
|
+
function MoreButton({ count, className, 'data-testid': testId = 'more-modifiers', ...rest }) {
|
|
63
|
+
return ((0, jsx_runtime_1.jsx)(Modifier, { role: 'button', "aria-label": '\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432\u0441\u0435 \u0430\u043D\u0430\u043B\u043E\u0433\u0438', ...rest, className: cx('more', className), content: { type: 'text', text: `+${count}` }, "data-testid": testId }));
|
|
64
|
+
}
|
|
65
|
+
exports.MoreButton = MoreButton;
|
|
66
|
+
/**
|
|
67
|
+
* Определяет, обрезан ли текст в элементе.
|
|
68
|
+
* @param el Элемент.
|
|
69
|
+
* @return Обрезан ли текст в элементе.
|
|
70
|
+
*/
|
|
71
|
+
function isTruncated(el) {
|
|
72
|
+
return el.scrollWidth > el.clientWidth;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=modifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modifier.js","sourceRoot":"","sources":["../../../../src/common/components/modifier/modifier.tsx"],"names":[],"mappings":";;;;;;;AAAA,iCAA+D;AAC/D,sDAAoF;AACpF,uCAA2C;AAE3C,uGAAkF;AAClF,2FAAsE;AACtE,2DAAyC;AACzC,wEAAuC;AAEvC,MAAM,EAAE,GAAG,cAAU,CAAC,IAAI,CAAC,yBAAM,CAAC,CAAC;AAEnC;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,EACvB,IAAI,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AAoD;IACvE,OAAO,EAAE,CAAC,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC;AACzC,CAAC"}
|
|
@@ -14,8 +14,12 @@
|
|
|
14
14
|
--modifier-text-color: #{colors.$basic-gray87};
|
|
15
15
|
--modifier-border-width: 1px;
|
|
16
16
|
--modifier-border-color: #{colors.$basic-gray12};
|
|
17
|
+
--modifier-corner-bg: #{colors.$basic-gray12};
|
|
18
|
+
--modifier-corner-color: #{colors.$basic-gray87};
|
|
17
19
|
&.active {
|
|
18
20
|
--modifier-border-color: #{colors.$basic-blue};
|
|
21
|
+
--modifier-corner-color: #fff;
|
|
22
|
+
--modifier-corner-bg: #{colors.$basic-blue};
|
|
19
23
|
}
|
|
20
24
|
&:hover:not(.disabled) {
|
|
21
25
|
cursor: pointer;
|
|
@@ -28,6 +32,8 @@
|
|
|
28
32
|
--modifier-overlay-color: rgba(0, 0, 0, 0.04);
|
|
29
33
|
--modifier-border-width: 0;
|
|
30
34
|
--modifier-text-color: #{colors.$basic-gray38};
|
|
35
|
+
--modifier-corner-bg: transparent;
|
|
36
|
+
--modifier-corner-color: #{colors.$basic-gray38};
|
|
31
37
|
}
|
|
32
38
|
&::after {
|
|
33
39
|
content: '';
|
|
@@ -91,6 +97,36 @@
|
|
|
91
97
|
background-size: cover;
|
|
92
98
|
}
|
|
93
99
|
|
|
100
|
+
.image-wrapper {
|
|
101
|
+
border-radius: inherit;
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
position: absolute;
|
|
106
|
+
top: 0;
|
|
107
|
+
left: 0;
|
|
108
|
+
width: 100%;
|
|
109
|
+
height: 100%;
|
|
110
|
+
background: colors.$basic-gray4;
|
|
111
|
+
&.fail {
|
|
112
|
+
--modifier-media-opacity: 0;
|
|
113
|
+
}
|
|
114
|
+
> svg {
|
|
115
|
+
width: calc(48%);
|
|
116
|
+
height: calc(48%);
|
|
117
|
+
fill: colors.$basic-gray24;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.color {
|
|
122
|
+
display: flex;
|
|
123
|
+
align-items: center;
|
|
124
|
+
justify-content: center;
|
|
125
|
+
.cross {
|
|
126
|
+
fill: colors.$basic-gray24;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
94
130
|
.text {
|
|
95
131
|
padding: var(--modifier-padding);
|
|
96
132
|
display: block;
|
|
@@ -105,6 +141,7 @@
|
|
|
105
141
|
}
|
|
106
142
|
|
|
107
143
|
.counter {
|
|
144
|
+
white-space: nowrap;
|
|
108
145
|
font-weight: 600;
|
|
109
146
|
font-size: 12px;
|
|
110
147
|
line-height: 14px;
|
|
@@ -119,3 +156,27 @@
|
|
|
119
156
|
border-radius: 32px;
|
|
120
157
|
z-index: 1;
|
|
121
158
|
}
|
|
159
|
+
|
|
160
|
+
.corner {
|
|
161
|
+
font-weight: 600;
|
|
162
|
+
position: absolute;
|
|
163
|
+
bottom: 0;
|
|
164
|
+
right: 0;
|
|
165
|
+
width: 24px;
|
|
166
|
+
height: 24px;
|
|
167
|
+
border-bottom-right-radius: inherit;
|
|
168
|
+
font-size: 12px;
|
|
169
|
+
line-height: 14px;
|
|
170
|
+
padding-right: 2px;
|
|
171
|
+
display: flex;
|
|
172
|
+
justify-content: flex-end;
|
|
173
|
+
align-items: flex-end;
|
|
174
|
+
color: var(--modifier-corner-color);
|
|
175
|
+
background: linear-gradient(
|
|
176
|
+
to bottom right,
|
|
177
|
+
transparent 0%,
|
|
178
|
+
transparent 50%,
|
|
179
|
+
var(--modifier-corner-bg) 50%,
|
|
180
|
+
var(--modifier-corner-bg) 100%
|
|
181
|
+
);
|
|
182
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
export interface TextContent {
|
|
3
|
+
type: 'text';
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ColorContent {
|
|
7
|
+
type: 'color';
|
|
8
|
+
color: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ImageContent {
|
|
11
|
+
type: 'image';
|
|
12
|
+
src: string;
|
|
13
|
+
}
|
|
14
|
+
export type ModifierContent = TextContent | ColorContent | ImageContent;
|
|
15
|
+
export interface ModifierProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'content'> {
|
|
16
|
+
/** Вывести выбранным. */
|
|
17
|
+
active?: boolean;
|
|
18
|
+
/** Вывести отключенным. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** Вывести зачеркнутым. */
|
|
21
|
+
crossedOut?: boolean;
|
|
22
|
+
/** Содержимое. */
|
|
23
|
+
content: ModifierContent;
|
|
24
|
+
/** Высота по дизайн-гайдам. */
|
|
25
|
+
size?: 's' | 'm';
|
|
26
|
+
/** Кол-во. */
|
|
27
|
+
count?: number;
|
|
28
|
+
/** Выводить ли ярлык уценки. */
|
|
29
|
+
markdown?: boolean;
|
|
30
|
+
/** Идентификатор для систем автоматизированного тестирования. */
|
|
31
|
+
'data-testid'?: string;
|
|
32
|
+
}
|
|
33
|
+
export type MoreButtonProps = Omit<ModifierProps, 'content' | 'crossedOut' | 'active' | 'count'> & {
|
|
34
|
+
count: number;
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/common/components/modifier/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageFormInput = exports.PageForm = exports.PageButtons = exports.PaginationControls = void 0;
|
|
4
|
+
var pagination_controls_1 = require("./pagination-controls");
|
|
5
|
+
Object.defineProperty(exports, "PaginationControls", { enumerable: true, get: function () { return pagination_controls_1.PaginationControls; } });
|
|
6
|
+
Object.defineProperty(exports, "PageButtons", { enumerable: true, get: function () { return pagination_controls_1.PageButtons; } });
|
|
7
|
+
Object.defineProperty(exports, "PageForm", { enumerable: true, get: function () { return pagination_controls_1.PageForm; } });
|
|
8
|
+
Object.defineProperty(exports, "PageFormInput", { enumerable: true, get: function () { return pagination_controls_1.PageFormInput; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/common/components/pagination-controls/index.ts"],"names":[],"mappings":";;;AACA,6DAAiG;AAAxF,yHAAA,kBAAkB,OAAA;AAAE,kHAAA,WAAW,OAAA;AAAE,+GAAA,QAAQ,OAAA;AAAE,oHAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PaginationControlsProps } from './types';
|
|
2
|
+
import { InputProps } from '@sima-land/ui-nucleons/input';
|
|
3
|
+
/**
|
|
4
|
+
* Блок управления пагинацией.
|
|
5
|
+
* @param props Свойства.
|
|
6
|
+
* @return Элемент.
|
|
7
|
+
*/
|
|
8
|
+
export declare function PaginationControls({ current: currentProp, total: totalProp, onPageChange, flow, Buttons, Form, withForm: withFormProp, className, ...restProps }: PaginationControlsProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Кнопки страниц.
|
|
11
|
+
* @param props Свойства.
|
|
12
|
+
* @return Элемент.
|
|
13
|
+
*/
|
|
14
|
+
export declare function PageButtons({ total, current, onPageChange, }: {
|
|
15
|
+
total: number;
|
|
16
|
+
current: number;
|
|
17
|
+
onPageChange: (page: number) => void;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Форма выбора страницы.
|
|
21
|
+
* @param props Свойства.
|
|
22
|
+
* @return Элемент.
|
|
23
|
+
*/
|
|
24
|
+
export declare function PageForm({ total, onPageChange }: any): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* Поле ввода номера страницы. Только стилизует Input.
|
|
27
|
+
* @param props Свойства.
|
|
28
|
+
* @return Элемент.
|
|
29
|
+
*/
|
|
30
|
+
export declare function PageFormInput({ className, ...restProps }: InputProps): import("react/jsx-runtime").JSX.Element;
|