@bethinkpl/design-system 26.10.2 → 26.11.1
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/.eslintrc.cjs +2 -3
- package/dist/design-system.umd.cjs +18 -18
- package/dist/design-system.umd.cjs.map +1 -1
- package/dist/lib/js/components/Avatar/Avatar.consts.d.ts +16 -1
- package/dist/lib/js/components/Avatar/Avatar.vue.d.ts +10 -21
- package/dist/lib/js/components/Badge/Badge.consts.d.ts +24 -0
- package/dist/lib/js/components/Badge/Badge.vue.d.ts +28 -0
- package/dist/lib/js/components/Badge/index.d.ts +4 -0
- package/dist/lib/js/components/BadgeScore/BadgeScore.vue.d.ts +2 -2
- package/dist/lib/js/components/Banner/Banner.vue.d.ts +11 -7
- package/dist/lib/js/components/Buttons/Button/Button.vue.d.ts +3 -2
- package/dist/lib/js/components/Buttons/IconButton/IconButton.vue.d.ts +6 -4
- package/dist/lib/js/components/Cards/CardExpandable/CardExpandable.vue.d.ts +2 -1
- package/dist/lib/js/components/Chip/Chip.vue.d.ts +8 -5
- package/dist/lib/js/components/DatePickers/DateBox/DateBox.vue.d.ts +2 -1
- package/dist/lib/js/components/DatePickers/DatePicker/DatePicker.vue.d.ts +6 -4
- package/dist/lib/js/components/DatePickers/DateRangePicker/DateRangePicker.vue.d.ts +2 -1
- package/dist/lib/js/components/Drawer/DrawerHeader/DrawerHeader.vue.d.ts +19 -12
- package/dist/lib/js/components/Drawer/DrawerListItem/DrawerListItem.vue.d.ts +2 -1
- package/dist/lib/js/components/Drawer/DrawerSection/DrawerSection.vue.d.ts +11 -7
- package/dist/lib/js/components/Drawer/DrawerTile/DrawerTile.vue.d.ts +2 -1
- package/dist/lib/js/components/Form/Checkbox/Checkbox.vue.d.ts +2 -1
- package/dist/lib/js/components/Form/RadioButton/RadioButton.vue.d.ts +2 -1
- package/dist/lib/js/components/Form/SelectionControl/SelectionControl.vue.d.ts +1 -1
- package/dist/lib/js/components/Headers/OverlayHeader/OverlayHeader.vue.d.ts +7 -4
- package/dist/lib/js/components/Headers/SectionHeader/SectionHeader.vue.d.ts +9 -6
- package/dist/lib/js/components/IconText/IconText.vue.d.ts +1 -1
- package/dist/lib/js/components/Icons/FeatureIcon/FeatureIcon.vue.d.ts +2 -2
- package/dist/lib/js/components/Icons/Icon/Icon.consts.d.ts +1 -0
- package/dist/lib/js/components/Icons/Icon/Icon.vue.d.ts +1 -1
- package/dist/lib/js/components/Modal/Modal.vue.d.ts +2 -1
- package/dist/lib/js/components/Modals/Modal/Modal.vue.d.ts +15 -11
- package/dist/lib/js/components/Modals/ModalDialog/ModalDialog.vue.d.ts +15 -11
- package/dist/lib/js/components/Outline/OutlineItem/OutlineItem.vue.d.ts +2 -1
- package/dist/lib/js/components/Pagination/Pagination.vue.d.ts +9 -5
- package/dist/lib/js/components/ProgressBar/ProgressBar.vue.d.ts +2 -1
- package/dist/lib/js/components/ProgressDonutChart/ProgressDonutChart.vue.d.ts +2 -1
- package/dist/lib/js/components/RichList/BasicRichListItem/BasicRichListItem.vue.d.ts +8 -6
- package/dist/lib/js/components/RichList/RichListItem/RichListItem.vue.d.ts +6 -4
- package/dist/lib/js/components/SelectList/SelectListItem/SelectListItem.vue.d.ts +2 -1
- package/dist/lib/js/components/SelectList/SelectListItemTile/SelectListItemTile.vue.d.ts +2 -1
- package/dist/lib/js/components/SelectList/SelectListItemToggle/SelectListItemToggle.vue.d.ts +2 -1
- package/dist/lib/js/components/SelectionTile/SelectionTile.vue.d.ts +8 -5
- package/dist/lib/js/components/Statuses/AccessStatus/AccessStatus.vue.d.ts +2 -1
- package/dist/lib/js/components/Statuses/BlockadeStatus/BlockadeStatus.vue.d.ts +2 -1
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionOpenEnded/SurveyQuestionOpenEnded.vue.d.ts +12 -7
- package/dist/lib/js/components/SurveyQuestions/SurveyQuestionScale/SurveyQuestionScale.vue.d.ts +13 -8
- package/dist/lib/js/components/SurveyToggle/SurveyToggle.vue.d.ts +1 -1
- package/dist/lib/js/components/Switch/Switch.vue.d.ts +2 -1
- package/dist/lib/js/components/TabItem/TabItem.vue.d.ts +2 -2
- package/dist/lib/js/components/Tile/Tile.sb.shared.d.ts +14 -9
- package/dist/lib/js/components/Tile/Tile.vue.d.ts +2 -1
- package/dist/lib/js/components/Toast/Toast.vue.d.ts +5 -4
- package/dist/lib/js/components/Toggles/CounterToggle/CounterToggle.vue.d.ts +1 -1
- package/dist/lib/js/components/Toggles/ToggleButton/ToggleButton.vue.d.ts +2 -1
- package/dist/lib/js/icons/fontawesome.d.ts +1 -0
- package/dist/lib/js/index.d.ts +2 -0
- package/docs/assets/{AccessStatus-Bb89L0n4.js → AccessStatus-DAozhq98.js} +1 -1
- package/docs/assets/{AccessStatus.stories-B3_KTVWu.js → AccessStatus.stories-C6cLegp3.js} +1 -1
- package/docs/assets/Avatar-CyH7GOXC.js +1 -0
- package/docs/assets/Avatar.stories-EMICoTsv.js +37 -0
- package/docs/assets/Badge-C_DdsSZ7.js +1 -0
- package/docs/assets/Badge.stories-BdIOpCFV.js +21 -0
- package/docs/assets/{BadgeScore-VoyhoyPu.js → BadgeScore-DpNakYLf.js} +1 -1
- package/docs/assets/{BadgeScore.stories-CNY-1Nuu.js → BadgeScore.stories-B46-Fee0.js} +1 -1
- package/docs/assets/{Banner-DaqGIRps.js → Banner-BVX9uvqC.js} +1 -1
- package/docs/assets/{Banner.stories-BP7LrBw0.js → Banner.stories-B0AwPpRk.js} +1 -1
- package/docs/assets/{BasicRichListItem-C2lY5QHc.js → BasicRichListItem-5SyClSLN.js} +1 -1
- package/docs/assets/{BasicRichListItem.stories-CJLLsCH2.js → BasicRichListItem.stories-BmeYvwcc.js} +2 -2
- package/docs/assets/{BlockadeStatus-BovI8qdo.js → BlockadeStatus-BsXZvAIL.js} +1 -1
- package/docs/assets/{BlockedeStatus.stories-CZqKhsVe.js → BlockedeStatus.stories-ClRpE3bZ.js} +1 -1
- package/docs/assets/{Button-TCMWFFTV.js → Button-BlGyuUvH.js} +1 -1
- package/docs/assets/{Button.stories-BP78ebL5.js → Button.stories-Ut5KitzG.js} +1 -1
- package/docs/assets/{CardExpandable-U3c3_RFR.js → CardExpandable-CjAv2mlM.js} +1 -1
- package/docs/assets/{CardExpandable.stories-CJJrRvWG.js → CardExpandable.stories-CcoVrKMp.js} +1 -1
- package/docs/assets/{Checkbox-Bsa7X8oN.js → Checkbox-DBDCkcql.js} +1 -1
- package/docs/assets/{Checkbox.stories-D_FmTwaw.js → Checkbox.stories-B--JF1-e.js} +1 -1
- package/docs/assets/{Chip-CTSLlUHr.js → Chip-CoQMdgxz.js} +1 -1
- package/docs/assets/{Chip.stories-BlDSOmpM.js → Chip.stories-6aVLme2A.js} +1 -1
- package/docs/assets/{Color-ERTF36HU-06Iq2w_Z.js → Color-ERTF36HU-Bgd4agbd.js} +1 -1
- package/docs/assets/{CounterToggle-BVPp4FeG.js → CounterToggle-B1tyHrcb.js} +1 -1
- package/docs/assets/{CounterToggle.stories-Bj6qyGpF.js → CounterToggle.stories-ByxrdK5a.js} +1 -1
- package/docs/assets/{DateBox.stories-DL_j7ydW.js → DateBox.stories-DdmSt5SP.js} +1 -1
- package/docs/assets/{DatePicker-CcKDLhxp.js → DatePicker-CphfRqao.js} +1 -1
- package/docs/assets/{DatePicker.stories-CK6I-6c-.js → DatePicker.stories-QTXcDV8x.js} +1 -1
- package/docs/assets/{DateRangePicker-laHPjs-v.js → DateRangePicker-BFevyPhM.js} +1 -1
- package/docs/assets/{DateRangePicker.stories-BtP6-oba.js → DateRangePicker.stories-DeOtJw_j.js} +1 -1
- package/docs/assets/{DocsRenderer-CFRXHY34-D86268a8.js → DocsRenderer-CFRXHY34-BqGlF68N.js} +5 -5
- package/docs/assets/{DrawerHeader-BUFtT2yY.js → DrawerHeader-D97tPP1t.js} +1 -1
- package/docs/assets/{DrawerHeader.stories-C2E1814K.js → DrawerHeader.stories-C5e5tJVz.js} +1 -1
- package/docs/assets/{DrawerListItem-BruVct4m.js → DrawerListItem-By3go0J8.js} +1 -1
- package/docs/assets/{DrawerListItem.stories-D5YRBGHl.js → DrawerListItem.stories-Bnmka2iO.js} +1 -1
- package/docs/assets/{DrawerListItemGroup.stories-Bn3gvIvs.js → DrawerListItemGroup.stories-DNKDkE6S.js} +1 -1
- package/docs/assets/{DrawerSection-CGE0Z89z.js → DrawerSection-DkyBHEhI.js} +1 -1
- package/docs/assets/{DrawerSection.stories-DanW010v.js → DrawerSection.stories-nXh59UtP.js} +1 -1
- package/docs/assets/{DrawerTile-C4SUdovI.js → DrawerTile-Bn3QBEM3.js} +1 -1
- package/docs/assets/{DrawerTile.stories-DfNjL51X.js → DrawerTile.stories-BJiXhGFF.js} +1 -1
- package/docs/assets/{Dropdown.stories-ARX2jFhf.js → Dropdown.stories-Bgb2T7PO.js} +1 -1
- package/docs/assets/{FeatureIcon-DEdW5Abw.js → FeatureIcon-DV_vwpea.js} +1 -1
- package/docs/assets/{FeatureIcon.stories-BvrIv3nz.js → FeatureIcon.stories-BavMJsoo.js} +1 -1
- package/docs/assets/{GroupRichListItem-BvMN1U8t.js → GroupRichListItem-O4THFrsv.js} +1 -1
- package/docs/assets/{GroupRichListItem.stories-BBLgdtH3.js → GroupRichListItem.stories-BEZOyJzl.js} +1 -1
- package/docs/assets/{Icon-BCID_1bx.js → Icon-D72drrb6.js} +6 -6
- package/docs/assets/{Icon.stories-DGcaJLbW.js → Icon.stories-D_loJzAi.js} +1 -1
- package/docs/assets/{IconButton-BAw3zjHF.js → IconButton-Da_zvyX7.js} +1 -1
- package/docs/assets/{IconButton.stories-qS45zAsa.js → IconButton.stories-DEV41Nj2.js} +1 -1
- package/docs/assets/{IconText-832pwWI9.js → IconText-BfNA5UTy.js} +1 -1
- package/docs/assets/{IconText.stories-I2fBQvxS.js → IconText.stories-Bm-mCumu.js} +1 -1
- package/docs/assets/{Modal-Dup6Muk_.js → Modal-e2OJqEx6.js} +1 -1
- package/docs/assets/{Modal.stories-BaoTM0GW.js → Modal.stories-C-gPjZ8I.js} +1 -1
- package/docs/assets/{ModalDialog-DOx_9BEj.js → ModalDialog-BcTTN7PD.js} +1 -1
- package/docs/assets/{ModalDialog.stories-D8jVrVFf.js → ModalDialog.stories-B2kXr7sL.js} +1 -1
- package/docs/assets/{OutlineItem-BsB-mMO_.js → OutlineItem-C5cknxOM.js} +1 -1
- package/docs/assets/{OutlineItem.stories-BWjCGXmh.js → OutlineItem.stories-CICRx4vQ.js} +1 -1
- package/docs/assets/{OverlayHeader-IVWPOkcc.js → OverlayHeader-5R2Jm9fs.js} +1 -1
- package/docs/assets/{OverlayHeader.stories-Bfs3IIBX.js → OverlayHeader.stories-BA01siTU.js} +1 -1
- package/docs/assets/{Pagination-bDyh9QNI.js → Pagination-BfHdJXPr.js} +1 -1
- package/docs/assets/{Pagination.stories-UEaZytU1.js → Pagination.stories-raD7KfI2.js} +1 -1
- package/docs/assets/{PopOver-D3l-RPQg.js → PopOver-BWwOLXJP.js} +1 -1
- package/docs/assets/{PopOver.stories-3vKhXSoG.js → PopOver.stories-vM1d9Vff.js} +1 -1
- package/docs/assets/{ProgressBar-CS0FvbKL.js → ProgressBar-BOZMVymY.js} +1 -1
- package/docs/assets/{ProgressBar.stories-D3hrlw5G.js → ProgressBar.stories-D_QQfH1F.js} +1 -1
- package/docs/assets/{ProgressDonutChart-Ds7o43EP.js → ProgressDonutChart-BWyCd55w.js} +1 -1
- package/docs/assets/{ProgressDonutChart.stories-D6gMV_Gy.js → ProgressDonutChart.stories-Dlv29dAf.js} +1 -1
- package/docs/assets/{RadioButton-CPXnEX35.js → RadioButton-L8hnF8sH.js} +1 -1
- package/docs/assets/{RadioButton.stories-BcRXcnlp.js → RadioButton.stories-BUJXHXGa.js} +1 -1
- package/docs/assets/{RichListItem.stories-xEDsV2D_.js → RichListItem.stories-NraC9DuF.js} +2 -2
- package/docs/assets/{SectionHeader-uor_aNAH.js → SectionHeader-WXMwcaWe.js} +1 -1
- package/docs/assets/{SectionHeader.stories-CPacayR1.js → SectionHeader.stories-D0Ta5y-c.js} +1 -1
- package/docs/assets/{SelectList.stories-B-sk3_IU.js → SelectList.stories-_qOcDSsN.js} +1 -1
- package/docs/assets/{SelectListItem-CwQPayet.js → SelectListItem-DHqmJFi_.js} +1 -1
- package/docs/assets/{SelectListItem.stories-Czz_7goW.js → SelectListItem.stories-BrQwuqXQ.js} +1 -1
- package/docs/assets/{SelectListItemTile-BS64oXam.js → SelectListItemTile-pCS7yK08.js} +1 -1
- package/docs/assets/{SelectListItemTile.stories-B0tSdA5I.js → SelectListItemTile.stories-CwdlpMd7.js} +1 -1
- package/docs/assets/{SelectListItemToggle-6Qc40Pdh.js → SelectListItemToggle-GN-0OBDP.js} +1 -1
- package/docs/assets/{SelectListItemToggle.stories-Du5NmLzv.js → SelectListItemToggle.stories-C4txWtg4.js} +1 -1
- package/docs/assets/{SelectionControl-KJWkMhCz.js → SelectionControl-BL5uVF9q.js} +1 -1
- package/docs/assets/{SelectionTile-DSpUGzPs.js → SelectionTile-Bxj2H72X.js} +2 -2
- package/docs/assets/{SelectionTile.stories-WMHY5FHJ.js → SelectionTile.stories-dYQOOlxh.js} +1 -1
- package/docs/assets/{SurveyQuestionOpenEnded-DP0hAB06.js → SurveyQuestionOpenEnded-CbCdMqdU.js} +1 -1
- package/docs/assets/{SurveyQuestionOpenEnded.stories-Dz2pNxN6.js → SurveyQuestionOpenEnded.stories-CMwbUI_V.js} +1 -1
- package/docs/assets/{SurveyQuestionScale-C0UAJdFd.js → SurveyQuestionScale-HqskoWHw.js} +1 -1
- package/docs/assets/{SurveyQuestionScale.stories-BFpl63w3.js → SurveyQuestionScale.stories-DIIdVIxr.js} +1 -1
- package/docs/assets/{SurveyToggle-CUgbE0SL.js → SurveyToggle-dFnl6u9f.js} +1 -1
- package/docs/assets/{SurveyToggle.stories-DtsK6lka.js → SurveyToggle.stories-VLCT1-6b.js} +1 -1
- package/docs/assets/{Switch-Dba5kcqg.js → Switch-B-8G1I_D.js} +1 -1
- package/docs/assets/{Switch.stories-DfL5rrfA.js → Switch.stories-Ce_nwq2m.js} +1 -1
- package/docs/assets/{TabItem-CapV8hZ1.js → TabItem-CCiBiekg.js} +1 -1
- package/docs/assets/{TabItem.stories-DYTyMD_u.js → TabItem.stories-DBzmY8li.js} +1 -1
- package/docs/assets/{Tile-cjoefzuT.js → Tile-B06IR8wJ.js} +1 -1
- package/docs/assets/{Tile.sb.shared-Cgo0fG1v.js → Tile.sb.shared-Co8VJ0Bz.js} +1 -1
- package/docs/assets/{Tile.stories-B2oKdkzl.js → Tile.stories-BUVrWgXK.js} +1 -1
- package/docs/assets/{Toast-tGyu8Qsr.js → Toast-DSRIG3HV.js} +1 -1
- package/docs/assets/{Toast.stories-BUAwdQVH.js → Toast.stories-Hel1AZl0.js} +1 -1
- package/docs/assets/{ToggleButton-BsVq0wUU.js → ToggleButton-F9dPtMgO.js} +1 -1
- package/docs/assets/{ToggleButton.stories-C88JvePy.js → ToggleButton.stories-BCgq_RVA.js} +1 -1
- package/docs/assets/{Tooltip.stories-DTS2hkAV.js → Tooltip.stories-Dn4_HeNw.js} +1 -1
- package/docs/assets/{iframe-DJBrrd4-.js → iframe-B5cbsFW6.js} +4 -3
- package/docs/assets/{index-C_7Ic1-A.js → index-BeQ2I55w.js} +1 -1
- package/docs/assets/{index-nq_4YiNl.js → index-Dtbp-BBz.js} +1 -1
- package/docs/assets/{preview-TdvdvCat.js → preview-D7CmhTJh.js} +2 -2
- package/docs/assets/preview-DKb1KTxp.js +64 -0
- package/docs/assets/{string-CxurpGTK.js → string-ybdEWR3p.js} +1 -1
- package/docs/iframe.html +1 -1
- package/docs/index.json +1 -1
- package/docs/project.json +1 -1
- package/lib/js/components/Avatar/Avatar.consts.ts +20 -1
- package/lib/js/components/Avatar/Avatar.spec.ts +83 -3
- package/lib/js/components/Avatar/Avatar.stories.ts +24 -4
- package/lib/js/components/Avatar/Avatar.vue +210 -46
- package/lib/js/components/Badge/Badge.consts.ts +29 -0
- package/lib/js/components/Badge/Badge.spec.ts +168 -0
- package/lib/js/components/Badge/Badge.stories.ts +99 -0
- package/lib/js/components/Badge/Badge.vue +297 -0
- package/lib/js/components/Badge/index.ts +4 -0
- package/lib/js/components/Chip/Chip.stories.ts +1 -1
- package/lib/js/icons/fontawesome.ts +2 -0
- package/lib/js/index.ts +2 -0
- package/package.json +3 -2
- package/docs/assets/Avatar-OqeGv3bT.js +0 -1
- package/docs/assets/Avatar.stories-Ran7nhCi.js +0 -35
- package/docs/assets/preview-hR283N6x.js +0 -64
- /package/lib/{js/components/Chip → images}/logo-badge.svg +0 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="ds-badge"
|
|
4
|
+
:class="{
|
|
5
|
+
'-ds-x-small': size === BADGE_SIZES.X_SMALL,
|
|
6
|
+
'-ds-small': size === BADGE_SIZES.SMALL,
|
|
7
|
+
'-ds-medium': size === BADGE_SIZES.MEDIUM,
|
|
8
|
+
'-ds-large': size === BADGE_SIZES.LARGE,
|
|
9
|
+
'-ds-x-large': size === BADGE_SIZES.X_LARGE,
|
|
10
|
+
'-ds-color-primary': color === BADGE_COLORS.PRIMARY,
|
|
11
|
+
'-ds-color-success': color === BADGE_COLORS.SUCCESS,
|
|
12
|
+
'-ds-color-fail': color === BADGE_COLORS.FAIL,
|
|
13
|
+
'-ds-color-danger': color === BADGE_COLORS.DANGER,
|
|
14
|
+
'-ds-color-neutral': color === BADGE_COLORS.NEUTRAL,
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
<div
|
|
18
|
+
:class="[
|
|
19
|
+
'ds-badge__elevation',
|
|
20
|
+
{
|
|
21
|
+
'-ds-no-elevation': elevation === BADGE_ELEVATIONS.NONE,
|
|
22
|
+
'-ds-elevation-s': elevation === BADGE_ELEVATIONS.SMALL,
|
|
23
|
+
},
|
|
24
|
+
]"
|
|
25
|
+
>
|
|
26
|
+
</div>
|
|
27
|
+
<div v-if="!imageUrl && !icon" class="ds-badge__content">
|
|
28
|
+
{{ label }}
|
|
29
|
+
</div>
|
|
30
|
+
<icon v-if="!imageUrl && icon" :icon="icon" :size="iconSize" class="ds-badge__icon" />
|
|
31
|
+
<img v-if="imageUrl" :src="imageUrl" class="ds-badge__image" />
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<style scoped lang="scss">
|
|
36
|
+
@import '../../../styles/settings/radiuses';
|
|
37
|
+
@import '../../../styles/settings/typography/tokens';
|
|
38
|
+
@import '../../../styles/settings/colors/tokens';
|
|
39
|
+
@import '../../../styles/settings/spacings';
|
|
40
|
+
@import '../../../styles/settings/shadows';
|
|
41
|
+
|
|
42
|
+
$badge-elevation-size-xl: 30px;
|
|
43
|
+
$badge-elevation-size-l: 24px;
|
|
44
|
+
$badge-elevation-size-m: 18px;
|
|
45
|
+
$badge-elevation-size-s: 12px;
|
|
46
|
+
$badge-elevation-size-xs: 10px;
|
|
47
|
+
|
|
48
|
+
$badge-content-size-xl: 20px;
|
|
49
|
+
$badge-content-size-l: 16px;
|
|
50
|
+
$badge-content-size-m: 12px;
|
|
51
|
+
$badge-content-size-s: 8px;
|
|
52
|
+
$badge-content-size-xs: 6px;
|
|
53
|
+
|
|
54
|
+
$elevation-gap-xl: ($badge-elevation-size-xl - $badge-content-size-xl) / 2;
|
|
55
|
+
$elevation-gap-l: ($badge-elevation-size-l - $badge-content-size-l) / 2;
|
|
56
|
+
$elevation-gap-m: ($badge-elevation-size-m - $badge-content-size-m) / 2;
|
|
57
|
+
$elevation-gap-s: ($badge-elevation-size-s - $badge-content-size-s) / 2;
|
|
58
|
+
$elevation-gap-xs: ($badge-elevation-size-xs - $badge-content-size-xs) / 2;
|
|
59
|
+
|
|
60
|
+
.ds-badge {
|
|
61
|
+
$root: &;
|
|
62
|
+
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
position: relative;
|
|
66
|
+
|
|
67
|
+
&__elevation {
|
|
68
|
+
align-items: center;
|
|
69
|
+
background-color: $color-default-background;
|
|
70
|
+
border-radius: $radius-xl;
|
|
71
|
+
display: flex;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
position: absolute;
|
|
74
|
+
|
|
75
|
+
&.-ds-no-elevation {
|
|
76
|
+
display: none;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&.-ds-elevation-s {
|
|
80
|
+
box-shadow: $shadow-s;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&__content {
|
|
85
|
+
align-items: center;
|
|
86
|
+
border-radius: $radius-xl;
|
|
87
|
+
color: $color-inverted-text;
|
|
88
|
+
display: flex;
|
|
89
|
+
justify-content: center;
|
|
90
|
+
position: relative;
|
|
91
|
+
width: 100%;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&__icon {
|
|
95
|
+
position: relative;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&__image {
|
|
99
|
+
position: relative;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.-ds-x-small {
|
|
103
|
+
height: $badge-content-size-xs;
|
|
104
|
+
min-width: $badge-content-size-xs;
|
|
105
|
+
|
|
106
|
+
& #{$root}__elevation {
|
|
107
|
+
height: $badge-elevation-size-xs;
|
|
108
|
+
left: -$elevation-gap-xs;
|
|
109
|
+
padding: $elevation-gap-xs;
|
|
110
|
+
top: -$elevation-gap-xs;
|
|
111
|
+
width: calc(100% + 2 * $elevation-gap-xs);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
& #{$root}__image {
|
|
115
|
+
max-width: $badge-content-size-xs;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
&.-ds-small {
|
|
120
|
+
height: $badge-content-size-s;
|
|
121
|
+
min-width: $badge-content-size-s;
|
|
122
|
+
|
|
123
|
+
& #{$root}__elevation {
|
|
124
|
+
height: $badge-elevation-size-s;
|
|
125
|
+
left: -$elevation-gap-s;
|
|
126
|
+
padding: $elevation-gap-s;
|
|
127
|
+
top: -$elevation-gap-s;
|
|
128
|
+
width: calc(100% + 2 * $elevation-gap-s);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
& #{$root}__image {
|
|
132
|
+
max-width: $badge-content-size-s;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&.-ds-medium {
|
|
137
|
+
height: $badge-content-size-m;
|
|
138
|
+
min-width: $badge-content-size-m;
|
|
139
|
+
|
|
140
|
+
& #{$root}__elevation {
|
|
141
|
+
height: $badge-elevation-size-m;
|
|
142
|
+
left: -$elevation-gap-m;
|
|
143
|
+
padding: $elevation-gap-m;
|
|
144
|
+
top: -$elevation-gap-m;
|
|
145
|
+
width: calc(100% + 2 * $elevation-gap-m);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
& #{$root}__content {
|
|
149
|
+
@include label-xs-default-bold;
|
|
150
|
+
|
|
151
|
+
padding: 0 $space-5xs;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
& #{$root}__image {
|
|
155
|
+
max-width: $badge-content-size-m;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&.-ds-large {
|
|
160
|
+
height: $badge-content-size-l;
|
|
161
|
+
min-width: $badge-content-size-l;
|
|
162
|
+
|
|
163
|
+
& #{$root}__elevation {
|
|
164
|
+
height: $badge-elevation-size-l;
|
|
165
|
+
left: -$elevation-gap-l;
|
|
166
|
+
padding: $elevation-gap-l;
|
|
167
|
+
top: -$elevation-gap-l;
|
|
168
|
+
width: calc(100% + 2 * $elevation-gap-l);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
& #{$root}__content {
|
|
172
|
+
@include label-xs-default-bold;
|
|
173
|
+
|
|
174
|
+
padding: 0 $space-4xs;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
& #{$root}__image {
|
|
178
|
+
max-width: $badge-content-size-l;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&.-ds-x-large {
|
|
183
|
+
height: $badge-content-size-xl;
|
|
184
|
+
min-width: $badge-content-size-xl;
|
|
185
|
+
|
|
186
|
+
& #{$root}__elevation {
|
|
187
|
+
height: $badge-elevation-size-xl;
|
|
188
|
+
left: -$elevation-gap-xl;
|
|
189
|
+
padding: $elevation-gap-xl;
|
|
190
|
+
top: -$elevation-gap-xl;
|
|
191
|
+
width: calc(100% + 2 * $elevation-gap-xl);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
& #{$root}__content {
|
|
195
|
+
@include label-s-default-bold;
|
|
196
|
+
|
|
197
|
+
padding: 0 $space-4xs;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
& #{$root}__image {
|
|
201
|
+
max-width: $badge-content-size-xl;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&.-ds-color-primary {
|
|
206
|
+
& #{$root}__content {
|
|
207
|
+
background-color: $color-primary-background-strong;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
& #{$root}__icon {
|
|
211
|
+
color: $color-primary-icon;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&.-ds-color-success {
|
|
216
|
+
& #{$root}__content {
|
|
217
|
+
background-color: $color-success-background-strong;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
& #{$root}__icon {
|
|
221
|
+
color: $color-success-icon;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
&.-ds-color-fail {
|
|
226
|
+
& #{$root}__content {
|
|
227
|
+
background-color: $color-fail-background-strong;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
& #{$root}__icon {
|
|
231
|
+
color: $color-fail-icon;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&.-ds-color-danger {
|
|
236
|
+
& #{$root}__content {
|
|
237
|
+
background-color: $color-danger-background-strong;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
& #{$root}__icon {
|
|
241
|
+
color: $color-danger-icon;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
&.-ds-color-neutral {
|
|
246
|
+
& #{$root}__content {
|
|
247
|
+
background-color: $color-neutral-background-heavy;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
& #{$root}__icon {
|
|
251
|
+
color: $color-neutral-icon;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
</style>
|
|
256
|
+
|
|
257
|
+
<script lang="ts" setup>
|
|
258
|
+
import {
|
|
259
|
+
BADGE_COLORS,
|
|
260
|
+
BADGE_SIZES,
|
|
261
|
+
BADGE_ELEVATIONS,
|
|
262
|
+
BadgeColor,
|
|
263
|
+
BadgeElevation,
|
|
264
|
+
BadgeSize,
|
|
265
|
+
} from './Badge.consts';
|
|
266
|
+
import Icon, { ICON_SIZES, IconItem } from '../Icons/Icon';
|
|
267
|
+
import { computed } from 'vue';
|
|
268
|
+
|
|
269
|
+
const {
|
|
270
|
+
size = BADGE_SIZES.SMALL,
|
|
271
|
+
color = BADGE_COLORS.PRIMARY,
|
|
272
|
+
elevation = BADGE_ELEVATIONS.X_SMALL,
|
|
273
|
+
icon,
|
|
274
|
+
} = defineProps<{
|
|
275
|
+
color?: BadgeColor;
|
|
276
|
+
size?: BadgeSize;
|
|
277
|
+
label?: string;
|
|
278
|
+
icon?: IconItem;
|
|
279
|
+
imageUrl?: string;
|
|
280
|
+
elevation?: BadgeElevation;
|
|
281
|
+
}>();
|
|
282
|
+
|
|
283
|
+
const iconSize = computed(() => {
|
|
284
|
+
// Casting to BadgeSize to work around an IDE issue (PhpStorm incorrectly flags some case branches as unreachable)
|
|
285
|
+
switch (size as BadgeSize) {
|
|
286
|
+
case BADGE_SIZES.SMALL:
|
|
287
|
+
return ICON_SIZES.XXX_SMALL;
|
|
288
|
+
case BADGE_SIZES.MEDIUM:
|
|
289
|
+
return ICON_SIZES.XX_SMALL;
|
|
290
|
+
case BADGE_SIZES.LARGE:
|
|
291
|
+
return ICON_SIZES.X_SMALL;
|
|
292
|
+
case BADGE_SIZES.X_LARGE:
|
|
293
|
+
default:
|
|
294
|
+
return ICON_SIZES.SMALL;
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
</script>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Chip from './Chip.vue';
|
|
2
2
|
import { CHIP_COLORS, CHIP_RADIUSES, CHIP_SIZES, CHIP_STATES } from './Chip.consts';
|
|
3
3
|
import { ICONS } from '../Icons/Icon';
|
|
4
|
-
import LogoBadge from '
|
|
4
|
+
import LogoBadge from '../../../images/logo-badge.svg';
|
|
5
5
|
import { Args, ArgTypes, Meta, StoryFn } from '@storybook/vue3';
|
|
6
6
|
|
|
7
7
|
export default {
|
|
@@ -181,6 +181,7 @@ import { faHeart as fasHeart } from '@fortawesome/pro-solid-svg-icons/faHeart';
|
|
|
181
181
|
import { faInfo as fasInfo } from '@fortawesome/pro-solid-svg-icons/faInfo';
|
|
182
182
|
import { faLightbulb as fasLightbulb } from '@fortawesome/pro-solid-svg-icons/faLightbulb';
|
|
183
183
|
import { faMemoCircleInfo as fasMemoCircleInfo } from '@fortawesome/pro-solid-svg-icons/faMemoCircleInfo';
|
|
184
|
+
import { faMessages } from '@fortawesome/pro-regular-svg-icons/faMessages';
|
|
184
185
|
import { faMessageQuestion as fasMessageQuestion } from '@fortawesome/pro-solid-svg-icons/faMessageQuestion';
|
|
185
186
|
import { faMessageQuestion } from '@fortawesome/pro-regular-svg-icons/faMessageQuestion';
|
|
186
187
|
import { faMessageXmark } from '@fortawesome/pro-regular-svg-icons/faMessageXmark';
|
|
@@ -352,6 +353,7 @@ export const FONTAWESOME_ICONS = {
|
|
|
352
353
|
FA_MEDAL: faMedal,
|
|
353
354
|
FA_MEMO_CIRCLE_INFO: faMemoCircleInfo,
|
|
354
355
|
FA_MEMO_CIRCLE_INFO_SOLID: fasMemoCircleInfo,
|
|
356
|
+
FA_MESSAGES: faMessages,
|
|
355
357
|
FA_MESSAGE_QUESTION_SOLID: fasMessageQuestion,
|
|
356
358
|
FA_MESSAGE_QUESTION: faMessageQuestion,
|
|
357
359
|
FA_MESSAGE_XMARK: faMessageXmark,
|
package/lib/js/index.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as Avatar } from './components/Avatar';
|
|
2
2
|
export * from './components/Avatar/Avatar.consts';
|
|
3
|
+
export { default as Badge } from './components/Badge';
|
|
4
|
+
export * from './components/Badge/Badge.consts';
|
|
3
5
|
export { default as BadgeScore } from './components/BadgeScore';
|
|
4
6
|
export { default as DsBadgeScore } from './components/BadgeScore';
|
|
5
7
|
export * from './components/BadgeScore/BadgeScore.consts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bethinkpl/design-system",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.11.1",
|
|
4
4
|
"description": "Bethink universe design-system",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"eslint-config-prettier": "8.5.0",
|
|
63
63
|
"eslint-plugin-import": "2.26.0",
|
|
64
64
|
"eslint-plugin-storybook": "0.8.0",
|
|
65
|
-
"eslint-plugin-vue": "
|
|
65
|
+
"eslint-plugin-vue": "10.0.0",
|
|
66
66
|
"flatpickr": "^4.6.13",
|
|
67
67
|
"jest": "^29.4.0",
|
|
68
68
|
"jest-environment-jsdom": "^29.4.0",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"vite-plugin-dts": "^3.9.1",
|
|
88
88
|
"vite-svg-loader": "^5.1.0",
|
|
89
89
|
"vue": "3.5.12",
|
|
90
|
+
"vue-eslint-parser": "^10.1.1",
|
|
90
91
|
"vue-popperjs": "github:bethinkpl/vue-popper#03c7912c4729386743b0cca8f39b35448cc3db7f"
|
|
91
92
|
},
|
|
92
93
|
"dependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as A,q as o,c as n,a as v,j as _,s as L,n as g,u as s,o as l}from"./vue.esm-bundler-DmkhfO_9.js";import{_ as S}from"./_plugin-vue_export-helper-DlAUqK2U.js";const e={XX_SMALL:"xx-small",X_SMALL:"x-small",SMALL:"small",MEDIUM:"medium",LARGE:"large",X_LARGE:"x-large"},M=["src","alt"],y={key:1,class:"ds-avatar__initials"},d=A({__name:"Avatar",props:{username:{},avatarUrl:{default:void 0},size:{default:e.X_SMALL}},setup(c){const t=c,u=["#1abc9c","#2ecc71","#3498db","#9b59b6","#34495e","#16a085","#27ae60","#2980b9","#8e44ad","#2c3e50","#f1c40f","#e67e22","#e74c3c","#f39c12","#d35400","#c0392b"];function m(a){const[r,i]=a.split(/\s+/);return r&&i?`${r[0]}${i[0]}`.toUpperCase():r.substring(0,2).toUpperCase()}const p=o(()=>{if(t.avatarUrl)return;const a=(t.username.charCodeAt(0)-65)%16;return u[a]}),f=o(()=>m(t.username));return(a,r)=>(l(),n("div",{class:g(["ds-avatar",{"-ds-xx-small":a.size===s(e).XX_SMALL,"-ds-x-small":a.size===s(e).X_SMALL,"-ds-small":a.size===s(e).SMALL,"-ds-medium":a.size===s(e).MEDIUM,"-ds-large":a.size===s(e).LARGE,"-ds-x-large":a.size===s(e).X_LARGE}])},[v("div",{class:"ds-avatar__content",style:L({backgroundColor:p.value})},[a.avatarUrl?(l(),n("img",{key:0,src:a.avatarUrl,alt:a.username,class:"ds-avatar__image"},null,8,M)):(l(),n("span",y,_(f.value),1))],4)],2))}}),b=S(d,[["__scopeId","data-v-11da23f8"]]);d.__docgenInfo={exportName:"default",displayName:"Avatar",description:"",tags:{},props:[{name:"username",required:!0,type:{name:"string"}},{name:"avatarUrl",required:!1,type:{name:"string"},defaultValue:{func:!1,value:"undefined"}},{name:"size",required:!1,type:{name:"AvatarSize"},defaultValue:{func:!1,value:"AVATAR_SIZES.X_SMALL"}}],sourceFiles:["/home/runner/work/design-system/design-system/lib/js/components/Avatar/Avatar.vue"]};export{b as A,e as a};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import{A as o,a as r}from"./Avatar-OqeGv3bT.js";import"./vue.esm-bundler-DmkhfO_9.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const z={title:"Components/Avatar",component:o,render:s=>({components:{Avatar:o},setup(){return{args:s}},template:'<Avatar v-bind="args" />'}),argTypes:{size:{control:"select",options:[...Object.values(r)]}}},a={args:{size:r.X_SMALL,username:"Dariusz Chrapek",avatarUrl:"https://wiecejnizlek.pl/wp-content/uploads/2021/08/Dariusz_Chrapek-uai-2996x2996-1-scaled.jpeg"}};a.parameters={design:{type:"figma",url:"https://www.figma.com/design/izQdYyiBR1GQgFkaOIfIJI/LMS---DS-Components?node-id=12364-12175&t=UpUoIm9oCAaH4dEp-4"}};const e={render:s=>({components:{Avatar:o},setup(){return{args:s,names:["Arkadiusz Kowalski","Bartosz Nowak","Cezary Kowalczyk","Dariusz Chrapek","Edward Nowak","Feliks Kowalski","Grzegorz Nowak","Henryk Kowalczyk","Ireneusz Nowak","Jacek Kowalski","Kamil Nowak","Leszek Kowalczyk","Marek Nowak","Norbert Kowalski","Oskar Nowak","Piotr Kowalczyk"]}},template:'<div style="display: flex; gap: 12px; flex-wrap: wrap;"><div v-for="name in names"><Avatar :username="name" :size="args.size" /></div></div>'}),argTypes:{size:{control:"select",options:Object.values(r)},username:{control:!1},avatarUrl:{control:!1}},args:{size:r.X_SMALL}};var t,n,i;a.parameters={...a.parameters,docs:{...(t=a.parameters)==null?void 0:t.docs,source:{originalSource:`{
|
|
2
|
-
args: {
|
|
3
|
-
size: AVATAR_SIZES.X_SMALL,
|
|
4
|
-
username: 'Dariusz Chrapek',
|
|
5
|
-
avatarUrl: 'https://wiecejnizlek.pl/wp-content/uploads/2021/08/Dariusz_Chrapek-uai-2996x2996-1-scaled.jpeg'
|
|
6
|
-
}
|
|
7
|
-
}`,...(i=(n=a.parameters)==null?void 0:n.docs)==null?void 0:i.source}}};var l,p,k;e.parameters={...e.parameters,docs:{...(l=e.parameters)==null?void 0:l.docs,source:{originalSource:`{
|
|
8
|
-
render: (args: AvatarProps) => ({
|
|
9
|
-
components: {
|
|
10
|
-
Avatar
|
|
11
|
-
},
|
|
12
|
-
setup() {
|
|
13
|
-
return {
|
|
14
|
-
args,
|
|
15
|
-
names: ['Arkadiusz Kowalski', 'Bartosz Nowak', 'Cezary Kowalczyk', 'Dariusz Chrapek', 'Edward Nowak', 'Feliks Kowalski', 'Grzegorz Nowak', 'Henryk Kowalczyk', 'Ireneusz Nowak', 'Jacek Kowalski', 'Kamil Nowak', 'Leszek Kowalczyk', 'Marek Nowak', 'Norbert Kowalski', 'Oskar Nowak', 'Piotr Kowalczyk']
|
|
16
|
-
};
|
|
17
|
-
},
|
|
18
|
-
template: \`<div style="display: flex; gap: 12px; flex-wrap: wrap;"><div v-for="name in names"><Avatar :username="name" :size="args.size" /></div></div>\`
|
|
19
|
-
}),
|
|
20
|
-
argTypes: {
|
|
21
|
-
size: {
|
|
22
|
-
control: 'select',
|
|
23
|
-
options: Object.values(AVATAR_SIZES)
|
|
24
|
-
},
|
|
25
|
-
username: {
|
|
26
|
-
control: false
|
|
27
|
-
},
|
|
28
|
-
avatarUrl: {
|
|
29
|
-
control: false
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
args: {
|
|
33
|
-
size: AVATAR_SIZES.X_SMALL
|
|
34
|
-
}
|
|
35
|
-
}`,...(k=(p=e.parameters)==null?void 0:p.docs)==null?void 0:k.source}}};const d=["Interactive","Colors"];export{e as Colors,a as Interactive,d as __namedExportsOrder,z as default};
|