@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.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/pd-button-goup.js +3 -0
  3. package/pd-button.js +3 -0
  4. package/pd-checkbox.js +3 -0
  5. package/pd-form-container.js +3 -0
  6. package/pd-form-row.js +3 -0
  7. package/pd-input-area.js +3 -0
  8. package/pd-input.js +3 -0
  9. package/pd-label-value.js +3 -0
  10. package/pd-radio-group.js +3 -0
  11. package/pd-select.js +3 -0
  12. package/src/{squi-base-ui.js → PdBaseUi.js} +1 -1
  13. package/src/{squi-base-ui-input.js → PdBaseUiInput.js} +2 -2
  14. package/src/{squi-button.js → PdButton.js} +1 -1
  15. package/src/{squi-button-group.js → PdButtonGroup.js} +3 -3
  16. package/src/{squi-checkbox.js → PdCheckbox.js} +2 -2
  17. package/src/{squi-form-container.js → PdFormContainer.js} +1 -1
  18. package/src/{squi-form-row.js → PdFormRow.js} +1 -1
  19. package/src/{squi-input.js → PdInput.js} +13 -13
  20. package/src/{squi-input-area.js → PdInputArea.js} +11 -11
  21. package/src/PdLabelValue.js +75 -0
  22. package/src/{squi-radio-group.js → PdRadioGroup.js} +4 -4
  23. package/src/{squi-select.js → PdSelect.js} +7 -7
  24. package/stories/button.stories.js +15 -0
  25. package/stories/checkbox.stories.js +50 -0
  26. package/stories/form-container.stories.js +50 -0
  27. package/stories/index.stories.js +297 -29
  28. package/stories/input-area.stories.js +129 -0
  29. package/stories/input.stories.js +130 -0
  30. package/stories/label-value.stories.js +32 -0
  31. package/stories/radio-group.stories.js +45 -0
  32. package/stories/select.stories.js +104 -0
  33. package/PdButton.js +0 -3
  34. package/PdButtonGroup.js +0 -3
  35. package/PdCheckbox.js +0 -3
  36. package/PdFormContainer.js +0 -3
  37. package/PdFormRow.js +0 -3
  38. package/PdInput.js +0 -3
  39. package/PdInputArea.js +0 -3
  40. package/PdRadioGroup.js +0 -3
  41. 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
@@ -1,3 +0,0 @@
1
- import { SquiButton } from './src/squi-button.js';
2
-
3
- window.customElements.define('squi-button', SquiButton);
package/PdButtonGroup.js DELETED
@@ -1,3 +0,0 @@
1
- import { SquiButtonGroup } from './src/squi-button-group.js';
2
-
3
- customElements.define('squi-button-group', SquiButtonGroup);
package/PdCheckbox.js DELETED
@@ -1,3 +0,0 @@
1
- import { SquiCheckbox } from './src/squi-checkbox.js';
2
-
3
- window.customElements.define('squi-checkbox', SquiCheckbox);
@@ -1,3 +0,0 @@
1
- import { SquiFormContainer } from './src/squi-form-container.js';
2
-
3
- window.customElements.define('squi-form-container', SquiFormContainer);
package/PdFormRow.js DELETED
@@ -1,3 +0,0 @@
1
- import { SquiFormRow } from './src/squi-form-row.js';
2
-
3
- window.customElements.define('squi-form-row', SquiFormRow);
package/PdInput.js DELETED
@@ -1,3 +0,0 @@
1
- import { SquiInput } from './src/squi-input.js';
2
-
3
- window.customElements.define('squi-input', SquiInput);
package/PdInputArea.js DELETED
@@ -1,3 +0,0 @@
1
- import { SquiInputArea } from './src/squi-input-area.js';
2
-
3
- window.customElements.define('squi-input-area', SquiInputArea);
package/PdRadioGroup.js DELETED
@@ -1,3 +0,0 @@
1
- import { SquiRadioGroup } from './src/squi-radio-group.js';
2
-
3
- window.customElements.define('squi-radio-group', SquiRadioGroup);
package/PdSelect.js DELETED
@@ -1,3 +0,0 @@
1
- import { SquiSelect } from './src/squi-select.js';
2
-
3
- window.customElements.define('squi-select', SquiSelect);