srcdev-nuxt-forms 2.2.0 → 2.3.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/README.md +12 -1
- package/assets/styles/forms/variables/_sizes.css +4 -16
- package/components/forms/input-text/InputTextCore.vue +2 -15
- package/nuxt.config.ts +1 -1
- package/package.json +7 -14
- package/components/forms/form-errors/stories/InputError.stories.ts +0 -36
- package/components/forms/input-button/stories/InputButtonCore.mdx +0 -8
- package/components/forms/input-button/stories/InputButtonCore.stories.ts +0 -65
- package/components/forms/input-radio/stories/MultipleRadioButtons.mdx +0 -8
- package/components/forms/input-radio/stories/MultipleRadiobuttons.stories.ts +0 -71
- package/components/forms/input-radio/stories/data/tags.json +0 -67
- package/components/forms/input-text/stories/InputTextCore.mdx +0 -8
- package/components/forms/input-text/stories/InputTextCore.stories.ts +0 -59
- package/components/forms/input-text/variants/stories/InputPasswordWithLabel.mdx +0 -8
- package/components/forms/input-text/variants/stories/InputPasswordWithLabel.stories.ts +0 -60
package/README.md
CHANGED
|
@@ -40,12 +40,23 @@ defineNuxtConfig({
|
|
|
40
40
|
|
|
41
41
|
## Development Server
|
|
42
42
|
|
|
43
|
-
Start the development server on <
|
|
43
|
+
Start the development server on <https://localhost:3000>
|
|
44
44
|
|
|
45
45
|
```bash
|
|
46
46
|
npm dev
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
## Browser https error
|
|
50
|
+
|
|
51
|
+
If you do not get a proceed to site ssl error, then you need to reset HSTS settings in browser
|
|
52
|
+
|
|
53
|
+
- Clearing all data for the site
|
|
54
|
+
- Click on the button to the left of the address bar
|
|
55
|
+
- Site settings
|
|
56
|
+
- Delete data
|
|
57
|
+
- Go to chrome://net-internals/#hsts and enter localhost into Delete domain security policies (or whichever domain you're having trouble with)
|
|
58
|
+
- Restart your browser
|
|
59
|
+
|
|
49
60
|
## Production
|
|
50
61
|
|
|
51
62
|
Build the application for production:
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
--form-element-border-width: 0.2rem;
|
|
5
5
|
--form-element-outline-width: 0.1rem;
|
|
6
6
|
|
|
7
|
+
--form-text-padding-inline: 0.5em;
|
|
8
|
+
--form-button-padding-inline: 1.25em;
|
|
9
|
+
--form-button-icon-gap: 1em;
|
|
10
|
+
|
|
7
11
|
[data-size='x-small'] {
|
|
8
12
|
--form-element-font-size: var(--step-0);
|
|
9
13
|
--form-placeholder-font-size: calc(var(--step-0) * 0.65);
|
|
10
14
|
--form-element-line-height: var(--step-0);
|
|
11
|
-
--form-icon-size: var(--step-0);
|
|
12
|
-
--form-button-padding-inline: calc(var(--step-0) * 1.65);
|
|
13
|
-
--form-text-padding-inline: calc(var(--step-0) * 0.25);
|
|
14
|
-
--form-button-icon-gap: calc(var(--step-0) * 0.65);
|
|
15
15
|
--form-input-border-radius: 0.4rem;
|
|
16
16
|
--form-icon-only-button-size: calc(var(--step-1) * 2 + 1px);
|
|
17
17
|
--form-toggle-symbol-size: calc(var(--step-0) * 1.55);
|
|
@@ -24,9 +24,6 @@
|
|
|
24
24
|
--form-placeholder-font-size: calc(var(--step-1) * 0.65);
|
|
25
25
|
--form-element-line-height: var(--step-1);
|
|
26
26
|
--form-icon-size: var(--step-1);
|
|
27
|
-
--form-button-padding-inline: calc(var(--step-0) * 1.65);
|
|
28
|
-
--form-text-padding-inline: calc(var(--step-1) * 0.25);
|
|
29
|
-
--form-button-icon-gap: calc(var(--step-0) * 0.65);
|
|
30
27
|
--form-input-border-radius: 0.4rem;
|
|
31
28
|
--form-icon-only-button-size: calc(var(--step-1) * 2.25 + 1px);
|
|
32
29
|
--form-toggle-symbol-size: calc(var(--step-1) * 1.635);
|
|
@@ -39,9 +36,6 @@
|
|
|
39
36
|
--form-placeholder-font-size: calc(var(--step-2) * 0.65);
|
|
40
37
|
--form-element-line-height: var(--step-2);
|
|
41
38
|
--form-icon-size: var(--step-2);
|
|
42
|
-
--form-button-padding-inline: calc(var(--step-0) * 1.65);
|
|
43
|
-
--form-text-padding-inline: calc(var(--step-2) * 0.25);
|
|
44
|
-
--form-button-icon-gap: calc(var(--step-0) * 0.65);
|
|
45
39
|
--form-input-border-radius: 0.4rem;
|
|
46
40
|
--form-icon-only-button-size: calc(var(--step-1) * 2.5 + 1px);
|
|
47
41
|
--form-toggle-symbol-size: calc(var(--step-2) * 1.72);
|
|
@@ -54,9 +48,6 @@
|
|
|
54
48
|
--form-placeholder-font-size: calc(var(--step-3) * 0.65);
|
|
55
49
|
--form-element-line-height: var(--step-3);
|
|
56
50
|
--form-icon-size: var(--step-3);
|
|
57
|
-
--form-button-padding-inline: calc(var(--step-0) * 1.65);
|
|
58
|
-
--form-text-padding-inline: calc(var(--step-3) * 0.25);
|
|
59
|
-
--form-button-icon-gap: calc(var(--step-0) * 0.65);
|
|
60
51
|
--form-input-border-radius: 0.4rem;
|
|
61
52
|
--form-icon-only-button-size: calc(var(--step-1) * 2.75 + 1px);
|
|
62
53
|
--form-toggle-symbol-size: calc(var(--step-3) * 1.78);
|
|
@@ -69,9 +60,6 @@
|
|
|
69
60
|
--form-placeholder-font-size: calc(var(--step-4) * 0.65);
|
|
70
61
|
--form-element-line-height: var(--step-4);
|
|
71
62
|
--form-icon-size: var(--step-4);
|
|
72
|
-
--form-button-padding-inline: calc(var(--step-0) * 1.75);
|
|
73
|
-
--form-text-padding-inline: calc(var(--step-4) * 0.25);
|
|
74
|
-
--form-button-icon-gap: calc(var(--step-0) * 0.75);
|
|
75
63
|
--form-input-border-radius: 0.4rem;
|
|
76
64
|
--form-icon-only-button-size: calc(var(--step-1) * 3 + 1px);
|
|
77
65
|
--form-toggle-symbol-size: calc(var(--step-4) * 1.816);
|
|
@@ -165,7 +165,6 @@ onMounted(() => {
|
|
|
165
165
|
&:not(:has(.input-button-core)) {
|
|
166
166
|
.slot {
|
|
167
167
|
display: inline-block;
|
|
168
|
-
padding-inline: 0.8rem;
|
|
169
168
|
|
|
170
169
|
.icon {
|
|
171
170
|
color: var(--theme-form-input-text);
|
|
@@ -178,17 +177,11 @@ onMounted(() => {
|
|
|
178
177
|
}
|
|
179
178
|
}
|
|
180
179
|
|
|
181
|
-
/* &:has(.input-button-core) {
|
|
182
|
-
.input-button-core {
|
|
183
|
-
margin-inline: 0.6rem;
|
|
184
|
-
}
|
|
185
|
-
} */
|
|
186
|
-
|
|
187
180
|
&.has-left-slot {
|
|
188
181
|
.left-slot {
|
|
189
182
|
display: flex;
|
|
190
183
|
align-items: center;
|
|
191
|
-
margin-inline:
|
|
184
|
+
margin-inline-start: 1rem;
|
|
192
185
|
}
|
|
193
186
|
}
|
|
194
187
|
|
|
@@ -196,19 +189,13 @@ onMounted(() => {
|
|
|
196
189
|
.right-slot {
|
|
197
190
|
display: flex;
|
|
198
191
|
align-items: center;
|
|
199
|
-
margin-inline:
|
|
192
|
+
margin-inline-end: 1rem;
|
|
200
193
|
}
|
|
201
194
|
}
|
|
202
195
|
|
|
203
|
-
&:not(.has-left-slot) {
|
|
204
|
-
padding-inline-start: var(--form-text-padding-inline);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
196
|
&:focus-within {
|
|
208
197
|
box-shadow: var(--box-shadow-on);
|
|
209
|
-
/* --_theme-form-input-outline-focus: hsl(from var(--_theme-form-input-outline-focus) h s 50%); */
|
|
210
198
|
outline: var(--form-element-outline-width) solid hsl(from var(--theme-form-input-outline-focus) h s 90%);
|
|
211
|
-
/* outline: var(--form-element-outline-width) solid white; */
|
|
212
199
|
}
|
|
213
200
|
|
|
214
201
|
.input-text-core {
|
package/nuxt.config.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
export default defineNuxtConfig({
|
|
4
4
|
devtools: { enabled: true },
|
|
5
5
|
css: ['modern-normalize', './assets/styles/main.css'],
|
|
6
|
-
modules: ['@nuxt/icon', '@nuxt/test-utils/module'
|
|
6
|
+
modules: ['@nuxt/icon', '@nuxt/test-utils/module'],
|
|
7
7
|
typescript: {
|
|
8
8
|
tsConfig: {
|
|
9
9
|
compilerOptions: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcdev-nuxt-forms",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.3.0",
|
|
5
5
|
"main": "nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"lint": "eslint .",
|
|
16
16
|
"postinstall": "nuxt prepare .playground",
|
|
17
17
|
"release": "release-it",
|
|
18
|
-
"storybook": "storybook dev --port 6006 --config-dir .storybook",
|
|
19
18
|
"test": "vitest"
|
|
20
19
|
},
|
|
21
20
|
"files": [
|
|
@@ -25,15 +24,15 @@
|
|
|
25
24
|
"types/"
|
|
26
25
|
],
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"@nuxt/eslint-config": "0.7.
|
|
29
|
-
"@nuxt/icon": "1.10.
|
|
27
|
+
"@nuxt/eslint-config": "0.7.5",
|
|
28
|
+
"@nuxt/icon": "1.10.3",
|
|
30
29
|
"@nuxt/test-utils": "3.15.1",
|
|
31
30
|
"@vue/test-utils": "2.4.6",
|
|
32
|
-
"eslint": "9.
|
|
31
|
+
"eslint": "9.18.0",
|
|
33
32
|
"happy-dom": "15.11.7",
|
|
34
|
-
"nuxt": "3.
|
|
35
|
-
"release-it": "
|
|
36
|
-
"typescript": "5.7.
|
|
33
|
+
"nuxt": "3.15.0",
|
|
34
|
+
"release-it": "18.1.1",
|
|
35
|
+
"typescript": "5.7.3",
|
|
37
36
|
"vitest": "2.1.8",
|
|
38
37
|
"vue": "3.5.13"
|
|
39
38
|
},
|
|
@@ -45,12 +44,6 @@
|
|
|
45
44
|
"@iconify-json/ph": "1.2.2",
|
|
46
45
|
"@iconify-json/radix-icons": "1.2.2",
|
|
47
46
|
"@iconify-json/ri": "1.2.5",
|
|
48
|
-
"@nuxtjs/storybook": "8.3.2",
|
|
49
|
-
"@storybook/addon-essentials": "8.4.7",
|
|
50
|
-
"@storybook/addon-interactions": "8.4.7",
|
|
51
|
-
"@storybook/addon-links": "8.4.7",
|
|
52
|
-
"@storybook/vue3": "8.4.7",
|
|
53
|
-
"http-proxy-middleware": "3.0.3",
|
|
54
47
|
"modern-normalize": "3.0.1",
|
|
55
48
|
"zod": "3.24.1"
|
|
56
49
|
},
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
// import { Suspense } from 'vue';
|
|
3
|
-
import InputError from '../InputError.vue';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/UI/InputError',
|
|
7
|
-
component: InputError,
|
|
8
|
-
} as Meta<typeof InputError>;
|
|
9
|
-
|
|
10
|
-
const Template: StoryFn<typeof InputError> = (args) => ({
|
|
11
|
-
components: { InputError },
|
|
12
|
-
setup() {
|
|
13
|
-
return { args };
|
|
14
|
-
},
|
|
15
|
-
template: `
|
|
16
|
-
<Suspense>
|
|
17
|
-
<template #default>
|
|
18
|
-
<InputError v-bind="args" />
|
|
19
|
-
</template>
|
|
20
|
-
<template #fallback>
|
|
21
|
-
<div>Loading...</div>
|
|
22
|
-
</template>
|
|
23
|
-
</Suspense>
|
|
24
|
-
`,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
export const SingleErrorMessage = Template.bind({});
|
|
28
|
-
SingleErrorMessage.args = {
|
|
29
|
-
dataTestid: 'inputError',
|
|
30
|
-
errorMessage: 'Hello World',
|
|
31
|
-
showError: true,
|
|
32
|
-
id: 'testId',
|
|
33
|
-
styleClassPassthrough: ['testClass'],
|
|
34
|
-
compact: false,
|
|
35
|
-
isDetached: true,
|
|
36
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas, Controls } from '@storybook/blocks';
|
|
2
|
-
import * as InputButtonCoreStories from './InputButtonCore.stories'
|
|
3
|
-
|
|
4
|
-
<Meta of={InputButtonCoreStories} />
|
|
5
|
-
|
|
6
|
-
<Canvas of={InputButtonCoreStories.Primary} />
|
|
7
|
-
|
|
8
|
-
<Controls of={InputButtonCoreStories.Primary} />
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
import InputButtonCore from '../InputButtonCore.vue';
|
|
3
|
-
import propValidators from '../../c12/prop-validators';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Forms/Buttons/Core',
|
|
7
|
-
component: InputButtonCore,
|
|
8
|
-
argTypes: {
|
|
9
|
-
size: {
|
|
10
|
-
options: propValidators.size,
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
},
|
|
13
|
-
weight: {
|
|
14
|
-
options: propValidators.weight,
|
|
15
|
-
control: { type: 'select' },
|
|
16
|
-
},
|
|
17
|
-
theme: {
|
|
18
|
-
options: propValidators.theme,
|
|
19
|
-
control: { type: 'select' },
|
|
20
|
-
default: 'primary',
|
|
21
|
-
},
|
|
22
|
-
effect: {
|
|
23
|
-
options: ['fancy', 'pulse'],
|
|
24
|
-
control: { type: 'select' },
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
} as Meta<typeof InputButtonCore>;
|
|
28
|
-
|
|
29
|
-
const Template: StoryFn<typeof InputButtonCore> = (args) => ({
|
|
30
|
-
components: { InputButtonCore },
|
|
31
|
-
setup() {
|
|
32
|
-
return { args };
|
|
33
|
-
},
|
|
34
|
-
template: `
|
|
35
|
-
<Suspense>
|
|
36
|
-
<template #default>
|
|
37
|
-
<InputButtonCore v-bind="args">
|
|
38
|
-
<template v-if="${'left' in args}" v-slot:title>${args.left}</template>
|
|
39
|
-
<template v-if="${'right' in args}" v-slot:content>${args.right}</template>
|
|
40
|
-
<template v-if="${'iconOnly' in args}" v-slot:content>${args.iconOnly}</template>
|
|
41
|
-
</InputButtonCore>
|
|
42
|
-
</template>
|
|
43
|
-
<template #fallback>
|
|
44
|
-
<div>Loading...</div>
|
|
45
|
-
</template>
|
|
46
|
-
</Suspense>
|
|
47
|
-
`,
|
|
48
|
-
// template: '<InputButtonCore v-bind="args" />',
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
export const Primary = Template.bind({});
|
|
52
|
-
Primary.args = {
|
|
53
|
-
size: 'medium',
|
|
54
|
-
weight: 'wght-400',
|
|
55
|
-
theme: 'primary',
|
|
56
|
-
useEffect: false,
|
|
57
|
-
effect: 'pulse',
|
|
58
|
-
buttonText: 'Button text prop',
|
|
59
|
-
dataTestid: 'buttonTestId',
|
|
60
|
-
styleClassPassthrough: ['testClass', 'testClass2'],
|
|
61
|
-
isPending: false,
|
|
62
|
-
readonly: false,
|
|
63
|
-
left: 'Left',
|
|
64
|
-
right: 'Right',
|
|
65
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas, Controls } from '@storybook/blocks';
|
|
2
|
-
import * as MultipleRadiobuttonsStories from './MultipleRadiobuttons.stories'
|
|
3
|
-
|
|
4
|
-
<Meta of={MultipleRadiobuttonsStories} />
|
|
5
|
-
|
|
6
|
-
<Canvas of={MultipleRadiobuttonsStories.Primary} />
|
|
7
|
-
|
|
8
|
-
<Controls of={MultipleRadiobuttonsStories.Primary} />
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
import MultipleRadiobuttons from '../MultipleRadiobuttons.vue';
|
|
3
|
-
import propValidators from '../../c12/prop-validators';
|
|
4
|
-
import modelData from './data/tags.json';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'Components/Forms/MultipleRadiobuttons',
|
|
8
|
-
component: MultipleRadiobuttons,
|
|
9
|
-
argTypes: {
|
|
10
|
-
size: {
|
|
11
|
-
options: propValidators.size,
|
|
12
|
-
control: { type: 'select' },
|
|
13
|
-
},
|
|
14
|
-
weight: {
|
|
15
|
-
options: propValidators.weight,
|
|
16
|
-
control: { type: 'select' },
|
|
17
|
-
},
|
|
18
|
-
theme: {
|
|
19
|
-
options: propValidators.theme,
|
|
20
|
-
control: { type: 'select' },
|
|
21
|
-
default: 'primary',
|
|
22
|
-
},
|
|
23
|
-
optionsLayout: {
|
|
24
|
-
options: ['inline', 'equal-widths'],
|
|
25
|
-
control: { type: 'select' },
|
|
26
|
-
},
|
|
27
|
-
direction: {
|
|
28
|
-
options: ['row', 'row-reverse'],
|
|
29
|
-
control: { type: 'select' },
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
} as Meta<typeof MultipleRadiobuttons>;
|
|
33
|
-
|
|
34
|
-
const Template: StoryFn<typeof MultipleRadiobuttons> = (args) => ({
|
|
35
|
-
components: { MultipleRadiobuttons },
|
|
36
|
-
setup() {
|
|
37
|
-
return { args };
|
|
38
|
-
},
|
|
39
|
-
template: `
|
|
40
|
-
<Suspense>
|
|
41
|
-
<template #default>
|
|
42
|
-
<MultipleRadiobuttons v-bind="args">
|
|
43
|
-
<template v-if="${'description' in args}" v-slot:description>${args.description}</template>
|
|
44
|
-
</MultipleRadiobuttons>
|
|
45
|
-
</template>
|
|
46
|
-
<template #fallback>
|
|
47
|
-
<div>Loading...</div>
|
|
48
|
-
</template>
|
|
49
|
-
</Suspense>
|
|
50
|
-
`,
|
|
51
|
-
// template: '<MultipleRadiobuttons v-bind="args" />',
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export const Primary = Template.bind({});
|
|
55
|
-
Primary.args = {
|
|
56
|
-
id: 'tagsRadio',
|
|
57
|
-
name: 'tagsRadio',
|
|
58
|
-
legend: 'Choose tags (as radiobuttons)',
|
|
59
|
-
required: true,
|
|
60
|
-
label: 'Check between 3 and 8 tags',
|
|
61
|
-
placeholder: 'eg. Type something here',
|
|
62
|
-
isButton: true,
|
|
63
|
-
errorMessage: 'Please select between 3 and 8 tags',
|
|
64
|
-
fieldHasError: false,
|
|
65
|
-
modelValue: [],
|
|
66
|
-
fieldData: modelData,
|
|
67
|
-
size: 'x-small',
|
|
68
|
-
optionsLayout: 'inline',
|
|
69
|
-
theme: 'primary',
|
|
70
|
-
direction: 'row',
|
|
71
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"data": [
|
|
3
|
-
{
|
|
4
|
-
"id": "pizza",
|
|
5
|
-
"name": "tags",
|
|
6
|
-
"value": "pizza",
|
|
7
|
-
"label": "Pizza"
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"id": "italian",
|
|
11
|
-
"name": "tags",
|
|
12
|
-
"value": "italian",
|
|
13
|
-
"label": "Italian"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"id": "vegetarian",
|
|
17
|
-
"name": "tags",
|
|
18
|
-
"value": "vegetarian",
|
|
19
|
-
"label": "Vegetarian"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"id": "stir-fry",
|
|
23
|
-
"name": "tags",
|
|
24
|
-
"value": "stir-fry",
|
|
25
|
-
"label": "Stir-fry"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"id": "asian",
|
|
29
|
-
"name": "tags",
|
|
30
|
-
"value": "asian",
|
|
31
|
-
"label": "Asian"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"id": "cookies",
|
|
35
|
-
"name": "tags",
|
|
36
|
-
"value": "cookies",
|
|
37
|
-
"label": "Cookies"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"id": "dessert",
|
|
41
|
-
"name": "tags",
|
|
42
|
-
"value": "dessert",
|
|
43
|
-
"label": "Dessert"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"id": "baking",
|
|
47
|
-
"name": "tags",
|
|
48
|
-
"value": "baking",
|
|
49
|
-
"label": "Baking"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"id": "pasta",
|
|
53
|
-
"name": "tags",
|
|
54
|
-
"value": "pasta",
|
|
55
|
-
"label": "Pasta"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"id": "chicken",
|
|
59
|
-
"name": "tags",
|
|
60
|
-
"value": "chicken",
|
|
61
|
-
"label": "Chicken"
|
|
62
|
-
}
|
|
63
|
-
],
|
|
64
|
-
"total": 5,
|
|
65
|
-
"skip": 0,
|
|
66
|
-
"limit": 10
|
|
67
|
-
}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
import InputTextCore from '../InputTextCore.vue';
|
|
3
|
-
import propValidators from '../../c12/prop-validators';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Forms/Input/Text/Core',
|
|
7
|
-
component: InputTextCore,
|
|
8
|
-
argTypes: {
|
|
9
|
-
type: {
|
|
10
|
-
options: propValidators.inputTypesText,
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
},
|
|
13
|
-
inputMode: {
|
|
14
|
-
options: propValidators.inputMode,
|
|
15
|
-
control: { type: 'select' },
|
|
16
|
-
},
|
|
17
|
-
theme: {
|
|
18
|
-
options: propValidators.theme,
|
|
19
|
-
control: { type: 'select' },
|
|
20
|
-
default: 'primary',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
} as Meta<typeof InputTextCore>;
|
|
24
|
-
|
|
25
|
-
const Template: StoryFn<typeof InputTextCore> = (args) => ({
|
|
26
|
-
components: { InputTextCore },
|
|
27
|
-
setup() {
|
|
28
|
-
return { args };
|
|
29
|
-
},
|
|
30
|
-
template: `
|
|
31
|
-
<Suspense>
|
|
32
|
-
<template #default>
|
|
33
|
-
<InputTextCore v-bind="args">
|
|
34
|
-
<template v-if="${'left' in args}" v-slot:title>${args.left}</template>
|
|
35
|
-
<template v-if="${'right' in args}" v-slot:content>${args.right}</template>
|
|
36
|
-
</InputTextCore>
|
|
37
|
-
</template>
|
|
38
|
-
<template #fallback>
|
|
39
|
-
<div>Loading...</div>
|
|
40
|
-
</template>
|
|
41
|
-
</Suspense>
|
|
42
|
-
`,
|
|
43
|
-
// template: '<InputTextCore v-bind="args" />',
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export const Primary = Template.bind({});
|
|
47
|
-
Primary.args = {
|
|
48
|
-
type: 'text',
|
|
49
|
-
inputmode: 'text',
|
|
50
|
-
maxlength: 255,
|
|
51
|
-
id: 'testId',
|
|
52
|
-
name: 'testName',
|
|
53
|
-
required: true,
|
|
54
|
-
placeholder: 'Input placeholder text',
|
|
55
|
-
fieldHasError: false,
|
|
56
|
-
styleClassPassthrough: ['testClass1', 'testClass2'],
|
|
57
|
-
theme: 'primary',
|
|
58
|
-
modelValue: 'This is the model value',
|
|
59
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Meta, Canvas, Controls } from '@storybook/blocks';
|
|
2
|
-
import * as InputPasswordWithLabelStories from './InputPasswordWithLabel.stories'
|
|
3
|
-
|
|
4
|
-
<Meta of={InputPasswordWithLabelStories} />
|
|
5
|
-
|
|
6
|
-
<Canvas of={InputPasswordWithLabelStories.Primary} />
|
|
7
|
-
|
|
8
|
-
<Controls of={InputPasswordWithLabelStories.Primary} />
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryFn } from '@nuxtjs/storybook';
|
|
2
|
-
import InputPasswordWithLabel from '../InputPasswordWithLabel.vue';
|
|
3
|
-
import propValidators from '../../../c12/prop-validators';
|
|
4
|
-
|
|
5
|
-
export default {
|
|
6
|
-
title: 'Components/Forms/Input/Text/InputPasswordWithLabel',
|
|
7
|
-
component: InputPasswordWithLabel,
|
|
8
|
-
argTypes: {
|
|
9
|
-
type: {
|
|
10
|
-
options: propValidators.inputTypesText,
|
|
11
|
-
control: { type: 'select' },
|
|
12
|
-
},
|
|
13
|
-
inputMode: {
|
|
14
|
-
options: propValidators.inputMode,
|
|
15
|
-
control: { type: 'select' },
|
|
16
|
-
},
|
|
17
|
-
theme: {
|
|
18
|
-
options: propValidators.theme,
|
|
19
|
-
control: { type: 'select' },
|
|
20
|
-
default: 'primary',
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
} as Meta<typeof InputPasswordWithLabel>;
|
|
24
|
-
|
|
25
|
-
const Template: StoryFn<typeof InputPasswordWithLabel> = (args) => ({
|
|
26
|
-
components: { InputPasswordWithLabel },
|
|
27
|
-
setup() {
|
|
28
|
-
return { args };
|
|
29
|
-
},
|
|
30
|
-
template: `
|
|
31
|
-
<Suspense>
|
|
32
|
-
<template #default>
|
|
33
|
-
<InputPasswordWithLabel v-bind="args">
|
|
34
|
-
<template v-if="${'iconOnly' in args}" v-slot:iconOnly>${args.iconOnly}</template>
|
|
35
|
-
</InputPasswordWithLabel>
|
|
36
|
-
</template>
|
|
37
|
-
<template #fallback>
|
|
38
|
-
<div>Loading...</div>
|
|
39
|
-
</template>
|
|
40
|
-
</Suspense>
|
|
41
|
-
`,
|
|
42
|
-
// template: '<InputPasswordWithLabel v-bind="args" />',
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export const Primary = Template.bind({});
|
|
46
|
-
Primary.args = {
|
|
47
|
-
type: 'password',
|
|
48
|
-
maxlength: 255,
|
|
49
|
-
id: 'testId',
|
|
50
|
-
name: 'testName',
|
|
51
|
-
placeholder: 'Input placeholder text',
|
|
52
|
-
label: 'Input label text',
|
|
53
|
-
errorMessage: 'This is an error message',
|
|
54
|
-
fieldHasError: false,
|
|
55
|
-
required: true,
|
|
56
|
-
styleClassPassthrough: ['testClass1', 'testClass2'],
|
|
57
|
-
theme: 'primary',
|
|
58
|
-
modelValue: 'This is the model value',
|
|
59
|
-
iconOnly: `<Icon name="radix-icons:eye-none" class="icon" />`,
|
|
60
|
-
};
|