@maggioli-design-system/mds-input-tip 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  2. package/dist/cjs/index-f87612f6.js +1122 -0
  3. package/dist/cjs/loader.cjs.js +4 -2
  4. package/dist/cjs/mds-input-tip.cjs.entry.js +5 -4
  5. package/dist/cjs/mds-input-tip.cjs.js +12 -10
  6. package/dist/collection/collection-manifest.json +2 -2
  7. package/dist/collection/common/locale.js +31 -1
  8. package/dist/collection/components/mds-input-tip/mds-input-tip.css +105 -87
  9. package/dist/collection/components/mds-input-tip/mds-input-tip.js +2 -2
  10. package/dist/collection/components/mds-input-tip/meta/dictionary.js +5 -0
  11. package/dist/collection/components/mds-input-tip/test/mds-input-tip.stories.js +18 -0
  12. package/dist/collection/type/preference.js +1 -0
  13. package/dist/components/mds-input-tip.js +4 -3
  14. package/dist/documentation.d.ts +34 -0
  15. package/dist/documentation.json +4 -4
  16. package/dist/esm/app-globals-0f993ce5.js +3 -0
  17. package/dist/esm/index-a04da9f4.js +1095 -0
  18. package/dist/esm/loader.js +5 -3
  19. package/dist/esm/mds-input-tip.entry.js +5 -4
  20. package/dist/esm/mds-input-tip.js +13 -11
  21. package/dist/esm-es5/app-globals-0f993ce5.js +1 -0
  22. package/dist/esm-es5/index-a04da9f4.js +1 -0
  23. package/dist/esm-es5/loader.js +1 -1
  24. package/dist/esm-es5/mds-input-tip.entry.js +1 -1
  25. package/dist/esm-es5/mds-input-tip.js +1 -1
  26. package/dist/mds-input-tip/mds-input-tip.esm.js +1 -1
  27. package/dist/mds-input-tip/mds-input-tip.js +1 -1
  28. package/dist/mds-input-tip/p-14639038.entry.js +1 -0
  29. package/dist/mds-input-tip/p-56ba5cbf.system.js +1 -0
  30. package/dist/mds-input-tip/p-58828816.system.js +2 -0
  31. package/dist/mds-input-tip/p-96bf634c.js +2 -0
  32. package/dist/mds-input-tip/p-ca408384.system.js +1 -0
  33. package/dist/mds-input-tip/p-e1255160.js +1 -0
  34. package/dist/mds-input-tip/p-ed74ada1.system.entry.js +1 -0
  35. package/dist/stats.json +54 -39
  36. package/dist/types/common/locale.d.ts +5 -4
  37. package/dist/types/components/mds-input-tip/mds-input-tip.d.ts +1 -1
  38. package/dist/types/components/mds-input-tip/meta/dictionary.d.ts +2 -0
  39. package/dist/types/components/mds-input-tip/test/mds-input-tip.stories.d.ts +20 -0
  40. package/dist/types/components.d.ts +2 -2
  41. package/dist/types/stencil-public-runtime.d.ts +3 -10
  42. package/dist/types/type/preference.d.ts +2 -0
  43. package/documentation.json +6 -26
  44. package/loader/cdn.js +1 -2
  45. package/loader/index.cjs.js +1 -2
  46. package/loader/index.d.ts +3 -0
  47. package/loader/index.es2017.js +1 -2
  48. package/loader/index.js +1 -2
  49. package/package.json +19 -19
  50. package/readme.md +4 -4
  51. package/src/common/locale.ts +39 -4
  52. package/src/components/mds-input-tip/css/mds-input-tip-pref-animation.css +16 -0
  53. package/src/components/mds-input-tip/mds-input-tip.css +9 -7
  54. package/src/components/mds-input-tip/mds-input-tip.tsx +1 -1
  55. package/src/components/mds-input-tip/meta/dictionary.ts +8 -0
  56. package/src/components/mds-input-tip/readme.md +4 -4
  57. package/src/components/mds-input-tip/test/mds-input-tip.stories.tsx +26 -0
  58. package/src/components.d.ts +2 -2
  59. package/src/fixtures/icons.json +1 -0
  60. package/src/tailwind/components.css +71 -0
  61. package/src/type/preference.ts +10 -0
  62. package/www/build/mds-input-tip.esm.js +1 -1
  63. package/www/build/mds-input-tip.js +1 -1
  64. package/www/build/p-14639038.entry.js +1 -0
  65. package/www/build/p-56ba5cbf.system.js +1 -0
  66. package/www/build/p-58828816.system.js +2 -0
  67. package/www/build/p-96bf634c.js +2 -0
  68. package/www/build/p-ca408384.system.js +1 -0
  69. package/www/build/p-e1255160.js +1 -0
  70. package/www/build/p-ed74ada1.system.entry.js +1 -0
  71. package/dist/cjs/index-fe2df682.js +0 -1571
  72. package/dist/collection/components/mds-input-tip/test/mds-input-tip.e2e.js +0 -9
  73. package/dist/esm/index-351c5c8a.js +0 -1544
  74. package/dist/esm-es5/index-351c5c8a.js +0 -1
  75. package/dist/mds-input-tip/p-22b86e20.js +0 -2
  76. package/dist/mds-input-tip/p-3428f886.system.js +0 -2
  77. package/dist/mds-input-tip/p-630886b5.entry.js +0 -1
  78. package/dist/mds-input-tip/p-89e037f5.system.entry.js +0 -1
  79. package/dist/mds-input-tip/p-e5fe0b68.system.js +0 -1
  80. package/www/build/p-22b86e20.js +0 -2
  81. package/www/build/p-3428f886.system.js +0 -2
  82. package/www/build/p-630886b5.entry.js +0 -1
  83. package/www/build/p-89e037f5.system.entry.js +0 -1
  84. package/www/build/p-e5fe0b68.system.js +0 -1
@@ -1,7 +1,7 @@
1
1
  type LocaleConfig = {
2
- it?: Record<string, string>;
3
- en?: Record<string, string>;
4
- gr?: Record<string, string>;
2
+ it?: Record<string, string | string[]>;
3
+ en?: Record<string, string | string[]>;
4
+ gr?: Record<string, string | string[]>;
5
5
  };
6
6
  export declare class Locale {
7
7
  defaultLanguage: string;
@@ -9,6 +9,7 @@ export declare class Locale {
9
9
  config: LocaleConfig;
10
10
  constructor(configData: LocaleConfig);
11
11
  lang: (element: HTMLElement) => void;
12
- get: (tag: string) => string;
12
+ private pluralize;
13
+ get: (tag: string | string[], context?: Record<string, string | number>) => string;
13
14
  }
14
15
  export {};
@@ -1,7 +1,7 @@
1
1
  import { InputTipPositionType } from './meta/types';
2
2
  export declare class MdsInputTip {
3
3
  /**
4
- * Specifies the position of the element relative to its container
4
+ * Specifies if the component is active and shows expanded children or not
5
5
  */
6
6
  readonly active?: boolean;
7
7
  /**
@@ -0,0 +1,2 @@
1
+ declare const inputTipPositionDictionary: string[];
2
+ export { inputTipPositionDictionary, };
@@ -0,0 +1,20 @@
1
+ declare const _default: {
2
+ title: string;
3
+ argTypes: {
4
+ active: {
5
+ type: {
6
+ name: string;
7
+ };
8
+ description: string;
9
+ };
10
+ position: {
11
+ description: string;
12
+ options: string[];
13
+ control: {
14
+ type: string;
15
+ };
16
+ };
17
+ };
18
+ };
19
+ export default _default;
20
+ export declare const Default: any;
@@ -10,7 +10,7 @@ export { InputTipPositionType } from "./components/mds-input-tip/meta/types";
10
10
  export namespace Components {
11
11
  interface MdsInputTip {
12
12
  /**
13
- * Specifies the position of the element relative to its container
13
+ * Specifies if the component is active and shows expanded children or not
14
14
  */
15
15
  "active"?: boolean;
16
16
  /**
@@ -33,7 +33,7 @@ declare global {
33
33
  declare namespace LocalJSX {
34
34
  interface MdsInputTip {
35
35
  /**
36
- * Specifies the position of the element relative to its container
36
+ * Specifies if the component is active and shows expanded children or not
37
37
  */
38
38
  "active"?: boolean;
39
39
  /**
@@ -768,6 +768,7 @@ export declare namespace JSXBase {
768
768
  hrefLang?: string;
769
769
  hreflang?: string;
770
770
  media?: string;
771
+ ping?: string;
771
772
  rel?: string;
772
773
  target?: string;
773
774
  referrerPolicy?: ReferrerPolicy;
@@ -794,7 +795,6 @@ export declare namespace JSXBase {
794
795
  cite?: string;
795
796
  }
796
797
  interface ButtonHTMLAttributes<T> extends HTMLAttributes<T> {
797
- autoFocus?: boolean;
798
798
  disabled?: boolean;
799
799
  form?: string;
800
800
  formAction?: string;
@@ -921,8 +921,6 @@ export declare namespace JSXBase {
921
921
  autocapitalize?: string;
922
922
  autoComplete?: string;
923
923
  autocomplete?: string;
924
- autoFocus?: boolean;
925
- autofocus?: boolean | string;
926
924
  capture?: string;
927
925
  checked?: boolean;
928
926
  crossOrigin?: string;
@@ -979,8 +977,6 @@ export declare namespace JSXBase {
979
977
  popoverTarget?: string;
980
978
  }
981
979
  interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
982
- autoFocus?: boolean;
983
- autofocus?: boolean | string;
984
980
  challenge?: string;
985
981
  disabled?: boolean;
986
982
  form?: string;
@@ -993,7 +989,6 @@ export declare namespace JSXBase {
993
989
  interface LabelHTMLAttributes<T> extends HTMLAttributes<T> {
994
990
  form?: string;
995
991
  htmlFor?: string;
996
- htmlfor?: string;
997
992
  }
998
993
  interface LiHTMLAttributes<T> extends HTMLAttributes<T> {
999
994
  value?: string | string[] | number;
@@ -1104,7 +1099,6 @@ export declare namespace JSXBase {
1104
1099
  interface OutputHTMLAttributes<T> extends HTMLAttributes<T> {
1105
1100
  form?: string;
1106
1101
  htmlFor?: string;
1107
- htmlfor?: string;
1108
1102
  name?: string;
1109
1103
  }
1110
1104
  interface ParamHTMLAttributes<T> extends HTMLAttributes<T> {
@@ -1129,7 +1123,6 @@ export declare namespace JSXBase {
1129
1123
  type?: string;
1130
1124
  }
1131
1125
  interface SelectHTMLAttributes<T> extends HTMLAttributes<T> {
1132
- autoFocus?: boolean;
1133
1126
  disabled?: boolean;
1134
1127
  form?: string;
1135
1128
  multiple?: boolean;
@@ -1164,8 +1157,6 @@ export declare namespace JSXBase {
1164
1157
  interface TextareaHTMLAttributes<T> extends HTMLAttributes<T> {
1165
1158
  autoComplete?: string;
1166
1159
  autocomplete?: string;
1167
- autoFocus?: boolean;
1168
- autofocus?: boolean | string;
1169
1160
  cols?: number;
1170
1161
  disabled?: boolean;
1171
1162
  form?: string;
@@ -1218,6 +1209,8 @@ export declare namespace JSXBase {
1218
1209
  interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
1219
1210
  innerHTML?: string;
1220
1211
  accessKey?: string;
1212
+ autoFocus?: boolean;
1213
+ autofocus?: boolean | string;
1221
1214
  class?: string | {
1222
1215
  [className: string]: boolean;
1223
1216
  };
@@ -0,0 +1,2 @@
1
+ export type UIPreferenceType = 'animation' | 'consumption' | 'contrast' | 'theme';
2
+ export type ConsumptionModeType = 'high' | 'medium' | 'low';
@@ -1,9 +1,9 @@
1
1
  {
2
- "timestamp": "2024-08-23T14:24:28",
2
+ "timestamp": "2024-09-05T13:13:09",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
- "version": "4.10.0",
6
- "typescriptVersion": "5.3.3"
5
+ "version": "4.21.0",
6
+ "typescriptVersion": "5.5.3"
7
7
  },
8
8
  "components": [
9
9
  {
@@ -26,7 +26,7 @@
26
26
  "mutable": false,
27
27
  "attr": "active",
28
28
  "reflectToAttr": true,
29
- "docs": "Specifies the position of the element relative to its container",
29
+ "docs": "Specifies if the component is active and shows expanded children or not",
30
30
  "docsTags": [],
31
31
  "default": "false",
32
32
  "values": [
@@ -269,26 +269,6 @@
269
269
  "docstring": "",
270
270
  "path": "src/components/mds-filter-item/meta/event-detail.ts"
271
271
  },
272
- "src/components/mds-form/meta/types.ts::CharacterSetType": {
273
- "declaration": "export type CharacterSetType =\n | '8859-1'\n | 'ansi'\n | 'ascii'\n | 'utf-8'",
274
- "docstring": "",
275
- "path": "src/components/mds-form/meta/types.ts"
276
- },
277
- "src/components/mds-form/meta/types.ts::FormAutocompleteType": {
278
- "declaration": "export type FormAutocompleteType =\n | 'off'\n | 'on'",
279
- "docstring": "",
280
- "path": "src/components/mds-form/meta/types.ts"
281
- },
282
- "src/components/mds-form/meta/types.ts::EnctypeType": {
283
- "declaration": "export type EnctypeType =\n | 'application/x-www-form-urlencoded'\n | 'multipart/form-data'\n | 'text/plain'",
284
- "docstring": "",
285
- "path": "src/components/mds-form/meta/types.ts"
286
- },
287
- "src/components/mds-form/meta/types.ts::FormMethodType": {
288
- "declaration": "export type FormMethodType =\n | 'get'\n | 'post'",
289
- "docstring": "",
290
- "path": "src/components/mds-form/meta/types.ts"
291
- },
292
272
  "src/components/mds-header-bar/meta/types.ts::MenuType": {
293
273
  "declaration": "export type MenuType =\n | 'all'\n | 'desktop'\n | 'mobile'\n | 'none'",
294
274
  "docstring": "",
@@ -454,10 +434,10 @@
454
434
  "docstring": "",
455
435
  "path": "src/components/mds-pref-animation/meta/types.ts"
456
436
  },
457
- "src/components/mds-pref-consumption/meta/types.ts::ConsumptionModeType": {
437
+ "src/type/preference.ts::ConsumptionModeType": {
458
438
  "declaration": "export type ConsumptionModeType =\n | 'high'\n | 'medium'\n | 'low'",
459
439
  "docstring": "",
460
- "path": "src/components/mds-pref-consumption/meta/types.ts"
440
+ "path": "src/type/preference.ts"
461
441
  },
462
442
  "src/components/mds-pref-contrast/meta/types.ts::ContrastModeType": {
463
443
  "declaration": "export type ContrastModeType =\n | 'more'\n | 'no-preference'\n | 'system'",
package/loader/cdn.js CHANGED
@@ -1,3 +1,2 @@
1
-
2
1
  module.exports = require('../dist/cjs/loader.cjs.js');
3
- module.exports.applyPolyfills = function() { return Promise.resolve() };
2
+ module.exports.applyPolyfills = function() { return Promise.resolve() };
@@ -1,3 +1,2 @@
1
-
2
1
  module.exports = require('../dist/cjs/loader.cjs.js');
3
- module.exports.applyPolyfills = function() { return Promise.resolve() };
2
+ module.exports.applyPolyfills = function() { return Promise.resolve() };
package/loader/index.d.ts CHANGED
@@ -9,6 +9,9 @@ export interface CustomElementsDefineOptions {
9
9
  rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
10
10
  }
11
11
  export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): void;
12
+ /**
13
+ * @deprecated
14
+ */
12
15
  export declare function applyPolyfills(): Promise<void>;
13
16
 
14
17
  /**
@@ -1,3 +1,2 @@
1
-
2
1
  export * from '../dist/esm/polyfills/index.js';
3
- export * from '../dist/esm/loader.js';
2
+ export * from '../dist/esm/loader.js';
package/loader/index.js CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  (function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
3
2
  export * from '../dist/esm/polyfills/index.js';
4
- export * from '../dist/esm-es5/loader.js';
3
+ export * from '../dist/esm-es5/loader.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maggioli-design-system/mds-input-tip",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "mds-input-tip is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScirpt framework you are using.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -24,36 +24,36 @@
24
24
  "test": "stencil test --spec --e2e"
25
25
  },
26
26
  "dependencies": {
27
- "@maggioli-design-system/mds-input-tip-item": "1.0.0",
28
- "@maggioli-design-system/styles": "14.3.2",
29
- "@stencil/core": "4.10.0"
30
- },
27
+ "@maggioli-design-system/mds-input-tip-item": "1.1.0",
28
+ "@maggioli-design-system/styles": "15.3.0",
29
+ "@stencil/core": "4.21.0"
30
+ },
31
31
  "license": "MIT",
32
32
  "author": {
33
33
  "name": "Vittorio Vittori",
34
34
  "email": "vittorio.vittori@maggioli.it",
35
35
  "url": "https://vitto.github.io/vit.to/"
36
- },
36
+ },
37
37
  "contributors": [
38
38
  {
39
- "name": "Andrea Pruccoli",
40
- "email": "andrea.pruccoli@maggioli.it",
41
- "role": "Software Engineer"
39
+ "name": "Andrea Pruccoli",
40
+ "email": "andrea.pruccoli@maggioli.it",
41
+ "role": "Software Engineer"
42
42
  },
43
43
  {
44
- "name": "Daniele Tardia",
45
- "email": "daniele.tardia@hibo.it",
46
- "role": "Senior Developer"
44
+ "name": "Daniele Tardia",
45
+ "email": "daniele.tardia@hibo.it",
46
+ "role": "Senior Developer"
47
47
  },
48
48
  {
49
- "name": "Nicola Tamburini",
50
- "email": "nicola.tamburini@maggioli.it",
51
- "role": "Software Engineer"
49
+ "name": "Nicola Tamburini",
50
+ "email": "nicola.tamburini@maggioli.it",
51
+ "role": "Software Engineer"
52
52
  },
53
53
  {
54
- "name": "Vittorio Vittori",
55
- "email": "vittorio.vittori@maggioli.it",
56
- "role": "Product Designer"
54
+ "name": "Vittorio Vittori",
55
+ "email": "vittorio.vittori@maggioli.it",
56
+ "role": "Product Designer"
57
57
  }
58
- ]
58
+ ]
59
59
  }
package/readme.md CHANGED
@@ -7,10 +7,10 @@
7
7
 
8
8
  ## Properties
9
9
 
10
- | Property | Attribute | Description | Type | Default |
11
- | ---------- | ---------- | --------------------------------------------------------------- | -------------------------------- | ------- |
12
- | `active` | `active` | Specifies the position of the element relative to its container | `boolean \| undefined` | `false` |
13
- | `position` | `position` | Specifies the position of the element relative to its container | `"bottom" \| "top" \| undefined` | `'top'` |
10
+ | Property | Attribute | Description | Type | Default |
11
+ | ---------- | ---------- | ----------------------------------------------------------------------- | -------------------------------- | ------- |
12
+ | `active` | `active` | Specifies if the component is active and shows expanded children or not | `boolean \| undefined` | `false` |
13
+ | `position` | `position` | Specifies the position of the element relative to its container | `"bottom" \| "top" \| undefined` | `'top'` |
14
14
 
15
15
 
16
16
  ## Dependencies
@@ -1,7 +1,9 @@
1
+ import Handlebars from 'handlebars'
2
+
1
3
  type LocaleConfig = {
2
- it?: Record<string, string>
3
- en?: Record<string, string>
4
- gr?: Record<string, string>
4
+ it?: Record<string, string | string[]>
5
+ en?: Record<string, string | string[]>
6
+ gr?: Record<string, string | string[]>
5
7
  }
6
8
 
7
9
  export class Locale {
@@ -25,7 +27,40 @@ export class Locale {
25
27
  this.language = this.defaultLanguage
26
28
  }
27
29
 
28
- get = (tag: string): string => {
30
+ private pluralize = (tag: string | string[], context: Record<string, string | number>): string => {
31
+
32
+ const languagePhrase: string | string[] = this.config[this.language][tag] ?? this.config[this.defaultLanguage][tag]
33
+ const phrases: string[] = []
34
+
35
+ if (Array.isArray(languagePhrase)) {
36
+ phrases.push(languagePhrase[0])
37
+ phrases.push(languagePhrase[1])
38
+ } else {
39
+ phrases.push(languagePhrase)
40
+ phrases.push(languagePhrase)
41
+ }
42
+
43
+ const [ defaultPhrase ] = phrases
44
+ let translatePhrase: string = defaultPhrase
45
+
46
+ const keys = Object.keys(context)
47
+ if (keys.length > 0) {
48
+ const [firstKey] = keys
49
+ if (typeof context[firstKey] === 'number') {
50
+ if (context[firstKey] !== 1) {
51
+ translatePhrase = phrases[1]
52
+ }
53
+ }
54
+ }
55
+
56
+ const template = Handlebars.compile(translatePhrase)
57
+ return template(context)
58
+ }
59
+
60
+ get = (tag: string | string[], context?: Record<string, string | number>): string => {
61
+ if (context) {
62
+ return this.pluralize(tag, context)
63
+ }
29
64
  return this.config[this.language][tag] ?? this.config[this.defaultLanguage][tag]
30
65
  }
31
66
  }
@@ -0,0 +1,16 @@
1
+ @tailwind utilities;
2
+
3
+ @container style(--magma-pref-animation: reduce) {
4
+ :host {
5
+ transition-duration: 0s;
6
+ }
7
+ }
8
+
9
+ @container style(--magma-pref-animation: system) {
10
+
11
+ @media (prefers-reduced-motion) {
12
+ :host {
13
+ transition-duration: 0s;
14
+ }
15
+ }
16
+ }
@@ -19,34 +19,36 @@
19
19
  transform: var(--mds-input-tip-active-translate);
20
20
  }
21
21
 
22
- :host ( :empty ) {
22
+ :host(:empty) {
23
23
  display: none;
24
24
  }
25
25
 
26
- :host ( [position="top"] ) {
26
+ :host([position="top"]) {
27
27
  top: theme('spacing.100');
28
28
  }
29
29
 
30
- :host ( [position="bottom"] ) {
30
+ :host([position="bottom"]) {
31
31
  bottom: theme('spacing.100');
32
32
  }
33
33
 
34
- :host ( [position="top"][active]:not([active="false"]) ) {
34
+ :host([position="top"][active]:not([active="false"])) {
35
35
 
36
36
  --mds-input-tip-active-translate: translate(calc(theme('translate.100') * -1), calc(theme('translate.100') * -1));
37
37
  }
38
38
 
39
- :host( [position="top"][active]:not([active="false"]) ) ::slotted( mds-input-tip-item ) {
39
+ :host([position="top"][active]:not([active="false"])) ::slotted( mds-input-tip-item ) {
40
40
  border-top-left-radius: 0;
41
41
  border-top-right-radius: 0;
42
42
  }
43
43
 
44
- :host ( [position="bottom"][active]:not([active="false"]) ) {
44
+ :host([position="bottom"][active]:not([active="false"])) {
45
45
 
46
46
  --mds-input-tip-active-translate: translate(calc(theme('translate.100') * -1), theme('translate.100'));
47
47
  }
48
48
 
49
- :host( [position="bottom"][active]:not([active="false"]) ) ::slotted( mds-input-tip-item ) {
49
+ :host([position="bottom"][active]:not([active="false"])) ::slotted( mds-input-tip-item ) {
50
50
  border-bottom-left-radius: 0;
51
51
  border-bottom-right-radius: 0;
52
52
  }
53
+
54
+ @import './css/mds-input-tip-pref-animation.css';
@@ -9,7 +9,7 @@ import { InputTipPositionType } from './meta/types'
9
9
  export class MdsInputTip {
10
10
 
11
11
  /**
12
- * Specifies the position of the element relative to its container
12
+ * Specifies if the component is active and shows expanded children or not
13
13
  */
14
14
  @Prop({ reflect: true }) readonly active?: boolean = false
15
15
 
@@ -0,0 +1,8 @@
1
+ const inputTipPositionDictionary = [
2
+ 'top',
3
+ 'bottom',
4
+ ]
5
+
6
+ export {
7
+ inputTipPositionDictionary,
8
+ }
@@ -7,10 +7,10 @@
7
7
 
8
8
  ## Properties
9
9
 
10
- | Property | Attribute | Description | Type | Default |
11
- | ---------- | ---------- | --------------------------------------------------------------- | -------------------------------- | ------- |
12
- | `active` | `active` | Specifies the position of the element relative to its container | `boolean \| undefined` | `false` |
13
- | `position` | `position` | Specifies the position of the element relative to its container | `"bottom" \| "top" \| undefined` | `'top'` |
10
+ | Property | Attribute | Description | Type | Default |
11
+ | ---------- | ---------- | ----------------------------------------------------------------------- | -------------------------------- | ------- |
12
+ | `active` | `active` | Specifies if the component is active and shows expanded children or not | `boolean \| undefined` | `false` |
13
+ | `position` | `position` | Specifies the position of the element relative to its container | `"bottom" \| "top" \| undefined` | `'top'` |
14
14
 
15
15
 
16
16
  ----------------------------------------------
@@ -0,0 +1,26 @@
1
+ import { inputTipPositionDictionary } from '../meta/dictionary'
2
+ import { h } from '@stencil/core'
3
+
4
+ export default {
5
+ title: 'Form / Input Tip',
6
+ argTypes: {
7
+ active: {
8
+ type: { name: 'boolean' },
9
+ description: 'Specifies if the component is active and shows expanded children or not',
10
+ },
11
+ position: {
12
+ description: 'Specifies the position of the element relative to its container',
13
+ options: inputTipPositionDictionary,
14
+ control: { type: 'select' },
15
+ },
16
+ },
17
+ }
18
+
19
+ const Template = args =>
20
+ <mds-input-tip {...args}>
21
+ <mds-input-tip-item variant="required"></mds-input-tip-item>
22
+ <mds-input-tip-item variant="disabled"></mds-input-tip-item>
23
+ <mds-input-tip-item variant="readonly"></mds-input-tip-item>
24
+ </mds-input-tip>
25
+
26
+ export const Default = Template.bind({})
@@ -10,7 +10,7 @@ export { InputTipPositionType } from "./components/mds-input-tip/meta/types";
10
10
  export namespace Components {
11
11
  interface MdsInputTip {
12
12
  /**
13
- * Specifies the position of the element relative to its container
13
+ * Specifies if the component is active and shows expanded children or not
14
14
  */
15
15
  "active"?: boolean;
16
16
  /**
@@ -33,7 +33,7 @@ declare global {
33
33
  declare namespace LocalJSX {
34
34
  interface MdsInputTip {
35
35
  /**
36
- * Specifies the position of the element relative to its container
36
+ * Specifies if the component is active and shows expanded children or not
37
37
  */
38
38
  "active"?: boolean;
39
39
  /**
@@ -282,6 +282,7 @@
282
282
  "mi/baseline/badge",
283
283
  "mi/baseline/book",
284
284
  "mi/baseline/border-all",
285
+ "mi/baseline/broken-image",
285
286
  "mi/baseline/cancel",
286
287
  "mi/baseline/category",
287
288
  "mi/baseline/check-box",
@@ -1,5 +1,6 @@
1
1
  @import '~@maggioli-design-system/styles/dist/tailwind/components.css';
2
2
  @tailwind components;
3
+ @tailwind utilities;
3
4
 
4
5
  @layer components {
5
6
  .svg {
@@ -12,4 +13,74 @@
12
13
  h-full
13
14
  w-full;
14
15
  }
16
+
17
+ .contrast-area-base {
18
+ border-radius: inherit;
19
+ box-shadow: theme('boxShadow.outline-50') inset;
20
+ display: none;
21
+ inset: 0;
22
+ opacity: 0;
23
+ pointer-events: none;
24
+ position: absolute;
25
+ transition-behavior: allow-discrete;
26
+ transition-property: display opacity;
27
+ }
28
+
29
+ .contrast-area-50 {
30
+ @apply contrast-area-base;
31
+
32
+ box-shadow: theme('boxShadow.outline-50') inset;
33
+ }
34
+
35
+ .contrast-area {
36
+ @apply contrast-area-base;
37
+
38
+ box-shadow: theme('boxShadow.outline') inset;
39
+ }
40
+
41
+ @container style(--magma-pref-contrast: more) {
42
+ .contrast-area,
43
+ .contrast-area-50 {
44
+ @apply
45
+ block
46
+ opacity-100;
47
+
48
+ /* @starting-style {
49
+ opacity: 0;
50
+ } */
51
+ }
52
+ }
53
+
54
+ @container style(--magma-pref-contrast: system) {
55
+
56
+ @media (prefers-contrast: more) {
57
+ .contrast-area,
58
+ .contrast-area-50 {
59
+ @apply
60
+ block
61
+ opacity-100;
62
+
63
+ /* @starting-style {
64
+ opacity: 0;
65
+ } */
66
+ }
67
+ }
68
+ }
69
+
70
+ @container style(--magma-pref-animation: reduce) {
71
+ .contrast-area,
72
+ .contrast-area-50 {
73
+ @apply duration-0;
74
+ }
75
+ }
76
+
77
+ @container style(--magma-pref-animation: system) {
78
+
79
+ @media (prefers-reduced-motion) {
80
+ .contrast-area,
81
+ .contrast-area-50 {
82
+ @apply duration-0;
83
+ }
84
+ }
85
+ }
15
86
  }
@@ -0,0 +1,10 @@
1
+ export type UIPreferenceType =
2
+ | 'animation'
3
+ | 'consumption'
4
+ | 'contrast'
5
+ | 'theme'
6
+
7
+ export type ConsumptionModeType =
8
+ | 'high'
9
+ | 'medium'
10
+ | 'low'
@@ -1 +1 @@
1
- import{p as t,b as p}from"./p-22b86e20.js";export{s as setNonce}from"./p-22b86e20.js";(()=>{const p=import.meta.url,s={};return""!==p&&(s.resourcesUrl=new URL(".",p).href),t(s)})().then((t=>p([["p-630886b5",[[1,"mds-input-tip",{active:[516],position:[513]}]]]],t)));
1
+ import{p as t,b as p}from"./p-96bf634c.js";export{s as setNonce}from"./p-96bf634c.js";import{g as o}from"./p-e1255160.js";(()=>{const s=import.meta.url,p={};return""!==s&&(p.resourcesUrl=new URL(".",s).href),t(p)})().then((async s=>(await o(),p([["p-14639038",[[1,"mds-input-tip",{active:[516],position:[513]}]]]],s))));
@@ -115,7 +115,7 @@ DOMTokenList
115
115
  var resourcesUrl = scriptElm ? scriptElm.getAttribute('data-resources-url') || scriptElm.src : '';
116
116
  var start = function() {
117
117
  // if src is not present then origin is "null", and new URL() throws TypeError: Failed to construct 'URL': Invalid base URL
118
- var url = new URL('./p-e5fe0b68.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
118
+ var url = new URL('./p-ca408384.system.js', new URL(resourcesUrl, window.location.origin !== 'null' ? window.location.origin : undefined));
119
119
  System.import(url.href);
120
120
  };
121
121