@citizenplane/pimp 9.13.2 → 9.13.4
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/dist/pimp.es.js +22 -37
- package/dist/pimp.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpBadge.vue +10 -4
- package/src/components/icons/IconNoPassport.vue +12 -11
- package/src/components/icons/IconPassport.vue +14 -11
- package/src/stories/CpBadge.stories.ts +24 -0
- package/src/stories/CpIcon.stories.ts +23 -0
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cpBadge" :class="componentDynamicClasses">
|
|
3
3
|
<slot name="leading-icon">
|
|
4
|
-
<cp-icon v-if="leadingIcon"
|
|
4
|
+
<cp-icon v-if="leadingIcon" class="cpBadge__icon" :type="leadingIcon" />
|
|
5
5
|
</slot>
|
|
6
6
|
<span class="cpBadge__label">
|
|
7
7
|
<slot>{{ label }}</slot>
|
|
8
8
|
</span>
|
|
9
9
|
<slot v-if="!isClearable" name="trailing-icon">
|
|
10
|
-
<cp-icon v-if="trailingIcon"
|
|
10
|
+
<cp-icon v-if="trailingIcon" class="cpBadge__icon" :type="trailingIcon" />
|
|
11
11
|
</slot>
|
|
12
|
-
<button v-if="isClearable" class="cpBadge__clear"
|
|
13
|
-
<cp-icon
|
|
12
|
+
<button v-if="isClearable" class="cpBadge__clear" :disabled="isDisabled" type="button" @click="handleClear">
|
|
13
|
+
<cp-icon class="cpBadge__clearIcon" type="x" />
|
|
14
14
|
</button>
|
|
15
15
|
</div>
|
|
16
16
|
</template>
|
|
@@ -28,6 +28,7 @@ interface Emits {
|
|
|
28
28
|
interface Props {
|
|
29
29
|
color?: Colors
|
|
30
30
|
isClearable?: boolean
|
|
31
|
+
isDashed?: boolean
|
|
31
32
|
isDisabled?: boolean
|
|
32
33
|
isSquare?: boolean
|
|
33
34
|
isStroked?: boolean
|
|
@@ -57,6 +58,7 @@ const componentDynamicClasses = computed(() => {
|
|
|
57
58
|
`cpBadge--is${capitalizeFirstLetter(props.color)}`,
|
|
58
59
|
{ 'cpBadge--isStroked': props.isStroked },
|
|
59
60
|
{ 'cpBadge--isSquare': props.isSquare },
|
|
61
|
+
{ 'cpBadge--isDashed': props.isDashed },
|
|
60
62
|
{ 'cpBadge--isDisabled': props.isDisabled },
|
|
61
63
|
]
|
|
62
64
|
})
|
|
@@ -108,6 +110,10 @@ const handleClear = () => emit('onClear')
|
|
|
108
110
|
outline: 1px solid currentColor;
|
|
109
111
|
}
|
|
110
112
|
|
|
113
|
+
&--isDashed {
|
|
114
|
+
outline-style: dashed;
|
|
115
|
+
}
|
|
116
|
+
|
|
111
117
|
&--isSquare {
|
|
112
118
|
border-radius: fn.px-to-rem(8);
|
|
113
119
|
|
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<svg
|
|
3
|
-
|
|
3
|
+
clip-rule="evenodd"
|
|
4
|
+
fill="currentColor"
|
|
5
|
+
fill-rule="evenodd"
|
|
4
6
|
height="24"
|
|
5
7
|
viewBox="0 0 24 24"
|
|
6
|
-
|
|
8
|
+
width="24"
|
|
7
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
stroke="currentColor"
|
|
9
|
-
stroke-width="2"
|
|
10
|
-
stroke-linecap="round"
|
|
11
|
-
stroke-linejoin="round"
|
|
12
10
|
>
|
|
13
11
|
<g clip-path="url(#clip0_4785_394)">
|
|
14
|
-
<path d="M1 1L23 23" />
|
|
15
|
-
<path d="M4.68018 9.35397V21H16.0532M19.4477 19.1946V5C19.4477 3.89543 18.5522 3 17.4477 3H7H4.68018V4.53769" />
|
|
16
12
|
<path
|
|
17
|
-
d="
|
|
13
|
+
d="M0.292977 0.292992C0.683498 -0.0974964 1.31652 -0.0975061 1.70704 0.292992L3.81544 2.40139C3.99781 2.15781 4.28852 2.00004 4.61622 2.00002H17.3838C19.0406 2.00007 20.3838 3.3432 20.3838 5.00002V18.9697L23.707 22.293C24.0976 22.6835 24.0975 23.3165 23.707 23.7071C23.3165 24.0976 22.6835 24.0976 22.293 23.7071L0.292977 1.70705C-0.0975315 1.31653 -0.0975422 0.683511 0.292977 0.292992ZM5.61622 4.20217L8.50196 7.08791C9.22217 5.95299 10.4883 5.19839 11.9326 5.19827C14.1759 5.1985 15.995 7.01743 15.9951 9.26077C15.9951 10.7049 15.2405 11.9711 14.1055 12.6914L18.3838 16.9697V5.00002C18.3838 4.44777 17.936 4.00007 17.3838 4.00002H5.61622V4.20217ZM11.9326 7.19827C11.0354 7.19842 10.2711 7.77302 9.98829 8.57424L12.6182 11.2041C13.4194 10.9216 13.9951 10.1587 13.9951 9.26077C13.995 8.122 13.0714 7.1985 11.9326 7.19827Z"
|
|
14
|
+
/>
|
|
15
|
+
<path
|
|
16
|
+
d="M4.61622 8.35354C5.16835 8.35354 5.61597 8.80146 5.61622 9.35354V20H15.9893C16.5415 20 16.9893 20.4477 16.9893 21C16.9893 21.5523 16.5415 22 15.9893 22H4.61622C4.06396 22 3.61622 21.5523 3.61622 21V9.35354C3.61646 8.80148 4.06411 8.35357 4.61622 8.35354Z"
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
d="M11.3223 15.3047C11.8742 15.3051 12.3223 15.7526 12.3223 16.3047C12.3221 16.8567 11.8742 17.3043 11.3223 17.3047H9.14259C8.59038 17.3047 8.14272 16.8569 8.14259 16.3047C8.14259 15.7524 8.5903 15.3047 9.14259 15.3047H11.3223Z"
|
|
18
20
|
/>
|
|
19
|
-
<path d="M9.20605 16.3044H11.3855" />
|
|
20
21
|
</g>
|
|
21
22
|
<defs>
|
|
22
23
|
<clipPath id="clip0_4785_394">
|
|
23
|
-
<rect
|
|
24
|
+
<rect fill="white" height="24" width="24" />
|
|
24
25
|
</clipPath>
|
|
25
26
|
</defs>
|
|
26
27
|
</svg>
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<svg
|
|
2
|
+
<svg
|
|
3
|
+
clip-rule="evenodd"
|
|
4
|
+
fill="currentColor"
|
|
5
|
+
fill-rule="evenodd"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 24 24"
|
|
8
|
+
width="24"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
>
|
|
3
11
|
<path
|
|
4
|
-
d="
|
|
5
|
-
stroke="#3E3E5B"
|
|
6
|
-
stroke-width="2"
|
|
7
|
-
stroke-linejoin="round"
|
|
12
|
+
d="M14.7227 15.3047C15.2747 15.3049 15.7227 15.7526 15.7227 16.3047C15.7225 16.8567 15.2747 17.3044 14.7227 17.3047H9.14258C8.59037 17.3047 8.14271 16.8569 8.14258 16.3047C8.14258 15.7524 8.59029 15.3047 9.14258 15.3047H14.7227Z"
|
|
8
13
|
/>
|
|
9
|
-
<circle cx="12.3163" cy="9.26086" r="3.06237" stroke="#3E3E5B" stroke-width="2" />
|
|
10
14
|
<path
|
|
11
|
-
d="
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
stroke-linejoin="round"
|
|
15
|
+
d="M11.9326 5.19824C14.1761 5.19831 15.995 7.01731 15.9951 9.26074C15.995 11.5042 14.1761 13.3232 11.9326 13.3232C9.6891 13.3232 7.87019 11.5043 7.87012 9.26074C7.87025 7.01728 9.68913 5.19827 11.9326 5.19824ZM11.9326 7.19824C10.7937 7.19827 9.87025 8.12185 9.87012 9.26074C9.87019 10.3997 10.7937 11.3232 11.9326 11.3232C13.0715 11.3232 13.995 10.3997 13.9951 9.26074C13.995 8.12188 13.0715 7.19831 11.9326 7.19824Z"
|
|
16
|
+
/>
|
|
17
|
+
<path
|
|
18
|
+
d="M17.3838 2C19.0406 2.00005 20.3838 3.34318 20.3838 5V19C20.3838 20.6568 19.0406 21.9999 17.3838 22H4.61621C4.06395 22 3.61621 21.5523 3.61621 21V3C3.61621 2.44773 4.06395 2.00002 4.61621 2H17.3838ZM5.61621 20H17.3838C17.936 19.9999 18.3838 19.5523 18.3838 19V5C18.3838 4.44775 17.936 4.00005 17.3838 4H5.61621V20Z"
|
|
16
19
|
/>
|
|
17
20
|
</svg>
|
|
18
21
|
</template>
|
|
@@ -22,6 +22,10 @@ const meta = {
|
|
|
22
22
|
control: 'boolean',
|
|
23
23
|
description: 'Whether the badge has a stroked border',
|
|
24
24
|
},
|
|
25
|
+
isDashed: {
|
|
26
|
+
control: 'boolean',
|
|
27
|
+
description: 'Whether the badge has a dashed border',
|
|
28
|
+
},
|
|
25
29
|
isSquare: {
|
|
26
30
|
control: 'boolean',
|
|
27
31
|
description: 'Whether the badge has a square border',
|
|
@@ -145,6 +149,26 @@ export const IsStroked: Story = {
|
|
|
145
149
|
}),
|
|
146
150
|
}
|
|
147
151
|
|
|
152
|
+
export const IsDashed: Story = {
|
|
153
|
+
render: (args: Args) => ({
|
|
154
|
+
components: { CpBadge },
|
|
155
|
+
setup() {
|
|
156
|
+
return { args }
|
|
157
|
+
},
|
|
158
|
+
template: `
|
|
159
|
+
<div style="display: flex; gap: 8px; align-items: center;">
|
|
160
|
+
<CpBadge v-bind="args" is-dashed is-stroked color="blue" leading-icon="plus" trailing-icon="plus" label="Label" />
|
|
161
|
+
<CpBadge v-bind="args" is-dashed is-stroked color="red" leading-icon="plus" trailing-icon="plus" label="Label" />
|
|
162
|
+
<CpBadge v-bind="args" is-dashed is-stroked color="orange" leading-icon="plus" trailing-icon="plus" label="Label" />
|
|
163
|
+
<CpBadge v-bind="args" is-dashed is-stroked color="yellow" leading-icon="plus" trailing-icon="plus" label="Label" />
|
|
164
|
+
<CpBadge v-bind="args" is-dashed is-stroked color="green" leading-icon="plus" trailing-icon="plus" label="Label" />
|
|
165
|
+
<CpBadge v-bind="args" is-dashed is-stroked color="purple" leading-icon="plus" trailing-icon="plus" label="Label" />
|
|
166
|
+
<CpBadge v-bind="args" is-dashed is-stroked color="gray" leading-icon="plus" trailing-icon="plus" label="Label" />
|
|
167
|
+
</div>
|
|
168
|
+
`,
|
|
169
|
+
}),
|
|
170
|
+
}
|
|
171
|
+
|
|
148
172
|
export const IsSquare: Story = {
|
|
149
173
|
args: { ...Default.args, isSquare: true, label: 'Square' },
|
|
150
174
|
render: defaultRender,
|
|
@@ -113,3 +113,26 @@ export const AllIcons: Story = {
|
|
|
113
113
|
`,
|
|
114
114
|
}),
|
|
115
115
|
}
|
|
116
|
+
|
|
117
|
+
export const AllIconsColored: Story = {
|
|
118
|
+
args: {
|
|
119
|
+
type: 'check',
|
|
120
|
+
},
|
|
121
|
+
render: () => ({
|
|
122
|
+
components: { CpIcon },
|
|
123
|
+
setup() {
|
|
124
|
+
return { icons: iconsOptions }
|
|
125
|
+
},
|
|
126
|
+
template: `
|
|
127
|
+
<div style="padding: 20px; display: grid; grid-template-columns: repeat(4, minmax(100px, 3fr)); gap: 16px;">
|
|
128
|
+
<div v-for="icon in icons" style="display: flex; flex-direction: column; align-items: center;border: 1px solid #eee;border-radius: 4px;">
|
|
129
|
+
<span style="font-size: 12px; padding: 8px; word-break: break-word;">{{ icon }}</span>
|
|
130
|
+
<hr style="width: 100%; background-color: #eee; height: 1px; border: 0" />
|
|
131
|
+
<div style="padding: 20px; color: green;background-color: #f0fdf4;width: 100%;display: flex;align-items: center;justify-content: center;height: 100%;">
|
|
132
|
+
<CpIcon :key="icon" :type="icon" />
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
`,
|
|
137
|
+
}),
|
|
138
|
+
}
|