@pnx-mixtape/ids-shape 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 (3) hide show
  1. package/enums.ts +25 -0
  2. package/index.ts +57 -10
  3. package/package.json +1 -1
package/enums.ts CHANGED
@@ -9,6 +9,31 @@ export enum FormStatusTypes {
9
9
  INVALID = "invalid"
10
10
  }
11
11
 
12
+ export enum InputTypeTypes {
13
+ BUTTON = "button",
14
+ CHECKBOX = "checkbox",
15
+ COLOR = "color",
16
+ DATE = "date",
17
+ DATETIMELOCAL = "datetime-local",
18
+ EMAIL = "email",
19
+ FILE = "file",
20
+ HIDDEN = "hidden",
21
+ IMAGE = "image",
22
+ MONTH = "month",
23
+ NUMBER = "number",
24
+ PASSWORD = "password",
25
+ RADIO = "radio",
26
+ RANGE = "range",
27
+ RESET = "reset",
28
+ SEARCH = "search",
29
+ SUBMIT = "submit",
30
+ TEL = "tel",
31
+ TEXT = "text",
32
+ TIME = "time",
33
+ URL = "url",
34
+ WEEK = "week"
35
+ }
36
+
12
37
  export enum MediaAlignmentTypes {
13
38
  LEFT = "left",
14
39
  RIGHT = "right",
package/index.ts CHANGED
@@ -14,6 +14,7 @@ import {
14
14
  IconRotateModifier,
15
15
  IconSizeModifier,
16
16
  InPageAlertTypes,
17
+ InputTypeTypes,
17
18
  ListItemModifiers,
18
19
  LoadingTypes,
19
20
  MastheadModifier,
@@ -46,6 +47,7 @@ export type Link = {
46
47
  download?: boolean
47
48
  iconStart?: Icon
48
49
  iconEnd?: Icon
50
+ iconOnly?: boolean
49
51
  }
50
52
 
51
53
  export type Button = {
@@ -56,6 +58,7 @@ export type Button = {
56
58
  disabled?: boolean
57
59
  iconStart?: Icon
58
60
  iconEnd?: Icon
61
+ iconOnly?: boolean
59
62
  }
60
63
 
61
64
  export type Heading = {
@@ -126,12 +129,52 @@ export type WysiwygText = HTMLElement[] // just an example.
126
129
  * Forms
127
130
  */
128
131
 
129
- export type FormControl = {
132
+ export type InputBase = {
130
133
  id: string
131
134
  name: string
135
+ required?: boolean
136
+ }
137
+
138
+ export type FormControl = InputBase & {
132
139
  label: string
133
140
  value: string
134
141
  checked?: boolean
142
+ status?: FormStatusTypes
143
+ hasDescription?: boolean
144
+ }
145
+
146
+ export type FormOption = {
147
+ label: string
148
+ value: string
149
+ selected?: boolean
150
+ }
151
+
152
+ export type FormSelect = InputBase & {
153
+ options: FormOption[]
154
+ status?: FormStatusTypes
155
+ hasDescription?: boolean
156
+ label?: string,
157
+ }
158
+
159
+ export type FormText = InputBase & {
160
+ type: InputTypeTypes
161
+ value?: string
162
+ status?: FormStatusTypes
163
+ hasDescription?: boolean
164
+ label?: string,
165
+ placeholder?: string;
166
+ }
167
+
168
+ export type FormTextArea = InputBase & {
169
+ value?: string
170
+ status?: FormStatusTypes
171
+ hasDescription?: boolean
172
+ label?: string,
173
+ }
174
+
175
+ export type FormInput = {
176
+ fieldType: "text" | "textarea" | "select" | "checkbox" | "radio"
177
+ input: FormText | FormTextArea | FormSelect | FormControl
135
178
  }
136
179
 
137
180
  export type FormDescription = {
@@ -146,16 +189,10 @@ export type FormStatus = {
146
189
  }
147
190
 
148
191
  export type FormLabel = {
149
- id: string
192
+ id?: string
150
193
  title: string
151
194
  inline?: boolean
152
- }
153
-
154
- export type FormInput = {
155
- id: string
156
- input: HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement
157
- status?: FormStatusTypes
158
- label?: string,
195
+ as?: "label" | "legend"
159
196
  }
160
197
 
161
198
  export type FormItem = {
@@ -173,6 +210,14 @@ export type Form = {
173
210
  action: string
174
211
  items: FormItem | FormItem[]
175
212
  actions?: Button | Button[]
213
+ title?: string
214
+ id?: string
215
+ }
216
+
217
+ export type SearchForm = {
218
+ action: string
219
+ input: FormInput
220
+ button: Button
176
221
  }
177
222
 
178
223
 
@@ -261,7 +306,7 @@ export type Header = {
261
306
  logo: LinkedImage | LinkedImage[]
262
307
  title?: string
263
308
  description?: string
264
- search?: Form
309
+ search?: SearchForm
265
310
  navigation?: Navigation
266
311
  controls?: Button[]
267
312
  }
@@ -413,6 +458,7 @@ export type SupportList = {
413
458
  export type TabItem = {
414
459
  id: string
415
460
  content: string | WysiwygText
461
+ title?: string
416
462
  }
417
463
 
418
464
  export type TabListItem = {
@@ -467,6 +513,7 @@ export {
467
513
  IconRotateModifier,
468
514
  IconSizeModifier,
469
515
  InPageAlertTypes,
516
+ InputTypeTypes,
470
517
  LoadingTypes,
471
518
  MediaAlignmentTypes,
472
519
  SectionModifiers,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnx-mixtape/ids-shape",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "shape details for ids project",
5
5
  "main": "./index.ts",
6
6
  "type": "module",