fds-vue-core 2.3.2 → 3.0.0
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/fds-vue-core.cjs.js +21 -21
- package/dist/fds-vue-core.cjs.js.map +1 -1
- package/dist/fds-vue-core.es.js +21 -21
- package/dist/fds-vue-core.es.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Blocks/FdsBlockAlert/FdsBlockAlert.stories.ts +12 -12
- package/src/components/Blocks/FdsBlockAlert/FdsBlockAlert.vue +3 -3
- package/src/components/Blocks/FdsBlockAlert/types.ts +1 -1
- package/src/components/Blocks/FdsBlockExpander/FdsBlockExpander.stories.ts +11 -11
- package/src/components/Blocks/FdsBlockExpander/FdsBlockExpander.vue +2 -2
- package/src/components/Blocks/FdsBlockExpander/types.ts +1 -1
- package/src/components/Blocks/FdsBlockInfo/FdsBlockInfo.stories.ts +3 -3
- package/src/components/Blocks/FdsBlockInfo/FdsBlockInfo.vue +6 -6
- package/src/components/Blocks/FdsBlockInfo/types.ts +1 -1
- package/src/components/Blocks/FdsBlockLink/FdsBlockLink.stories.ts +12 -12
- package/src/components/Blocks/FdsBlockLink/FdsBlockLink.vue +1 -1
- package/src/components/Blocks/FdsBlockLink/types.ts +1 -1
- package/src/components/Buttons/FdsButtonCopy/FdsButtonCopy.stories.ts +6 -6
- package/src/components/Buttons/FdsButtonCopy/FdsButtonCopy.vue +4 -4
- package/src/components/Buttons/FdsButtonCopy/types.ts +2 -2
- package/src/components/FdsDevMode/FdsDevModeStorage.vue +4 -4
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@ const blockAlertTransform = (
|
|
|
6
6
|
storyContext: {
|
|
7
7
|
args?: {
|
|
8
8
|
visible?: boolean
|
|
9
|
-
|
|
9
|
+
heading?: string
|
|
10
10
|
closeable?: boolean
|
|
11
11
|
collapsable?: boolean
|
|
12
12
|
expanded?: boolean
|
|
@@ -18,7 +18,7 @@ const blockAlertTransform = (
|
|
|
18
18
|
const args = storyContext?.args || {}
|
|
19
19
|
const attrs = []
|
|
20
20
|
|
|
21
|
-
if (args.
|
|
21
|
+
if (args.heading) attrs.push(`heading="${args.heading}"`)
|
|
22
22
|
if (args.closeable) attrs.push(':closeable="true"')
|
|
23
23
|
if (args.collapsable) attrs.push(':collapsable="true"')
|
|
24
24
|
if (args.expanded) attrs.push(':expanded="true"')
|
|
@@ -49,7 +49,7 @@ const meta: Meta<typeof FdsBlockAlert> = {
|
|
|
49
49
|
closeable: { control: { type: 'boolean' } },
|
|
50
50
|
collapsable: { control: { type: 'boolean' } },
|
|
51
51
|
expanded: { control: { type: 'boolean' } },
|
|
52
|
-
|
|
52
|
+
heading: { control: { type: 'text' } },
|
|
53
53
|
default: { control: { type: 'text' } },
|
|
54
54
|
locale: { control: { type: 'select' }, options: ['sv', 'en'] },
|
|
55
55
|
},
|
|
@@ -58,7 +58,7 @@ const meta: Meta<typeof FdsBlockAlert> = {
|
|
|
58
58
|
closeable: false,
|
|
59
59
|
collapsable: false,
|
|
60
60
|
expanded: false,
|
|
61
|
-
|
|
61
|
+
heading: 'About this component',
|
|
62
62
|
default: 'This is an alert block with some important information.',
|
|
63
63
|
},
|
|
64
64
|
}
|
|
@@ -73,25 +73,25 @@ export const Default: Story = {
|
|
|
73
73
|
template: `<FdsBlockAlert v-bind="args"><p>{{ args.default }}</p></FdsBlockAlert>`,
|
|
74
74
|
}),
|
|
75
75
|
args: {
|
|
76
|
-
|
|
76
|
+
heading: 'About this component',
|
|
77
77
|
default: 'This is an alert block with some important information.',
|
|
78
78
|
},
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export const
|
|
81
|
+
export const WithHeading: Story = {
|
|
82
82
|
render: () => ({
|
|
83
83
|
components: { FdsBlockAlert },
|
|
84
84
|
template: `
|
|
85
|
-
<FdsBlockAlert
|
|
86
|
-
<p>This alert block has a <a href="test" class="link">test</a>
|
|
85
|
+
<FdsBlockAlert heading="Information">
|
|
86
|
+
<p>This alert block has a <a href="test" class="link">test</a> heading and provides important information to the user.</p>
|
|
87
87
|
</FdsBlockAlert>
|
|
88
88
|
`,
|
|
89
89
|
}),
|
|
90
90
|
parameters: {
|
|
91
91
|
docs: {
|
|
92
92
|
source: {
|
|
93
|
-
transform: () => `<FdsBlockAlert
|
|
94
|
-
<p>This alert block has a <a href="test" class="link">test</a>
|
|
93
|
+
transform: () => `<FdsBlockAlert heading="Information">
|
|
94
|
+
<p>This alert block has a <a href="test" class="link">test</a> heading and provides important information to the user.</p>
|
|
95
95
|
</FdsBlockAlert>`,
|
|
96
96
|
},
|
|
97
97
|
},
|
|
@@ -102,7 +102,7 @@ export const Collapsable: Story = {
|
|
|
102
102
|
render: () => ({
|
|
103
103
|
components: { FdsBlockAlert },
|
|
104
104
|
template: `
|
|
105
|
-
<FdsBlockAlert
|
|
105
|
+
<FdsBlockAlert heading="Collapsable Alert" collapsable>
|
|
106
106
|
<p>This alert block can be collapsed and expanded. The content below is only visible when expanded.</p>
|
|
107
107
|
<p>Additional details about the alert can be shown here.</p>
|
|
108
108
|
</FdsBlockAlert>
|
|
@@ -111,7 +111,7 @@ export const Collapsable: Story = {
|
|
|
111
111
|
parameters: {
|
|
112
112
|
docs: {
|
|
113
113
|
source: {
|
|
114
|
-
transform: () => `<FdsBlockAlert
|
|
114
|
+
transform: () => `<FdsBlockAlert heading="Collapsable Alert" collapsable>
|
|
115
115
|
<p>This alert block can be collapsed and expanded. The content below is only visible when expanded.</p>
|
|
116
116
|
<p>Additional details about the alert can be shown here.</p>
|
|
117
117
|
</FdsBlockAlert>`,
|
|
@@ -11,7 +11,7 @@ const props = withDefaults(defineProps<FdsAlertBlockProps>(), {
|
|
|
11
11
|
closeable: false,
|
|
12
12
|
collapsable: false,
|
|
13
13
|
expanded: false,
|
|
14
|
-
|
|
14
|
+
heading: '',
|
|
15
15
|
locale: 'sv',
|
|
16
16
|
dataTestid: undefined,
|
|
17
17
|
})
|
|
@@ -73,7 +73,7 @@ defineSlots<{
|
|
|
73
73
|
<div>
|
|
74
74
|
<div>
|
|
75
75
|
<div
|
|
76
|
-
v-if="
|
|
76
|
+
v-if="heading"
|
|
77
77
|
class="font-bold w-full justify-between items-start flex gap-2"
|
|
78
78
|
:class="{ 'mb-2': (isExpanded || !collapsable) && hasSlot }"
|
|
79
79
|
>
|
|
@@ -81,7 +81,7 @@ defineSlots<{
|
|
|
81
81
|
<div class="h-7 flex items-center">
|
|
82
82
|
<FdsIcon name="alert" :size="24" class="fill-yellow-700" />
|
|
83
83
|
</div>
|
|
84
|
-
<span class="leading-7">{{
|
|
84
|
+
<span class="leading-7">{{ heading }}</span>
|
|
85
85
|
</div>
|
|
86
86
|
<div class="relative h-7">
|
|
87
87
|
<FdsButtonIcon
|
|
@@ -6,7 +6,7 @@ const blockExpanderTransform = (
|
|
|
6
6
|
_src: string,
|
|
7
7
|
storyContext: {
|
|
8
8
|
args?: {
|
|
9
|
-
|
|
9
|
+
heading?: string
|
|
10
10
|
preIcon?: string
|
|
11
11
|
open?: boolean
|
|
12
12
|
disabled?: boolean
|
|
@@ -17,7 +17,7 @@ const blockExpanderTransform = (
|
|
|
17
17
|
const args = storyContext?.args || {}
|
|
18
18
|
const attrs = []
|
|
19
19
|
|
|
20
|
-
if (args.
|
|
20
|
+
if (args.heading) attrs.push(`heading="${args.heading}"`)
|
|
21
21
|
if (args.preIcon) attrs.push(`preIcon="${args.preIcon}"`)
|
|
22
22
|
if (args.open) attrs.push(':open="true"')
|
|
23
23
|
if (args.disabled) attrs.push(':disabled="true"')
|
|
@@ -41,14 +41,14 @@ const meta: Meta<typeof FdsBlockExpander> = {
|
|
|
41
41
|
argTypes: {
|
|
42
42
|
disabled: { control: { type: 'boolean' } },
|
|
43
43
|
open: { control: { type: 'boolean' } },
|
|
44
|
-
|
|
44
|
+
heading: { control: { type: 'text' } },
|
|
45
45
|
preIcon: { control: { type: 'select' }, options: Object.keys(icons) },
|
|
46
46
|
default: { control: { type: 'text' } },
|
|
47
47
|
},
|
|
48
48
|
args: {
|
|
49
49
|
disabled: false,
|
|
50
50
|
open: false,
|
|
51
|
-
|
|
51
|
+
heading: 'Expandable Content',
|
|
52
52
|
preIcon: undefined,
|
|
53
53
|
default: 'This is the expandable content that shows when the block is opened.',
|
|
54
54
|
},
|
|
@@ -64,7 +64,7 @@ export const Default: Story = {
|
|
|
64
64
|
template: `<FdsBlockExpander v-bind="args"><p>{{ args.default }}</p></FdsBlockExpander>`,
|
|
65
65
|
}),
|
|
66
66
|
args: {
|
|
67
|
-
|
|
67
|
+
heading: 'Expandable Content',
|
|
68
68
|
default: 'This is the expandable content that shows when the block is opened.',
|
|
69
69
|
},
|
|
70
70
|
}
|
|
@@ -73,7 +73,7 @@ export const WithIcon: Story = {
|
|
|
73
73
|
render: () => ({
|
|
74
74
|
components: { FdsBlockExpander },
|
|
75
75
|
template: `
|
|
76
|
-
<FdsBlockExpander
|
|
76
|
+
<FdsBlockExpander heading="Settings" preIcon="settings">
|
|
77
77
|
<div class="space-y-2">
|
|
78
78
|
<p>This expander block has an icon in the header.</p>
|
|
79
79
|
<p>Click to expand and see more content.</p>
|
|
@@ -87,7 +87,7 @@ export const Open: Story = {
|
|
|
87
87
|
render: () => ({
|
|
88
88
|
components: { FdsBlockExpander },
|
|
89
89
|
template: `
|
|
90
|
-
<FdsBlockExpander
|
|
90
|
+
<FdsBlockExpander heading="Pre-opened Content" open>
|
|
91
91
|
<p>This expander block starts in the open state.</p>
|
|
92
92
|
<p>You can still click the header to close it.</p>
|
|
93
93
|
</FdsBlockExpander>
|
|
@@ -99,7 +99,7 @@ export const Disabled: Story = {
|
|
|
99
99
|
render: () => ({
|
|
100
100
|
components: { FdsBlockExpander },
|
|
101
101
|
template: `
|
|
102
|
-
<FdsBlockExpander
|
|
102
|
+
<FdsBlockExpander heading="Disabled Block" disabled>
|
|
103
103
|
<p>This expander block is disabled and cannot be interacted with.</p>
|
|
104
104
|
</FdsBlockExpander>
|
|
105
105
|
`,
|
|
@@ -111,13 +111,13 @@ export const MultipleBlocks: Story = {
|
|
|
111
111
|
components: { FdsBlockExpander },
|
|
112
112
|
template: `
|
|
113
113
|
<div class="space-y-4">
|
|
114
|
-
<FdsBlockExpander
|
|
114
|
+
<FdsBlockExpander heading="First Block" preIcon="information">
|
|
115
115
|
<p>Content for the first expander block.</p>
|
|
116
116
|
</FdsBlockExpander>
|
|
117
|
-
<FdsBlockExpander
|
|
117
|
+
<FdsBlockExpander heading="Second Block" preIcon="settings">
|
|
118
118
|
<p>Content for the second expander block.</p>
|
|
119
119
|
</FdsBlockExpander>
|
|
120
|
-
<FdsBlockExpander
|
|
120
|
+
<FdsBlockExpander heading="Third Block" preIcon="alert">
|
|
121
121
|
<p>Content for the third expander block.</p>
|
|
122
122
|
</FdsBlockExpander>
|
|
123
123
|
</div>
|
|
@@ -12,7 +12,7 @@ defineOptions({
|
|
|
12
12
|
|
|
13
13
|
const props = withDefaults(defineProps<FdsExpanderBlockProps>(), {
|
|
14
14
|
disabled: false,
|
|
15
|
-
|
|
15
|
+
heading: '',
|
|
16
16
|
open: false,
|
|
17
17
|
preIcon: undefined,
|
|
18
18
|
stickerColor: undefined,
|
|
@@ -94,7 +94,7 @@ defineSlots<{
|
|
|
94
94
|
</span>
|
|
95
95
|
<span class="inline-flex items-center">
|
|
96
96
|
<span class="font-bold font-heading text-lg leading-md" :class="{ 'text-gray-700': disabled }">
|
|
97
|
-
{{
|
|
97
|
+
{{ heading }}
|
|
98
98
|
</span>
|
|
99
99
|
</span>
|
|
100
100
|
</span>
|
|
@@ -4,7 +4,7 @@ import type { FdsStickerProps } from '../../FdsSticker/types'
|
|
|
4
4
|
|
|
5
5
|
export interface FdsExpanderBlockProps extends /* @vue-ignore */ HTMLAttributes {
|
|
6
6
|
disabled?: boolean
|
|
7
|
-
|
|
7
|
+
heading?: string
|
|
8
8
|
open?: boolean
|
|
9
9
|
preIcon?: FdsIconName
|
|
10
10
|
stickerColor?: FdsStickerProps['variant']
|
|
@@ -49,7 +49,7 @@ const meta: Meta<typeof FdsBlockInfo> = {
|
|
|
49
49
|
},
|
|
50
50
|
argTypes: {
|
|
51
51
|
heading: { control: { type: 'text' } },
|
|
52
|
-
|
|
52
|
+
iconSize: { control: { type: 'select' }, options: ['small', 'large'] },
|
|
53
53
|
icon: { control: { type: 'select' }, options: Object.keys(icons) },
|
|
54
54
|
headerInfo: {
|
|
55
55
|
control: { type: 'text' },
|
|
@@ -59,7 +59,7 @@ const meta: Meta<typeof FdsBlockInfo> = {
|
|
|
59
59
|
},
|
|
60
60
|
args: {
|
|
61
61
|
heading: 'About this component',
|
|
62
|
-
|
|
62
|
+
iconSize: 'small',
|
|
63
63
|
icon: undefined,
|
|
64
64
|
headerInfo: '',
|
|
65
65
|
header: 'About this component',
|
|
@@ -94,7 +94,7 @@ export const WithIcon: Story = {
|
|
|
94
94
|
render: () => ({
|
|
95
95
|
components: { FdsBlockInfo },
|
|
96
96
|
template: `
|
|
97
|
-
<FdsBlockInfo heading="About this component" icon="information"
|
|
97
|
+
<FdsBlockInfo heading="About this component" icon="information" iconSize="large">
|
|
98
98
|
<p>The Info Block can contain various types and amounts of content. We recommend using multiple instances of it for grouping related content.</p>
|
|
99
99
|
</FdsBlockInfo>
|
|
100
100
|
`,
|
|
@@ -6,7 +6,7 @@ import type { FdsBlockInfoProps } from './types'
|
|
|
6
6
|
|
|
7
7
|
const props = withDefaults(defineProps<FdsBlockInfoProps>(), {
|
|
8
8
|
icon: undefined,
|
|
9
|
-
|
|
9
|
+
iconSize: 'small',
|
|
10
10
|
heading: undefined,
|
|
11
11
|
dataTestid: undefined,
|
|
12
12
|
})
|
|
@@ -16,9 +16,9 @@ const hasSlot = useHasSlot()
|
|
|
16
16
|
const contentClasses = computed(() => [
|
|
17
17
|
'rounded-md bg-blue_t-100 mb-4',
|
|
18
18
|
!hasSlot.value && 'mb-0!',
|
|
19
|
-
props.
|
|
20
|
-
props.
|
|
21
|
-
props.
|
|
19
|
+
props.iconSize === 'small' && 'p-4',
|
|
20
|
+
props.iconSize === 'small' && hasSlot.value && 'pb-6',
|
|
21
|
+
props.iconSize === 'large' && props.icon && 'p-6',
|
|
22
22
|
])
|
|
23
23
|
|
|
24
24
|
const smallIconSize = 24
|
|
@@ -45,7 +45,7 @@ defineSlots<{
|
|
|
45
45
|
<template>
|
|
46
46
|
<div :id="contentBlockId" :class="contentClasses" v-bind="rootAttrs">
|
|
47
47
|
<!-- Large icon layout: icon left, header + content right -->
|
|
48
|
-
<div v-if="
|
|
48
|
+
<div v-if="iconSize === 'large' && icon" class="flex items-start gap-4">
|
|
49
49
|
<FdsIcon :name="icon" :size="largeIconSize" class="fill-blue-500" />
|
|
50
50
|
<div class="flex-1">
|
|
51
51
|
<div v-if="heading" class="mb-1">
|
|
@@ -67,7 +67,7 @@ defineSlots<{
|
|
|
67
67
|
<div v-if="heading" :class="{ 'mb-2': hasSlot }">
|
|
68
68
|
<header class="flex items-start justify-between gap-4">
|
|
69
69
|
<div class="flex items-center gap-3">
|
|
70
|
-
<FdsIcon v-if="icon &&
|
|
70
|
+
<FdsIcon v-if="icon && iconSize === 'small'" :name="icon" :size="smallIconSize" class="fill-blue-500" />
|
|
71
71
|
<h3 class="m-0 text-base font-main font-bold tracking-wide">{{ heading }}</h3>
|
|
72
72
|
</div>
|
|
73
73
|
<div class="flex items-start gap-3">
|
|
@@ -7,7 +7,7 @@ const blockLinkTransform = (
|
|
|
7
7
|
_src: string,
|
|
8
8
|
storyContext: {
|
|
9
9
|
args?: {
|
|
10
|
-
|
|
10
|
+
heading?: string
|
|
11
11
|
icon?: string
|
|
12
12
|
arrow?: boolean
|
|
13
13
|
disabled?: boolean
|
|
@@ -24,7 +24,7 @@ const blockLinkTransform = (
|
|
|
24
24
|
const args = storyContext?.args || {}
|
|
25
25
|
const attrs = []
|
|
26
26
|
|
|
27
|
-
if (args.
|
|
27
|
+
if (args.heading) attrs.push(`heading="${args.heading}"`)
|
|
28
28
|
if (args.icon) attrs.push(`icon="${args.icon}"`)
|
|
29
29
|
if (args.arrow) attrs.push(':arrow="true"')
|
|
30
30
|
if (args.disabled) attrs.push(':disabled="true"')
|
|
@@ -49,7 +49,7 @@ const meta: Meta<typeof FdsBlockLink> = {
|
|
|
49
49
|
},
|
|
50
50
|
},
|
|
51
51
|
argTypes: {
|
|
52
|
-
|
|
52
|
+
heading: { control: { type: 'text' } },
|
|
53
53
|
arrow: { control: { type: 'boolean' } },
|
|
54
54
|
disabled: { control: { type: 'boolean' } },
|
|
55
55
|
download: { control: { type: 'text' } },
|
|
@@ -62,7 +62,7 @@ const meta: Meta<typeof FdsBlockLink> = {
|
|
|
62
62
|
as: { control: { type: 'select' }, options: ['button', 'a', 'router-link'] },
|
|
63
63
|
},
|
|
64
64
|
args: {
|
|
65
|
-
|
|
65
|
+
heading: 'Enter some text',
|
|
66
66
|
arrow: false,
|
|
67
67
|
disabled: false,
|
|
68
68
|
download: undefined,
|
|
@@ -86,7 +86,7 @@ export const Default: Story = {
|
|
|
86
86
|
template: `<FdsBlockLink v-bind="args">{{ args.default }}</FdsBlockLink>`,
|
|
87
87
|
}),
|
|
88
88
|
args: {
|
|
89
|
-
|
|
89
|
+
heading: 'Enter some text',
|
|
90
90
|
default: 'Nothing will happen',
|
|
91
91
|
},
|
|
92
92
|
}
|
|
@@ -95,7 +95,7 @@ export const WithIcon: Story = {
|
|
|
95
95
|
render: () => ({
|
|
96
96
|
components: { FdsBlockLink },
|
|
97
97
|
template: `
|
|
98
|
-
<FdsBlockLink
|
|
98
|
+
<FdsBlockLink heading="Settings" icon="settings" href="/settings">
|
|
99
99
|
<p>Click to go to settings page.</p>
|
|
100
100
|
</FdsBlockLink>
|
|
101
101
|
`,
|
|
@@ -106,7 +106,7 @@ export const WithArrow: Story = {
|
|
|
106
106
|
render: () => ({
|
|
107
107
|
components: { FdsBlockLink },
|
|
108
108
|
template: `
|
|
109
|
-
<FdsBlockLink
|
|
109
|
+
<FdsBlockLink heading="Continue" arrow href="/next">
|
|
110
110
|
<p>This block has an arrow indicating it's clickable.</p>
|
|
111
111
|
</FdsBlockLink>
|
|
112
112
|
`,
|
|
@@ -117,7 +117,7 @@ export const WithSticker: Story = {
|
|
|
117
117
|
render: () => ({
|
|
118
118
|
components: { FdsBlockLink, FdsSticker },
|
|
119
119
|
template: `
|
|
120
|
-
<FdsBlockLink
|
|
120
|
+
<FdsBlockLink heading="New Feature" href="/feature">
|
|
121
121
|
<p>Check out our latest feature!</p>
|
|
122
122
|
<template #sticker>
|
|
123
123
|
<FdsSticker variant="blue">New</FdsSticker>
|
|
@@ -131,7 +131,7 @@ export const Disabled: Story = {
|
|
|
131
131
|
render: () => ({
|
|
132
132
|
components: { FdsBlockLink },
|
|
133
133
|
template: `
|
|
134
|
-
<FdsBlockLink
|
|
134
|
+
<FdsBlockLink heading="Disabled Block" disabled>
|
|
135
135
|
<p>This block is disabled and cannot be interacted with.</p>
|
|
136
136
|
</FdsBlockLink>
|
|
137
137
|
`,
|
|
@@ -142,7 +142,7 @@ export const NonInteractive: Story = {
|
|
|
142
142
|
render: () => ({
|
|
143
143
|
components: { FdsBlockLink },
|
|
144
144
|
template: `
|
|
145
|
-
<FdsBlockLink
|
|
145
|
+
<FdsBlockLink heading="Information Only" :interactive="false">
|
|
146
146
|
<p>This block is not interactive - it's just for display.</p>
|
|
147
147
|
</FdsBlockLink>
|
|
148
148
|
`,
|
|
@@ -154,7 +154,7 @@ export const ExternalLink: Story = {
|
|
|
154
154
|
components: { FdsBlockLink },
|
|
155
155
|
template: `
|
|
156
156
|
<FdsBlockLink
|
|
157
|
-
|
|
157
|
+
heading="External Link"
|
|
158
158
|
href="https://example.com"
|
|
159
159
|
target="_blank"
|
|
160
160
|
rel="noreferrer noopener"
|
|
@@ -170,7 +170,7 @@ export const Download: Story = {
|
|
|
170
170
|
components: { FdsBlockLink },
|
|
171
171
|
template: `
|
|
172
172
|
<FdsBlockLink
|
|
173
|
-
|
|
173
|
+
heading="Download File"
|
|
174
174
|
icon="download"
|
|
175
175
|
href="/files/document.pdf"
|
|
176
176
|
download="document.pdf"
|
|
@@ -121,7 +121,7 @@ defineSlots<{
|
|
|
121
121
|
>
|
|
122
122
|
<div class="flex items-center gap-4" :class="headerClasses">
|
|
123
123
|
<h3 class="flex-1 font-heading text-lg tracking-normal m-0 leading-md" :class="headerTextClasses">
|
|
124
|
-
{{
|
|
124
|
+
{{ heading }}
|
|
125
125
|
</h3>
|
|
126
126
|
</div>
|
|
127
127
|
<div :class="slotWrapperClasses">
|
|
@@ -14,8 +14,8 @@ const meta: Meta<typeof FdsButtonCopy> = {
|
|
|
14
14
|
const push = (s: string) => attrs.push(s)
|
|
15
15
|
if (typeof a.value === 'string') push(`value="${a.value}"`)
|
|
16
16
|
if (typeof a.targetId === 'string') push(`target-id="${a.targetId}"`)
|
|
17
|
-
if (typeof a.
|
|
18
|
-
if (typeof a.
|
|
17
|
+
if (typeof a.text === 'string') push(`text="${a.text}"`)
|
|
18
|
+
if (typeof a.copiedText === 'string') push(`copied-text="${a.copiedText}"`)
|
|
19
19
|
if (typeof a.timeoutMs === 'number' && a.timeoutMs !== 1500) push(`:timeout-ms="${a.timeoutMs}"`)
|
|
20
20
|
if (a.disabled) push(':disabled="true"')
|
|
21
21
|
const attrsStr = attrs.length ? ` ${attrs.join(' ')}` : ''
|
|
@@ -27,15 +27,15 @@ const meta: Meta<typeof FdsButtonCopy> = {
|
|
|
27
27
|
argTypes: {
|
|
28
28
|
value: { control: { type: 'text' } },
|
|
29
29
|
targetId: { control: { type: 'text' } },
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
text: { control: { type: 'text' } },
|
|
31
|
+
copiedText: { control: { type: 'text' } },
|
|
32
32
|
timeoutMs: { control: { type: 'number' } },
|
|
33
33
|
disabled: { control: { type: 'boolean' } },
|
|
34
34
|
},
|
|
35
35
|
args: {
|
|
36
36
|
value: 'Text att kopiera',
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
text: 'Kopiera',
|
|
38
|
+
copiedText: 'Kopierat!',
|
|
39
39
|
timeoutMs: 800,
|
|
40
40
|
disabled: false,
|
|
41
41
|
},
|
|
@@ -6,8 +6,8 @@ import type { FdsCopyButtonProps } from './types'
|
|
|
6
6
|
|
|
7
7
|
const props = withDefaults(defineProps<FdsCopyButtonProps>(), {
|
|
8
8
|
value: '',
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
text: 'Kopiera',
|
|
10
|
+
copiedText: 'Kopierat!',
|
|
11
11
|
timeoutMs: 800,
|
|
12
12
|
disabled: false,
|
|
13
13
|
dataTestid: undefined,
|
|
@@ -70,14 +70,14 @@ onMounted(() => {
|
|
|
70
70
|
<template>
|
|
71
71
|
<div v-if="isCopied" class="flex items-center gap-2 h-7">
|
|
72
72
|
<FdsIcon name="bigSuccess" />
|
|
73
|
-
<span>{{ props.
|
|
73
|
+
<span>{{ props.copiedText }}</span>
|
|
74
74
|
</div>
|
|
75
75
|
<FdsButtonMinor
|
|
76
76
|
v-else
|
|
77
77
|
type="button"
|
|
78
78
|
:disabled="props.disabled"
|
|
79
79
|
icon="copy"
|
|
80
|
-
:text="isCopied ? props.
|
|
80
|
+
:text="isCopied ? props.copiedText : props.text"
|
|
81
81
|
:dataTestid="dataTestid"
|
|
82
82
|
@click="onClick"
|
|
83
83
|
/>
|
|
@@ -3,8 +3,8 @@ import type { HTMLAttributes } from 'vue'
|
|
|
3
3
|
export interface FdsCopyButtonProps extends /* @vue-ignore */ HTMLAttributes {
|
|
4
4
|
value?: string
|
|
5
5
|
targetId?: string
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
text?: string
|
|
7
|
+
copiedText?: string
|
|
8
8
|
timeoutMs?: number
|
|
9
9
|
disabled?: boolean
|
|
10
10
|
dataTestid?: string
|
|
@@ -226,7 +226,7 @@ const deleteCookieEntry = () => {
|
|
|
226
226
|
</FdsTabs>
|
|
227
227
|
|
|
228
228
|
<!-- localStorage TAB -->
|
|
229
|
-
<FdsBlockInfo v-if="activeTab === 'local'" heading="localStorage" icon="information"
|
|
229
|
+
<FdsBlockInfo v-if="activeTab === 'local'" heading="localStorage" icon="information" iconSize="small">
|
|
230
230
|
<div v-if="!localStorageEntries.length" class="text-sm text-gray-600">Inga värden i localStorage.</div>
|
|
231
231
|
<div v-else class="max-h-72 overflow-auto border border-gray-200 rounded-md">
|
|
232
232
|
<table class="w-full text-left text-xs border-collapse">
|
|
@@ -282,7 +282,7 @@ const deleteCookieEntry = () => {
|
|
|
282
282
|
</FdsBlockInfo>
|
|
283
283
|
|
|
284
284
|
<!-- sessionStorage TAB -->
|
|
285
|
-
<FdsBlockInfo v-else-if="activeTab === 'session'" heading="sessionStorage" icon="information"
|
|
285
|
+
<FdsBlockInfo v-else-if="activeTab === 'session'" heading="sessionStorage" icon="information" iconSize="small">
|
|
286
286
|
<div v-if="!sessionStorageEntries.length" class="text-sm text-gray-600">Inga värden i sessionStorage.</div>
|
|
287
287
|
<div v-else class="max-h-72 overflow-auto border border-gray-200 rounded-md">
|
|
288
288
|
<table class="w-full text-left text-xs border-collapse">
|
|
@@ -338,7 +338,7 @@ const deleteCookieEntry = () => {
|
|
|
338
338
|
</FdsBlockInfo>
|
|
339
339
|
|
|
340
340
|
<!-- Cookies TAB -->
|
|
341
|
-
<FdsBlockInfo v-else-if="activeTab === 'cookies'" heading="Cookies" icon="information"
|
|
341
|
+
<FdsBlockInfo v-else-if="activeTab === 'cookies'" heading="Cookies" icon="information" iconSize="small">
|
|
342
342
|
<div v-if="!cookieEntries.length" class="text-sm text-gray-600">Inga cookies satta för domänen.</div>
|
|
343
343
|
<div v-else class="max-h-72 overflow-auto border border-gray-200 rounded-md">
|
|
344
344
|
<table class="w-full text-left text-xs border-collapse">
|
|
@@ -398,7 +398,7 @@ const deleteCookieEntry = () => {
|
|
|
398
398
|
v-else
|
|
399
399
|
heading="Placeholder"
|
|
400
400
|
icon="information"
|
|
401
|
-
|
|
401
|
+
iconSize="small"
|
|
402
402
|
class="min-h-[200px] flex items-center justify-center text-sm text-gray-500"
|
|
403
403
|
>
|
|
404
404
|
(Tom flik – reserverad för framtida DevMode-verktyg)
|