@citizenplane/pimp 17.0.2 → 17.0.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/components/CpBadge.vue.d.ts +6 -9
- package/dist/components/CpBadge.vue.d.ts.map +1 -1
- package/dist/components/CpHeading.vue.d.ts +4 -6
- package/dist/components/CpHeading.vue.d.ts.map +1 -1
- package/dist/components/CpMultiselect.vue.d.ts +2 -2
- package/dist/components/CpMultiselect.vue.d.ts.map +1 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/pimp.es.js +2343 -2343
- package/dist/pimp.umd.js +44 -44
- package/package.json +1 -1
- package/src/components/CpBadge.vue +3 -7
- package/src/components/CpHeading.vue +3 -7
- package/src/components/CpMultiselect.vue +5 -2
- package/src/constants/index.ts +0 -1
- package/src/stories/CpHeading.stories.ts +2 -3
- package/dist/constants/Heading.d.ts +0 -9
- package/dist/constants/Heading.d.ts.map +0 -1
- package/src/constants/Heading.ts +0 -8
package/package.json
CHANGED
|
@@ -18,22 +18,18 @@
|
|
|
18
18
|
<script setup lang="ts">
|
|
19
19
|
import { computed, useSlots } from 'vue'
|
|
20
20
|
|
|
21
|
-
import type { Colors, Sizes } from '@/constants'
|
|
22
21
|
import { capitalizeFirstLetter } from '@/helpers'
|
|
23
22
|
|
|
24
|
-
type BadgeSizes = Extract<Sizes, '2xs' | 'xs' | 'sm' | 'md'>
|
|
25
|
-
type BadgeVariants = 'outline' | 'soft' | 'solid'
|
|
26
|
-
|
|
27
23
|
interface Props {
|
|
28
|
-
color?:
|
|
24
|
+
color?: 'neutral' | 'accent' | 'error' | 'warning' | 'success' | 'blue' | 'pink' | 'magenta' | 'yellow' | 'white'
|
|
29
25
|
disabled?: boolean
|
|
30
26
|
isClearable?: boolean
|
|
31
27
|
isSquare?: boolean
|
|
32
28
|
label?: string
|
|
33
29
|
leadingIcon?: string
|
|
34
|
-
size?:
|
|
30
|
+
size?: '2xs' | 'xs' | 'sm' | 'md'
|
|
35
31
|
trailingIcon?: string
|
|
36
|
-
variant?:
|
|
32
|
+
variant?: 'outline' | 'soft' | 'solid'
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -5,20 +5,16 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup lang="ts">
|
|
8
|
-
import { HeadingLevels } from '@/constants'
|
|
9
|
-
|
|
10
|
-
type HeadingSize = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* @deprecated `CpHeading` is deprecated. Use CpText instead.
|
|
14
10
|
*/
|
|
15
11
|
interface Props {
|
|
16
|
-
headingLevel?:
|
|
17
|
-
size?:
|
|
12
|
+
headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
|
|
13
|
+
size?: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900
|
|
18
14
|
}
|
|
19
15
|
|
|
20
16
|
withDefaults(defineProps<Props>(), {
|
|
21
|
-
headingLevel:
|
|
17
|
+
headingLevel: 'h1',
|
|
22
18
|
size: 500,
|
|
23
19
|
})
|
|
24
20
|
|
|
@@ -130,7 +130,7 @@ interface Props {
|
|
|
130
130
|
name?: string
|
|
131
131
|
onSearch?: (query: string) => void
|
|
132
132
|
optionDisabled?: string | ((option: unknown) => boolean)
|
|
133
|
-
optionLabel?: string
|
|
133
|
+
optionLabel?: string | ((option: unknown) => string)
|
|
134
134
|
options?: unknown[]
|
|
135
135
|
placeholder?: string
|
|
136
136
|
required?: boolean
|
|
@@ -236,7 +236,10 @@ const dynamicOptions = computed(() => {
|
|
|
236
236
|
if (hasRegisteredOnSearch.value) return props.options
|
|
237
237
|
|
|
238
238
|
return props.options.filter((option: unknown) => {
|
|
239
|
-
const optionLabel =
|
|
239
|
+
const optionLabel =
|
|
240
|
+
typeof option === 'object' && typeof props.optionLabel === 'string'
|
|
241
|
+
? (option as Record<string, unknown>)[props.optionLabel]
|
|
242
|
+
: option
|
|
240
243
|
return (optionLabel as string).toLowerCase().includes(searchQuery.value.toLowerCase())
|
|
241
244
|
})
|
|
242
245
|
})
|
package/src/constants/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export type { Colors } from './colors/Colors'
|
|
2
2
|
export { Position } from './Position'
|
|
3
3
|
export type { ToggleColors } from './colors/ToggleColors'
|
|
4
|
-
export { HeadingLevels } from './Heading'
|
|
5
4
|
export { PAGINATION_FORMATS, RESERVED_KEYS, VISIBLE_ROWS_MAX } from './CpTableConfig'
|
|
6
5
|
export type { Sizes } from './Sizes'
|
|
7
6
|
|
|
@@ -2,10 +2,9 @@ import type { Args, Meta, StoryObj } from '@storybook/vue3-vite'
|
|
|
2
2
|
|
|
3
3
|
import CpHeading from '@/components/CpHeading.vue'
|
|
4
4
|
|
|
5
|
-
import { HeadingLevels } from '@/constants'
|
|
6
5
|
import { docLabelStyle } from '@/stories/documentationStyles'
|
|
7
6
|
|
|
8
|
-
const headingLevels =
|
|
7
|
+
const headingLevels = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] as const
|
|
9
8
|
const headingSizes = [100, 200, 300, 400, 500, 600, 700, 800, 900] as const
|
|
10
9
|
|
|
11
10
|
const headingRowStyle = 'display: grid; grid-template-columns: 90px 1fr; gap: 16px; align-items: center;'
|
|
@@ -44,7 +43,7 @@ type Story = StoryObj<typeof meta>
|
|
|
44
43
|
*/
|
|
45
44
|
export const Default: Story = {
|
|
46
45
|
args: {
|
|
47
|
-
headingLevel:
|
|
46
|
+
headingLevel: 'h1',
|
|
48
47
|
size: 500,
|
|
49
48
|
},
|
|
50
49
|
render: (args: Args) => ({
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../../src/constants/Heading.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACvB,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;IACT,EAAE,OAAO;CACV"}
|