@progressive-development/pd-forms 0.0.13 → 0.0.14
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/package.json +1 -1
- package/pd-button-goup.js +3 -0
- package/pd-button.js +3 -0
- package/pd-checkbox.js +3 -0
- package/pd-form-container.js +3 -0
- package/pd-form-row.js +3 -0
- package/pd-input-area.js +3 -0
- package/pd-input.js +3 -0
- package/pd-label-value.js +3 -0
- package/pd-radio-group.js +3 -0
- package/pd-select.js +3 -0
- package/src/{squi-base-ui.js → PdBaseUi.js} +1 -1
- package/src/{squi-base-ui-input.js → PdBaseUiInput.js} +2 -2
- package/src/{squi-button.js → PdButton.js} +1 -1
- package/src/{squi-button-group.js → PdButtonGroup.js} +3 -3
- package/src/{squi-checkbox.js → PdCheckbox.js} +2 -2
- package/src/{squi-form-container.js → PdFormContainer.js} +1 -1
- package/src/{squi-form-row.js → PdFormRow.js} +1 -1
- package/src/{squi-input.js → PdInput.js} +13 -13
- package/src/{squi-input-area.js → PdInputArea.js} +11 -11
- package/src/PdLabelValue.js +75 -0
- package/src/{squi-radio-group.js → PdRadioGroup.js} +4 -4
- package/src/{squi-select.js → PdSelect.js} +7 -7
- package/stories/button.stories.js +15 -0
- package/stories/checkbox.stories.js +50 -0
- package/stories/form-container.stories.js +50 -0
- package/stories/index.stories.js +297 -29
- package/stories/input-area.stories.js +129 -0
- package/stories/input.stories.js +130 -0
- package/stories/label-value.stories.js +32 -0
- package/stories/radio-group.stories.js +45 -0
- package/stories/select.stories.js +104 -0
- package/PdButton.js +0 -3
- package/PdButtonGroup.js +0 -3
- package/PdCheckbox.js +0 -3
- package/PdFormContainer.js +0 -3
- package/PdFormRow.js +0 -3
- package/PdInput.js +0 -3
- package/PdInputArea.js +0 -3
- package/PdRadioGroup.js +0 -3
- package/PdSelect.js +0 -3
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import '../pd-select.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'PdForms/Select',
|
|
6
|
+
component: 'pd-select',
|
|
7
|
+
argTypes: {
|
|
8
|
+
primaryColor: { control: 'color' },
|
|
9
|
+
secondaryColor: { control: 'color' },
|
|
10
|
+
textColor: { control: 'color' },
|
|
11
|
+
highlightColor: { control: 'color' },
|
|
12
|
+
errorColor: { control: 'color' },
|
|
13
|
+
errorBackgroundColor: { control: 'color' },
|
|
14
|
+
borderRadius: { control: 'text' },
|
|
15
|
+
displayFont: { control: 'text' },
|
|
16
|
+
fontSize: { control: 'text' },
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function Template({
|
|
21
|
+
selectVals,
|
|
22
|
+
primaryColor,
|
|
23
|
+
secondaryColor,
|
|
24
|
+
textColor,
|
|
25
|
+
highlightColor,
|
|
26
|
+
errorColor,
|
|
27
|
+
errorBackgroundColor,
|
|
28
|
+
borderRadius,
|
|
29
|
+
displayFont,
|
|
30
|
+
fontSize,
|
|
31
|
+
}) {
|
|
32
|
+
let style = '';
|
|
33
|
+
if (primaryColor) {
|
|
34
|
+
style += `--squi-primary-color:${primaryColor};`;
|
|
35
|
+
}
|
|
36
|
+
if (secondaryColor) {
|
|
37
|
+
style += `--squi-secondary-color:${secondaryColor};`;
|
|
38
|
+
}
|
|
39
|
+
if (textColor) {
|
|
40
|
+
style += `--squi-text-color:${textColor};`;
|
|
41
|
+
}
|
|
42
|
+
if (highlightColor) {
|
|
43
|
+
style += `--squi-highlight-color:${highlightColor};`;
|
|
44
|
+
}
|
|
45
|
+
if (errorColor) {
|
|
46
|
+
style += `--squi-error-color:${errorColor};`;
|
|
47
|
+
}
|
|
48
|
+
if (errorBackgroundColor) {
|
|
49
|
+
style += `--squi-error-background-color:${errorBackgroundColor};`;
|
|
50
|
+
}
|
|
51
|
+
if (borderRadius) {
|
|
52
|
+
style += `--squi-border-radius:${borderRadius};`;
|
|
53
|
+
}
|
|
54
|
+
if (displayFont) {
|
|
55
|
+
style += `--squi-display-font:${displayFont};`;
|
|
56
|
+
}
|
|
57
|
+
if (fontSize) {
|
|
58
|
+
style += `--squi-font-size:${fontSize};`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return html`
|
|
62
|
+
<h3>Select default</h3>
|
|
63
|
+
<pd-select
|
|
64
|
+
id="testId1"
|
|
65
|
+
.values="${selectVals}"
|
|
66
|
+
style="${style}"
|
|
67
|
+
></pd-select>
|
|
68
|
+
|
|
69
|
+
<h3>Select with label</h3>
|
|
70
|
+
<pd-select
|
|
71
|
+
id="testId2"
|
|
72
|
+
.values="${selectVals}"
|
|
73
|
+
label="Label for Select"
|
|
74
|
+
style="${style}"
|
|
75
|
+
></pd-select>
|
|
76
|
+
|
|
77
|
+
<h3>Select with label - disabled</h3>
|
|
78
|
+
<pd-select
|
|
79
|
+
id="testId2"
|
|
80
|
+
.values="${selectVals}"
|
|
81
|
+
label="Label for Select"
|
|
82
|
+
?disabled="${true}"
|
|
83
|
+
style="${style}"
|
|
84
|
+
></pd-select>
|
|
85
|
+
|
|
86
|
+
<h3>Select with label - error</h3>
|
|
87
|
+
<pd-select
|
|
88
|
+
id="testId2"
|
|
89
|
+
.values="${selectVals}"
|
|
90
|
+
label="Label for Select"
|
|
91
|
+
errorMsg="Fehler aufgetreten"
|
|
92
|
+
style="${style}"
|
|
93
|
+
></pd-select>
|
|
94
|
+
`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const Select = Template.bind({});
|
|
98
|
+
Select.args = {
|
|
99
|
+
selectVals: [
|
|
100
|
+
{ name: 'Option 1', value: 1 },
|
|
101
|
+
{ name: 'Option 2', value: 2 },
|
|
102
|
+
{ name: 'Option 3', value: 3 },
|
|
103
|
+
],
|
|
104
|
+
};
|
package/PdButton.js
DELETED
package/PdButtonGroup.js
DELETED
package/PdCheckbox.js
DELETED
package/PdFormContainer.js
DELETED
package/PdFormRow.js
DELETED
package/PdInput.js
DELETED
package/PdInputArea.js
DELETED
package/PdRadioGroup.js
DELETED
package/PdSelect.js
DELETED