@fluentui/web-components 3.0.0-beta.45 → 3.0.0-beta.47

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.
@@ -5151,7 +5151,7 @@ var __decorateClass$o = (decorators, target, key, kind) => {
5151
5151
  if (kind && result) __defProp$o(target, key, result);
5152
5152
  return result;
5153
5153
  };
5154
- class Button extends FASTElement {
5154
+ class BaseButton extends FASTElement {
5155
5155
  constructor() {
5156
5156
  super();
5157
5157
  this.disabledFocusable = false;
@@ -5162,22 +5162,8 @@ class Button extends FASTElement {
5162
5162
  * @internal
5163
5163
  */
5164
5164
  this.elementInternals = this.attachInternals();
5165
- this.iconOnly = false;
5166
5165
  this.elementInternals.role = "button";
5167
5166
  }
5168
- /**
5169
- * Handles changes to appearance attribute custom states
5170
- * @param prev - the previous state
5171
- * @param next - the next state
5172
- */
5173
- appearanceChanged(prev, next) {
5174
- if (prev) {
5175
- toggleState(this.elementInternals, `${prev}`, false);
5176
- }
5177
- if (next) {
5178
- toggleState(this.elementInternals, `${next}`, true);
5179
- }
5180
- }
5181
5167
  /**
5182
5168
  * Sets the element's internal disabled state when the element is focusable while disabled.
5183
5169
  *
@@ -5198,14 +5184,6 @@ class Button extends FASTElement {
5198
5184
  get form() {
5199
5185
  return this.elementInternals.form;
5200
5186
  }
5201
- /**
5202
- * Handles changes to icon only custom states
5203
- * @param prev - the previous state
5204
- * @param next - the next state
5205
- */
5206
- iconOnlyChanged(prev, next) {
5207
- toggleState(this.elementInternals, "icon", next);
5208
- }
5209
5187
  /**
5210
5188
  * A reference to all associated label elements.
5211
5189
  *
@@ -5214,32 +5192,6 @@ class Button extends FASTElement {
5214
5192
  get labels() {
5215
5193
  return Object.freeze(Array.from(this.elementInternals.labels));
5216
5194
  }
5217
- /**
5218
- * Handles changes to shape attribute custom states
5219
- * @param prev - the previous state
5220
- * @param next - the next state
5221
- */
5222
- shapeChanged(prev, next) {
5223
- if (prev) {
5224
- toggleState(this.elementInternals, `${prev}`, false);
5225
- }
5226
- if (next) {
5227
- toggleState(this.elementInternals, `${next}`, true);
5228
- }
5229
- }
5230
- /**
5231
- * Handles changes to size attribute custom states
5232
- * @param prev - the previous state
5233
- * @param next - the next state
5234
- */
5235
- sizeChanged(prev, next) {
5236
- if (prev) {
5237
- toggleState(this.elementInternals, `${prev}`, false);
5238
- }
5239
- if (next) {
5240
- toggleState(this.elementInternals, `${next}`, true);
5241
- }
5242
- }
5243
5195
  /**
5244
5196
  * Removes the form submission fallback control when the type changes.
5245
5197
  *
@@ -5399,52 +5351,105 @@ class Button extends FASTElement {
5399
5351
  *
5400
5352
  * @public
5401
5353
  */
5402
- Button.formAssociated = true;
5403
- __decorateClass$o([attr], Button.prototype, "appearance", 2);
5354
+ BaseButton.formAssociated = true;
5404
5355
  __decorateClass$o([attr({
5405
5356
  mode: "boolean"
5406
- })], Button.prototype, "autofocus", 2);
5407
- __decorateClass$o([observable], Button.prototype, "defaultSlottedContent", 2);
5357
+ })], BaseButton.prototype, "autofocus", 2);
5358
+ __decorateClass$o([observable], BaseButton.prototype, "defaultSlottedContent", 2);
5408
5359
  __decorateClass$o([attr({
5409
5360
  mode: "boolean"
5410
- })], Button.prototype, "disabled", 2);
5361
+ })], BaseButton.prototype, "disabled", 2);
5411
5362
  __decorateClass$o([attr({
5412
5363
  attribute: "disabled-focusable",
5413
5364
  mode: "boolean"
5414
- })], Button.prototype, "disabledFocusable", 2);
5365
+ })], BaseButton.prototype, "disabledFocusable", 2);
5415
5366
  __decorateClass$o([attr({
5416
5367
  attribute: "tabindex",
5417
5368
  mode: "fromView",
5418
5369
  converter: nullableNumberConverter
5419
- })], Button.prototype, "tabIndex", 2);
5370
+ })], BaseButton.prototype, "tabIndex", 2);
5420
5371
  __decorateClass$o([attr({
5421
5372
  attribute: "formaction"
5422
- })], Button.prototype, "formAction", 2);
5373
+ })], BaseButton.prototype, "formAction", 2);
5423
5374
  __decorateClass$o([attr({
5424
5375
  attribute: "form"
5425
- })], Button.prototype, "formAttribute", 2);
5376
+ })], BaseButton.prototype, "formAttribute", 2);
5426
5377
  __decorateClass$o([attr({
5427
5378
  attribute: "formenctype"
5428
- })], Button.prototype, "formEnctype", 2);
5379
+ })], BaseButton.prototype, "formEnctype", 2);
5429
5380
  __decorateClass$o([attr({
5430
5381
  attribute: "formmethod"
5431
- })], Button.prototype, "formMethod", 2);
5382
+ })], BaseButton.prototype, "formMethod", 2);
5432
5383
  __decorateClass$o([attr({
5433
5384
  attribute: "formnovalidate",
5434
5385
  mode: "boolean"
5435
- })], Button.prototype, "formNoValidate", 2);
5386
+ })], BaseButton.prototype, "formNoValidate", 2);
5436
5387
  __decorateClass$o([attr({
5437
5388
  attribute: "formtarget"
5438
- })], Button.prototype, "formTarget", 2);
5389
+ })], BaseButton.prototype, "formTarget", 2);
5390
+ __decorateClass$o([attr], BaseButton.prototype, "name", 2);
5391
+ __decorateClass$o([attr], BaseButton.prototype, "type", 2);
5392
+ __decorateClass$o([attr], BaseButton.prototype, "value", 2);
5393
+ class Button extends BaseButton {
5394
+ constructor() {
5395
+ super(...arguments);
5396
+ this.iconOnly = false;
5397
+ }
5398
+ /**
5399
+ * Handles changes to appearance attribute custom states
5400
+ * @param prev - the previous state
5401
+ * @param next - the next state
5402
+ */
5403
+ appearanceChanged(prev, next) {
5404
+ if (prev) {
5405
+ toggleState(this.elementInternals, `${prev}`, false);
5406
+ }
5407
+ if (next) {
5408
+ toggleState(this.elementInternals, `${next}`, true);
5409
+ }
5410
+ }
5411
+ /**
5412
+ * Handles changes to shape attribute custom states
5413
+ * @param prev - the previous state
5414
+ * @param next - the next state
5415
+ */
5416
+ shapeChanged(prev, next) {
5417
+ if (prev) {
5418
+ toggleState(this.elementInternals, `${prev}`, false);
5419
+ }
5420
+ if (next) {
5421
+ toggleState(this.elementInternals, `${next}`, true);
5422
+ }
5423
+ }
5424
+ /**
5425
+ * Handles changes to size attribute custom states
5426
+ * @param prev - the previous state
5427
+ * @param next - the next state
5428
+ */
5429
+ sizeChanged(prev, next) {
5430
+ if (prev) {
5431
+ toggleState(this.elementInternals, `${prev}`, false);
5432
+ }
5433
+ if (next) {
5434
+ toggleState(this.elementInternals, `${next}`, true);
5435
+ }
5436
+ }
5437
+ /**
5438
+ * Handles changes to icon only custom states
5439
+ * @param prev - the previous state
5440
+ * @param next - the next state
5441
+ */
5442
+ iconOnlyChanged(prev, next) {
5443
+ toggleState(this.elementInternals, "icon", next);
5444
+ }
5445
+ }
5446
+ __decorateClass$o([attr], Button.prototype, "appearance", 2);
5447
+ __decorateClass$o([attr], Button.prototype, "shape", 2);
5448
+ __decorateClass$o([attr], Button.prototype, "size", 2);
5439
5449
  __decorateClass$o([attr({
5440
5450
  attribute: "icon-only",
5441
5451
  mode: "boolean"
5442
5452
  })], Button.prototype, "iconOnly", 2);
5443
- __decorateClass$o([attr], Button.prototype, "name", 2);
5444
- __decorateClass$o([attr], Button.prototype, "shape", 2);
5445
- __decorateClass$o([attr], Button.prototype, "size", 2);
5446
- __decorateClass$o([attr], Button.prototype, "type", 2);
5447
- __decorateClass$o([attr], Button.prototype, "value", 2);
5448
5453
  applyMixins(Button, StartEnd);
5449
5454
 
5450
5455
  function buttonTemplate$1(options = {}) {
@@ -6273,7 +6278,7 @@ var __decorateClass$j = (decorators, target, key, kind) => {
6273
6278
  if (kind && result) __defProp$j(target, key, result);
6274
6279
  return result;
6275
6280
  };
6276
- class Divider extends FASTElement {
6281
+ class BaseDivider extends FASTElement {
6277
6282
  constructor() {
6278
6283
  super(...arguments);
6279
6284
  /**
@@ -6282,41 +6287,6 @@ class Divider extends FASTElement {
6282
6287
  * @internal
6283
6288
  */
6284
6289
  this.elementInternals = this.attachInternals();
6285
- this.inset = false;
6286
- }
6287
- /**
6288
- * Handles changes to align-content attribute custom states
6289
- * @param prev - the previous state
6290
- * @param next - the next state
6291
- */
6292
- alignContentChanged(prev, next) {
6293
- if (prev) {
6294
- toggleState(this.elementInternals, `align-${prev}`, false);
6295
- }
6296
- if (next) {
6297
- toggleState(this.elementInternals, `align-${next}`, true);
6298
- }
6299
- }
6300
- /**
6301
- * Handles changes to appearance attribute custom states
6302
- * @param prev - the previous state
6303
- * @param next - the next state
6304
- */
6305
- appearanceChanged(prev, next) {
6306
- if (prev) {
6307
- toggleState(this.elementInternals, `${prev}`, false);
6308
- }
6309
- if (next) {
6310
- toggleState(this.elementInternals, `${next}`, true);
6311
- }
6312
- }
6313
- /**
6314
- * Handles changes to inset custom states
6315
- * @param prev - the previous state
6316
- * @param next - the next state
6317
- */
6318
- insetChanged(prev, next) {
6319
- toggleState(this.elementInternals, "inset", next);
6320
6290
  }
6321
6291
  connectedCallback() {
6322
6292
  super.connectedCallback();
@@ -6357,8 +6327,48 @@ class Divider extends FASTElement {
6357
6327
  }
6358
6328
  }
6359
6329
  }
6360
- __decorateClass$j([attr], Divider.prototype, "role", 2);
6361
- __decorateClass$j([attr], Divider.prototype, "orientation", 2);
6330
+ __decorateClass$j([attr], BaseDivider.prototype, "role", 2);
6331
+ __decorateClass$j([attr], BaseDivider.prototype, "orientation", 2);
6332
+ class Divider extends BaseDivider {
6333
+ constructor() {
6334
+ super(...arguments);
6335
+ this.inset = false;
6336
+ }
6337
+ /**
6338
+ * Handles changes to align-content attribute custom states
6339
+ * @param prev - the previous state
6340
+ * @param next - the next state
6341
+ */
6342
+ alignContentChanged(prev, next) {
6343
+ if (prev) {
6344
+ toggleState(this.elementInternals, `align-${prev}`, false);
6345
+ }
6346
+ if (next) {
6347
+ toggleState(this.elementInternals, `align-${next}`, true);
6348
+ }
6349
+ }
6350
+ /**
6351
+ * Handles changes to appearance attribute custom states
6352
+ * @param prev - the previous state
6353
+ * @param next - the next state
6354
+ */
6355
+ appearanceChanged(prev, next) {
6356
+ if (prev) {
6357
+ toggleState(this.elementInternals, `${prev}`, false);
6358
+ }
6359
+ if (next) {
6360
+ toggleState(this.elementInternals, `${next}`, true);
6361
+ }
6362
+ }
6363
+ /**
6364
+ * Handles changes to inset custom states
6365
+ * @param prev - the previous state
6366
+ * @param next - the next state
6367
+ */
6368
+ insetChanged(prev, next) {
6369
+ toggleState(this.elementInternals, "inset", next);
6370
+ }
6371
+ }
6362
6372
  __decorateClass$j([attr({
6363
6373
  attribute: "align-content"
6364
6374
  })], Divider.prototype, "alignContent", 2);
@@ -9403,11 +9413,12 @@ __decorateClass$5([attr], Spinner.prototype, "size", 2);
9403
9413
  __decorateClass$5([attr], Spinner.prototype, "appearance", 2);
9404
9414
 
9405
9415
  const styles$7 = css`
9406
- ${display("flex")}
9416
+ ${display("inline-flex")}
9407
9417
 
9408
- :host{display:flex;align-items:center;height:32px;width:32px;contain:content}:host(${tinyState}){height:20px;width:20px}:host(${extraSmallState}){height:24px;width:24px}:host(${smallState}){height:28px;width:28px}:host(${largeState}){height:36px;width:36px}:host(${extraLargeState}){height:40px;width:40px}:host(${hugeState}){height:44px;width:44px}.progress{height:100%;width:100%}.background{fill:none;stroke:${colorBrandStroke2};stroke-width:1.5px}:host(${invertedState}) .background{stroke:rgba(255,255,255,0.2)}.indicator{stroke:${colorBrandStroke1};fill:none;stroke-width:1.5px;stroke-linecap:round;transform-origin:50% 50%;transform:rotate(-90deg);transition:all 0.2s ease-in-out;animation:spin-infinite 3s cubic-bezier(0.53,0.21,0.29,0.67) infinite}:host(${invertedState}) .indicator{stroke:${colorNeutralStrokeOnBrand2}}@keyframes spin-infinite{0%{stroke-dasharray:0.01px 43.97px;transform:rotate(0deg)}50%{stroke-dasharray:21.99px 21.99px;transform:rotate(450deg)}100%{stroke-dasharray:0.01px 43.97px;transform:rotate(1080deg)}}`;
9418
+ :host{--duration:1.5s;--indicatorSize:${strokeWidthThicker};--size:32px;height:var(--size);width:var(--size);contain:strict;content-visibility:auto}:host(${tinyState}){--indicatorSize:${strokeWidthThick};--size:20px}:host(${extraSmallState}){--indicatorSize:${strokeWidthThick};--size:24px}:host(${smallState}){--indicatorSize:${strokeWidthThick};--size:28px}:host(${largeState}){--indicatorSize:${strokeWidthThicker};--size:36px}:host(${extraLargeState}){--indicatorSize:${strokeWidthThicker};--size:40px}:host(${hugeState}){--indicatorSize:${strokeWidthThickest};--size:44px}.progress,.background,.spinner,.start,.end,.indicator{position:absolute;inset:0}.progress,.spinner,.indicator{animation:none var(--duration) infinite ${curveEasyEase}}.progress{animation-timing-function:linear;animation-name:spin-linear}.background{border:var(--indicatorSize) solid ${colorBrandStroke2};border-radius:50%}:host(${invertedState}) .background{border-color:rgba(255,255,255,0.2)}.spinner{animation-name:spin-swing}.start{overflow:hidden;inset-inline-end:50%}.end{overflow:hidden;inset-inline-start:50%}.indicator{color:${colorBrandStroke1};box-sizing:border-box;border-radius:50%;border:var(--indicatorSize) solid transparent;border-block-start-color:currentcolor;border-inline-end-color:currentcolor}:host(${invertedState}) .indicator{color:${colorNeutralStrokeOnBrand2}}.start .indicator{rotate:135deg;inset:0 -100% 0 0;animation-name:spin-start}.end .indicator{rotate:135deg;inset:0 0 0 -100%;animation-name:spin-end}@keyframes spin-linear{100%{transform:rotate(360deg)}}@keyframes spin-swing{0%{transform:rotate(-135deg)}50%{transform:rotate(0deg)}100%{transform:rotate(225deg)}}@keyframes spin-start{0%,100%{transform:rotate(0deg)}50%{transform:rotate(-80deg)}}@keyframes spin-end{0%,100%{transform:rotate(0deg)}50%{transform:rotate(70deg)}}`.withBehaviors(forcedColorsStylesheetBehavior(css`
9419
+ .background{display:none}.indicator{border-color:Canvas;border-block-start-color:Highlight;border-inline-end-color:Highlight}`));
9409
9420
 
9410
- const template$7 = html`<slot name="indicator"><svg class="progress" part="progress" viewBox="0 0 16 16"><circle class="background" cx="8px" cy="8px" r="7px"></circle><circle class="indicator" cx="8px" cy="8px" r="7px"></circle></svg></slot>`;
9421
+ const template$7 = html`<slot name="indicator"><div class="background"></div><div class="progress"><div class="spinner"><div class="start"><div class="indicator"></div></div><div class="end"><div class="indicator"></div></div></div></div></slot>`;
9411
9422
 
9412
9423
  const definition$7 = Spinner.compose({
9413
9424
  name: `${FluentDesignSystem.prefix}-spinner`,