@fluentui/web-components 3.0.0-alpha.6 → 3.0.0-alpha.7

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 (77) hide show
  1. package/CHANGELOG.json +28 -1
  2. package/CHANGELOG.md +13 -2
  3. package/dist/dts/avatar/avatar.d.ts +97 -0
  4. package/dist/dts/avatar/avatar.definition.d.ts +9 -0
  5. package/dist/dts/avatar/avatar.options.d.ts +142 -0
  6. package/dist/dts/avatar/avatar.styles.d.ts +4 -0
  7. package/dist/dts/avatar/avatar.template.d.ts +8 -0
  8. package/dist/dts/avatar/define.d.ts +1 -0
  9. package/dist/dts/avatar/index.d.ts +5 -0
  10. package/dist/dts/divider/define.d.ts +1 -0
  11. package/dist/dts/divider/divider.d.ts +31 -0
  12. package/dist/dts/divider/divider.definition.d.ts +9 -0
  13. package/dist/dts/divider/divider.options.d.ts +40 -0
  14. package/dist/dts/divider/divider.styles.d.ts +4 -0
  15. package/dist/dts/divider/divider.template.d.ts +7 -0
  16. package/dist/dts/divider/index.d.ts +5 -0
  17. package/dist/dts/image/define.d.ts +1 -0
  18. package/dist/dts/image/image.d.ts +48 -0
  19. package/dist/dts/image/image.definition.d.ts +9 -0
  20. package/dist/dts/image/image.options.d.ts +27 -0
  21. package/dist/dts/image/image.styles.d.ts +5 -0
  22. package/dist/dts/image/image.template.d.ts +7 -0
  23. package/dist/dts/image/index.d.ts +5 -0
  24. package/dist/dts/index.d.ts +3 -0
  25. package/dist/dts/utils/get-initials.d.ts +18 -0
  26. package/dist/esm/avatar/avatar.definition.js +17 -0
  27. package/dist/esm/avatar/avatar.definition.js.map +1 -0
  28. package/dist/esm/avatar/avatar.js +92 -0
  29. package/dist/esm/avatar/avatar.js.map +1 -0
  30. package/dist/esm/avatar/avatar.options.js +87 -0
  31. package/dist/esm/avatar/avatar.options.js.map +1 -0
  32. package/dist/esm/avatar/avatar.styles.js +476 -0
  33. package/dist/esm/avatar/avatar.styles.js.map +1 -0
  34. package/dist/esm/avatar/avatar.template.js +28 -0
  35. package/dist/esm/avatar/avatar.template.js.map +1 -0
  36. package/dist/esm/avatar/define.js +4 -0
  37. package/dist/esm/avatar/define.js.map +1 -0
  38. package/dist/esm/avatar/index.js +6 -0
  39. package/dist/esm/avatar/index.js.map +1 -0
  40. package/dist/esm/divider/define.js +4 -0
  41. package/dist/esm/divider/define.js.map +1 -0
  42. package/dist/esm/divider/divider.definition.js +17 -0
  43. package/dist/esm/divider/divider.definition.js.map +1 -0
  44. package/dist/esm/divider/divider.js +21 -0
  45. package/dist/esm/divider/divider.js.map +1 -0
  46. package/dist/esm/divider/divider.options.js +31 -0
  47. package/dist/esm/divider/divider.options.js.map +1 -0
  48. package/dist/esm/divider/divider.styles.js +111 -0
  49. package/dist/esm/divider/divider.styles.js.map +1 -0
  50. package/dist/esm/divider/divider.template.js +7 -0
  51. package/dist/esm/divider/divider.template.js.map +1 -0
  52. package/dist/esm/divider/index.js +6 -0
  53. package/dist/esm/divider/index.js.map +1 -0
  54. package/dist/esm/image/define.js +4 -0
  55. package/dist/esm/image/define.js.map +1 -0
  56. package/dist/esm/image/image.definition.js +17 -0
  57. package/dist/esm/image/image.definition.js.map +1 -0
  58. package/dist/esm/image/image.js +24 -0
  59. package/dist/esm/image/image.js.map +1 -0
  60. package/dist/esm/image/image.options.js +21 -0
  61. package/dist/esm/image/image.options.js.map +1 -0
  62. package/dist/esm/image/image.styles.js +52 -0
  63. package/dist/esm/image/image.styles.js.map +1 -0
  64. package/dist/esm/image/image.template.js +7 -0
  65. package/dist/esm/image/image.template.js.map +1 -0
  66. package/dist/esm/image/index.js +6 -0
  67. package/dist/esm/image/index.js.map +1 -0
  68. package/dist/esm/index.js +3 -0
  69. package/dist/esm/index.js.map +1 -1
  70. package/dist/esm/utils/get-initials.js +83 -0
  71. package/dist/esm/utils/get-initials.js.map +1 -0
  72. package/dist/fluent-web-components.api.json +3379 -1847
  73. package/dist/web-components.d.ts +454 -0
  74. package/dist/web-components.js +494 -19
  75. package/dist/web-components.min.js +123 -118
  76. package/docs/api-report.md +237 -0
  77. package/package.json +13 -1
@@ -0,0 +1,28 @@
1
+ import { html } from '@microsoft/fast-element';
2
+ const defaultIconTemplate = html `<svg
3
+ width="1em"
4
+ height="1em"
5
+ viewBox="0 0 20 20"
6
+ xmlns="http://www.w3.org/2000/svg"
7
+ class="default-icon"
8
+ fill="currentcolor"
9
+ aria-hidden="true"
10
+ >
11
+ <path
12
+ d="M10 2a4 4 0 100 8 4 4 0 000-8zM7 6a3 3 0 116 0 3 3 0 01-6 0zm-2 5a2 2 0 00-2 2c0 1.7.83 2.97 2.13 3.8A9.14 9.14 0 0010 18c1.85 0 3.58-.39 4.87-1.2A4.35 4.35 0 0017 13a2 2 0 00-2-2H5zm-1 2a1 1 0 011-1h10a1 1 0 011 1c0 1.3-.62 2.28-1.67 2.95A8.16 8.16 0 0110 17a8.16 8.16 0 01-4.33-1.05A3.36 3.36 0 014 13z"
13
+ ></path>
14
+ </svg>`;
15
+ /**
16
+ * The template for the Avatar component.
17
+ * @public
18
+ */
19
+ export function avatarTemplate() {
20
+ return html `
21
+ <template role="img" data-color=${x => x.generateColor()}>
22
+ <slot>${x => (x.name || x.initials ? x.generateInitials() : defaultIconTemplate)}</slot>
23
+ <slot name="badge"></slot>
24
+ </template>
25
+ `;
26
+ }
27
+ export const template = avatarTemplate();
28
+ //# sourceMappingURL=avatar.template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.template.js","sourceRoot":"","sources":["../../../src/avatar/avatar.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGpE,MAAM,mBAAmB,GAAG,IAAI,CAAA;;;;;;;;;;;;OAYzB,CAAC;AAER;;;GAGG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,IAAI,CAAG;sCACsB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,EAAE;cAC9C,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,mBAAmB,CAAC;;;GAGnF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAgC,cAAc,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { definition } from './avatar.definition.js';
3
+ definition.define(FluentDesignSystem.registry);
4
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/avatar/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './avatar.js';
2
+ export * from './avatar.options.js';
3
+ export { template as AvatarTemplate } from './avatar.template.js';
4
+ export { styles as AvatarStyles } from './avatar.styles.js';
5
+ export { definition as AvatarDefinition } from './avatar.definition.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/avatar/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,UAAU,IAAI,gBAAgB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { definition } from './divider.definition.js';
3
+ definition.define(FluentDesignSystem.registry);
4
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/divider/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { Divider } from './divider.js';
3
+ import { template } from './divider.template.js';
4
+ import { styles } from './divider.styles.js';
5
+ /**
6
+ * The Fluent Divider Element
7
+ *
8
+ * @public
9
+ * @remarks
10
+ * HTML Element: \<fluent-divider\>
11
+ */
12
+ export const definition = Divider.compose({
13
+ name: `${FluentDesignSystem.prefix}-divider`,
14
+ template,
15
+ styles,
16
+ });
17
+ //# sourceMappingURL=divider.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.definition.js","sourceRoot":"","sources":["../../../src/divider/divider.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IACxC,IAAI,EAAE,GAAG,kBAAkB,CAAC,MAAM,UAAU;IAC5C,QAAQ;IACR,MAAM;CACP,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { __decorate } from "tslib";
2
+ import { attr } from '@microsoft/fast-element';
3
+ import { FASTDivider } from '@microsoft/fast-foundation';
4
+ /**
5
+ * @class Divider component
6
+ *
7
+ * @remarks
8
+ * This class extends the FASTDivider. A divider groups sections of content to create visual rhythm and hierarchy. Use dividers along with spacing and headers to organize content in your layout.
9
+ */
10
+ export class Divider extends FASTDivider {
11
+ }
12
+ __decorate([
13
+ attr({ attribute: 'align-content' })
14
+ ], Divider.prototype, "alignContent", void 0);
15
+ __decorate([
16
+ attr
17
+ ], Divider.prototype, "appearance", void 0);
18
+ __decorate([
19
+ attr({ mode: 'boolean' })
20
+ ], Divider.prototype, "inset", void 0);
21
+ //# sourceMappingURL=divider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.js","sourceRoot":"","sources":["../../../src/divider/divider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGzD;;;;;GAKG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;CA2BvC;AAnBC;IADC,IAAI,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;6CACK;AAS1C;IADC,IAAI;2CACiC;AAStC;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;sCACH"}
@@ -0,0 +1,31 @@
1
+ import { DividerOrientation, DividerRole } from '@microsoft/fast-foundation';
2
+ /**
3
+ * Fast Foundation DividerRole property
4
+ * @public
5
+ */
6
+ export { DividerRole };
7
+ /**
8
+ * Fast Foundation Orientation property
9
+ * @public
10
+ */
11
+ export { DividerOrientation };
12
+ /**
13
+ * Align content within divider
14
+ * @public
15
+ */
16
+ export const DividerAlignContent = {
17
+ center: 'center',
18
+ start: 'start',
19
+ end: 'end',
20
+ };
21
+ /**
22
+ * DividerAppearance - divider color defined by a design token alias.
23
+ * @public
24
+ */
25
+ export const DividerAppearance = {
26
+ strong: 'strong',
27
+ brand: 'brand',
28
+ subtle: 'subtle',
29
+ default: 'default',
30
+ };
31
+ //# sourceMappingURL=divider.options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.options.js","sourceRoot":"","sources":["../../../src/divider/divider.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAY,MAAM,4BAA4B,CAAC;AAEvF;;;GAGG;AACH,OAAO,EAAE,WAAW,EAAE,CAAC;AAEvB;;;GAGG;AACH,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAE9B;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;CACF,CAAC;AAQX;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;CACV,CAAC"}
@@ -0,0 +1,111 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ import { display } from '@microsoft/fast-foundation';
3
+ import { colorBrandForeground1, colorBrandStroke1, colorNeutralForeground1, colorNeutralForeground2, colorNeutralForeground3, colorNeutralStroke1, colorNeutralStroke2, colorNeutralStroke3, fontFamilyBase, fontSizeBase200, fontWeightRegular, strokeWidthThin, } from '../theme/design-tokens.js';
4
+ /** Divider styles
5
+ * @public
6
+ */
7
+ export const styles = css `
8
+ ${display('flex')}
9
+
10
+ :host::after,
11
+ :host::before {
12
+ align-self: center;
13
+ background: ${colorNeutralStroke2};
14
+ box-sizing: border-box;
15
+ content: '';
16
+ display: flex;
17
+ flex-grow: 1;
18
+ height: ${strokeWidthThin};
19
+ }
20
+
21
+ :host([inset]) {
22
+ padding: 0 12px;
23
+ }
24
+
25
+ :host ::slotted(*) {
26
+ color: ${colorNeutralForeground2};
27
+ font-family: ${fontFamilyBase};
28
+ font-size: ${fontSizeBase200};
29
+ font-weight: ${fontWeightRegular};
30
+ margin: 0;
31
+ padding: 0 12px;
32
+ }
33
+
34
+ :host([align-content='start'])::before,
35
+ :host([align-content='end'])::after {
36
+ flex-basis: 12px;
37
+ flex-grow: 0;
38
+ flex-shrink: 0;
39
+ }
40
+
41
+ :host([orientation='vertical']) {
42
+ height: 100%;
43
+ min-height: 84px;
44
+ }
45
+ :host([orientation='vertical']):empty {
46
+ min-height: 20px;
47
+ }
48
+
49
+ :host([orientation='vertical']) {
50
+ flex-direction: column;
51
+ align-items: center;
52
+ }
53
+
54
+ :host([orientation='vertical'][inset])::before {
55
+ margin-top: 12px;
56
+ }
57
+ :host([orientation='vertical'][inset])::after {
58
+ margin-bottom: 12px;
59
+ }
60
+
61
+ :host([orientation='vertical']):empty::before,
62
+ :host([orientation='vertical']):empty::after {
63
+ height: 10px;
64
+ min-height: 10px;
65
+ flex-grow: 0;
66
+ }
67
+
68
+ :host([orientation='vertical'])::before,
69
+ :host([orientation='vertical'])::after {
70
+ width: ${strokeWidthThin};
71
+ min-height: 20px;
72
+ height: 100%;
73
+ }
74
+
75
+ :host([orientation='vertical']) ::slotted(*) {
76
+ display: flex;
77
+ flex-direction: column;
78
+ padding: 12px 0;
79
+ line-height: 20px;
80
+ }
81
+
82
+ :host([orientation='vertical'][align-content='start'])::before {
83
+ min-height: 8px;
84
+ }
85
+ :host([orientation='vertical'][align-content='end'])::after {
86
+ min-height: 8px;
87
+ }
88
+
89
+ :host([appearance='strong'])::before,
90
+ :host([appearance='strong'])::after {
91
+ background: ${colorNeutralStroke1};
92
+ }
93
+ :host([appearance='strong']) ::slotted(*) {
94
+ color: ${colorNeutralForeground1};
95
+ }
96
+ :host([appearance='brand'])::before,
97
+ :host([appearance='brand'])::after {
98
+ background: ${colorBrandStroke1};
99
+ }
100
+ :host([appearance='brand']) ::slotted(*) {
101
+ color: ${colorBrandForeground1};
102
+ }
103
+ :host([appearance='subtle'])::before,
104
+ :host([appearance='subtle'])::after {
105
+ background: ${colorNeutralStroke3};
106
+ }
107
+ :host([appearance='subtle']) ::slotted(*) {
108
+ color: ${colorNeutralForeground3};
109
+ }
110
+ `;
111
+ //# sourceMappingURL=divider.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.styles.js","sourceRoot":"","sources":["../../../src/divider/divider.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;IACrB,OAAO,CAAC,MAAM,CAAC;;;;;kBAKD,mBAAmB;;;;;cAKvB,eAAe;;;;;;;;aAQhB,uBAAuB;mBACjB,cAAc;iBAChB,eAAe;mBACb,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAyCvB,eAAe;;;;;;;;;;;;;;;;;;;;;kBAqBV,mBAAmB;;;aAGxB,uBAAuB;;;;kBAIlB,iBAAiB;;;aAGtB,qBAAqB;;;;kBAIhB,mBAAmB;;;aAGxB,uBAAuB;;CAEnC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { dividerTemplate } from '@microsoft/fast-foundation';
2
+ /**
3
+ * Template for the Divider component
4
+ * @public
5
+ */
6
+ export const template = dividerTemplate();
7
+ //# sourceMappingURL=divider.template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divider.template.js","sourceRoot":"","sources":["../../../src/divider/divider.template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAiC,eAAe,EAAE,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './divider.js';
2
+ export * from './divider.options.js';
3
+ export { definition as DividerDefinition } from './divider.definition.js';
4
+ export { template as DividerTemplate } from './divider.template.js';
5
+ export { styles as DividerStyles } from './divider.styles.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/divider/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,UAAU,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,QAAQ,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { definition } from './image.definition.js';
3
+ definition.define(FluentDesignSystem.registry);
4
+ //# sourceMappingURL=define.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define.js","sourceRoot":"","sources":["../../../src/image/define.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,UAAU,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { FluentDesignSystem } from '../fluent-design-system.js';
2
+ import { Image } from './image.js';
3
+ import { template } from './image.template.js';
4
+ import { styles } from './image.styles.js';
5
+ /**
6
+ * The Fluent Image Element
7
+ *
8
+ * @public
9
+ * @remarks
10
+ * HTML Element: \<fluent-image\>
11
+ */
12
+ export const definition = Image.compose({
13
+ name: `${FluentDesignSystem.prefix}-image`,
14
+ template,
15
+ styles,
16
+ });
17
+ //# sourceMappingURL=image.definition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.definition.js","sourceRoot":"","sources":["../../../src/image/image.definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC;IACtC,IAAI,EAAE,GAAG,kBAAkB,CAAC,MAAM,QAAQ;IAC1C,QAAQ;IACR,MAAM;CACP,CAAC,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { __decorate } from "tslib";
2
+ import { attr, FASTElement } from '@microsoft/fast-element';
3
+ /**
4
+ * The base class used for constucting a fluent image custom element
5
+ * @public
6
+ */
7
+ export class Image extends FASTElement {
8
+ }
9
+ __decorate([
10
+ attr({ mode: 'boolean' })
11
+ ], Image.prototype, "block", void 0);
12
+ __decorate([
13
+ attr({ mode: 'boolean' })
14
+ ], Image.prototype, "bordered", void 0);
15
+ __decorate([
16
+ attr({ mode: 'boolean' })
17
+ ], Image.prototype, "shadow", void 0);
18
+ __decorate([
19
+ attr
20
+ ], Image.prototype, "fit", void 0);
21
+ __decorate([
22
+ attr
23
+ ], Image.prototype, "shape", void 0);
24
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/image/image.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAG5D;;;GAGG;AACH,MAAM,OAAO,KAAM,SAAQ,WAAW;CA8CrC;AArCC;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;oCACH;AASvB;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;uCACA;AAS1B;IADC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;qCACF;AASxB;IADC,IAAI;kCACiB;AAStB;IADC,IAAI;oCACqB"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Image fit
3
+ * @public
4
+ */
5
+ export const ImageFit = {
6
+ none: 'none',
7
+ center: 'center',
8
+ contain: 'contain',
9
+ cover: 'cover',
10
+ default: 'default',
11
+ };
12
+ /**
13
+ * Image shape
14
+ * @public
15
+ */
16
+ export const ImageShape = {
17
+ circular: 'circular',
18
+ rounded: 'rounded',
19
+ square: 'square',
20
+ };
21
+ //# sourceMappingURL=image.options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.options.js","sourceRoot":"","sources":["../../../src/image/image.options.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC;AAOX;;;GAGG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { css } from '@microsoft/fast-element';
2
+ import { borderRadiusCircular, colorNeutralStroke2, shadow4, strokeWidthThin } from '../theme/design-tokens.js';
3
+ /** Image styles
4
+ *
5
+ * @public
6
+ */
7
+ export const styles = css `
8
+ :host ::slotted(img) {
9
+ box-sizing: border-box;
10
+ min-height: 8px;
11
+ min-width: 8px;
12
+ display: inline-block;
13
+ }
14
+ :host([block]) ::slotted(img) {
15
+ width: 100%;
16
+ height: auto;
17
+ }
18
+ :host([bordered]) ::slotted(img) {
19
+ border: ${strokeWidthThin} solid ${colorNeutralStroke2};
20
+ }
21
+ :host([fit='none']) ::slotted(img) {
22
+ object-fit: none;
23
+ object-position: top left;
24
+ height: 100%;
25
+ width: 100%;
26
+ }
27
+ :host([fit='center']) ::slotted(img) {
28
+ object-fit: none;
29
+ object-position: center;
30
+ height: 100%;
31
+ width: 100%;
32
+ }
33
+ :host([fit='contain']) ::slotted(img) {
34
+ object-fit: contain;
35
+ object-position: center;
36
+ height: 100%;
37
+ width: 100%;
38
+ }
39
+ :host([fit='cover']) ::slotted(img) {
40
+ object-fit: cover;
41
+ object-position: center;
42
+ height: 100%;
43
+ width: 100%;
44
+ }
45
+ :host([shadow]) ::slotted(img) {
46
+ box-shadow: ${shadow4};
47
+ }
48
+ :host([shape='circular']) ::slotted(img) {
49
+ border-radius: ${borderRadiusCircular};
50
+ }
51
+ `;
52
+ //# sourceMappingURL=image.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.styles.js","sourceRoot":"","sources":["../../../src/image/image.styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEhH;;;GAGG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;cAYX,eAAe,UAAU,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA2BxC,OAAO;;;qBAGJ,oBAAoB;;CAExC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { html } from '@microsoft/fast-element';
2
+ /**
3
+ * Template for the Image component
4
+ * @public
5
+ */
6
+ export const template = html `<slot></slot>`;
7
+ //# sourceMappingURL=image.template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image.template.js","sourceRoot":"","sources":["../../../src/image/image.template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAGpE;;;GAGG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA+B,IAAI,CAAO,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './image.js';
2
+ export * from './image.options.js';
3
+ export { definition as ImageDefinition } from './image.definition.js';
4
+ export { template as ImageTemplate } from './image.template.js';
5
+ export { styles as ImageStyles } from './image.styles.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/image/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,QAAQ,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,7 +1,10 @@
1
1
  export * from './accordion/index.js';
2
2
  export * from './accordion-item/index.js';
3
+ export * from './avatar/index.js';
3
4
  export * from './badge/index.js';
4
5
  export * from './counter-badge/index.js';
6
+ export * from './divider/index.js';
7
+ export * from './image/index.js';
5
8
  export * from './progress-bar/index.js';
6
9
  export * from './spinner/index.js';
7
10
  export * from './switch/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,83 @@
1
+ /* TODO: This file is a direct copy of the React Avatar utils */
2
+ /**
3
+ * Regular expressions matching characters to ignore when calculating the initials.
4
+ */
5
+ /**
6
+ * Regular expression matching characters within various types of enclosures, including the enclosures themselves
7
+ * so for example, (xyz) [xyz] {xyz} all would be ignored
8
+ */
9
+ const UNWANTED_ENCLOSURES_REGEX = /[\(\[\{][^\)\]\}]*[\)\]\}]/g;
10
+ /**
11
+ * Regular expression matching special ASCII characters except space, plus some unicode special characters.
12
+ * Applies after unwanted enclosures have been removed
13
+ */
14
+ // eslint-disable-next-line no-control-regex
15
+ const UNWANTED_CHARS_REGEX = /[\0-\u001F\!-/:-@\[-`\{-\u00BF\u0250-\u036F\uD800-\uFFFF]/g;
16
+ /**
17
+ * Regular expression matching phone numbers. Applied after chars matching UNWANTED_CHARS_REGEX have been removed
18
+ * and number has been trimmed for whitespaces
19
+ */
20
+ const PHONENUMBER_REGEX = /^\d+[\d\s]*(:?ext|x|)\s*\d+$/i;
21
+ /** Regular expression matching one or more spaces. */
22
+ const MULTIPLE_WHITESPACES_REGEX = /\s+/g;
23
+ /**
24
+ * Regular expression matching languages for which we currently don't support initials.
25
+ * Arabic: Arabic, Arabic Supplement, Arabic Extended-A.
26
+ * Korean: Hangul Jamo, Hangul Compatibility Jamo, Hangul Jamo Extended-A, Hangul Syllables, Hangul Jamo Extended-B.
27
+ * Japanese: Hiragana, Katakana.
28
+ * CJK: CJK Unified Ideographs Extension A, CJK Unified Ideographs, CJK Compatibility Ideographs,
29
+ * CJK Unified Ideographs Extension B
30
+ */
31
+ // eslint-disable-next-line
32
+ const UNSUPPORTED_TEXT_REGEX = /[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\u1100-\u11FF\u3130-\u318F\uA960-\uA97F\uAC00-\uD7AF\uD7B0-\uD7FF\u3040-\u309F\u30A0-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF]|[\uD840-\uD869][\uDC00-\uDED6]/;
33
+ function getInitialsLatin(displayName, isRtl, firstInitialOnly) {
34
+ let initials = '';
35
+ const splits = displayName.split(' ');
36
+ if (splits.length !== 0) {
37
+ initials += splits[0].charAt(0).toUpperCase();
38
+ }
39
+ if (!firstInitialOnly) {
40
+ if (splits.length === 2) {
41
+ initials += splits[1].charAt(0).toUpperCase();
42
+ }
43
+ else if (splits.length === 3) {
44
+ initials += splits[2].charAt(0).toUpperCase();
45
+ }
46
+ }
47
+ if (isRtl && initials.length > 1) {
48
+ return initials.charAt(1) + initials.charAt(0);
49
+ }
50
+ return initials;
51
+ }
52
+ function cleanupDisplayName(displayName) {
53
+ displayName = displayName.replace(UNWANTED_ENCLOSURES_REGEX, '');
54
+ displayName = displayName.replace(UNWANTED_CHARS_REGEX, '');
55
+ displayName = displayName.replace(MULTIPLE_WHITESPACES_REGEX, ' ');
56
+ displayName = displayName.trim();
57
+ return displayName;
58
+ }
59
+ /**
60
+ * Get (up to 2 characters) initials based on display name of the persona.
61
+ *
62
+ * @param displayName - The full name of the person or entity
63
+ * @param isRtl - Whether the display is in RTL
64
+ * @param options - Extra options to control the behavior of getInitials
65
+ *
66
+ * @returns The 1 or 2 character initials based on the name. Or an empty string if no initials
67
+ * could be derived from the name.
68
+ *
69
+ * @internal
70
+ */
71
+ export function getInitials(displayName, isRtl, options) {
72
+ if (!displayName) {
73
+ return '';
74
+ }
75
+ displayName = cleanupDisplayName(displayName);
76
+ // For names containing CJK characters, and phone numbers, we don't display initials
77
+ if (UNSUPPORTED_TEXT_REGEX.test(displayName) ||
78
+ (!(options === null || options === void 0 ? void 0 : options.allowPhoneInitials) && PHONENUMBER_REGEX.test(displayName))) {
79
+ return '';
80
+ }
81
+ return getInitialsLatin(displayName, isRtl, options === null || options === void 0 ? void 0 : options.firstInitialOnly);
82
+ }
83
+ //# sourceMappingURL=get-initials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-initials.js","sourceRoot":"","sources":["../../../src/utils/get-initials.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAEhE;;GAEG;AAEH;;;GAGG;AACH,MAAM,yBAAyB,GAAW,6BAA6B,CAAC;AAExE;;;GAGG;AACH,4CAA4C;AAC5C,MAAM,oBAAoB,GAAW,4DAA4D,CAAC;AAElG;;;GAGG;AACH,MAAM,iBAAiB,GAAW,+BAA+B,CAAC;AAElE,sDAAsD;AACtD,MAAM,0BAA0B,GAAW,MAAM,CAAC;AAElD;;;;;;;GAOG;AACH,2BAA2B;AAC3B,MAAM,sBAAsB,GAAW,4MAA4M,CAAC;AAEpP,SAAS,gBAAgB,CAAC,WAAmB,EAAE,KAAc,EAAE,gBAA0B;IACvF,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,MAAM,MAAM,GAAa,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;QACvB,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;KAC/C;IAED,IAAI,CAAC,gBAAgB,EAAE;QACrB,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACvB,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C;aAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,QAAQ,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C;KACF;IAED,IAAI,KAAK,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QAChC,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;KAChD;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,kBAAkB,CAAC,WAAmB;IAC7C,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;IACjE,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IAC5D,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,0BAA0B,EAAE,GAAG,CAAC,CAAC;IACnE,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAEjC,OAAO,WAAW,CAAC;AACrB,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CACzB,WAAsC,EACtC,KAAc,EACd,OAMC;IAED,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,EAAE,CAAC;KACX;IAED,WAAW,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAE9C,oFAAoF;IACpF,IACE,sBAAsB,CAAC,IAAI,CAAC,WAAW,CAAC;QACxC,CAAC,CAAC,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,kBAAkB,CAAA,IAAI,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EACrE;QACA,OAAO,EAAE,CAAC;KACX;IAED,OAAO,gBAAgB,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,CAAC,CAAC;AACzE,CAAC"}