@citizenplane/pimp 13.1.0 → 14.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/pimp.es.js +2654 -2531
- package/dist/pimp.umd.js +16 -16
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CpAccordion.vue +2 -13
- package/src/components/CpDate.vue +2 -2
- package/src/components/CpInput.vue +2 -2
- package/src/components/CpMultiselect.vue +3 -3
- package/src/components/CpSelect.vue +3 -3
- package/src/components/CpTelInput.vue +2 -2
- package/src/components/CpTextarea.vue +3 -3
- package/src/components/CpTransitionCounter.vue +77 -0
- package/src/components/CpTransitionListItems.vue +41 -0
- package/src/components/CpTransitionSize.vue +88 -0
- package/src/components/CpTransitionSlide.vue +44 -0
- package/src/components/CpTransitionTabContent.vue +70 -0
- package/src/components/index.ts +12 -2
- package/src/stories/BaseInputLabel.stories.ts +1 -1
- package/src/stories/CpAccordion.stories.ts +1 -1
- package/src/stories/CpAccordionGroup.stories.ts +1 -1
- package/src/stories/CpAirlineLogo.stories.ts +1 -1
- package/src/stories/CpAlert.stories.ts +1 -1
- package/src/stories/CpBadge.stories.ts +1 -1
- package/src/stories/CpButton.stories.ts +1 -1
- package/src/stories/CpCheckbox.stories.ts +1 -1
- package/src/stories/CpContextualMenu.stories.ts +1 -1
- package/src/stories/CpDate.stories.ts +1 -1
- package/src/stories/CpDatepicker.stories.ts +1 -1
- package/src/stories/CpDialog.stories.ts +1 -1
- package/src/stories/CpHeading.stories.ts +1 -1
- package/src/stories/CpIcon.stories.ts +1 -1
- package/src/stories/CpInput.stories.ts +1 -1
- package/src/stories/CpItemActions.stories.ts +1 -1
- package/src/stories/CpLoader.stories.ts +1 -1
- package/src/stories/CpMenuItem.stories.ts +1 -1
- package/src/stories/CpMultiselect.stories.ts +1 -1
- package/src/stories/CpPartnerBadge.stories.ts +1 -1
- package/src/stories/CpRadio.stories.ts +1 -1
- package/src/stories/CpSelect.stories.ts +1 -1
- package/src/stories/CpSelectMenu.stories.ts +1 -1
- package/src/stories/CpSelectableButton.stories.ts +1 -1
- package/src/stories/CpSwitch.stories.ts +1 -1
- package/src/stories/CpTable.stories.ts +1 -1
- package/src/stories/CpTableEmptyState.stories.ts +1 -1
- package/src/stories/CpTabs.stories.ts +1 -1
- package/src/stories/CpTelInput.stories.ts +1 -1
- package/src/stories/CpTextarea.stories.ts +1 -1
- package/src/stories/CpToast.stories.ts +1 -1
- package/src/stories/CpTooltip.stories.ts +1 -1
- package/src/stories/CpTransitionCounter.stories.ts +66 -0
- package/src/stories/{TransitionExpand.stories.ts → CpTransitionExpand.stories.ts} +11 -11
- package/src/stories/CpTransitionListItems.stories.ts +147 -0
- package/src/stories/CpTransitionSize.stories.ts +147 -0
- package/src/stories/CpTransitionSlide.stories.ts +65 -0
- package/src/stories/CpTransitionTabContent.stories.ts +78 -0
- /package/src/components/{TransitionExpand.vue → CpTransitionExpand.vue} +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ref } from 'vue'
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/vue3'
|
|
4
|
+
|
|
5
|
+
import CpTabs from '@/components/CpTabs.vue'
|
|
6
|
+
import CpTransitionTabContent from '@/components/CpTransitionTabContent.vue'
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Transitions/CpTransitionTabContent',
|
|
10
|
+
component: CpTransitionTabContent,
|
|
11
|
+
argTypes: {
|
|
12
|
+
duration: {
|
|
13
|
+
control: { type: 'number', min: 100, max: 800, step: 50 },
|
|
14
|
+
},
|
|
15
|
+
direction: { table: { disable: true } },
|
|
16
|
+
},
|
|
17
|
+
} satisfies Meta<typeof CpTransitionTabContent>
|
|
18
|
+
|
|
19
|
+
export default meta
|
|
20
|
+
type Story = StoryObj<typeof meta>
|
|
21
|
+
|
|
22
|
+
const tabs = [
|
|
23
|
+
{ title: 'Details', icon: 'info' },
|
|
24
|
+
{ title: 'History', icon: 'clock' },
|
|
25
|
+
{ title: 'Settings', icon: 'settings' },
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
const tabBodies = [
|
|
29
|
+
'Overview and metadata for this item.',
|
|
30
|
+
'Past changes and audit trail appear here.',
|
|
31
|
+
'Preferences and access rules for this workspace.',
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
const layoutStyle = 'display: flex; flex-direction: column; gap: 20px; min-width: 600px;'
|
|
35
|
+
|
|
36
|
+
const panelStyle =
|
|
37
|
+
'min-height: 120px; padding: 20px; border-radius: 12px; background: #f3f4f6; font-size: 15px; line-height: 1.5;'
|
|
38
|
+
|
|
39
|
+
export const Default: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
duration: 300,
|
|
42
|
+
},
|
|
43
|
+
render: (args) => ({
|
|
44
|
+
components: { CpTabs, CpTransitionTabContent },
|
|
45
|
+
setup() {
|
|
46
|
+
const activeTabIndex = ref(0)
|
|
47
|
+
const transitionDirection = ref<'forward' | 'backward'>('forward')
|
|
48
|
+
|
|
49
|
+
const onTabClick = (index: number) => {
|
|
50
|
+
if (index === activeTabIndex.value) return
|
|
51
|
+
transitionDirection.value = index > activeTabIndex.value ? 'forward' : 'backward'
|
|
52
|
+
activeTabIndex.value = index
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
args,
|
|
57
|
+
tabs,
|
|
58
|
+
tabBodies,
|
|
59
|
+
activeTabIndex,
|
|
60
|
+
transitionDirection,
|
|
61
|
+
onTabClick,
|
|
62
|
+
layoutStyle,
|
|
63
|
+
panelStyle,
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
template: `
|
|
67
|
+
<div :style="layoutStyle">
|
|
68
|
+
<CpTabs :tabs="tabs" @on-tab-click="onTabClick" />
|
|
69
|
+
<CpTransitionTabContent v-bind="args" :direction="transitionDirection">
|
|
70
|
+
<div :key="activeTabIndex" :style="panelStyle">
|
|
71
|
+
<strong>{{ tabs[activeTabIndex].title }}</strong>
|
|
72
|
+
<p style="margin: 8px 0 0;">{{ tabBodies[activeTabIndex] }}</p>
|
|
73
|
+
</div>
|
|
74
|
+
</CpTransitionTabContent>
|
|
75
|
+
</div>
|
|
76
|
+
`,
|
|
77
|
+
}),
|
|
78
|
+
}
|
|
File without changes
|