@citizenplane/pimp 9.4.4 → 9.4.6

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.
@@ -110,3 +110,44 @@ export const Disabled: Story = {
110
110
  disabled: true,
111
111
  },
112
112
  }
113
+
114
+ export const NextToInput: Story = {
115
+ args: {
116
+ label: 'Date',
117
+ required: false,
118
+ disabled: false,
119
+ isInvalid: false,
120
+ displayErrorMessage: true,
121
+ },
122
+ render: (args) => ({
123
+ components: { CpDate },
124
+ setup() {
125
+ const date = ref('')
126
+ const textModel = ref('')
127
+ return { args, date, textModel }
128
+ },
129
+ template: `
130
+ <div style="display: flex; flex-direction: column; gap: 10px; max-width: 245px; padding: 0px;">
131
+ <CpDate
132
+ v-model="date"
133
+ v-bind="args"
134
+ style="flex: 1; min-width: 0;"
135
+ @onValidation="(isValid) => console.log('Validation:', isValid)"
136
+ />
137
+ <CpInput
138
+ v-model="textModel"
139
+ label="Text input"
140
+ placeholder="Enter text here"
141
+ style="flex: 1; min-width: 0;"
142
+ >
143
+ <template #leading-icon>
144
+ <CpIcon type="key" />
145
+ </template>
146
+ <template #trailing-icon>
147
+ <CpIcon type="key" />
148
+ </template>
149
+ </CpInput>
150
+ </div>
151
+ `,
152
+ }),
153
+ }
@@ -2,6 +2,7 @@ import { ref } from 'vue'
2
2
 
3
3
  import type { Meta, StoryObj } from '@storybook/vue3'
4
4
 
5
+ import CpIcon from '@/components/CpIcon.vue'
5
6
  import CpInput from '@/components/CpInput.vue'
6
7
 
7
8
  import { Sizes } from '@/constants'
@@ -161,20 +162,13 @@ export const Mask: Story = {
161
162
  mask: '## ## ## ## ##',
162
163
  },
163
164
  }
165
+
164
166
  export const WithIcon: Story = {
165
167
  args: {
166
168
  ...Default.args,
167
- required: false,
168
- disabled: false,
169
- autocomplete: 'off',
170
- isInvalid: false,
171
- errorMessage: '',
172
- removeBorder: false,
173
- isSearch: true,
174
- help: '',
175
169
  },
176
170
  render: (args) => ({
177
- components: { CpInput },
171
+ components: { CpInput, CpIcon },
178
172
  setup() {
179
173
  const value = ref('')
180
174
  return { args, value }
@@ -185,6 +179,54 @@ export const WithIcon: Story = {
185
179
  v-model="value"
186
180
  v-bind="args"
187
181
  >
182
+ <template #trailing-icon>
183
+ <CpIcon type="users" />
184
+ </template>
185
+ <template #leading-icon>
186
+ <CpIcon type="key" />
187
+ </template>
188
+ </CpInput>
189
+ </div>
190
+ `,
191
+ }),
192
+ }
193
+
194
+ export const WithUnits: Story = {
195
+ args: {
196
+ ...Default.args,
197
+ },
198
+ render: (args) => ({
199
+ components: { CpInput },
200
+ setup() {
201
+ const value = ref('')
202
+ return { args, value }
203
+ },
204
+ template: `
205
+ <div style="display: flex; flex-direction: column; gap: 10px; max-width: 400px; padding: 20px;">
206
+ <CpInput
207
+ v-model="value"
208
+ mask="####"
209
+ v-bind="args"
210
+ >
211
+ <template #leading-icon>
212
+
213
+ </template>
214
+ <template #trailing-icon>
215
+ EUR
216
+ </template>
217
+ </CpInput>
218
+
219
+ <CpInput
220
+ v-model="value"
221
+ mask="####"
222
+ v-bind="args"
223
+ >
224
+ <template #leading-icon>
225
+ kg
226
+ </template>
227
+ <template #trailing-icon>
228
+ cm
229
+ </template>
188
230
  </CpInput>
189
231
  </div>
190
232
  `,
@@ -186,7 +186,7 @@ export const Multiple: Story = {
186
186
  return { args, selectedAirlines, dynamicOptions, handleSearch, isLoading }
187
187
  },
188
188
  template: `
189
- <div style="padding: 20px;">
189
+ <div>
190
190
  <CpMultiselect v-model="selectedAirlines" v-bind="args" :options="dynamicOptions" :is-loading="isLoading" @search="handleSearch">
191
191
  <template #prefix>
192
192
  <cp-partner-badge type="airline" size="sm" />