@speckle/ui-components 2.12.666

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 (40) hide show
  1. package/.eslintrc.cjs +118 -0
  2. package/README.md +60 -0
  3. package/dist/components/SourceAppBadge.vue.d.ts +14 -0
  4. package/dist/components/common/Badge.vue.d.ts +65 -0
  5. package/dist/components/common/loading/Bar.vue.d.ts +13 -0
  6. package/dist/components/common/steps/Bullet.vue.d.ts +65 -0
  7. package/dist/components/common/steps/Number.vue.d.ts +57 -0
  8. package/dist/components/common/text/Link.vue.d.ts +106 -0
  9. package/dist/components/form/Button.vue.d.ts +256 -0
  10. package/dist/components/form/CardButton.vue.d.ts +24 -0
  11. package/dist/components/form/Checkbox.vue.d.ts +194 -0
  12. package/dist/components/form/TextArea.vue.d.ts +152 -0
  13. package/dist/components/form/TextInput.vue.d.ts +301 -0
  14. package/dist/components/form/select/Base.vue.d.ts +283 -0
  15. package/dist/components/form/select/SourceApps.vue.d.ts +126 -0
  16. package/dist/components/global/ToastRenderer.vue.d.ts +17 -0
  17. package/dist/composables/common/steps.d.ts +24 -0
  18. package/dist/composables/form/input.d.ts +6 -0
  19. package/dist/composables/form/select.d.ts +29 -0
  20. package/dist/composables/form/textInput.d.ts +44 -0
  21. package/dist/composables/layout/resize.d.ts +36 -0
  22. package/dist/helpers/common/components.d.ts +11 -0
  23. package/dist/helpers/common/validation.d.ts +23 -0
  24. package/dist/helpers/form/input.d.ts +9 -0
  25. package/dist/helpers/global/toast.d.ts +22 -0
  26. package/dist/helpers/tailwind.d.ts +19 -0
  27. package/dist/lib.cjs +1 -0
  28. package/dist/lib.d.ts +24 -0
  29. package/dist/lib.js +2155 -0
  30. package/dist/style.css +1 -0
  31. package/index.html +12 -0
  32. package/package.json +99 -0
  33. package/postcss.config.js +7 -0
  34. package/tailwind.config.cjs +14 -0
  35. package/tsconfig.json +31 -0
  36. package/tsconfig.node.json +10 -0
  37. package/utils/tailwind-configure.cjs +15 -0
  38. package/utils/tailwind-configure.d.ts +1 -0
  39. package/utils/tailwind-configure.js +13 -0
  40. package/vite.config.ts +48 -0
@@ -0,0 +1,256 @@
1
+ import { ConcreteComponent, PropType } from 'vue';
2
+ import { Nullable, Optional } from '@speckle/shared';
3
+ type FormButtonSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl';
4
+ type FormButtonColor = 'default' | 'invert' | 'danger' | 'warning' | 'success' | 'card' | 'secondary';
5
+ declare const _sfc_main: import("vue").DefineComponent<{
6
+ /**
7
+ * URL to which to navigate - can be a relative (app) path or an absolute link for an external URL
8
+ */
9
+ to: {
10
+ type: PropType<Optional<string>>;
11
+ required: false;
12
+ default: undefined;
13
+ };
14
+ /**
15
+ * Choose from one of many button sizes
16
+ */
17
+ size: {
18
+ type: PropType<FormButtonSize>;
19
+ default: string;
20
+ };
21
+ /**
22
+ * If set, will make the button take up all available space horizontally
23
+ */
24
+ fullWidth: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ /**
29
+ * Will outline the button.
30
+ */
31
+ outlined: {
32
+ type: BooleanConstructor;
33
+ default: boolean;
34
+ };
35
+ /**
36
+ * Will apply a rounded class.
37
+ */
38
+ rounded: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
42
+ /**
43
+ * Similar to "link", but without an underline and possibly in different colors
44
+ */
45
+ text: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
49
+ /**
50
+ * Will remove paddings and background. Use for links.
51
+ */
52
+ link: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ /**
57
+ * Colors:
58
+ * default: the default primary blue.
59
+ * invert: for when you want to use this button on a primary background.
60
+ * danger: for dangerous actions (e.g. deletions).
61
+ * warning: for less dangerous actions (e.g. archival).
62
+ */
63
+ color: {
64
+ type: PropType<FormButtonColor>;
65
+ default: string;
66
+ };
67
+ /**
68
+ * Whether the target location should be forcefully treated as an external URL
69
+ * (for relative paths this will likely cause a redirect)
70
+ */
71
+ external: {
72
+ type: PropType<Optional<boolean>>;
73
+ required: false;
74
+ default: undefined;
75
+ };
76
+ /**
77
+ * Whether to disable the button so that it can't be pressed
78
+ */
79
+ disabled: {
80
+ type: PropType<Optional<boolean>>;
81
+ required: false;
82
+ default: undefined;
83
+ };
84
+ /**
85
+ * If set, will have type set to "submit" to enable it to submit any parent forms
86
+ */
87
+ submit: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
91
+ /**
92
+ * Add icon to the left from the text
93
+ */
94
+ iconLeft: {
95
+ type: PropType<Nullable<ConcreteComponent>>;
96
+ default: null;
97
+ };
98
+ /**
99
+ * Add icon to the right from the text
100
+ */
101
+ iconRight: {
102
+ type: PropType<Nullable<ConcreteComponent>>;
103
+ default: null;
104
+ };
105
+ /**
106
+ * Hide default slot (when you want to show icons only)
107
+ */
108
+ hideText: {
109
+ type: BooleanConstructor;
110
+ default: boolean;
111
+ };
112
+ /**
113
+ * Customize component to be used when rendering links.
114
+ *
115
+ * The component will try to dynamically resolve NuxtLink and RouterLink and use those, if this is set to null.
116
+ */
117
+ linkComponent: {
118
+ type: PropType<Nullable<ConcreteComponent>>;
119
+ default: null;
120
+ };
121
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "click"[], "click", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
122
+ /**
123
+ * URL to which to navigate - can be a relative (app) path or an absolute link for an external URL
124
+ */
125
+ to: {
126
+ type: PropType<Optional<string>>;
127
+ required: false;
128
+ default: undefined;
129
+ };
130
+ /**
131
+ * Choose from one of many button sizes
132
+ */
133
+ size: {
134
+ type: PropType<FormButtonSize>;
135
+ default: string;
136
+ };
137
+ /**
138
+ * If set, will make the button take up all available space horizontally
139
+ */
140
+ fullWidth: {
141
+ type: BooleanConstructor;
142
+ default: boolean;
143
+ };
144
+ /**
145
+ * Will outline the button.
146
+ */
147
+ outlined: {
148
+ type: BooleanConstructor;
149
+ default: boolean;
150
+ };
151
+ /**
152
+ * Will apply a rounded class.
153
+ */
154
+ rounded: {
155
+ type: BooleanConstructor;
156
+ default: boolean;
157
+ };
158
+ /**
159
+ * Similar to "link", but without an underline and possibly in different colors
160
+ */
161
+ text: {
162
+ type: BooleanConstructor;
163
+ default: boolean;
164
+ };
165
+ /**
166
+ * Will remove paddings and background. Use for links.
167
+ */
168
+ link: {
169
+ type: BooleanConstructor;
170
+ default: boolean;
171
+ };
172
+ /**
173
+ * Colors:
174
+ * default: the default primary blue.
175
+ * invert: for when you want to use this button on a primary background.
176
+ * danger: for dangerous actions (e.g. deletions).
177
+ * warning: for less dangerous actions (e.g. archival).
178
+ */
179
+ color: {
180
+ type: PropType<FormButtonColor>;
181
+ default: string;
182
+ };
183
+ /**
184
+ * Whether the target location should be forcefully treated as an external URL
185
+ * (for relative paths this will likely cause a redirect)
186
+ */
187
+ external: {
188
+ type: PropType<Optional<boolean>>;
189
+ required: false;
190
+ default: undefined;
191
+ };
192
+ /**
193
+ * Whether to disable the button so that it can't be pressed
194
+ */
195
+ disabled: {
196
+ type: PropType<Optional<boolean>>;
197
+ required: false;
198
+ default: undefined;
199
+ };
200
+ /**
201
+ * If set, will have type set to "submit" to enable it to submit any parent forms
202
+ */
203
+ submit: {
204
+ type: BooleanConstructor;
205
+ default: boolean;
206
+ };
207
+ /**
208
+ * Add icon to the left from the text
209
+ */
210
+ iconLeft: {
211
+ type: PropType<Nullable<ConcreteComponent>>;
212
+ default: null;
213
+ };
214
+ /**
215
+ * Add icon to the right from the text
216
+ */
217
+ iconRight: {
218
+ type: PropType<Nullable<ConcreteComponent>>;
219
+ default: null;
220
+ };
221
+ /**
222
+ * Hide default slot (when you want to show icons only)
223
+ */
224
+ hideText: {
225
+ type: BooleanConstructor;
226
+ default: boolean;
227
+ };
228
+ /**
229
+ * Customize component to be used when rendering links.
230
+ *
231
+ * The component will try to dynamically resolve NuxtLink and RouterLink and use those, if this is set to null.
232
+ */
233
+ linkComponent: {
234
+ type: PropType<Nullable<ConcreteComponent>>;
235
+ default: null;
236
+ };
237
+ }>> & {
238
+ onClick?: ((...args: any[]) => any) | undefined;
239
+ }, {
240
+ to: Optional<string>;
241
+ size: FormButtonSize;
242
+ fullWidth: boolean;
243
+ outlined: boolean;
244
+ rounded: boolean;
245
+ text: boolean;
246
+ link: boolean;
247
+ color: FormButtonColor;
248
+ external: Optional<boolean>;
249
+ disabled: Optional<boolean>;
250
+ submit: boolean;
251
+ iconLeft: Nullable<ConcreteComponent>;
252
+ iconRight: Nullable<ConcreteComponent>;
253
+ hideText: boolean;
254
+ linkComponent: Nullable<ConcreteComponent>;
255
+ }>;
256
+ export default _sfc_main;
@@ -0,0 +1,24 @@
1
+ import type { PropType as __PropType } from 'vue';
2
+ declare const _sfc_main: import("vue").DefineComponent<{
3
+ disabled: {
4
+ type: __PropType<boolean | undefined>;
5
+ required: false;
6
+ };
7
+ modelValue: {
8
+ type: __PropType<boolean | undefined>;
9
+ required: false;
10
+ };
11
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "update:modelValue")[], "click" | "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
12
+ disabled: {
13
+ type: __PropType<boolean | undefined>;
14
+ required: false;
15
+ };
16
+ modelValue: {
17
+ type: __PropType<boolean | undefined>;
18
+ required: false;
19
+ };
20
+ }>> & {
21
+ onClick?: ((...args: any[]) => any) | undefined;
22
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
23
+ }, {}>;
24
+ export default _sfc_main;
@@ -0,0 +1,194 @@
1
+ import { RuleExpression } from 'vee-validate';
2
+ import { PropType } from 'vue';
3
+ import { Optional } from '@speckle/shared';
4
+ /**
5
+ * Troubleshooting:
6
+ * - If clicking on the checkbox doesn't do anything, check if any of its ancestor elements
7
+ * have a @click.prevent on them anywhere.
8
+ * - If you're not using the checkbox in a group, it's suggested that you set :value="true",
9
+ * so that a v-model attached to the checkbox will be either 'true' or 'undefined' depending on the
10
+ * checked state
11
+ */
12
+ type ValueType = Optional<string | true> | string[];
13
+ declare const _sfc_main: import("vue").DefineComponent<{
14
+ /**
15
+ * Input name/id. In a checkbox group, all checkboxes must have the same name and different values.
16
+ */
17
+ name: {
18
+ type: StringConstructor;
19
+ required: true;
20
+ };
21
+ /**
22
+ * Whether the input is disabled
23
+ */
24
+ disabled: {
25
+ type: BooleanConstructor;
26
+ default: boolean;
27
+ };
28
+ /**
29
+ * Set label text
30
+ */
31
+ label: {
32
+ type: PropType<Optional<string>>;
33
+ default: undefined;
34
+ };
35
+ /**
36
+ * Help text
37
+ */
38
+ description: {
39
+ type: PropType<Optional<string>>;
40
+ default: undefined;
41
+ };
42
+ /**
43
+ * Whether to inline the help description
44
+ */
45
+ inlineDescription: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
49
+ /**
50
+ * vee-validate validation rules
51
+ */
52
+ rules: {
53
+ type: PropType<RuleExpression<ValueType>>;
54
+ default: undefined;
55
+ };
56
+ /**
57
+ * vee-validate validation() on component mount
58
+ */
59
+ validateOnMount: {
60
+ type: BooleanConstructor;
61
+ default: boolean;
62
+ };
63
+ /**
64
+ * Whether to show the red "required" asterisk
65
+ */
66
+ showRequired: {
67
+ type: BooleanConstructor;
68
+ default: boolean;
69
+ };
70
+ /**
71
+ * Checkbox group's value
72
+ */
73
+ modelValue: {
74
+ type: PropType<false | ValueType>;
75
+ default: undefined;
76
+ };
77
+ /**
78
+ * Checkbox's own value. If it is checked, modelValue will include this value (amongst any other checked values from the same group).
79
+ * If not set will default to 'name' value.
80
+ */
81
+ value: {
82
+ type: PropType<Optional<string | true>>;
83
+ default: boolean;
84
+ };
85
+ /**
86
+ * HTML ID to use, must be globally unique. If not specified, a random ID will be generated. One is necessary to properly associate the label and checkbox.
87
+ */
88
+ id: {
89
+ type: PropType<Optional<string>>;
90
+ default: undefined;
91
+ };
92
+ hideLabel: {
93
+ type: BooleanConstructor;
94
+ default: boolean;
95
+ };
96
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
97
+ /**
98
+ * Input name/id. In a checkbox group, all checkboxes must have the same name and different values.
99
+ */
100
+ name: {
101
+ type: StringConstructor;
102
+ required: true;
103
+ };
104
+ /**
105
+ * Whether the input is disabled
106
+ */
107
+ disabled: {
108
+ type: BooleanConstructor;
109
+ default: boolean;
110
+ };
111
+ /**
112
+ * Set label text
113
+ */
114
+ label: {
115
+ type: PropType<Optional<string>>;
116
+ default: undefined;
117
+ };
118
+ /**
119
+ * Help text
120
+ */
121
+ description: {
122
+ type: PropType<Optional<string>>;
123
+ default: undefined;
124
+ };
125
+ /**
126
+ * Whether to inline the help description
127
+ */
128
+ inlineDescription: {
129
+ type: BooleanConstructor;
130
+ default: boolean;
131
+ };
132
+ /**
133
+ * vee-validate validation rules
134
+ */
135
+ rules: {
136
+ type: PropType<RuleExpression<ValueType>>;
137
+ default: undefined;
138
+ };
139
+ /**
140
+ * vee-validate validation() on component mount
141
+ */
142
+ validateOnMount: {
143
+ type: BooleanConstructor;
144
+ default: boolean;
145
+ };
146
+ /**
147
+ * Whether to show the red "required" asterisk
148
+ */
149
+ showRequired: {
150
+ type: BooleanConstructor;
151
+ default: boolean;
152
+ };
153
+ /**
154
+ * Checkbox group's value
155
+ */
156
+ modelValue: {
157
+ type: PropType<false | ValueType>;
158
+ default: undefined;
159
+ };
160
+ /**
161
+ * Checkbox's own value. If it is checked, modelValue will include this value (amongst any other checked values from the same group).
162
+ * If not set will default to 'name' value.
163
+ */
164
+ value: {
165
+ type: PropType<Optional<string | true>>;
166
+ default: boolean;
167
+ };
168
+ /**
169
+ * HTML ID to use, must be globally unique. If not specified, a random ID will be generated. One is necessary to properly associate the label and checkbox.
170
+ */
171
+ id: {
172
+ type: PropType<Optional<string>>;
173
+ default: undefined;
174
+ };
175
+ hideLabel: {
176
+ type: BooleanConstructor;
177
+ default: boolean;
178
+ };
179
+ }>> & {
180
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
181
+ }, {
182
+ disabled: boolean;
183
+ modelValue: false | ValueType;
184
+ label: Optional<string>;
185
+ description: Optional<string>;
186
+ inlineDescription: boolean;
187
+ rules: RuleExpression<ValueType>;
188
+ validateOnMount: boolean;
189
+ showRequired: boolean;
190
+ value: Optional<string | true>;
191
+ id: Optional<string>;
192
+ hideLabel: boolean;
193
+ }>;
194
+ export default _sfc_main;
@@ -0,0 +1,152 @@
1
+ import type { PropType as __PropType } from 'vue';
2
+ import { RuleExpression } from 'vee-validate';
3
+ import { InputColor } from '../../composables/form/textInput';
4
+ declare const _sfc_main: import("vue").DefineComponent<{
5
+ name: {
6
+ type: __PropType<string>;
7
+ required: true;
8
+ };
9
+ showLabel: {
10
+ type: __PropType<boolean | undefined>;
11
+ required: false;
12
+ };
13
+ help: {
14
+ type: __PropType<string | undefined>;
15
+ required: false;
16
+ };
17
+ placeholder: {
18
+ type: __PropType<string | undefined>;
19
+ required: false;
20
+ };
21
+ label: {
22
+ type: __PropType<string | undefined>;
23
+ required: false;
24
+ };
25
+ disabled: {
26
+ type: __PropType<boolean | undefined>;
27
+ required: false;
28
+ };
29
+ rules: {
30
+ type: __PropType<RuleExpression<string>>;
31
+ required: false;
32
+ };
33
+ validateOnMount: {
34
+ type: __PropType<boolean | undefined>;
35
+ required: false;
36
+ };
37
+ validateOnValueUpdate: {
38
+ type: __PropType<boolean | undefined>;
39
+ required: false;
40
+ };
41
+ useLabelInErrors: {
42
+ type: __PropType<boolean | undefined>;
43
+ required: false;
44
+ default: boolean;
45
+ };
46
+ autoFocus: {
47
+ type: __PropType<boolean | undefined>;
48
+ required: false;
49
+ };
50
+ modelValue: {
51
+ type: __PropType<string | undefined>;
52
+ required: false;
53
+ default: string;
54
+ };
55
+ showClear: {
56
+ type: __PropType<boolean | undefined>;
57
+ required: false;
58
+ };
59
+ fullWidth: {
60
+ type: __PropType<boolean | undefined>;
61
+ required: false;
62
+ };
63
+ showRequired: {
64
+ type: __PropType<boolean | undefined>;
65
+ required: false;
66
+ };
67
+ color: {
68
+ type: __PropType<InputColor | undefined>;
69
+ required: false;
70
+ default: string;
71
+ };
72
+ }, {
73
+ focus: () => void;
74
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "change" | "input" | "clear")[], "update:modelValue" | "change" | "input" | "clear", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
75
+ name: {
76
+ type: __PropType<string>;
77
+ required: true;
78
+ };
79
+ showLabel: {
80
+ type: __PropType<boolean | undefined>;
81
+ required: false;
82
+ };
83
+ help: {
84
+ type: __PropType<string | undefined>;
85
+ required: false;
86
+ };
87
+ placeholder: {
88
+ type: __PropType<string | undefined>;
89
+ required: false;
90
+ };
91
+ label: {
92
+ type: __PropType<string | undefined>;
93
+ required: false;
94
+ };
95
+ disabled: {
96
+ type: __PropType<boolean | undefined>;
97
+ required: false;
98
+ };
99
+ rules: {
100
+ type: __PropType<RuleExpression<string>>;
101
+ required: false;
102
+ };
103
+ validateOnMount: {
104
+ type: __PropType<boolean | undefined>;
105
+ required: false;
106
+ };
107
+ validateOnValueUpdate: {
108
+ type: __PropType<boolean | undefined>;
109
+ required: false;
110
+ };
111
+ useLabelInErrors: {
112
+ type: __PropType<boolean | undefined>;
113
+ required: false;
114
+ default: boolean;
115
+ };
116
+ autoFocus: {
117
+ type: __PropType<boolean | undefined>;
118
+ required: false;
119
+ };
120
+ modelValue: {
121
+ type: __PropType<string | undefined>;
122
+ required: false;
123
+ default: string;
124
+ };
125
+ showClear: {
126
+ type: __PropType<boolean | undefined>;
127
+ required: false;
128
+ };
129
+ fullWidth: {
130
+ type: __PropType<boolean | undefined>;
131
+ required: false;
132
+ };
133
+ showRequired: {
134
+ type: __PropType<boolean | undefined>;
135
+ required: false;
136
+ };
137
+ color: {
138
+ type: __PropType<InputColor | undefined>;
139
+ required: false;
140
+ default: string;
141
+ };
142
+ }>> & {
143
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
144
+ onChange?: ((...args: any[]) => any) | undefined;
145
+ onInput?: ((...args: any[]) => any) | undefined;
146
+ onClear?: ((...args: any[]) => any) | undefined;
147
+ }, {
148
+ color: InputColor | undefined;
149
+ modelValue: string | undefined;
150
+ useLabelInErrors: boolean | undefined;
151
+ }>;
152
+ export default _sfc_main;