@cscfi/csc-ui 4.0.0-alpha.2 → 4.0.0-alpha.3

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.
@@ -1,4 +1,4 @@
1
- import type { CSelectItem } from '../../types';
1
+ import type { CFieldSize, CSelectItem } from '../../types';
2
2
  /**
3
3
  * Custom filter predicate for `c-autocomplete`. Return `true` to keep the
4
4
  * option for the current query. The default matches the start of the label.
@@ -93,6 +93,8 @@ export interface CAutocompleteProps {
93
93
  returnObject?: boolean;
94
94
  /** Shadow variant */
95
95
  shadow?: boolean;
96
+ /** Field height: the 44px default or the 36px `small` box */
97
+ size?: CFieldSize;
96
98
  /** Set the validity of the input */
97
99
  valid?: boolean;
98
100
  /** Selected value (scalar, or object when return-object is set) */
@@ -123,6 +125,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CAutoc
123
125
  required: boolean;
124
126
  returnObject: boolean;
125
127
  shadow: boolean;
128
+ size: CFieldSize;
126
129
  valid: boolean;
127
130
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
128
131
  pre?: (props: {}) => any;
@@ -122,6 +122,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CButto
122
122
  disabled: boolean;
123
123
  hostId: string;
124
124
  loading: boolean;
125
+ size: CButtonSize;
125
126
  active: boolean;
126
127
  danger: boolean;
127
128
  fit: boolean;
@@ -130,7 +131,6 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CButto
130
131
  inverted: boolean;
131
132
  noRadius: boolean;
132
133
  noRipple: boolean;
133
- size: CButtonSize;
134
134
  target: string;
135
135
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
136
136
  icon?: (props: {}) => any;
@@ -15,8 +15,8 @@ interface CIconProps {
15
15
  size?: number;
16
16
  }
17
17
  declare const __VLS_export: import("vue").DefineComponent<CIconProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CIconProps> & Readonly<{}>, {
18
- color: string;
19
18
  size: number;
19
+ color: string;
20
20
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
21
  declare const _default: typeof __VLS_export;
22
22
  export default _default;
@@ -74,10 +74,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CIconB
74
74
  outlined: boolean;
75
75
  disabled: boolean;
76
76
  loading: boolean;
77
+ size: CIconButtonSize;
77
78
  danger: boolean;
78
79
  ghost: boolean;
79
80
  inverted: boolean;
80
- size: CIconButtonSize;
81
81
  badge: null | number | string;
82
82
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
83
83
  default?: (props: {}) => any;
@@ -1,3 +1,4 @@
1
+ import type { CFieldSize } from '../../types';
1
2
  interface CInputProps {
2
3
  /** Set by the wrapping form component when its input has focus or holds a value. */
3
4
  active?: boolean;
@@ -61,6 +62,8 @@ interface CInputProps {
61
62
  * @seeded from csc-ui — verify
62
63
  */
63
64
  shadow?: boolean;
65
+ /** Field height: the 44px default or the 36px `small` box */
66
+ size?: CFieldSize;
64
67
  /**
65
68
  * Set the validíty of the input
66
69
  *
@@ -85,6 +88,7 @@ declare const __VLS_base: import("vue").DefineComponent<CInputProps, {}, {}, {},
85
88
  labelOnTop: boolean;
86
89
  required: boolean;
87
90
  shadow: boolean;
91
+ size: CFieldSize;
88
92
  valid: boolean;
89
93
  inputId: string;
90
94
  active: boolean;
@@ -21,9 +21,11 @@ interface CLoginButtonProps {
21
21
  */
22
22
  src?: string;
23
23
  }
24
- declare var __VLS_1: {};
24
+ declare var __VLS_1: {}, __VLS_3: {};
25
25
  type __VLS_Slots = {} & {
26
- default?: (props: typeof __VLS_1) => any;
26
+ image?: (props: typeof __VLS_1) => any;
27
+ } & {
28
+ default?: (props: typeof __VLS_3) => any;
27
29
  };
28
30
  declare const __VLS_base: import("vue").DefineComponent<CLoginButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CLoginButtonProps> & Readonly<{}>, {
29
31
  href: string;
@@ -1,4 +1,4 @@
1
- import type { CSelectItem } from '../../types';
1
+ import type { CFieldSize, CSelectItem } from '../../types';
2
2
  interface CSelectProps {
3
3
  /** Make the selected value clearable */
4
4
  clearable?: boolean;
@@ -58,6 +58,8 @@ interface CSelectProps {
58
58
  returnObject?: boolean;
59
59
  /** Shadow variant */
60
60
  shadow?: boolean;
61
+ /** Field height: the 44px default or the 36px `small` box */
62
+ size?: CFieldSize;
61
63
  /** Set the validity of the input */
62
64
  valid?: boolean;
63
65
  /** Selected value (scalar, or object when return-object is set) */
@@ -91,6 +93,7 @@ declare const __VLS_base: import("vue").DefineComponent<CSelectProps, {
91
93
  required: boolean;
92
94
  returnObject: boolean;
93
95
  shadow: boolean;
96
+ size: CFieldSize;
94
97
  valid: boolean;
95
98
  optionAsSelection: boolean;
96
99
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -21,8 +21,8 @@ interface CSpinnerProps {
21
21
  }
22
22
  declare const __VLS_export: import("vue").DefineComponent<CSpinnerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CSpinnerProps> & Readonly<{}>, {
23
23
  width: number;
24
- color: string;
25
24
  size: number;
25
+ color: string;
26
26
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
27
  declare const _default: typeof __VLS_export;
28
28
  export default _default;
@@ -39,8 +39,8 @@ declare const _default: typeof __VLS_export;
39
39
  export default _default;
40
40
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CTagProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CTagProps> & Readonly<{}>, {
41
41
  flat: boolean;
42
- active: boolean;
43
42
  size: CTagSize;
43
+ active: boolean;
44
44
  badge: null | number | string;
45
45
  closeable: boolean;
46
46
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
@@ -1,3 +1,4 @@
1
+ import type { CFieldSize } from '../../types';
1
2
  /**
2
3
  * Native `autocapitalize` behaviour of the input.
3
4
  */
@@ -118,6 +119,8 @@ export interface CTextFieldProps {
118
119
  * @seeded from csc-ui — verify
119
120
  */
120
121
  shadow?: boolean;
122
+ /** Field height: the 44px default or the 36px `small` box (single-line fields) */
123
+ size?: CFieldSize;
121
124
  /**
122
125
  * Step size on a numeric input
123
126
  *
@@ -172,6 +175,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<CTextF
172
175
  placeholder: string;
173
176
  required: boolean;
174
177
  shadow: boolean;
178
+ size: CFieldSize;
175
179
  valid: boolean;
176
180
  autocomplete: string;
177
181
  readonly: boolean;
@@ -19,7 +19,7 @@ export type { CToastsHorizontal, CToastsProps, CToastsVertical, } from './compon
19
19
  export type * from './tag-name-map';
20
20
  export { applyTheme, resetTheme, themeToCss } from './theme/applyTheme';
21
21
  export type { Family, ThemeSeeds } from './theme/applyTheme';
22
- export type { CSelectItem, CToastMessage, CToastType } from './types';
22
+ export type { CFieldSize, CSelectItem, CToastMessage, CToastType, } from './types';
23
23
  export { h } from 'vue';
24
24
  export type { VNode, VNodeChild } from 'vue';
25
25
  /**
@@ -130,7 +130,7 @@ export interface CAutocompleteElementEventMap {
130
130
  'update:value': CustomEvent<CAutocompleteItem | null | number | string>;
131
131
  }
132
132
  /** A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options. */
133
- export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'external' | 'filter' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'noResultsText' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'valid' | 'value'> {
133
+ export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'external' | 'filter' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'noResultsText' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'size' | 'valid' | 'value'> {
134
134
  /** Make the selected value clearable */
135
135
  clearable?: boolean;
136
136
  /** Disable the input */
@@ -173,6 +173,8 @@ export interface CAutocompleteElement extends Omit<HTMLElement, 'clearable' | 'd
173
173
  returnObject?: boolean;
174
174
  /** Shadow variant */
175
175
  shadow?: boolean;
176
+ /** Field height: the 44px default or the 36px `small` box */
177
+ size?: 'default' | 'small';
176
178
  /** Set the validity of the input */
177
179
  valid?: boolean;
178
180
  /** Selected value (scalar, or object when return-object is set) */
@@ -534,7 +536,7 @@ export interface CIconButtonElement extends Omit<HTMLElement, 'badge' | 'danger'
534
536
  /** Text variant of the button */
535
537
  text?: boolean;
536
538
  }
537
- export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' | 'errorMessage' | 'filled' | 'hideDetails' | 'hint' | 'inputId' | 'isTextarea' | 'label' | 'labelOnTop' | 'required' | 'shadow' | 'valid'> {
539
+ export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' | 'errorMessage' | 'filled' | 'hideDetails' | 'hint' | 'inputId' | 'isTextarea' | 'label' | 'labelOnTop' | 'required' | 'shadow' | 'size' | 'valid'> {
538
540
  /** Set by the wrapping form component when its input has focus or holds a value. */
539
541
  active?: boolean;
540
542
  /** Disable the input */
@@ -559,6 +561,8 @@ export interface CInputElement extends Omit<HTMLElement, 'active' | 'disabled' |
559
561
  required?: boolean;
560
562
  /** Shadow variant of the input */
561
563
  shadow?: boolean;
564
+ /** Field height: the 44px default or the 36px `small` box */
565
+ size?: 'default' | 'small';
562
566
  /** Set the validíty of the input */
563
567
  valid?: boolean;
564
568
  }
@@ -946,7 +950,7 @@ export interface CSelectElementEventMap {
946
950
  */
947
951
  'update:value': CustomEvent<CSelectItem | null | number | string>;
948
952
  }
949
- export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'optionAsSelection' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'valid' | 'value'> {
953
+ export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'items' | 'itemsPerPage' | 'label' | 'labelOnTop' | 'loading' | 'name' | 'optionAsSelection' | 'placeholder' | 'required' | 'returnObject' | 'shadow' | 'size' | 'valid' | 'value'> {
950
954
  /** Make the selected value clearable */
951
955
  clearable?: boolean;
952
956
  /** Disable the input */
@@ -981,6 +985,8 @@ export interface CSelectElement extends Omit<HTMLElement, 'clearable' | 'disable
981
985
  returnObject?: boolean;
982
986
  /** Shadow variant */
983
987
  shadow?: boolean;
988
+ /** Field height: the 44px default or the 36px `small` box */
989
+ size?: 'default' | 'small';
984
990
  /** Set the validity of the input */
985
991
  valid?: boolean;
986
992
  /** Selected value (scalar, or object when return-object is set) */
@@ -1367,7 +1373,7 @@ export interface CTextFieldElementEventMap {
1367
1373
  */
1368
1374
  'update:value': CustomEvent<string>;
1369
1375
  }
1370
- export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'autocorrect' | 'automaticCapitalize' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'max' | 'min' | 'name' | 'placeholder' | 'readonly' | 'required' | 'rows' | 'shadow' | 'step' | 'trimWhitespace' | 'type' | 'valid' | 'value'> {
1376
+ export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'autocorrect' | 'automaticCapitalize' | 'disabled' | 'errorMessage' | 'hideDetails' | 'hint' | 'hostId' | 'label' | 'labelOnTop' | 'max' | 'min' | 'name' | 'placeholder' | 'readonly' | 'required' | 'rows' | 'shadow' | 'size' | 'step' | 'trimWhitespace' | 'type' | 'valid' | 'value'> {
1371
1377
  /** HTML input autocomplete */
1372
1378
  autocomplete?: string;
1373
1379
  /**
@@ -1409,6 +1415,8 @@ export interface CTextFieldElement extends Omit<HTMLElement, 'autocomplete' | 'a
1409
1415
  rows?: number;
1410
1416
  /** Shadow variant of the input */
1411
1417
  shadow?: boolean;
1418
+ /** Field height: the 44px default or the 36px `small` box (single-line fields) */
1419
+ size?: 'default' | 'small';
1412
1420
  /** Step size on a numeric input */
1413
1421
  step?: null | number;
1414
1422
  /** Trim whitespace from the return value */
@@ -6,6 +6,12 @@
6
6
  *
7
7
  * import type { CSelectItem } from '@cscfi/csc-ui';
8
8
  */
9
+ /**
10
+ * Field height of the form controls built on `c-input`. `default` is the 44px
11
+ * field; `small` is the 36px field. Owned here because the value passes from
12
+ * the wrapping control (`c-select`) into `c-input`.
13
+ */
14
+ export type CFieldSize = 'default' | 'small';
9
15
  /**
10
16
  * A selectable item for the value-selection components (`c-select`,
11
17
  * `c-autocomplete`) when options are supplied via the `items` prop instead of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cscfi/csc-ui",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.3",
4
4
  "description": "Vue 3-based replacement for @cscfi/csc-ui — same custom element tag names, Vue v-model contract.",
5
5
  "type": "module",
6
6
  "main": "./dist/csc-ui.js",