@neovici/cosmoz-input 6.0.0-beta.1 → 6.0.0-beta.2

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.
@@ -12,6 +12,7 @@ const observedAttributes = [
12
12
  'type',
13
13
  'variant',
14
14
  'hint',
15
+ 'error-message',
15
16
  'compact',
16
17
  'required',
17
18
  'pattern',
@@ -7,7 +7,15 @@ import { attributes, render } from './render';
7
7
  import { styles } from './styles';
8
8
  import { useAutoHeight } from './use-auto-height';
9
9
  import { useInput } from './use-input';
10
- const observedAttributes = ['rows', 'placeholder', ...attributes];
10
+ const observedAttributes = [
11
+ 'rows',
12
+ 'placeholder',
13
+ 'label',
14
+ 'hint',
15
+ 'error-message',
16
+ 'required',
17
+ ...attributes,
18
+ ];
11
19
  export const Textarea = (host) => {
12
20
  const { autocomplete, value, placeholder, readonly, disabled, rows, cols, maxlength, } = host, { onChange, onFocus, onInput, onRef } = useInput(host);
13
21
  useAutoHeight(host);
@@ -88,5 +88,5 @@ const style = css `
88
88
  `;
89
89
  customElements.define('cosmoz-toggle', component(CosmozToggle, {
90
90
  styleSheets: [style, toggleStyles],
91
- observedAttributes: ['disabled'],
91
+ observedAttributes: ['label', 'disabled', 'error'],
92
92
  }));
package/dist/render.js CHANGED
@@ -15,9 +15,9 @@ export const render = (control, { hint, label, invalid, errorMessage, compact, r
15
15
  ${control}
16
16
  </div>
17
17
  <!-- compact: tooltip always visible, red icon when invalid -->
18
- ${when(invalid, () => html `<cosmoz-tooltip
18
+ ${when(compact && invalid && errorMessage, () => html `<cosmoz-tooltip
19
19
  placement="top"
20
- description=${invalid ? errorMessage : label}
20
+ description=${errorMessage}
21
21
  delay="300"
22
22
  >
23
23
  ${infoCircleIcon({ width: '16px', height: '16px' })}
package/dist/styles.js CHANGED
@@ -48,7 +48,7 @@ export const styles = css `
48
48
  }
49
49
 
50
50
  .wrap:has(#input:focus) {
51
- box-shadow: 0 0 0 2px var(--cz-color-border-brand);
51
+ box-shadow: var(--cz-focus-ring);
52
52
  }
53
53
 
54
54
  :host([invalid]) .wrap {
@@ -56,7 +56,7 @@ export const styles = css `
56
56
  }
57
57
 
58
58
  :host([invalid]) .wrap:has(#input:focus) {
59
- box-shadow: 0 0 0 2px var(--cz-color-border-error);
59
+ box-shadow: var(--cz-focus-ring-error);
60
60
  }
61
61
 
62
62
  .control {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-input",
3
- "version": "6.0.0-beta.1",
3
+ "version": "6.0.0-beta.2",
4
4
  "description": "A input web component",
5
5
  "keywords": [
6
6
  "lit-html",