@fluentui/web-components 3.0.0-beta.72 → 3.0.0-beta.74

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 (55) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/dist/dts/index-rollup.d.ts +1 -0
  3. package/dist/dts/index.d.ts +1 -0
  4. package/dist/dts/text-input/text-input.d.ts +16 -6
  5. package/dist/dts/tooltip/define.d.ts +1 -0
  6. package/dist/dts/tooltip/index.d.ts +5 -0
  7. package/dist/dts/tooltip/tooltip.d.ts +88 -0
  8. package/dist/dts/tooltip/tooltip.definition.d.ts +9 -0
  9. package/dist/dts/tooltip/tooltip.options.d.ts +24 -0
  10. package/dist/dts/tooltip/tooltip.styles.d.ts +5 -0
  11. package/dist/dts/tooltip/tooltip.template.d.ts +6 -0
  12. package/dist/esm/avatar/avatar.js +1 -2
  13. package/dist/esm/avatar/avatar.js.map +1 -1
  14. package/dist/esm/button/button.js +1 -2
  15. package/dist/esm/button/button.js.map +1 -1
  16. package/dist/esm/checkbox/checkbox.js +1 -2
  17. package/dist/esm/checkbox/checkbox.js.map +1 -1
  18. package/dist/esm/index-rollup.js +1 -0
  19. package/dist/esm/index-rollup.js.map +1 -1
  20. package/dist/esm/index.js +1 -0
  21. package/dist/esm/index.js.map +1 -1
  22. package/dist/esm/menu/menu.js +0 -3
  23. package/dist/esm/menu/menu.js.map +1 -1
  24. package/dist/esm/menu-item/menu-item.js +0 -7
  25. package/dist/esm/menu-item/menu-item.js.map +1 -1
  26. package/dist/esm/menu-item/menu-item.template.js +1 -3
  27. package/dist/esm/menu-item/menu-item.template.js.map +1 -1
  28. package/dist/esm/menu-list/menu-list.js +1 -2
  29. package/dist/esm/menu-list/menu-list.js.map +1 -1
  30. package/dist/esm/radio-group/radio-group.js +1 -2
  31. package/dist/esm/radio-group/radio-group.js.map +1 -1
  32. package/dist/esm/slider/slider.js +1 -2
  33. package/dist/esm/slider/slider.js.map +1 -1
  34. package/dist/esm/text-input/text-input.js +18 -11
  35. package/dist/esm/text-input/text-input.js.map +1 -1
  36. package/dist/esm/textarea/textarea.js +1 -2
  37. package/dist/esm/textarea/textarea.js.map +1 -1
  38. package/dist/esm/tooltip/define.js +4 -0
  39. package/dist/esm/tooltip/define.js.map +1 -0
  40. package/dist/esm/tooltip/index.js +6 -0
  41. package/dist/esm/tooltip/index.js.map +1 -0
  42. package/dist/esm/tooltip/tooltip.definition.js +17 -0
  43. package/dist/esm/tooltip/tooltip.definition.js.map +1 -0
  44. package/dist/esm/tooltip/tooltip.js +188 -0
  45. package/dist/esm/tooltip/tooltip.js.map +1 -0
  46. package/dist/esm/tooltip/tooltip.options.js +19 -0
  47. package/dist/esm/tooltip/tooltip.options.js.map +1 -0
  48. package/dist/esm/tooltip/tooltip.styles.js +95 -0
  49. package/dist/esm/tooltip/tooltip.styles.js.map +1 -0
  50. package/dist/esm/tooltip/tooltip.template.js +11 -0
  51. package/dist/esm/tooltip/tooltip.template.js.map +1 -0
  52. package/dist/web-components.d.ts +140 -6
  53. package/dist/web-components.js +848 -651
  54. package/dist/web-components.min.js +259 -246
  55. package/package.json +2 -2
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The TooltipPositioning options and their corresponding CSS values
3
+ * @public
4
+ */
5
+ export const TooltipPositioningOption = {
6
+ 'above-start': 'block-start span-inline-end',
7
+ above: 'block-start',
8
+ 'above-end': 'block-start span-inline-start',
9
+ 'below-start': 'block-end span-inline-end',
10
+ below: 'block-end',
11
+ 'below-end': 'block-end span-inline-start',
12
+ 'before-top': 'inline-start span-block-end',
13
+ before: 'inline-start',
14
+ 'before-bottom': 'inline-start span-block-start',
15
+ 'after-top': 'inline-end span-block-end',
16
+ after: 'inline-end',
17
+ 'after-bottom': 'inline-end span-block-start',
18
+ };
19
+ //# sourceMappingURL=tooltip.options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.options.js","sourceRoot":"","sources":["../../../src/tooltip/tooltip.options.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,aAAa,EAAE,6BAA6B;IAC5C,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,+BAA+B;IAC5C,aAAa,EAAE,2BAA2B;IAC1C,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,6BAA6B;IAC1C,YAAY,EAAE,6BAA6B;IAC3C,MAAM,EAAE,cAAc;IACtB,eAAe,EAAE,+BAA+B;IAChD,WAAW,EAAE,2BAA2B;IACxC,KAAK,EAAE,YAAY;IACnB,cAAc,EAAE,6BAA6B;CACrC,CAAC"}
@@ -0,0 +1,95 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ import { display } from '../utils/display.js';
3
+ import { borderRadiusMedium, colorNeutralBackground1, colorNeutralForeground1, colorNeutralShadowAmbient, colorNeutralShadowKey, colorTransparentStroke, fontFamilyBase, fontSizeBase200, lineHeightBase200, spacingHorizontalMNudge, spacingHorizontalXS, spacingVerticalXS, } from '../theme/design-tokens.js';
4
+ import { TooltipPositioningOption } from './tooltip.options.js';
5
+ /**
6
+ * Styles for the tooltip component
7
+ * @public
8
+ */
9
+ export const styles = css `
10
+ ${display('inline-flex')}
11
+
12
+ :host(:not(:popover-open)) {
13
+ display: none;
14
+ }
15
+
16
+ :host {
17
+ --position-area: block-start;
18
+ --position-try-options: flip-block;
19
+ --block-offset: ${spacingVerticalXS};
20
+ --inline-offset: ${spacingHorizontalXS};
21
+ background: ${colorNeutralBackground1};
22
+ border-radius: ${borderRadiusMedium};
23
+ border: 1px solid ${colorTransparentStroke};
24
+ box-sizing: border-box;
25
+ color: ${colorNeutralForeground1};
26
+ display: inline-flex;
27
+ filter: drop-shadow(0 0 2px ${colorNeutralShadowAmbient}) drop-shadow(0 4px 8px ${colorNeutralShadowKey});
28
+ font-family: ${fontFamilyBase};
29
+ font-size: ${fontSizeBase200};
30
+ inset: unset;
31
+ line-height: ${lineHeightBase200};
32
+ margin: unset; /* Remove browser default for [popover] */
33
+ max-width: 240px;
34
+ padding: 4px ${spacingHorizontalMNudge} 6px;
35
+ position: absolute;
36
+ position-area: var(--position-area);
37
+ position-try-options: var(--position-try-options);
38
+ width: auto;
39
+ z-index: 1;
40
+ }
41
+
42
+ @supports (inset-area: block-start) {
43
+ :host {
44
+ inset-area: var(--position-area);
45
+ position-try-fallbacks: var(--position-try-options);
46
+ }
47
+ }
48
+
49
+ :host(:is([positioning^='above'], [positioning^='below'], :not([positioning]))) {
50
+ margin-block: var(--block-offset);
51
+ }
52
+
53
+ :host(:is([positioning^='before'], [positioning^='after'])) {
54
+ margin-inline: var(--inline-offset);
55
+ --position-try-options: flip-inline;
56
+ }
57
+
58
+ :host([positioning='above-start']) {
59
+ --position-area: ${TooltipPositioningOption['above-start']};
60
+ }
61
+ :host([positioning='above']) {
62
+ --position-area: ${TooltipPositioningOption.above};
63
+ }
64
+ :host([positioning='above-end']) {
65
+ --position-area: ${TooltipPositioningOption['above-end']};
66
+ }
67
+ :host([positioning='below-start']) {
68
+ --position-area: ${TooltipPositioningOption['below-start']};
69
+ }
70
+ :host([positioning='below']) {
71
+ --position-area: ${TooltipPositioningOption.below};
72
+ }
73
+ :host([positioning='below-end']) {
74
+ --position-area: ${TooltipPositioningOption.below};
75
+ }
76
+ :host([positioning='before-top']) {
77
+ --position-area: ${TooltipPositioningOption['before-top']};
78
+ }
79
+ :host([positioning='before']) {
80
+ --position-area: ${TooltipPositioningOption.before};
81
+ }
82
+ :host([positioning='before-bottom']) {
83
+ --position-area: ${TooltipPositioningOption['before-bottom']};
84
+ }
85
+ :host([positioning='after-top']) {
86
+ --position-area: ${TooltipPositioningOption['after-top']};
87
+ }
88
+ :host([positioning='after']) {
89
+ --position-area: ${TooltipPositioningOption.after};
90
+ }
91
+ :host([positioning='after-bottom']) {
92
+ --position-area: ${TooltipPositioningOption['after-bottom']};
93
+ }
94
+ `;
95
+ //# sourceMappingURL=tooltip.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.styles.js","sourceRoot":"","sources":["../../../src/tooltip/tooltip.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,aAAa,CAAC;;;;;;;;;sBASJ,iBAAiB;uBAChB,mBAAmB;kBACxB,uBAAuB;qBACpB,kBAAkB;wBACf,sBAAsB;;aAEjC,uBAAuB;;kCAEF,yBAAyB,2BAA2B,qBAAqB;mBACxF,cAAc;iBAChB,eAAe;;mBAEb,iBAAiB;;;mBAGjB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;uBAyBnB,wBAAwB,CAAC,aAAa,CAAC;;;uBAGvC,wBAAwB,CAAC,KAAK;;;uBAG9B,wBAAwB,CAAC,WAAW,CAAC;;;uBAGrC,wBAAwB,CAAC,aAAa,CAAC;;;uBAGvC,wBAAwB,CAAC,KAAK;;;uBAG9B,wBAAwB,CAAC,KAAK;;;uBAG9B,wBAAwB,CAAC,YAAY,CAAC;;;uBAGtC,wBAAwB,CAAC,MAAM;;;uBAG/B,wBAAwB,CAAC,eAAe,CAAC;;;uBAGzC,wBAAwB,CAAC,WAAW,CAAC;;;uBAGrC,wBAAwB,CAAC,KAAK;;;uBAG9B,wBAAwB,CAAC,cAAc,CAAC;;CAE9D,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { html } from '@microsoft/fast-element';
2
+ /**
3
+ * Template for the tooltip component
4
+ * @public
5
+ */
6
+ export const template = html `
7
+ <template popover aria-hidden="true">
8
+ <slot></slot>
9
+ </template>
10
+ `;
11
+ //# sourceMappingURL=tooltip.template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.template.js","sourceRoot":"","sources":["../../../src/tooltip/tooltip.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAS;;;;CAIpC,CAAC"}
@@ -2484,6 +2484,22 @@ export declare class BaseTextInput extends FASTElement {
2484
2484
  * HTML Attribute: `autofocus`
2485
2485
  */
2486
2486
  autofocus: boolean;
2487
+ /**
2488
+ * The current value of the input.
2489
+ * @public
2490
+ * @remarks
2491
+ * HTML Attribute: `current-value`
2492
+ */
2493
+ currentValue: string;
2494
+ /**
2495
+ * Tracks the current value of the input.
2496
+ *
2497
+ * @param prev - the previous value
2498
+ * @param next - the next value
2499
+ *
2500
+ * @internal
2501
+ */
2502
+ currentValueChanged(prev: string, next: string): void;
2487
2503
  /**
2488
2504
  * The default slotted content. This is the content that appears in the text field label.
2489
2505
  *
@@ -2655,12 +2671,6 @@ export declare class BaseTextInput extends FASTElement {
2655
2671
  * HTML Attribute: `type`
2656
2672
  */
2657
2673
  type: TextInputType;
2658
- /**
2659
- * The current value of the input.
2660
- *
2661
- * @internal
2662
- */
2663
- private _value;
2664
2674
  /**
2665
2675
  * A reference to the internal input element.
2666
2676
  *
@@ -9943,6 +9953,130 @@ export declare const ToggleButtonStyles: ElementStyles;
9943
9953
  */
9944
9954
  export declare const ToggleButtonTemplate: ElementViewTemplate<ToggleButton>;
9945
9955
 
9956
+ /**
9957
+ * A Tooltip Custom HTML Element.
9958
+ * Based on ARIA APG Tooltip Pattern {@link https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/ }
9959
+ * @public
9960
+ */
9961
+ export declare class Tooltip extends FASTElement {
9962
+ /**
9963
+ * The attached element internals
9964
+ */
9965
+ elementInternals: ElementInternals;
9966
+ /**
9967
+ * The item ID
9968
+ *
9969
+ * @public
9970
+ * @remarks
9971
+ * HTML Attribute: id
9972
+ */
9973
+ id: string;
9974
+ /**
9975
+ * Set the delay for the tooltip
9976
+ */
9977
+ delay?: number;
9978
+ /**
9979
+ * The default delay for the tooltip
9980
+ * @internal
9981
+ */
9982
+ private defaultDelay;
9983
+ /**
9984
+ * Set the positioning of the tooltip
9985
+ */
9986
+ positioning?: TooltipPositioningOption;
9987
+ /**
9988
+ * The id of the anchor element for the tooltip
9989
+ */
9990
+ anchor: string;
9991
+ /**
9992
+ * Reference to the anchor element
9993
+ * @internal
9994
+ */
9995
+ private get anchorElement();
9996
+ /**
9997
+ * Reference to the anchor positioning style element
9998
+ * @internal
9999
+ */
10000
+ protected anchorPositioningStyleElement: HTMLStyleElement | null;
10001
+ constructor();
10002
+ connectedCallback(): void;
10003
+ disconnectedCallback(): void;
10004
+ /**
10005
+ * Shows the tooltip
10006
+ * @param delay Number of milliseconds to delay showing the tooltip
10007
+ * @internal
10008
+ */
10009
+ showTooltip(delay?: number): void;
10010
+ /**
10011
+ * Hide the tooltip
10012
+ * @param delay Number of milliseconds to delay hiding the tooltip
10013
+ * @internal
10014
+ */
10015
+ hideTooltip(delay?: number): void;
10016
+ /**
10017
+ * Show the tooltip on mouse enter
10018
+ */
10019
+ mouseenterAnchorHandler: () => void;
10020
+ /**
10021
+ * Hide the tooltip on mouse leave
10022
+ */
10023
+ mouseleaveAnchorHandler: () => void;
10024
+ /**
10025
+ * Show the tooltip on focus
10026
+ */
10027
+ focusAnchorHandler: () => void;
10028
+ /**
10029
+ * Hide the tooltip on blur
10030
+ */
10031
+ blurAnchorHandler: () => void;
10032
+ }
10033
+
10034
+ /**
10035
+ * The {@link Tooltip } custom element definition.
10036
+ *
10037
+ * @public
10038
+ * @remarks
10039
+ * HTML Element: `<fluent-tooltip>`
10040
+ */
10041
+ export declare const TooltipDefinition: FASTElementDefinition<typeof Tooltip>;
10042
+
10043
+ /**
10044
+ * The TooltipPositioning options and their corresponding CSS values
10045
+ * @public
10046
+ */
10047
+ export declare const TooltipPositioningOption: {
10048
+ readonly 'above-start': "block-start span-inline-end";
10049
+ readonly above: "block-start";
10050
+ readonly 'above-end': "block-start span-inline-start";
10051
+ readonly 'below-start': "block-end span-inline-end";
10052
+ readonly below: "block-end";
10053
+ readonly 'below-end': "block-end span-inline-start";
10054
+ readonly 'before-top': "inline-start span-block-end";
10055
+ readonly before: "inline-start";
10056
+ readonly 'before-bottom': "inline-start span-block-start";
10057
+ readonly 'after-top': "inline-end span-block-end";
10058
+ readonly after: "inline-end";
10059
+ readonly 'after-bottom': "inline-end span-block-start";
10060
+ };
10061
+
10062
+ /**
10063
+ * The TooltipPositioning type
10064
+ * @public
10065
+ */
10066
+ export declare type TooltipPositioningOption = ValuesOf<typeof TooltipPositioningOption>;
10067
+
10068
+ /**
10069
+ * Styles for the tooltip component
10070
+ * @public
10071
+ */
10072
+ export declare const TooltipStyles: ElementStyles;
10073
+
10074
+ /**
10075
+ * Template for the tooltip component
10076
+ * @public
10077
+ */
10078
+ export declare const TooltipTemplate: ViewTemplate<Tooltip, any>;
10079
+
9946
10080
  export declare const typographyBody1StrongerStyles: CSSDirective;
9947
10081
 
9948
10082
  export declare const typographyBody1StrongStyles: CSSDirective;