@phcdevworks/spectre-components 0.0.1 → 1.1.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.
Files changed (62) hide show
  1. package/README.md +113 -40
  2. package/dist/base-2rD8EmdC.d.cts +32 -0
  3. package/dist/base-2rD8EmdC.d.ts +32 -0
  4. package/dist/button.cjs +295 -170
  5. package/dist/button.cjs.map +1 -1
  6. package/dist/button.d.cts +30 -61
  7. package/dist/button.d.ts +30 -61
  8. package/dist/button.js +296 -171
  9. package/dist/button.js.map +1 -1
  10. package/dist/checkbox.cjs +286 -71
  11. package/dist/checkbox.cjs.map +1 -1
  12. package/dist/checkbox.d.cts +38 -43
  13. package/dist/checkbox.d.ts +38 -43
  14. package/dist/checkbox.js +287 -72
  15. package/dist/checkbox.js.map +1 -1
  16. package/dist/fieldset.cjs +233 -88
  17. package/dist/fieldset.cjs.map +1 -1
  18. package/dist/fieldset.d.cts +23 -40
  19. package/dist/fieldset.d.ts +23 -40
  20. package/dist/fieldset.js +233 -88
  21. package/dist/fieldset.js.map +1 -1
  22. package/dist/form-iI7vV-3W.d.cts +6 -0
  23. package/dist/form-iI7vV-3W.d.ts +6 -0
  24. package/dist/index.cjs +564 -1029
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +5 -2
  27. package/dist/index.d.ts +5 -2
  28. package/dist/index.js +566 -1030
  29. package/dist/index.js.map +1 -1
  30. package/dist/input.cjs +232 -119
  31. package/dist/input.cjs.map +1 -1
  32. package/dist/input.d.cts +52 -68
  33. package/dist/input.d.ts +52 -68
  34. package/dist/input.js +232 -119
  35. package/dist/input.js.map +1 -1
  36. package/dist/label.cjs +232 -73
  37. package/dist/label.cjs.map +1 -1
  38. package/dist/label.d.cts +13 -22
  39. package/dist/label.d.ts +13 -22
  40. package/dist/label.js +232 -73
  41. package/dist/label.js.map +1 -1
  42. package/dist/projectable-BzDQ4xp_.d.cts +17 -0
  43. package/dist/projectable-s3SgvjGX.d.ts +17 -0
  44. package/dist/radio.cjs +286 -71
  45. package/dist/radio.cjs.map +1 -1
  46. package/dist/radio.d.cts +38 -43
  47. package/dist/radio.d.ts +38 -43
  48. package/dist/radio.js +287 -72
  49. package/dist/radio.js.map +1 -1
  50. package/dist/select.cjs +292 -163
  51. package/dist/select.cjs.map +1 -1
  52. package/dist/select.d.cts +35 -58
  53. package/dist/select.d.ts +35 -58
  54. package/dist/select.js +293 -163
  55. package/dist/select.js.map +1 -1
  56. package/dist/textarea.cjs +191 -290
  57. package/dist/textarea.cjs.map +1 -1
  58. package/dist/textarea.d.cts +41 -58
  59. package/dist/textarea.d.ts +41 -58
  60. package/dist/textarea.js +191 -290
  61. package/dist/textarea.js.map +1 -1
  62. package/package.json +13 -12
package/dist/button.d.cts CHANGED
@@ -1,4 +1,6 @@
1
- import { LitElement, TemplateResult } from 'lit';
1
+ import { TemplateResult } from 'lit';
2
+ import { S as SpectreProjectableElement } from './projectable-BzDQ4xp_.cjs';
3
+ import './base-2rD8EmdC.cjs';
2
4
 
3
5
  declare const spectreButtonVariants: readonly ["primary", "secondary", "ghost", "danger", "success", "cta", "accent"];
4
6
  declare const spectreButtonSizes: readonly ["sm", "md", "lg"];
@@ -7,34 +9,26 @@ type SpectreButtonVariant = (typeof spectreButtonVariants)[number];
7
9
  type SpectreButtonSize = (typeof spectreButtonSizes)[number];
8
10
  type SpectreButtonType = (typeof spectreButtonTypes)[number];
9
11
  interface SpectreButtonProps {
10
- autofocus?: boolean;
11
- disabled?: boolean;
12
- fullWidth?: boolean;
13
- label?: string;
14
- loading?: boolean;
15
- loadingLabel?: string;
16
- name?: string;
17
- pill?: boolean;
18
- size?: SpectreButtonSize;
19
- title?: string;
20
- type?: SpectreButtonType;
21
- variant?: SpectreButtonVariant;
22
- value?: string;
12
+ ariaLabel: string | null;
13
+ ariaLabelledBy: string | null;
14
+ ariaDescribedBy: string | null;
15
+ autofocus?: boolean | undefined;
16
+ disabled?: boolean | undefined;
17
+ form?: string | undefined;
18
+ fullWidth?: boolean | undefined;
19
+ label?: string | undefined;
20
+ loading?: boolean | undefined;
21
+ loadingLabel?: string | undefined;
22
+ name?: string | undefined;
23
+ pill?: boolean | undefined;
24
+ size?: SpectreButtonSize | undefined;
25
+ title?: string | undefined;
26
+ type?: SpectreButtonType | undefined;
27
+ variant?: SpectreButtonVariant | undefined;
28
+ value?: string | undefined;
23
29
  }
24
- declare class SpectreButtonElement extends LitElement implements SpectreButtonProps {
30
+ declare class SpectreButtonElement extends SpectreProjectableElement implements SpectreButtonProps {
25
31
  static properties: {
26
- ariaLabel: {
27
- attribute: string;
28
- type: StringConstructor;
29
- };
30
- ariaLabelledBy: {
31
- attribute: string;
32
- type: StringConstructor;
33
- };
34
- ariaDescribedBy: {
35
- attribute: string;
36
- type: StringConstructor;
37
- };
38
32
  autofocus: {
39
33
  type: BooleanConstructor;
40
34
  reflect: boolean;
@@ -43,6 +37,9 @@ declare class SpectreButtonElement extends LitElement implements SpectreButtonPr
43
37
  type: BooleanConstructor;
44
38
  reflect: boolean;
45
39
  };
40
+ form: {
41
+ type: StringConstructor;
42
+ };
46
43
  fullWidth: {
47
44
  attribute: string;
48
45
  type: BooleanConstructor;
@@ -73,10 +70,6 @@ declare class SpectreButtonElement extends LitElement implements SpectreButtonPr
73
70
  type: StringConstructor;
74
71
  reflect: boolean;
75
72
  };
76
- title: {
77
- type: StringConstructor;
78
- reflect: boolean;
79
- };
80
73
  type: {
81
74
  type: StringConstructor;
82
75
  reflect: boolean;
@@ -87,51 +80,27 @@ declare class SpectreButtonElement extends LitElement implements SpectreButtonPr
87
80
  };
88
81
  value: {
89
82
  type: StringConstructor;
90
- reflect: boolean;
91
83
  };
92
84
  };
93
- ariaLabel: string | null;
94
- ariaLabelledBy: string | null;
95
- ariaDescribedBy: string | null;
96
85
  autofocus: boolean;
97
86
  disabled: boolean;
87
+ form: string | undefined;
98
88
  fullWidth: boolean;
99
- label?: string;
89
+ label: string | undefined;
100
90
  loading: boolean;
101
91
  loadingLabel: string;
102
- name?: string;
92
+ name: string | undefined;
103
93
  pill: boolean;
104
94
  size: SpectreButtonSize;
105
- title: string;
106
95
  type: SpectreButtonType;
107
96
  variant: SpectreButtonVariant;
108
- value?: string;
109
- private _id?;
110
- get id(): string;
111
- set id(value: string);
112
- private projectedContent;
113
- private contentObserver?;
114
- createRenderRoot(): this;
115
- connectedCallback(): void;
116
- getAttribute(qualifiedName: string): string | null;
117
- hasAttribute(qualifiedName: string): boolean;
118
- setAttribute(qualifiedName: string, value: string): void;
119
- removeAttribute(qualifiedName: string): void;
120
- disconnectedCallback(): void;
97
+ value: string;
98
+ protected getContentContainer(): Element | null;
99
+ protected isInternalNode(node: Node): boolean;
121
100
  protected willUpdate(changedProperties: Map<PropertyKey, unknown>): void;
122
- protected update(changedProperties: Map<PropertyKey, unknown>): void;
123
101
  private get buttonClasses();
124
102
  private get isDisabled();
125
- private get hasProjectedContent();
126
103
  private get visibleLabelFallback();
127
- private get forwardedAriaLabel();
128
- private get forwardedAriaLabelledBy();
129
- private get forwardedAriaDescribedBy();
130
- private startContentObserver;
131
- private stopContentObserver;
132
- private syncProjectedContent;
133
- private isInternalButtonNode;
134
- private get nativeButton();
135
104
  focus(options?: FocusOptions): void;
136
105
  blur(): void;
137
106
  private renderButtonContent;
package/dist/button.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { LitElement, TemplateResult } from 'lit';
1
+ import { TemplateResult } from 'lit';
2
+ import { S as SpectreProjectableElement } from './projectable-s3SgvjGX.js';
3
+ import './base-2rD8EmdC.js';
2
4
 
3
5
  declare const spectreButtonVariants: readonly ["primary", "secondary", "ghost", "danger", "success", "cta", "accent"];
4
6
  declare const spectreButtonSizes: readonly ["sm", "md", "lg"];
@@ -7,34 +9,26 @@ type SpectreButtonVariant = (typeof spectreButtonVariants)[number];
7
9
  type SpectreButtonSize = (typeof spectreButtonSizes)[number];
8
10
  type SpectreButtonType = (typeof spectreButtonTypes)[number];
9
11
  interface SpectreButtonProps {
10
- autofocus?: boolean;
11
- disabled?: boolean;
12
- fullWidth?: boolean;
13
- label?: string;
14
- loading?: boolean;
15
- loadingLabel?: string;
16
- name?: string;
17
- pill?: boolean;
18
- size?: SpectreButtonSize;
19
- title?: string;
20
- type?: SpectreButtonType;
21
- variant?: SpectreButtonVariant;
22
- value?: string;
12
+ ariaLabel: string | null;
13
+ ariaLabelledBy: string | null;
14
+ ariaDescribedBy: string | null;
15
+ autofocus?: boolean | undefined;
16
+ disabled?: boolean | undefined;
17
+ form?: string | undefined;
18
+ fullWidth?: boolean | undefined;
19
+ label?: string | undefined;
20
+ loading?: boolean | undefined;
21
+ loadingLabel?: string | undefined;
22
+ name?: string | undefined;
23
+ pill?: boolean | undefined;
24
+ size?: SpectreButtonSize | undefined;
25
+ title?: string | undefined;
26
+ type?: SpectreButtonType | undefined;
27
+ variant?: SpectreButtonVariant | undefined;
28
+ value?: string | undefined;
23
29
  }
24
- declare class SpectreButtonElement extends LitElement implements SpectreButtonProps {
30
+ declare class SpectreButtonElement extends SpectreProjectableElement implements SpectreButtonProps {
25
31
  static properties: {
26
- ariaLabel: {
27
- attribute: string;
28
- type: StringConstructor;
29
- };
30
- ariaLabelledBy: {
31
- attribute: string;
32
- type: StringConstructor;
33
- };
34
- ariaDescribedBy: {
35
- attribute: string;
36
- type: StringConstructor;
37
- };
38
32
  autofocus: {
39
33
  type: BooleanConstructor;
40
34
  reflect: boolean;
@@ -43,6 +37,9 @@ declare class SpectreButtonElement extends LitElement implements SpectreButtonPr
43
37
  type: BooleanConstructor;
44
38
  reflect: boolean;
45
39
  };
40
+ form: {
41
+ type: StringConstructor;
42
+ };
46
43
  fullWidth: {
47
44
  attribute: string;
48
45
  type: BooleanConstructor;
@@ -73,10 +70,6 @@ declare class SpectreButtonElement extends LitElement implements SpectreButtonPr
73
70
  type: StringConstructor;
74
71
  reflect: boolean;
75
72
  };
76
- title: {
77
- type: StringConstructor;
78
- reflect: boolean;
79
- };
80
73
  type: {
81
74
  type: StringConstructor;
82
75
  reflect: boolean;
@@ -87,51 +80,27 @@ declare class SpectreButtonElement extends LitElement implements SpectreButtonPr
87
80
  };
88
81
  value: {
89
82
  type: StringConstructor;
90
- reflect: boolean;
91
83
  };
92
84
  };
93
- ariaLabel: string | null;
94
- ariaLabelledBy: string | null;
95
- ariaDescribedBy: string | null;
96
85
  autofocus: boolean;
97
86
  disabled: boolean;
87
+ form: string | undefined;
98
88
  fullWidth: boolean;
99
- label?: string;
89
+ label: string | undefined;
100
90
  loading: boolean;
101
91
  loadingLabel: string;
102
- name?: string;
92
+ name: string | undefined;
103
93
  pill: boolean;
104
94
  size: SpectreButtonSize;
105
- title: string;
106
95
  type: SpectreButtonType;
107
96
  variant: SpectreButtonVariant;
108
- value?: string;
109
- private _id?;
110
- get id(): string;
111
- set id(value: string);
112
- private projectedContent;
113
- private contentObserver?;
114
- createRenderRoot(): this;
115
- connectedCallback(): void;
116
- getAttribute(qualifiedName: string): string | null;
117
- hasAttribute(qualifiedName: string): boolean;
118
- setAttribute(qualifiedName: string, value: string): void;
119
- removeAttribute(qualifiedName: string): void;
120
- disconnectedCallback(): void;
97
+ value: string;
98
+ protected getContentContainer(): Element | null;
99
+ protected isInternalNode(node: Node): boolean;
121
100
  protected willUpdate(changedProperties: Map<PropertyKey, unknown>): void;
122
- protected update(changedProperties: Map<PropertyKey, unknown>): void;
123
101
  private get buttonClasses();
124
102
  private get isDisabled();
125
- private get hasProjectedContent();
126
103
  private get visibleLabelFallback();
127
- private get forwardedAriaLabel();
128
- private get forwardedAriaLabelledBy();
129
- private get forwardedAriaDescribedBy();
130
- private startContentObserver;
131
- private stopContentObserver;
132
- private syncProjectedContent;
133
- private isInternalButtonNode;
134
- private get nativeButton();
135
104
  focus(options?: FocusOptions): void;
136
105
  blur(): void;
137
106
  private renderButtonContent;