@fluentui/web-components 3.0.0-beta.70 → 3.0.0-beta.72
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.
- package/CHANGELOG.md +20 -2
- package/dist/dts/accordion/accordion.template.d.ts +1 -1
- package/dist/dts/accordion-item/accordion-item.d.ts +2 -2
- package/dist/dts/accordion-item/accordion-item.template.d.ts +1 -1
- package/dist/dts/anchor-button/anchor-button.d.ts +2 -2
- package/dist/dts/anchor-button/anchor-button.options.d.ts +1 -1
- package/dist/dts/anchor-button/anchor-button.template.d.ts +1 -1
- package/dist/dts/avatar/avatar.d.ts +2 -2
- package/dist/dts/avatar/avatar.template.d.ts +1 -1
- package/dist/dts/badge/badge.options.d.ts +1 -1
- package/dist/dts/badge/badge.template.d.ts +1 -1
- package/dist/dts/button/button.d.ts +1 -2
- package/dist/dts/button/button.options.d.ts +1 -1
- package/dist/dts/button/button.template.d.ts +2 -2
- package/dist/dts/compound-button/compound-button.options.d.ts +1 -1
- package/dist/dts/compound-button/compound-button.template.d.ts +1 -1
- package/dist/dts/counter-badge/counter-badge.options.d.ts +1 -1
- package/dist/dts/counter-badge/counter-badge.template.d.ts +2 -2
- package/dist/dts/dialog/dialog.template.d.ts +1 -1
- package/dist/dts/dialog-body/dialog-body.template.d.ts +1 -1
- package/dist/dts/divider/divider.d.ts +1 -1
- package/dist/dts/divider/divider.template.d.ts +1 -1
- package/dist/dts/drawer/drawer.template.d.ts +1 -1
- package/dist/dts/drawer-body/drawer-body.template.d.ts +1 -1
- package/dist/dts/field/field.d.ts +1 -1
- package/dist/dts/field/field.template.d.ts +1 -1
- package/dist/dts/image/image.template.d.ts +1 -1
- package/dist/dts/label/label.template.d.ts +2 -2
- package/dist/dts/link/link.d.ts +1 -1
- package/dist/dts/link/link.template.d.ts +1 -1
- package/dist/dts/menu/menu.d.ts +1 -1
- package/dist/dts/menu/menu.template.d.ts +1 -1
- package/dist/dts/menu-button/menu-button.template.d.ts +1 -1
- package/dist/dts/menu-item/menu-item.d.ts +1 -1
- package/dist/dts/menu-item/menu-item.styles.d.ts +0 -5
- package/dist/dts/menu-list/menu-list.template.d.ts +1 -1
- package/dist/dts/message-bar/message-bar.template.d.ts +1 -1
- package/dist/dts/patterns/start-end.d.ts +1 -1
- package/dist/dts/radio/radio.template.d.ts +1 -1
- package/dist/dts/radio-group/radio-group.template.d.ts +1 -1
- package/dist/dts/rating-display/rating-display.template.d.ts +1 -1
- package/dist/dts/slider/slider.d.ts +3 -3
- package/dist/dts/spinner/spinner.d.ts +1 -1
- package/dist/dts/spinner/spinner.template.d.ts +1 -1
- package/dist/dts/styles/states/index.d.ts +439 -95
- package/dist/dts/switch/switch.template.d.ts +2 -2
- package/dist/dts/tab/tab.d.ts +2 -1
- package/dist/dts/tab/tab.template.d.ts +1 -1
- package/dist/dts/tab-panel/tab-panel.template.d.ts +2 -2
- package/dist/dts/tablist/tablist.template.d.ts +1 -1
- package/dist/dts/tabs/tabs.d.ts +1 -1
- package/dist/dts/tabs/tabs.options.d.ts +2 -2
- package/dist/dts/tabs/tabs.template.d.ts +3 -3
- package/dist/dts/text/text.d.ts +1 -1
- package/dist/dts/text/text.template.d.ts +1 -1
- package/dist/dts/text-input/text-input.d.ts +1 -2
- package/dist/dts/textarea/textarea.template.d.ts +1 -1
- package/dist/dts/toggle-button/toggle-button.template.d.ts +1 -1
- package/dist/dts/utils/element-internals.d.ts +38 -1
- package/dist/dts/utils/template-helpers.d.ts +1 -2
- package/dist/esm/accordion/accordion.template.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.js +4 -13
- package/dist/esm/accordion-item/accordion-item.js.map +1 -1
- package/dist/esm/accordion-item/accordion-item.template.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.js +5 -20
- package/dist/esm/anchor-button/anchor-button.js.map +1 -1
- package/dist/esm/anchor-button/anchor-button.template.js.map +1 -1
- package/dist/esm/avatar/avatar.js +2 -3
- package/dist/esm/avatar/avatar.js.map +1 -1
- package/dist/esm/avatar/avatar.styles.js +32 -31
- package/dist/esm/avatar/avatar.styles.js.map +1 -1
- package/dist/esm/avatar/avatar.template.js.map +1 -1
- package/dist/esm/badge/badge.js +6 -27
- package/dist/esm/badge/badge.js.map +1 -1
- package/dist/esm/badge/badge.template.js.map +1 -1
- package/dist/esm/button/button.js +5 -20
- package/dist/esm/button/button.js.map +1 -1
- package/dist/esm/button/button.template.js.map +1 -1
- package/dist/esm/checkbox/checkbox.js +4 -13
- package/dist/esm/checkbox/checkbox.js.map +1 -1
- package/dist/esm/checkbox/checkbox.styles.js +1 -6
- package/dist/esm/checkbox/checkbox.styles.js.map +1 -1
- package/dist/esm/compound-button/compound-button.template.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.js +6 -26
- package/dist/esm/counter-badge/counter-badge.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.styles.js +1 -6
- package/dist/esm/counter-badge/counter-badge.styles.js.map +1 -1
- package/dist/esm/counter-badge/counter-badge.template.js.map +1 -1
- package/dist/esm/dialog/dialog.template.js.map +1 -1
- package/dist/esm/dialog-body/dialog-body.template.js.map +1 -1
- package/dist/esm/divider/divider.js +6 -21
- package/dist/esm/divider/divider.js.map +1 -1
- package/dist/esm/divider/divider.template.js.map +1 -1
- package/dist/esm/drawer/drawer.template.js.map +1 -1
- package/dist/esm/drawer-body/drawer-body.template.js.map +1 -1
- package/dist/esm/field/field.js.map +1 -1
- package/dist/esm/field/field.styles.js +1 -66
- package/dist/esm/field/field.styles.js.map +1 -1
- package/dist/esm/field/field.template.js.map +1 -1
- package/dist/esm/image/image.js +4 -13
- package/dist/esm/image/image.js.map +1 -1
- package/dist/esm/image/image.styles.js +8 -8
- package/dist/esm/image/image.styles.js.map +1 -1
- package/dist/esm/image/image.template.js.map +1 -1
- package/dist/esm/label/label.js +4 -13
- package/dist/esm/label/label.js.map +1 -1
- package/dist/esm/label/label.styles.js +4 -5
- package/dist/esm/label/label.styles.js.map +1 -1
- package/dist/esm/label/label.template.js.map +1 -1
- package/dist/esm/link/link.js +3 -7
- package/dist/esm/link/link.js.map +1 -1
- package/dist/esm/link/link.styles.js +3 -3
- package/dist/esm/link/link.styles.js.map +1 -1
- package/dist/esm/link/link.template.js.map +1 -1
- package/dist/esm/menu/menu.template.js.map +1 -1
- package/dist/esm/menu-button/menu-button.template.js.map +1 -1
- package/dist/esm/menu-item/menu-item.js.map +1 -1
- package/dist/esm/menu-item/menu-item.styles.js +1 -6
- package/dist/esm/menu-item/menu-item.styles.js.map +1 -1
- package/dist/esm/menu-list/menu-list.template.js.map +1 -1
- package/dist/esm/message-bar/message-bar.js +5 -19
- package/dist/esm/message-bar/message-bar.js.map +1 -1
- package/dist/esm/message-bar/message-bar.template.js.map +1 -1
- package/dist/esm/patterns/start-end.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.js +5 -19
- package/dist/esm/progress-bar/progress-bar.js.map +1 -1
- package/dist/esm/progress-bar/progress-bar.options.js.map +1 -1
- package/dist/esm/radio/radio.template.js.map +1 -1
- package/dist/esm/radio-group/radio-group.template.js.map +1 -1
- package/dist/esm/rating-display/rating-display.js +4 -9
- package/dist/esm/rating-display/rating-display.js.map +1 -1
- package/dist/esm/rating-display/rating-display.template.js.map +1 -1
- package/dist/esm/slider/slider.js +4 -14
- package/dist/esm/slider/slider.js.map +1 -1
- package/dist/esm/spinner/spinner.js +4 -13
- package/dist/esm/spinner/spinner.js.map +1 -1
- package/dist/esm/styles/states/index.js +437 -97
- package/dist/esm/styles/states/index.js.map +1 -1
- package/dist/esm/switch/switch.template.js.map +1 -1
- package/dist/esm/tab/tab.js +1 -1
- package/dist/esm/tab/tab.js.map +1 -1
- package/dist/esm/tab/tab.template.js.map +1 -1
- package/dist/esm/tab-panel/tab-panel.template.js.map +1 -1
- package/dist/esm/tablist/tablist.js +6 -22
- package/dist/esm/tablist/tablist.js.map +1 -1
- package/dist/esm/tabs/tabs.js.map +1 -1
- package/dist/esm/tabs/tabs.template.js.map +1 -1
- package/dist/esm/text/text.js +6 -25
- package/dist/esm/text/text.js.map +1 -1
- package/dist/esm/text/text.styles.js +20 -39
- package/dist/esm/text/text.styles.js.map +1 -1
- package/dist/esm/text/text.template.js.map +1 -1
- package/dist/esm/text-input/text-input.js +4 -14
- package/dist/esm/text-input/text-input.js.map +1 -1
- package/dist/esm/textarea/textarea.js +9 -21
- package/dist/esm/textarea/textarea.js.map +1 -1
- package/dist/esm/textarea/textarea.template.js.map +1 -1
- package/dist/esm/utils/element-internals.js +65 -0
- package/dist/esm/utils/element-internals.js.map +1 -1
- package/dist/esm/utils/template-helpers.js +1 -1
- package/dist/esm/utils/template-helpers.js.map +1 -1
- package/dist/web-components.d.ts +7 -7
- package/dist/web-components.js +431 -374
- package/dist/web-components.min.js +316 -316
- package/package.json +1 -1
package/dist/web-components.js
CHANGED
|
@@ -4338,7 +4338,14 @@ function applyMixins(derivedCtor, ...baseCtors) {
|
|
|
4338
4338
|
}
|
|
4339
4339
|
|
|
4340
4340
|
const CustomStatesSetSupported = CSS.supports("selector(:state(g))");
|
|
4341
|
+
const statesMap = /* @__PURE__ */new Map();
|
|
4342
|
+
function stateSelector(state) {
|
|
4343
|
+
return statesMap.get(state) ?? statesMap.set(state, CustomStatesSetSupported ? `:state(${state})` : `[state--${state}]`).get(state);
|
|
4344
|
+
}
|
|
4341
4345
|
function toggleState(elementInternals, state, force) {
|
|
4346
|
+
if (!state) {
|
|
4347
|
+
return;
|
|
4348
|
+
}
|
|
4342
4349
|
if (!CustomStatesSetSupported) {
|
|
4343
4350
|
elementInternals.shadowRoot.host.toggleAttribute(`state--${state}`, force);
|
|
4344
4351
|
return;
|
|
@@ -4349,6 +4356,35 @@ function toggleState(elementInternals, state, force) {
|
|
|
4349
4356
|
}
|
|
4350
4357
|
elementInternals.states.delete(state);
|
|
4351
4358
|
}
|
|
4359
|
+
const matchingStateMap = /* @__PURE__ */new WeakMap();
|
|
4360
|
+
function hasMatchingState(States, state) {
|
|
4361
|
+
if (!States || !state) {
|
|
4362
|
+
return false;
|
|
4363
|
+
}
|
|
4364
|
+
if (matchingStateMap.has(States)) {
|
|
4365
|
+
return matchingStateMap.get(States).has(state);
|
|
4366
|
+
}
|
|
4367
|
+
const stateSet = new Set(Object.values(States));
|
|
4368
|
+
matchingStateMap.set(States, stateSet);
|
|
4369
|
+
return stateSet.has(state);
|
|
4370
|
+
}
|
|
4371
|
+
function swapStates(elementInternals, prev = "", next = "", States, prefix = "") {
|
|
4372
|
+
toggleState(elementInternals, `${prefix}${prev}`, false);
|
|
4373
|
+
if (!States || hasMatchingState(States, next)) {
|
|
4374
|
+
toggleState(elementInternals, `${prefix}${next}`, true);
|
|
4375
|
+
}
|
|
4376
|
+
}
|
|
4377
|
+
|
|
4378
|
+
const AccordionItemSize = {
|
|
4379
|
+
small: "small",
|
|
4380
|
+
medium: "medium",
|
|
4381
|
+
large: "large",
|
|
4382
|
+
extraLarge: "extra-large"
|
|
4383
|
+
};
|
|
4384
|
+
const AccordionItemMarkerPosition = {
|
|
4385
|
+
start: "start",
|
|
4386
|
+
end: "end"
|
|
4387
|
+
};
|
|
4352
4388
|
|
|
4353
4389
|
var __defProp$v = Object.defineProperty;
|
|
4354
4390
|
var __getOwnPropDesc$v = Object.getOwnPropertyDescriptor;
|
|
@@ -4412,12 +4448,7 @@ class AccordionItem extends BaseAccordionItem {
|
|
|
4412
4448
|
* @param next - next value
|
|
4413
4449
|
*/
|
|
4414
4450
|
sizeChanged(prev, next) {
|
|
4415
|
-
|
|
4416
|
-
toggleState(this.elementInternals, prev, false);
|
|
4417
|
-
}
|
|
4418
|
-
if (next) {
|
|
4419
|
-
toggleState(this.elementInternals, next, true);
|
|
4420
|
-
}
|
|
4451
|
+
swapStates(this.elementInternals, prev, next, AccordionItemSize);
|
|
4421
4452
|
}
|
|
4422
4453
|
/**
|
|
4423
4454
|
* Handles changes to marker-position attribute
|
|
@@ -4425,12 +4456,7 @@ class AccordionItem extends BaseAccordionItem {
|
|
|
4425
4456
|
* @param next - next value
|
|
4426
4457
|
*/
|
|
4427
4458
|
markerPositionChanged(prev, next) {
|
|
4428
|
-
|
|
4429
|
-
toggleState(this.elementInternals, `align-${prev}`, false);
|
|
4430
|
-
}
|
|
4431
|
-
if (next) {
|
|
4432
|
-
toggleState(this.elementInternals, `align-${next}`, true);
|
|
4433
|
-
}
|
|
4459
|
+
swapStates(this.elementInternals, prev, next, AccordionItemMarkerPosition, "align-");
|
|
4434
4460
|
}
|
|
4435
4461
|
/**
|
|
4436
4462
|
* Handles changes to block attribute
|
|
@@ -4450,58 +4476,126 @@ __decorateClass$v([attr({
|
|
|
4450
4476
|
})], AccordionItem.prototype, "block", 2);
|
|
4451
4477
|
applyMixins(AccordionItem, StartEnd);
|
|
4452
4478
|
|
|
4453
|
-
const
|
|
4454
|
-
const
|
|
4455
|
-
const
|
|
4456
|
-
const
|
|
4457
|
-
const
|
|
4458
|
-
const
|
|
4459
|
-
const
|
|
4460
|
-
const
|
|
4461
|
-
const
|
|
4462
|
-
const
|
|
4463
|
-
const
|
|
4464
|
-
const
|
|
4465
|
-
const
|
|
4466
|
-
const
|
|
4467
|
-
const
|
|
4468
|
-
const
|
|
4469
|
-
const
|
|
4470
|
-
const
|
|
4471
|
-
const
|
|
4472
|
-
|
|
4473
|
-
const
|
|
4474
|
-
const
|
|
4475
|
-
const
|
|
4476
|
-
const
|
|
4477
|
-
const
|
|
4478
|
-
const
|
|
4479
|
-
const
|
|
4480
|
-
const
|
|
4481
|
-
const
|
|
4482
|
-
const
|
|
4483
|
-
const
|
|
4484
|
-
const
|
|
4485
|
-
const
|
|
4486
|
-
|
|
4487
|
-
const
|
|
4488
|
-
const
|
|
4489
|
-
const
|
|
4490
|
-
const
|
|
4491
|
-
const
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
const
|
|
4495
|
-
const
|
|
4496
|
-
const
|
|
4497
|
-
|
|
4498
|
-
const
|
|
4499
|
-
const
|
|
4500
|
-
const
|
|
4501
|
-
const
|
|
4502
|
-
const
|
|
4503
|
-
const
|
|
4504
|
-
|
|
4479
|
+
const alignEndState = stateSelector("align-end");
|
|
4480
|
+
const alignStartState = stateSelector("align-start");
|
|
4481
|
+
const anchorState = stateSelector("anchor");
|
|
4482
|
+
const autoResizeState = stateSelector("auto-resize");
|
|
4483
|
+
const badInputState = stateSelector("bad-input");
|
|
4484
|
+
const beigeState = stateSelector("beige");
|
|
4485
|
+
const blockState = stateSelector("block");
|
|
4486
|
+
const blueState = stateSelector("blue");
|
|
4487
|
+
const boldState = stateSelector("bold");
|
|
4488
|
+
const borderedState = stateSelector("bordered");
|
|
4489
|
+
const brandState = stateSelector("brand");
|
|
4490
|
+
const brassState = stateSelector("brass");
|
|
4491
|
+
const brownState = stateSelector("brown");
|
|
4492
|
+
const centerState = stateSelector("center");
|
|
4493
|
+
const checkedState = stateSelector("checked");
|
|
4494
|
+
const circularState = stateSelector("circular");
|
|
4495
|
+
const cornflowerState = stateSelector("cornflower");
|
|
4496
|
+
const cranberryState = stateSelector("cranberry");
|
|
4497
|
+
const customErrorState = stateSelector("custom-error");
|
|
4498
|
+
const dangerState = stateSelector("danger");
|
|
4499
|
+
const darkGreenState = stateSelector("dark-green");
|
|
4500
|
+
const darkRedState = stateSelector("dark-red");
|
|
4501
|
+
const disabledState = stateSelector("disabled");
|
|
4502
|
+
const displayShadowState = stateSelector("display-shadow");
|
|
4503
|
+
const dotState = stateSelector("dot");
|
|
4504
|
+
const endState = stateSelector("end");
|
|
4505
|
+
const errorState = stateSelector("error");
|
|
4506
|
+
const expandedState = stateSelector("expanded");
|
|
4507
|
+
const extraLargeState = stateSelector("extra-large");
|
|
4508
|
+
const extraSmallState = stateSelector("extra-small");
|
|
4509
|
+
const filledDarkerState = stateSelector("filled-darker");
|
|
4510
|
+
const filledLighterState = stateSelector("filled-lighter");
|
|
4511
|
+
const fitCenterState = stateSelector("fit-center");
|
|
4512
|
+
const fitContainState = stateSelector("fit-contain");
|
|
4513
|
+
const fitCoverState = stateSelector("fit-cover");
|
|
4514
|
+
const fitNoneState = stateSelector("fit-none");
|
|
4515
|
+
const focusVisibleState = stateSelector("focus-visible");
|
|
4516
|
+
const forestState = stateSelector("forest");
|
|
4517
|
+
const ghostState = stateSelector("ghost");
|
|
4518
|
+
const goldState = stateSelector("gold");
|
|
4519
|
+
const grapeState = stateSelector("grape");
|
|
4520
|
+
const hasMessageState = stateSelector("has-message");
|
|
4521
|
+
const hugeState = stateSelector("huge");
|
|
4522
|
+
const iconOnlyState = stateSelector("icon");
|
|
4523
|
+
const importantState = stateSelector("important");
|
|
4524
|
+
const indeterminateState = stateSelector("indeterminate");
|
|
4525
|
+
const informativeState = stateSelector("informative");
|
|
4526
|
+
const inlineState = stateSelector("inline");
|
|
4527
|
+
const insetState = stateSelector("inset");
|
|
4528
|
+
const invertedState = stateSelector("inverted");
|
|
4529
|
+
const italicState = stateSelector("italic");
|
|
4530
|
+
const justifyState = stateSelector("justify");
|
|
4531
|
+
const largeState = stateSelector("large");
|
|
4532
|
+
const lavenderState = stateSelector("lavender");
|
|
4533
|
+
const lightTealState = stateSelector("light-teal");
|
|
4534
|
+
const lilacState = stateSelector("lilac");
|
|
4535
|
+
const magentaState = stateSelector("magenta");
|
|
4536
|
+
const marigoldState = stateSelector("marigold");
|
|
4537
|
+
const mediumState = stateSelector("medium");
|
|
4538
|
+
const minkState = stateSelector("mink");
|
|
4539
|
+
const monospaceState = stateSelector("monospace");
|
|
4540
|
+
const multiLineState = stateSelector("multiline");
|
|
4541
|
+
const navyState = stateSelector("navy");
|
|
4542
|
+
const neutralState = stateSelector("neutral");
|
|
4543
|
+
const nowrapState = stateSelector("nowrap");
|
|
4544
|
+
const numericState = stateSelector("numeric");
|
|
4545
|
+
const outlineState = stateSelector("outline");
|
|
4546
|
+
const patternMismatchState = stateSelector("pattern-mismatch");
|
|
4547
|
+
const peachState = stateSelector("peach");
|
|
4548
|
+
const pinkState = stateSelector("pink");
|
|
4549
|
+
const platinumState = stateSelector("platinum");
|
|
4550
|
+
const plumState = stateSelector("plum");
|
|
4551
|
+
const pressedState = stateSelector("pressed");
|
|
4552
|
+
const primaryState = stateSelector("primary");
|
|
4553
|
+
const pumpkinState = stateSelector("pumpkin");
|
|
4554
|
+
const purpleState = stateSelector("purple");
|
|
4555
|
+
const rangeOverflowState = stateSelector("range-overflow");
|
|
4556
|
+
const rangeUnderflowState = stateSelector("range-underflow");
|
|
4557
|
+
const redState = stateSelector("red");
|
|
4558
|
+
const resizeBothState = stateSelector("resize-both");
|
|
4559
|
+
const resizeHorizontalState = stateSelector("resize-horizontal");
|
|
4560
|
+
const resizeVerticalState = stateSelector("resize-vertical");
|
|
4561
|
+
const roundedState = stateSelector("rounded");
|
|
4562
|
+
const royalBlueState = stateSelector("royal-blue");
|
|
4563
|
+
const seafoamState = stateSelector("seafoam");
|
|
4564
|
+
const semiboldState = stateSelector("semibold");
|
|
4565
|
+
const severeState = stateSelector("severe");
|
|
4566
|
+
const shadowState = stateSelector("shadow");
|
|
4567
|
+
const size1000State = stateSelector("size-1000");
|
|
4568
|
+
const size100State = stateSelector("size-100");
|
|
4569
|
+
const size200State = stateSelector("size-200");
|
|
4570
|
+
const size400State = stateSelector("size-400");
|
|
4571
|
+
const size500State = stateSelector("size-500");
|
|
4572
|
+
const size600State = stateSelector("size-600");
|
|
4573
|
+
const size700State = stateSelector("size-700");
|
|
4574
|
+
const size800State = stateSelector("size-800");
|
|
4575
|
+
const size900State = stateSelector("size-900");
|
|
4576
|
+
const smallState = stateSelector("small");
|
|
4577
|
+
const squareState = stateSelector("square");
|
|
4578
|
+
const steelState = stateSelector("steel");
|
|
4579
|
+
const stepMismatchState = stateSelector("step-mismatch");
|
|
4580
|
+
const strikethroughState = stateSelector("strikethrough");
|
|
4581
|
+
const strongState = stateSelector("strong");
|
|
4582
|
+
const submenuState = stateSelector("submenu");
|
|
4583
|
+
const subtleState = stateSelector("subtle");
|
|
4584
|
+
const successState = stateSelector("success");
|
|
4585
|
+
const tealState = stateSelector("teal");
|
|
4586
|
+
const tintState = stateSelector("tint");
|
|
4587
|
+
const tinyState = stateSelector("tiny");
|
|
4588
|
+
const tooLongState = stateSelector("too-long");
|
|
4589
|
+
const tooShortState = stateSelector("too-short");
|
|
4590
|
+
const transparentState = stateSelector("transparent");
|
|
4591
|
+
const truncateState = stateSelector("truncate");
|
|
4592
|
+
const typeMismatchState = stateSelector("type-mismatch");
|
|
4593
|
+
const underlineState = stateSelector("underline");
|
|
4594
|
+
const userInvalidState = stateSelector("user-invalid");
|
|
4595
|
+
const validState = stateSelector("valid");
|
|
4596
|
+
const valueMissingState = stateSelector("value-missing");
|
|
4597
|
+
const verticalState = stateSelector("vertical");
|
|
4598
|
+
const warningState = stateSelector("warning");
|
|
4505
4599
|
|
|
4506
4600
|
const colorNeutralForeground1 = "var(--colorNeutralForeground1)";
|
|
4507
4601
|
const colorNeutralForeground1Hover = "var(--colorNeutralForeground1Hover)";
|
|
@@ -4965,12 +5059,31 @@ const definition$A = Accordion.compose({
|
|
|
4965
5059
|
|
|
4966
5060
|
definition$A.define(FluentDesignSystem.registry);
|
|
4967
5061
|
|
|
5062
|
+
const ButtonAppearance = {
|
|
5063
|
+
primary: "primary",
|
|
5064
|
+
outline: "outline",
|
|
5065
|
+
subtle: "subtle",
|
|
5066
|
+
transparent: "transparent"
|
|
5067
|
+
};
|
|
5068
|
+
const ButtonShape = {
|
|
5069
|
+
circular: "circular",
|
|
5070
|
+
rounded: "rounded",
|
|
5071
|
+
square: "square"
|
|
5072
|
+
};
|
|
5073
|
+
const ButtonSize = {
|
|
5074
|
+
small: "small",
|
|
5075
|
+
medium: "medium",
|
|
5076
|
+
large: "large"
|
|
5077
|
+
};
|
|
4968
5078
|
const ButtonType = {
|
|
4969
5079
|
submit: "submit",
|
|
4970
5080
|
reset: "reset",
|
|
4971
5081
|
button: "button"
|
|
4972
5082
|
};
|
|
4973
5083
|
|
|
5084
|
+
const AnchorButtonAppearance = ButtonAppearance;
|
|
5085
|
+
const AnchorButtonShape = ButtonShape;
|
|
5086
|
+
const AnchorButtonSize = ButtonSize;
|
|
4974
5087
|
const AnchorAttributes = {
|
|
4975
5088
|
download: "download",
|
|
4976
5089
|
href: "href",
|
|
@@ -5114,12 +5227,7 @@ class AnchorButton extends BaseAnchor {
|
|
|
5114
5227
|
* @param next - the next state
|
|
5115
5228
|
*/
|
|
5116
5229
|
appearanceChanged(prev, next) {
|
|
5117
|
-
|
|
5118
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5119
|
-
}
|
|
5120
|
-
if (next) {
|
|
5121
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5122
|
-
}
|
|
5230
|
+
swapStates(this.elementInternals, prev, next, AnchorButtonAppearance);
|
|
5123
5231
|
}
|
|
5124
5232
|
/**
|
|
5125
5233
|
* Handles changes to shape attribute custom states
|
|
@@ -5127,12 +5235,7 @@ class AnchorButton extends BaseAnchor {
|
|
|
5127
5235
|
* @param next - the next state
|
|
5128
5236
|
*/
|
|
5129
5237
|
shapeChanged(prev, next) {
|
|
5130
|
-
|
|
5131
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5132
|
-
}
|
|
5133
|
-
if (next) {
|
|
5134
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5135
|
-
}
|
|
5238
|
+
swapStates(this.elementInternals, prev, next, AnchorButtonShape);
|
|
5136
5239
|
}
|
|
5137
5240
|
/**
|
|
5138
5241
|
* Handles changes to size attribute custom states
|
|
@@ -5140,12 +5243,7 @@ class AnchorButton extends BaseAnchor {
|
|
|
5140
5243
|
* @param next - the next state
|
|
5141
5244
|
*/
|
|
5142
5245
|
sizeChanged(prev, next) {
|
|
5143
|
-
|
|
5144
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5145
|
-
}
|
|
5146
|
-
if (next) {
|
|
5147
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5148
|
-
}
|
|
5246
|
+
swapStates(this.elementInternals, prev, next, AnchorButtonSize);
|
|
5149
5247
|
}
|
|
5150
5248
|
/**
|
|
5151
5249
|
* Handles changes to icon only custom states
|
|
@@ -5332,9 +5430,8 @@ const _Avatar = class _Avatar extends BaseAvatar {
|
|
|
5332
5430
|
generateColor() {
|
|
5333
5431
|
const colorful = this.color === AvatarColor.colorful;
|
|
5334
5432
|
const prev = this.currentColor;
|
|
5335
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5336
5433
|
this.currentColor = colorful && this.colorId ? this.colorId : colorful ? _Avatar.colors[getHashCode(this.name ?? "") % _Avatar.colors.length] : this.color ?? AvatarColor.neutral;
|
|
5337
|
-
|
|
5434
|
+
swapStates(this.elementInternals, prev, this.currentColor);
|
|
5338
5435
|
}
|
|
5339
5436
|
connectedCallback() {
|
|
5340
5437
|
super.connectedCallback();
|
|
@@ -5382,7 +5479,7 @@ const animations = {
|
|
|
5382
5479
|
nullEasing: curveLinear
|
|
5383
5480
|
};
|
|
5384
5481
|
const styles$w = css`
|
|
5385
|
-
${display("inline-flex")} :host{position:relative;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;font-family:${fontFamilyBase};font-weight:${fontWeightSemibold};font-size:${fontSizeBase300};border-radius:${borderRadiusCircular};color:${colorNeutralForeground3};background-color:${colorNeutralBackground6};contain:layout style}.default-icon,::slotted(svg){width:20px;height:20px;font-size:20px}::slotted(img){box-sizing:border-box;width:100%;height:100%;border-radius:${borderRadiusCircular}}::slotted([slot='badge']){position:absolute;bottom:0;right:0;box-shadow:0 0 0 ${strokeWidthThin}) ${colorNeutralBackground1}}:host([size='64']) ::slotted([slot='badge']),:host([size='72']) ::slotted([slot='badge']),:host([size='96']) ::slotted([slot='badge']),:host([size='120']) ::slotted([slot='badge']),:host([size='128']) ::slotted([slot='badge']){box-shadow:0 0 0 ${strokeWidthThick}) ${colorNeutralBackground1}}:host([size='16']),:host([size='20']),:host([size='24']){font-size:${fontSizeBase100};font-weight:${fontWeightRegular}}:host([size='16']){width:16px;height:16px}:host([size='20']){width:20px;height:20px}:host([size='24']){width:24px;height:24px}:host([size='16']) .default-icon,:host([size='16']) ::slotted(svg){width:12px;height:12px;font-size:12px}:host([size='20']) .default-icon,:host([size='24']) .default-icon,:host([size='20']) ::slotted(svg),:host([size='24']) ::slotted(svg){width:16px;height:16px;font-size:16px}:host([size='28']){width:28px;height:28px;font-size:${fontSizeBase200}}:host([size='36']){width:36px;height:36px}:host([size='40']){width:40px;height:40px}:host([size='48']),:host([size='56']){font-size:${fontSizeBase400}}:host([size='48']){width:48px;height:48px}:host([size='48']) .default-icon,:host([size='48']) ::slotted(svg){width:24px;height:24px;font-size:24px}:host([size='56']){width:56px;height:56px}:host([size='56']) .default-icon,:host([size='56']) ::slotted(svg){width:28px;height:28px;font-size:28px}:host([size='64']),:host([size='72']),:host([size='96']){font-size:${fontSizeBase500}}:host([size='64']) .default-icon,:host([size='72']) .default-icon,:host([size='64']) ::slotted(svg),:host([size='72']) ::slotted(svg){width:32px;height:32px;font-size:32px}:host([size='64']){width:64px;height:64px}:host([size='72']){width:72px;height:72px}:host([size='96']){width:96px;height:96px}:host([size='96']) .default-icon,:host([size='120']) .default-icon,:host([size='128']) .default-icon,:host([size='96']) ::slotted(svg),:host([size='120']) ::slotted(svg),:host([size='128']) ::slotted(svg){width:48px;height:48px;font-size:48px}:host([size='120']),:host([size='128']){font-size:${fontSizeBase600}}:host([size='120']){width:120px;height:120px}:host([size='128']){width:128px;height:128px}:host([shape='square']){border-radius:${borderRadiusMedium}}:host([shape='square'][size='20']),:host([shape='square'][size='24']){border-radius:${borderRadiusSmall}}:host([shape='square'][size='56']),:host([shape='square'][size='64']),:host([shape='square'][size='72']){border-radius:${borderRadiusLarge}}:host([shape='square'][size='96']),:host([shape='square'][size='120']),:host([shape='square'][size='128']){border-radius:${borderRadiusXLarge}}:host(
|
|
5482
|
+
${display("inline-flex")} :host{position:relative;align-items:center;justify-content:center;flex-shrink:0;width:32px;height:32px;font-family:${fontFamilyBase};font-weight:${fontWeightSemibold};font-size:${fontSizeBase300};border-radius:${borderRadiusCircular};color:${colorNeutralForeground3};background-color:${colorNeutralBackground6};contain:layout style}.default-icon,::slotted(svg){width:20px;height:20px;font-size:20px}::slotted(img){box-sizing:border-box;width:100%;height:100%;border-radius:${borderRadiusCircular}}::slotted([slot='badge']){position:absolute;bottom:0;right:0;box-shadow:0 0 0 ${strokeWidthThin}) ${colorNeutralBackground1}}:host([size='64']) ::slotted([slot='badge']),:host([size='72']) ::slotted([slot='badge']),:host([size='96']) ::slotted([slot='badge']),:host([size='120']) ::slotted([slot='badge']),:host([size='128']) ::slotted([slot='badge']){box-shadow:0 0 0 ${strokeWidthThick}) ${colorNeutralBackground1}}:host([size='16']),:host([size='20']),:host([size='24']){font-size:${fontSizeBase100};font-weight:${fontWeightRegular}}:host([size='16']){width:16px;height:16px}:host([size='20']){width:20px;height:20px}:host([size='24']){width:24px;height:24px}:host([size='16']) .default-icon,:host([size='16']) ::slotted(svg){width:12px;height:12px;font-size:12px}:host([size='20']) .default-icon,:host([size='24']) .default-icon,:host([size='20']) ::slotted(svg),:host([size='24']) ::slotted(svg){width:16px;height:16px;font-size:16px}:host([size='28']){width:28px;height:28px;font-size:${fontSizeBase200}}:host([size='36']){width:36px;height:36px}:host([size='40']){width:40px;height:40px}:host([size='48']),:host([size='56']){font-size:${fontSizeBase400}}:host([size='48']){width:48px;height:48px}:host([size='48']) .default-icon,:host([size='48']) ::slotted(svg){width:24px;height:24px;font-size:24px}:host([size='56']){width:56px;height:56px}:host([size='56']) .default-icon,:host([size='56']) ::slotted(svg){width:28px;height:28px;font-size:28px}:host([size='64']),:host([size='72']),:host([size='96']){font-size:${fontSizeBase500}}:host([size='64']) .default-icon,:host([size='72']) .default-icon,:host([size='64']) ::slotted(svg),:host([size='72']) ::slotted(svg){width:32px;height:32px;font-size:32px}:host([size='64']){width:64px;height:64px}:host([size='72']){width:72px;height:72px}:host([size='96']){width:96px;height:96px}:host([size='96']) .default-icon,:host([size='120']) .default-icon,:host([size='128']) .default-icon,:host([size='96']) ::slotted(svg),:host([size='120']) ::slotted(svg),:host([size='128']) ::slotted(svg){width:48px;height:48px;font-size:48px}:host([size='120']),:host([size='128']){font-size:${fontSizeBase600}}:host([size='120']){width:120px;height:120px}:host([size='128']){width:128px;height:128px}:host([shape='square']){border-radius:${borderRadiusMedium}}:host([shape='square'][size='20']),:host([shape='square'][size='24']){border-radius:${borderRadiusSmall}}:host([shape='square'][size='56']),:host([shape='square'][size='64']),:host([shape='square'][size='72']){border-radius:${borderRadiusLarge}}:host([shape='square'][size='96']),:host([shape='square'][size='120']),:host([shape='square'][size='128']){border-radius:${borderRadiusXLarge}}:host(${brandState}){color:${colorNeutralForegroundStaticInverted};background-color:${colorBrandBackgroundStatic}}:host(${darkRedState}){color:${colorPaletteDarkRedForeground2};background-color:${colorPaletteDarkRedBackground2}}:host(${cranberryState}){color:${colorPaletteCranberryForeground2};background-color:${colorPaletteCranberryBackground2}}:host(${redState}){color:${colorPaletteRedForeground2};background-color:${colorPaletteRedBackground2}}:host(${pumpkinState}){color:${colorPalettePumpkinForeground2};background-color:${colorPalettePumpkinBackground2}}:host(${peachState}){color:${colorPalettePeachForeground2};background-color:${colorPalettePeachBackground2}}:host(${marigoldState}){color:${colorPaletteMarigoldForeground2};background-color:${colorPaletteMarigoldBackground2}}:host(${goldState}){color:${colorPaletteGoldForeground2};background-color:${colorPaletteGoldBackground2}}:host(${brassState}){color:${colorPaletteBrassForeground2};background-color:${colorPaletteBrassBackground2}}:host(${brownState}){color:${colorPaletteBrownForeground2};background-color:${colorPaletteBrownBackground2}}:host(${forestState}){color:${colorPaletteForestForeground2};background-color:${colorPaletteForestBackground2}}:host(${seafoamState}){color:${colorPaletteSeafoamForeground2};background-color:${colorPaletteSeafoamBackground2}}:host(${darkGreenState}){color:${colorPaletteDarkGreenForeground2};background-color:${colorPaletteDarkGreenBackground2}}:host(${lightTealState}){color:${colorPaletteLightTealForeground2};background-color:${colorPaletteLightTealBackground2}}:host(${tealState}){color:${colorPaletteTealForeground2};background-color:${colorPaletteTealBackground2}}:host(${steelState}){color:${colorPaletteSteelForeground2};background-color:${colorPaletteSteelBackground2}}:host(${blueState}){color:${colorPaletteBlueForeground2};background-color:${colorPaletteBlueBackground2}}:host(${royalBlueState}){color:${colorPaletteRoyalBlueForeground2};background-color:${colorPaletteRoyalBlueBackground2}}:host(${cornflowerState}){color:${colorPaletteCornflowerForeground2};background-color:${colorPaletteCornflowerBackground2}}:host(${navyState}){color:${colorPaletteNavyForeground2};background-color:${colorPaletteNavyBackground2}}:host(${lavenderState}){color:${colorPaletteLavenderForeground2};background-color:${colorPaletteLavenderBackground2}}:host(${purpleState}){color:${colorPalettePurpleForeground2};background-color:${colorPalettePurpleBackground2}}:host(${grapeState}){color:${colorPaletteGrapeForeground2};background-color:${colorPaletteGrapeBackground2}}:host(${lilacState}){color:${colorPaletteLilacForeground2};background-color:${colorPaletteLilacBackground2}}:host(${pinkState}){color:${colorPalettePinkForeground2};background-color:${colorPalettePinkBackground2}}:host(${magentaState}){color:${colorPaletteMagentaForeground2};background-color:${colorPaletteMagentaBackground2}}:host(${plumState}){color:${colorPalettePlumForeground2};background-color:${colorPalettePlumBackground2}}:host(${beigeState}){color:${colorPaletteBeigeForeground2};background-color:${colorPaletteBeigeBackground2}}:host(${minkState}){color:${colorPaletteMinkForeground2};background-color:${colorPaletteMinkBackground2}}:host(${platinumState}){color:${colorPalettePlatinumForeground2};background-color:${colorPalettePlatinumBackground2}}:host(${anchorState}){color:${colorPaletteAnchorForeground2};background-color:${colorPaletteAnchorBackground2}}:host([active]){transform:perspective(1px);transition-property:transform,opacity;transition-duration:${durationUltraSlow},${durationFaster};transition-delay:${animations.fastEase},${animations.nullEasing}}:host([active])::before{content:'';position:absolute;top:0;left:0;bottom:0;right:0;border-radius:inherit;transition-property:margin,opacity;transition-duration:${durationUltraSlow}),${durationSlower};transition-delay:${animations.fastEase}),${animations.nullEasing})}:host([active])::before{box-shadow:${shadow8};border-style:solid;border-color:${colorBrandBackgroundStatic}}:host([active][appearance='shadow'])::before{border-style:none;border-color:none}:host([active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThick});border-width:${strokeWidthThick}}:host([size='56'][active]:not([appearance='shadow']))::before,:host([size='64'][active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThicker});border-width:${strokeWidthThicker}}:host([size='72'][active]:not([appearance='shadow']))::before,:host([size='96'][active]:not([appearance='shadow']))::before,:host([size='120'][active]:not([appearance='shadow']))::before,:host([size='128'][active]:not([appearance='shadow']))::before{margin:calc(-2 * ${strokeWidthThickest});border-width:${strokeWidthThickest}}:host([size='20'][active][appearance])::before,:host([size='24'][active][appearance])::before,:host([size='28'][active][appearance])::before{box-shadow:${shadow4}}:host([size='56'][active][appearance])::before,:host([size='64'][active][appearance])::before{box-shadow:${shadow16}}:host([size='72'][active][appearance])::before,:host([size='96'][active][appearance])::before,:host([size='120'][active][appearance])::before,:host([size='128'][active][appearance])::before{box-shadow:${shadow28}}:host([active][appearance='ring'])::before{box-shadow:none}:host([active='inactive']){opacity:0.8;transform:scale(0.875);transition-property:transform,opacity;transition-duration:${durationUltraSlow},${durationFaster};transition-delay:${animations.fastOutSlowInMin},${animations.nullEasing}}:host([active='inactive'])::before{margin:0;opacity:0;transition-property:margin,opacity;transition-duration:${durationUltraSlow},${durationSlower};transition-delay:${animations.fastOutSlowInMin},${animations.nullEasing}}@media screen and (prefers-reduced-motion:reduce){:host([active]){transition-duration:0.01ms}:host([active])::before{transition-duration:0.01ms;transition-delay:0.01ms}}`;
|
|
5386
5483
|
|
|
5387
5484
|
const defaultIconTemplate = html`<svg width="1em" height="1em" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" class="default-icon" fill="currentcolor" aria-hidden="true"><path 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"></path></svg>`;
|
|
5388
5485
|
function avatarTemplate() {
|
|
@@ -5414,6 +5511,19 @@ const BadgeColor = {
|
|
|
5414
5511
|
success: "success",
|
|
5415
5512
|
warning: "warning"
|
|
5416
5513
|
};
|
|
5514
|
+
const BadgeShape = {
|
|
5515
|
+
circular: "circular",
|
|
5516
|
+
rounded: "rounded",
|
|
5517
|
+
square: "square"
|
|
5518
|
+
};
|
|
5519
|
+
const BadgeSize = {
|
|
5520
|
+
tiny: "tiny",
|
|
5521
|
+
extraSmall: "extra-small",
|
|
5522
|
+
small: "small",
|
|
5523
|
+
medium: "medium",
|
|
5524
|
+
large: "large",
|
|
5525
|
+
extraLarge: "extra-large"
|
|
5526
|
+
};
|
|
5417
5527
|
|
|
5418
5528
|
var __defProp$r = Object.defineProperty;
|
|
5419
5529
|
var __getOwnPropDesc$r = Object.getOwnPropertyDescriptor;
|
|
@@ -5441,12 +5551,7 @@ class Badge extends FASTElement {
|
|
|
5441
5551
|
* @param next - the next state
|
|
5442
5552
|
*/
|
|
5443
5553
|
appearanceChanged(prev, next) {
|
|
5444
|
-
|
|
5445
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5446
|
-
}
|
|
5447
|
-
if (next) {
|
|
5448
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5449
|
-
}
|
|
5554
|
+
swapStates(this.elementInternals, prev, next, BadgeAppearance);
|
|
5450
5555
|
}
|
|
5451
5556
|
/**
|
|
5452
5557
|
* Handles changes to color attribute custom states
|
|
@@ -5454,12 +5559,7 @@ class Badge extends FASTElement {
|
|
|
5454
5559
|
* @param next - the next state
|
|
5455
5560
|
*/
|
|
5456
5561
|
colorChanged(prev, next) {
|
|
5457
|
-
|
|
5458
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5459
|
-
}
|
|
5460
|
-
if (next) {
|
|
5461
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5462
|
-
}
|
|
5562
|
+
swapStates(this.elementInternals, prev, next, BadgeColor);
|
|
5463
5563
|
}
|
|
5464
5564
|
/**
|
|
5465
5565
|
* Handles changes to shape attribute custom states
|
|
@@ -5467,12 +5567,7 @@ class Badge extends FASTElement {
|
|
|
5467
5567
|
* @param next - the next state
|
|
5468
5568
|
*/
|
|
5469
5569
|
shapeChanged(prev, next) {
|
|
5470
|
-
|
|
5471
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5472
|
-
}
|
|
5473
|
-
if (next) {
|
|
5474
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5475
|
-
}
|
|
5570
|
+
swapStates(this.elementInternals, prev, next, BadgeShape);
|
|
5476
5571
|
}
|
|
5477
5572
|
/**
|
|
5478
5573
|
* Handles changes to size attribute custom states
|
|
@@ -5480,12 +5575,7 @@ class Badge extends FASTElement {
|
|
|
5480
5575
|
* @param next - the next state
|
|
5481
5576
|
*/
|
|
5482
5577
|
sizeChanged(prev, next) {
|
|
5483
|
-
|
|
5484
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
5485
|
-
}
|
|
5486
|
-
if (next) {
|
|
5487
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
5488
|
-
}
|
|
5578
|
+
swapStates(this.elementInternals, prev, next, BadgeSize);
|
|
5489
5579
|
}
|
|
5490
5580
|
}
|
|
5491
5581
|
__decorateClass$r([attr], Badge.prototype, "appearance", 2);
|
|
@@ -6126,12 +6216,7 @@ class Button extends BaseButton {
|
|
|
6126
6216
|
* @param next - the next state
|
|
6127
6217
|
*/
|
|
6128
6218
|
appearanceChanged(prev, next) {
|
|
6129
|
-
|
|
6130
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
6131
|
-
}
|
|
6132
|
-
if (next) {
|
|
6133
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
6134
|
-
}
|
|
6219
|
+
swapStates(this.elementInternals, prev, next, ButtonAppearance);
|
|
6135
6220
|
}
|
|
6136
6221
|
/**
|
|
6137
6222
|
* Handles changes to shape attribute custom states
|
|
@@ -6139,12 +6224,7 @@ class Button extends BaseButton {
|
|
|
6139
6224
|
* @param next - the next state
|
|
6140
6225
|
*/
|
|
6141
6226
|
shapeChanged(prev, next) {
|
|
6142
|
-
|
|
6143
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
6144
|
-
}
|
|
6145
|
-
if (next) {
|
|
6146
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
6147
|
-
}
|
|
6227
|
+
swapStates(this.elementInternals, prev, next, ButtonShape);
|
|
6148
6228
|
}
|
|
6149
6229
|
/**
|
|
6150
6230
|
* Handles changes to size attribute custom states
|
|
@@ -6152,12 +6232,7 @@ class Button extends BaseButton {
|
|
|
6152
6232
|
* @param next - the next state
|
|
6153
6233
|
*/
|
|
6154
6234
|
sizeChanged(prev, next) {
|
|
6155
|
-
|
|
6156
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
6157
|
-
}
|
|
6158
|
-
if (next) {
|
|
6159
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
6160
|
-
}
|
|
6235
|
+
swapStates(this.elementInternals, prev, next, ButtonSize);
|
|
6161
6236
|
}
|
|
6162
6237
|
/**
|
|
6163
6238
|
* Handles changes to icon only custom states
|
|
@@ -6190,6 +6265,15 @@ const definition$w = Button.compose({
|
|
|
6190
6265
|
|
|
6191
6266
|
definition$w.define(FluentDesignSystem.registry);
|
|
6192
6267
|
|
|
6268
|
+
const CheckboxShape = {
|
|
6269
|
+
circular: "circular",
|
|
6270
|
+
square: "square"
|
|
6271
|
+
};
|
|
6272
|
+
const CheckboxSize = {
|
|
6273
|
+
medium: "medium",
|
|
6274
|
+
large: "large"
|
|
6275
|
+
};
|
|
6276
|
+
|
|
6193
6277
|
var __defProp$p = Object.defineProperty;
|
|
6194
6278
|
var __getOwnPropDesc$p = Object.getOwnPropertyDescriptor;
|
|
6195
6279
|
var __decorateClass$p = (decorators, target, key, kind) => {
|
|
@@ -6572,12 +6656,7 @@ class Checkbox extends BaseCheckbox {
|
|
|
6572
6656
|
* @internal
|
|
6573
6657
|
*/
|
|
6574
6658
|
shapeChanged(prev, next) {
|
|
6575
|
-
|
|
6576
|
-
toggleState(this.elementInternals, prev, false);
|
|
6577
|
-
}
|
|
6578
|
-
if (next) {
|
|
6579
|
-
toggleState(this.elementInternals, next, true);
|
|
6580
|
-
}
|
|
6659
|
+
swapStates(this.elementInternals, prev, next, CheckboxShape);
|
|
6581
6660
|
}
|
|
6582
6661
|
/**
|
|
6583
6662
|
* Applies size states when the `size` property changes.
|
|
@@ -6587,12 +6666,7 @@ class Checkbox extends BaseCheckbox {
|
|
|
6587
6666
|
* @internal
|
|
6588
6667
|
*/
|
|
6589
6668
|
sizeChanged(prev, next) {
|
|
6590
|
-
|
|
6591
|
-
toggleState(this.elementInternals, prev, false);
|
|
6592
|
-
}
|
|
6593
|
-
if (next) {
|
|
6594
|
-
toggleState(this.elementInternals, next, true);
|
|
6595
|
-
}
|
|
6669
|
+
swapStates(this.elementInternals, prev, next, CheckboxSize);
|
|
6596
6670
|
}
|
|
6597
6671
|
constructor() {
|
|
6598
6672
|
super();
|
|
@@ -6626,7 +6700,6 @@ __decorateClass$p([observable], Checkbox.prototype, "indeterminate", 2);
|
|
|
6626
6700
|
__decorateClass$p([attr], Checkbox.prototype, "shape", 2);
|
|
6627
6701
|
__decorateClass$p([attr], Checkbox.prototype, "size", 2);
|
|
6628
6702
|
|
|
6629
|
-
const indeterminateState = css.partial`:is([state--indeterminate], :state(indeterminate))`;
|
|
6630
6703
|
const styles$u = css`
|
|
6631
6704
|
${display("inline-flex")}
|
|
6632
6705
|
|
|
@@ -6687,6 +6760,33 @@ const definition$u = CompoundButton.compose({
|
|
|
6687
6760
|
|
|
6688
6761
|
definition$u.define(FluentDesignSystem.registry);
|
|
6689
6762
|
|
|
6763
|
+
const CounterBadgeAppearance = {
|
|
6764
|
+
filled: "filled",
|
|
6765
|
+
ghost: "ghost"
|
|
6766
|
+
};
|
|
6767
|
+
const CounterBadgeColor = {
|
|
6768
|
+
brand: "brand",
|
|
6769
|
+
danger: "danger",
|
|
6770
|
+
important: "important",
|
|
6771
|
+
informative: "informative",
|
|
6772
|
+
severe: "severe",
|
|
6773
|
+
subtle: "subtle",
|
|
6774
|
+
success: "success",
|
|
6775
|
+
warning: "warning"
|
|
6776
|
+
};
|
|
6777
|
+
const CounterBadgeShape = {
|
|
6778
|
+
circular: "circular",
|
|
6779
|
+
rounded: "rounded"
|
|
6780
|
+
};
|
|
6781
|
+
const CounterBadgeSize = {
|
|
6782
|
+
tiny: "tiny",
|
|
6783
|
+
extraSmall: "extra-small",
|
|
6784
|
+
small: "small",
|
|
6785
|
+
medium: "medium",
|
|
6786
|
+
large: "large",
|
|
6787
|
+
extraLarge: "extra-large"
|
|
6788
|
+
};
|
|
6789
|
+
|
|
6690
6790
|
var __defProp$o = Object.defineProperty;
|
|
6691
6791
|
var __getOwnPropDesc$o = Object.getOwnPropertyDescriptor;
|
|
6692
6792
|
var __decorateClass$o = (decorators, target, key, kind) => {
|
|
@@ -6715,12 +6815,7 @@ class CounterBadge extends FASTElement {
|
|
|
6715
6815
|
* @param next - the next state
|
|
6716
6816
|
*/
|
|
6717
6817
|
appearanceChanged(prev, next) {
|
|
6718
|
-
|
|
6719
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
6720
|
-
}
|
|
6721
|
-
if (next) {
|
|
6722
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
6723
|
-
}
|
|
6818
|
+
swapStates(this.elementInternals, prev, next, CounterBadgeAppearance);
|
|
6724
6819
|
}
|
|
6725
6820
|
/**
|
|
6726
6821
|
* Handles changes to color attribute custom states
|
|
@@ -6728,12 +6823,7 @@ class CounterBadge extends FASTElement {
|
|
|
6728
6823
|
* @param next - the next state
|
|
6729
6824
|
*/
|
|
6730
6825
|
colorChanged(prev, next) {
|
|
6731
|
-
|
|
6732
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
6733
|
-
}
|
|
6734
|
-
if (next) {
|
|
6735
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
6736
|
-
}
|
|
6826
|
+
swapStates(this.elementInternals, prev, next, CounterBadgeColor);
|
|
6737
6827
|
}
|
|
6738
6828
|
/**
|
|
6739
6829
|
* Handles changes to shape attribute custom states
|
|
@@ -6741,12 +6831,7 @@ class CounterBadge extends FASTElement {
|
|
|
6741
6831
|
* @param next - the next state
|
|
6742
6832
|
*/
|
|
6743
6833
|
shapeChanged(prev, next) {
|
|
6744
|
-
|
|
6745
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
6746
|
-
}
|
|
6747
|
-
if (next) {
|
|
6748
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
6749
|
-
}
|
|
6834
|
+
swapStates(this.elementInternals, prev, next, CounterBadgeShape);
|
|
6750
6835
|
}
|
|
6751
6836
|
/**
|
|
6752
6837
|
* Handles changes to size attribute custom states
|
|
@@ -6754,12 +6839,7 @@ class CounterBadge extends FASTElement {
|
|
|
6754
6839
|
* @param next - the next state
|
|
6755
6840
|
*/
|
|
6756
6841
|
sizeChanged(prev, next) {
|
|
6757
|
-
|
|
6758
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
6759
|
-
}
|
|
6760
|
-
if (next) {
|
|
6761
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
6762
|
-
}
|
|
6842
|
+
swapStates(this.elementInternals, prev, next, CounterBadgeSize);
|
|
6763
6843
|
}
|
|
6764
6844
|
countChanged() {
|
|
6765
6845
|
this.setCount();
|
|
@@ -6809,7 +6889,6 @@ __decorateClass$o([attr({
|
|
|
6809
6889
|
})], CounterBadge.prototype, "dot", 2);
|
|
6810
6890
|
applyMixins(CounterBadge, StartEnd);
|
|
6811
6891
|
|
|
6812
|
-
const dotState = css.partial`:is([state--dot], :state(dot))`;
|
|
6813
6892
|
const styles$s = css`
|
|
6814
6893
|
:host(${roundedState}){border-radius:${borderRadiusMedium}}:host(${roundedState}${tinyState}),:host(${roundedState}${extraSmallState}),:host(${roundedState}${smallState}){border-radius:${borderRadiusSmall}}${badgeSizeStyles}
|
|
6815
6894
|
${badgeFilledStyles}
|
|
@@ -6994,6 +7073,16 @@ const DividerRole = {
|
|
|
6994
7073
|
presentation: "presentation"
|
|
6995
7074
|
};
|
|
6996
7075
|
const DividerOrientation = Orientation;
|
|
7076
|
+
const DividerAlignContent = {
|
|
7077
|
+
center: "center",
|
|
7078
|
+
start: "start",
|
|
7079
|
+
end: "end"
|
|
7080
|
+
};
|
|
7081
|
+
const DividerAppearance = {
|
|
7082
|
+
strong: "strong",
|
|
7083
|
+
brand: "brand",
|
|
7084
|
+
subtle: "subtle"
|
|
7085
|
+
};
|
|
6997
7086
|
|
|
6998
7087
|
var __defProp$l = Object.defineProperty;
|
|
6999
7088
|
var __getOwnPropDesc$l = Object.getOwnPropertyDescriptor;
|
|
@@ -7043,13 +7132,8 @@ class BaseDivider extends FASTElement {
|
|
|
7043
7132
|
* @internal
|
|
7044
7133
|
*/
|
|
7045
7134
|
orientationChanged(previous, next) {
|
|
7046
|
-
this.elementInternals.ariaOrientation = this.role !== DividerRole.presentation ? next : null;
|
|
7047
|
-
|
|
7048
|
-
toggleState(this.elementInternals, `${previous}`, false);
|
|
7049
|
-
}
|
|
7050
|
-
if (next) {
|
|
7051
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
7052
|
-
}
|
|
7135
|
+
this.elementInternals.ariaOrientation = this.role !== DividerRole.presentation ? next ?? null : null;
|
|
7136
|
+
swapStates(this.elementInternals, previous, next, DividerOrientation);
|
|
7053
7137
|
}
|
|
7054
7138
|
}
|
|
7055
7139
|
__decorateClass$l([attr], BaseDivider.prototype, "role", 2);
|
|
@@ -7061,12 +7145,7 @@ class Divider extends BaseDivider {
|
|
|
7061
7145
|
* @param next - the next state
|
|
7062
7146
|
*/
|
|
7063
7147
|
alignContentChanged(prev, next) {
|
|
7064
|
-
|
|
7065
|
-
toggleState(this.elementInternals, `align-${prev}`, false);
|
|
7066
|
-
}
|
|
7067
|
-
if (next) {
|
|
7068
|
-
toggleState(this.elementInternals, `align-${next}`, true);
|
|
7069
|
-
}
|
|
7148
|
+
swapStates(this.elementInternals, prev, next, DividerAlignContent, "align-");
|
|
7070
7149
|
}
|
|
7071
7150
|
/**
|
|
7072
7151
|
* Handles changes to appearance attribute custom states
|
|
@@ -7074,12 +7153,7 @@ class Divider extends BaseDivider {
|
|
|
7074
7153
|
* @param next - the next state
|
|
7075
7154
|
*/
|
|
7076
7155
|
appearanceChanged(prev, next) {
|
|
7077
|
-
|
|
7078
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
7079
|
-
}
|
|
7080
|
-
if (next) {
|
|
7081
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
7082
|
-
}
|
|
7156
|
+
swapStates(this.elementInternals, prev, next, DividerAppearance);
|
|
7083
7157
|
}
|
|
7084
7158
|
/**
|
|
7085
7159
|
* Handles changes to inset custom states
|
|
@@ -7464,19 +7538,6 @@ __decorateClass$j([attr({
|
|
|
7464
7538
|
attribute: "label-position"
|
|
7465
7539
|
})], Field.prototype, "labelPosition", 2);
|
|
7466
7540
|
|
|
7467
|
-
const focusVisibleState = css.partial`:is([state--focus-visible], :state(focus-visible))`;
|
|
7468
|
-
const badInputState = css.partial`:is([state--${ValidationFlags.badInput}], :state(${ValidationFlags.badInput}))`;
|
|
7469
|
-
const customErrorState = css.partial`:is([state--${ValidationFlags.customError}], :state(${ValidationFlags.customError}))`;
|
|
7470
|
-
const patternMismatchState = css.partial`:is([state--${ValidationFlags.patternMismatch}], :state(${ValidationFlags.patternMismatch}))`;
|
|
7471
|
-
const rangeOverflowState = css.partial`:is([state--${ValidationFlags.rangeOverflow}], :state(${ValidationFlags.rangeOverflow}))`;
|
|
7472
|
-
const rangeUnderflowState = css.partial`:is([state--${ValidationFlags.rangeUnderflow}], :state(${ValidationFlags.rangeUnderflow}))`;
|
|
7473
|
-
const stepMismatchState = css.partial`:is([state--${ValidationFlags.stepMismatch}], :state(${ValidationFlags.stepMismatch}))`;
|
|
7474
|
-
const tooLongState = css.partial`:is([state--${ValidationFlags.tooLong}], :state(${ValidationFlags.tooLong}))`;
|
|
7475
|
-
const tooShortState = css.partial`:is([state--${ValidationFlags.tooShort}], :state(${ValidationFlags.tooShort}))`;
|
|
7476
|
-
const typeMismatchState = css.partial`:is([state--${ValidationFlags.typeMismatch}], :state(${ValidationFlags.typeMismatch}))`;
|
|
7477
|
-
const validState = css.partial`:is([state-${ValidationFlags.valid}], :state(${ValidationFlags.valid}))`;
|
|
7478
|
-
const valueMissingState = css.partial`:is([state--${ValidationFlags.valueMissing}], :state(${ValidationFlags.valueMissing}))`;
|
|
7479
|
-
const hasMessageState = css.partial`:is([state--has-message], :state(has-message))`;
|
|
7480
7541
|
const styles$m = css`
|
|
7481
7542
|
${display("inline-grid")}
|
|
7482
7543
|
|
|
@@ -7505,6 +7566,18 @@ const definition$n = Field.compose({
|
|
|
7505
7566
|
|
|
7506
7567
|
definition$n.define(FluentDesignSystem.registry);
|
|
7507
7568
|
|
|
7569
|
+
const ImageFit = {
|
|
7570
|
+
none: "none",
|
|
7571
|
+
center: "center",
|
|
7572
|
+
contain: "contain",
|
|
7573
|
+
cover: "cover"
|
|
7574
|
+
};
|
|
7575
|
+
const ImageShape = {
|
|
7576
|
+
circular: "circular",
|
|
7577
|
+
rounded: "rounded",
|
|
7578
|
+
square: "square"
|
|
7579
|
+
};
|
|
7580
|
+
|
|
7508
7581
|
var __defProp$i = Object.defineProperty;
|
|
7509
7582
|
var __getOwnPropDesc$i = Object.getOwnPropertyDescriptor;
|
|
7510
7583
|
var __decorateClass$i = (decorators, target, key, kind) => {
|
|
@@ -7553,12 +7626,7 @@ class Image extends FASTElement {
|
|
|
7553
7626
|
* @param next - the next state
|
|
7554
7627
|
*/
|
|
7555
7628
|
fitChanged(prev, next) {
|
|
7556
|
-
|
|
7557
|
-
toggleState(this.elementInternals, `fit-${prev}`, false);
|
|
7558
|
-
}
|
|
7559
|
-
if (next) {
|
|
7560
|
-
toggleState(this.elementInternals, `fit-${next}`, true);
|
|
7561
|
-
}
|
|
7629
|
+
swapStates(this.elementInternals, prev, next, ImageFit, "fit-");
|
|
7562
7630
|
}
|
|
7563
7631
|
/**
|
|
7564
7632
|
* Handles changes to shape attribute custom states
|
|
@@ -7566,12 +7634,7 @@ class Image extends FASTElement {
|
|
|
7566
7634
|
* @param next - the next state
|
|
7567
7635
|
*/
|
|
7568
7636
|
shapeChanged(prev, next) {
|
|
7569
|
-
|
|
7570
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
7571
|
-
}
|
|
7572
|
-
if (next) {
|
|
7573
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
7574
|
-
}
|
|
7637
|
+
swapStates(this.elementInternals, prev, next, ImageShape);
|
|
7575
7638
|
}
|
|
7576
7639
|
}
|
|
7577
7640
|
__decorateClass$i([attr({
|
|
@@ -7589,7 +7652,7 @@ __decorateClass$i([attr], Image.prototype, "shape", 2);
|
|
|
7589
7652
|
const template$m = html`<slot></slot>`;
|
|
7590
7653
|
|
|
7591
7654
|
const styles$l = css`
|
|
7592
|
-
:host{contain:content}:host ::slotted(img){box-sizing:border-box;min-height:8px;min-width:8px;display:inline-block}:host(
|
|
7655
|
+
:host{contain:content}:host ::slotted(img){box-sizing:border-box;min-height:8px;min-width:8px;display:inline-block}:host(${blockState}) ::slotted(img){width:100%;height:auto}:host(${borderedState}) ::slotted(img){border:${strokeWidthThin} solid ${colorNeutralStroke2}}:host(${fitNoneState}) ::slotted(img){object-fit:none;object-position:top left;height:100%;width:100%}:host(${fitCenterState}) ::slotted(img){object-fit:none;object-position:center;height:100%;width:100%}:host(${fitContainState}) ::slotted(img){object-fit:contain;object-position:center;height:100%;width:100%}:host(${fitCoverState}) ::slotted(img){object-fit:cover;object-position:center;height:100%;width:100%}:host(${shadowState}) ::slotted(img){box-shadow:${shadow4}}:host(${circularState}) ::slotted(img){border-radius:${borderRadiusCircular}}:host(${roundedState}) ::slotted(img){border-radius:${borderRadiusMedium}}`;
|
|
7593
7656
|
|
|
7594
7657
|
const definition$m = Image.compose({
|
|
7595
7658
|
name: `${FluentDesignSystem.prefix}-image`,
|
|
@@ -7599,6 +7662,16 @@ const definition$m = Image.compose({
|
|
|
7599
7662
|
|
|
7600
7663
|
definition$m.define(FluentDesignSystem.registry);
|
|
7601
7664
|
|
|
7665
|
+
const LabelSize = {
|
|
7666
|
+
small: "small",
|
|
7667
|
+
medium: "medium",
|
|
7668
|
+
large: "large"
|
|
7669
|
+
};
|
|
7670
|
+
const LabelWeight = {
|
|
7671
|
+
regular: "regular",
|
|
7672
|
+
semibold: "semibold"
|
|
7673
|
+
};
|
|
7674
|
+
|
|
7602
7675
|
var __defProp$h = Object.defineProperty;
|
|
7603
7676
|
var __getOwnPropDesc$h = Object.getOwnPropertyDescriptor;
|
|
7604
7677
|
var __decorateClass$h = (decorators, target, key, kind) => {
|
|
@@ -7625,12 +7698,7 @@ class Label extends FASTElement {
|
|
|
7625
7698
|
* @param next - the next state
|
|
7626
7699
|
*/
|
|
7627
7700
|
sizeChanged(prev, next) {
|
|
7628
|
-
|
|
7629
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
7630
|
-
}
|
|
7631
|
-
if (next) {
|
|
7632
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
7633
|
-
}
|
|
7701
|
+
swapStates(this.elementInternals, prev, next, LabelSize);
|
|
7634
7702
|
}
|
|
7635
7703
|
/**
|
|
7636
7704
|
* Handles changes to weight attribute custom states
|
|
@@ -7638,12 +7706,7 @@ class Label extends FASTElement {
|
|
|
7638
7706
|
* @param next - the next state
|
|
7639
7707
|
*/
|
|
7640
7708
|
weightChanged(prev, next) {
|
|
7641
|
-
|
|
7642
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
7643
|
-
}
|
|
7644
|
-
if (next) {
|
|
7645
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
7646
|
-
}
|
|
7709
|
+
swapStates(this.elementInternals, prev, next, LabelWeight);
|
|
7647
7710
|
}
|
|
7648
7711
|
/**
|
|
7649
7712
|
* Handles changes to disabled attribute custom states
|
|
@@ -7666,7 +7729,7 @@ __decorateClass$h([attr({
|
|
|
7666
7729
|
const styles$k = css`
|
|
7667
7730
|
${display("inline-flex")}
|
|
7668
7731
|
|
|
7669
|
-
:host{color:${colorNeutralForeground1};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};user-select:none}.asterisk{color:${colorPaletteRedForeground1};margin-inline-start:${spacingHorizontalXS}}:host(${smallState}){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host(${largeState}){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(${largeState})
|
|
7732
|
+
:host{color:${colorNeutralForeground1};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};user-select:none}.asterisk{color:${colorPaletteRedForeground1};margin-inline-start:${spacingHorizontalXS}}:host(${smallState}){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host(${largeState}){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(:is(${largeState},${semiboldState})){font-weight:${fontWeightSemibold}}:host(${disabledState}),:host(${disabledState}) .asterisk{color:${colorNeutralForegroundDisabled}}`;
|
|
7670
7733
|
|
|
7671
7734
|
function labelTemplate() {
|
|
7672
7735
|
return html`<slot></slot><span part="asterisk" class="asterisk" ?hidden="${x => !x.required}">*</span>`;
|
|
@@ -7681,6 +7744,10 @@ const definition$l = Label.compose({
|
|
|
7681
7744
|
|
|
7682
7745
|
definition$l.define(FluentDesignSystem.registry);
|
|
7683
7746
|
|
|
7747
|
+
const LinkAppearance = {
|
|
7748
|
+
subtle: "subtle"
|
|
7749
|
+
};
|
|
7750
|
+
|
|
7684
7751
|
var __defProp$g = Object.defineProperty;
|
|
7685
7752
|
var __getOwnPropDesc$g = Object.getOwnPropertyDescriptor;
|
|
7686
7753
|
var __decorateClass$g = (decorators, target, key, kind) => {
|
|
@@ -7700,12 +7767,7 @@ class Link extends BaseAnchor {
|
|
|
7700
7767
|
* @param next - the next state
|
|
7701
7768
|
*/
|
|
7702
7769
|
appearanceChanged(prev, next) {
|
|
7703
|
-
|
|
7704
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
7705
|
-
}
|
|
7706
|
-
if (next) {
|
|
7707
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
7708
|
-
}
|
|
7770
|
+
swapStates(this.elementInternals, prev, next, LinkAppearance);
|
|
7709
7771
|
}
|
|
7710
7772
|
/**
|
|
7711
7773
|
* Handles changes to inline attribute custom states
|
|
@@ -7724,7 +7786,7 @@ __decorateClass$g([attr({
|
|
|
7724
7786
|
const styles$j = css`
|
|
7725
7787
|
${display("inline")}
|
|
7726
7788
|
|
|
7727
|
-
:host{position:relative;box-sizing:border-box;background-color:transparent;color:${colorBrandForegroundLink};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};overflow:inherit;text-align:start;text-decoration:none;text-decoration-
|
|
7789
|
+
:host{position:relative;box-sizing:border-box;background-color:transparent;color:${colorBrandForegroundLink};cursor:pointer;font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};overflow:inherit;text-align:start;text-decoration:none;text-decoration-thickness:${strokeWidthThin};text-overflow:inherit;user-select:text}:host(:is(:hover,:focus-visible)){outline:none;text-decoration-line:underline}@media (hover:hover){:host(:hover){color:${colorBrandForegroundLinkHover}}:host(:active){color:${colorBrandForegroundLinkPressed}}:host(${subtleState}:hover){color:${colorNeutralForeground2LinkHover}}:host(${subtleState}:active){color:${colorNeutralForeground2LinkPressed}}}:host(${subtleState}){color:${colorNeutralForeground2Link}}:host-context(:is(h1,h2,h3,h4,h5,h6,p,fluent-text)),:host(${inlineState}){font:inherit;text-decoration:underline}:host(:not([href])){color:inherit;text-decoration:none}::slotted(a){position:absolute;inset:0}`.withBehaviors(forcedColorsStylesheetBehavior(css`
|
|
7728
7790
|
:host{color:LinkText}`));
|
|
7729
7791
|
|
|
7730
7792
|
function anchorTemplate() {
|
|
@@ -7988,7 +8050,6 @@ __decorateClass$f([observable], MenuItem.prototype, "slottedSubmenu", 2);
|
|
|
7988
8050
|
__decorateClass$f([observable], MenuItem.prototype, "submenu", 2);
|
|
7989
8051
|
applyMixins(MenuItem, StartEnd);
|
|
7990
8052
|
|
|
7991
|
-
const submenuState = css.partial`:is([state--submenu], :state(submenu))`;
|
|
7992
8053
|
const styles$i = css`
|
|
7993
8054
|
${display("grid")}
|
|
7994
8055
|
|
|
@@ -8592,6 +8653,21 @@ const definition$g = Menu.compose({
|
|
|
8592
8653
|
|
|
8593
8654
|
definition$g.define(FluentDesignSystem.registry);
|
|
8594
8655
|
|
|
8656
|
+
const MessageBarLayout = {
|
|
8657
|
+
multiline: "multiline",
|
|
8658
|
+
singleline: "singleline"
|
|
8659
|
+
};
|
|
8660
|
+
const MessageBarShape = {
|
|
8661
|
+
rounded: "rounded",
|
|
8662
|
+
square: "square"
|
|
8663
|
+
};
|
|
8664
|
+
const MessageBarIntent = {
|
|
8665
|
+
success: "success",
|
|
8666
|
+
warning: "warning",
|
|
8667
|
+
error: "error",
|
|
8668
|
+
info: "info"
|
|
8669
|
+
};
|
|
8670
|
+
|
|
8595
8671
|
var __defProp$c = Object.defineProperty;
|
|
8596
8672
|
var __getOwnPropDesc$c = Object.getOwnPropertyDescriptor;
|
|
8597
8673
|
var __decorateClass$c = (decorators, target, key, kind) => {
|
|
@@ -8624,12 +8700,7 @@ class MessageBar extends FASTElement {
|
|
|
8624
8700
|
* @param next - the next state
|
|
8625
8701
|
*/
|
|
8626
8702
|
shapeChanged(prev, next) {
|
|
8627
|
-
|
|
8628
|
-
toggleState(this.elementInternals, prev, false);
|
|
8629
|
-
}
|
|
8630
|
-
if (next) {
|
|
8631
|
-
toggleState(this.elementInternals, next, true);
|
|
8632
|
-
}
|
|
8703
|
+
swapStates(this.elementInternals, prev, next, MessageBarShape);
|
|
8633
8704
|
}
|
|
8634
8705
|
/**
|
|
8635
8706
|
* Handles changes to the layout attribute custom states
|
|
@@ -8637,12 +8708,7 @@ class MessageBar extends FASTElement {
|
|
|
8637
8708
|
* @param next - the next state
|
|
8638
8709
|
*/
|
|
8639
8710
|
layoutChanged(prev, next) {
|
|
8640
|
-
|
|
8641
|
-
toggleState(this.elementInternals, prev, false);
|
|
8642
|
-
}
|
|
8643
|
-
if (next) {
|
|
8644
|
-
toggleState(this.elementInternals, next, true);
|
|
8645
|
-
}
|
|
8711
|
+
swapStates(this.elementInternals, prev, next, MessageBarLayout);
|
|
8646
8712
|
}
|
|
8647
8713
|
/**
|
|
8648
8714
|
* Handles changes to the intent attribute custom states
|
|
@@ -8650,12 +8716,7 @@ class MessageBar extends FASTElement {
|
|
|
8650
8716
|
* @param next - the next state
|
|
8651
8717
|
*/
|
|
8652
8718
|
intentChanged(prev, next) {
|
|
8653
|
-
|
|
8654
|
-
toggleState(this.elementInternals, prev, false);
|
|
8655
|
-
}
|
|
8656
|
-
if (next) {
|
|
8657
|
-
toggleState(this.elementInternals, next, true);
|
|
8658
|
-
}
|
|
8719
|
+
swapStates(this.elementInternals, prev, next, MessageBarIntent);
|
|
8659
8720
|
}
|
|
8660
8721
|
}
|
|
8661
8722
|
__decorateClass$c([attr], MessageBar.prototype, "shape", 2);
|
|
@@ -8682,6 +8743,20 @@ const definition$f = MessageBar.compose({
|
|
|
8682
8743
|
|
|
8683
8744
|
definition$f.define(FluentDesignSystem.registry);
|
|
8684
8745
|
|
|
8746
|
+
const ProgressBarThickness = {
|
|
8747
|
+
medium: "medium",
|
|
8748
|
+
large: "large"
|
|
8749
|
+
};
|
|
8750
|
+
const ProgressBarShape = {
|
|
8751
|
+
rounded: "rounded",
|
|
8752
|
+
square: "square"
|
|
8753
|
+
};
|
|
8754
|
+
const ProgressBarValidationState = {
|
|
8755
|
+
success: "success",
|
|
8756
|
+
warning: "warning",
|
|
8757
|
+
error: "error"
|
|
8758
|
+
};
|
|
8759
|
+
|
|
8685
8760
|
var __defProp$b = Object.defineProperty;
|
|
8686
8761
|
var __getOwnPropDesc$b = Object.getOwnPropertyDescriptor;
|
|
8687
8762
|
var __decorateClass$b = (decorators, target, key, kind) => {
|
|
@@ -8708,12 +8783,7 @@ class BaseProgressBar extends FASTElement {
|
|
|
8708
8783
|
* @param next - the next state
|
|
8709
8784
|
*/
|
|
8710
8785
|
validationStateChanged(prev, next) {
|
|
8711
|
-
|
|
8712
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
8713
|
-
}
|
|
8714
|
-
if (next) {
|
|
8715
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
8716
|
-
}
|
|
8786
|
+
swapStates(this.elementInternals, prev, next, ProgressBarValidationState);
|
|
8717
8787
|
}
|
|
8718
8788
|
/**
|
|
8719
8789
|
* Updates the percent complete when the `value` property changes.
|
|
@@ -8770,12 +8840,7 @@ class ProgressBar extends BaseProgressBar {
|
|
|
8770
8840
|
* @param next - the next state
|
|
8771
8841
|
*/
|
|
8772
8842
|
thicknessChanged(prev, next) {
|
|
8773
|
-
|
|
8774
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
8775
|
-
}
|
|
8776
|
-
if (next) {
|
|
8777
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
8778
|
-
}
|
|
8843
|
+
swapStates(this.elementInternals, prev, next, ProgressBarThickness);
|
|
8779
8844
|
}
|
|
8780
8845
|
/**
|
|
8781
8846
|
* Handles changes to shape attribute custom states
|
|
@@ -8783,12 +8848,7 @@ class ProgressBar extends BaseProgressBar {
|
|
|
8783
8848
|
* @param next - the next state
|
|
8784
8849
|
*/
|
|
8785
8850
|
shapeChanged(prev, next) {
|
|
8786
|
-
|
|
8787
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
8788
|
-
}
|
|
8789
|
-
if (next) {
|
|
8790
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
8791
|
-
}
|
|
8851
|
+
swapStates(this.elementInternals, prev, next, ProgressBarShape);
|
|
8792
8852
|
}
|
|
8793
8853
|
}
|
|
8794
8854
|
__decorateClass$b([attr], ProgressBar.prototype, "thickness", 2);
|
|
@@ -9386,6 +9446,17 @@ const definition$c = Radio.compose({
|
|
|
9386
9446
|
|
|
9387
9447
|
definition$c.define(FluentDesignSystem.registry);
|
|
9388
9448
|
|
|
9449
|
+
const RatingDisplayColor = {
|
|
9450
|
+
neutral: "neutral",
|
|
9451
|
+
brand: "brand",
|
|
9452
|
+
marigold: "marigold"
|
|
9453
|
+
};
|
|
9454
|
+
const RatingDisplaySize = {
|
|
9455
|
+
small: "small",
|
|
9456
|
+
medium: "medium",
|
|
9457
|
+
large: "large"
|
|
9458
|
+
};
|
|
9459
|
+
|
|
9389
9460
|
var __defProp$9 = Object.defineProperty;
|
|
9390
9461
|
var __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor;
|
|
9391
9462
|
var __decorateClass$9 = (decorators, target, key, kind) => {
|
|
@@ -9483,8 +9554,7 @@ class RatingDisplay extends BaseRatingDisplay {
|
|
|
9483
9554
|
* @param next - The next state
|
|
9484
9555
|
*/
|
|
9485
9556
|
colorChanged(prev, next) {
|
|
9486
|
-
|
|
9487
|
-
if (next) toggleState(this.elementInternals, next, true);
|
|
9557
|
+
swapStates(this.elementInternals, prev, next, RatingDisplayColor);
|
|
9488
9558
|
}
|
|
9489
9559
|
/**
|
|
9490
9560
|
* Handles changes to the size attribute.
|
|
@@ -9493,8 +9563,7 @@ class RatingDisplay extends BaseRatingDisplay {
|
|
|
9493
9563
|
* @param next - The next state
|
|
9494
9564
|
*/
|
|
9495
9565
|
sizeChanged(prev, next) {
|
|
9496
|
-
|
|
9497
|
-
if (next) toggleState(this.elementInternals, next, true);
|
|
9566
|
+
swapStates(this.elementInternals, prev, next, RatingDisplaySize);
|
|
9498
9567
|
}
|
|
9499
9568
|
/**
|
|
9500
9569
|
* Overrides the selected value and returns 1 if compact is true.
|
|
@@ -9542,6 +9611,10 @@ const definition$b = RatingDisplay.compose({
|
|
|
9542
9611
|
|
|
9543
9612
|
definition$b.define(FluentDesignSystem.registry);
|
|
9544
9613
|
|
|
9614
|
+
const SliderSize = {
|
|
9615
|
+
small: "small",
|
|
9616
|
+
medium: "medium"
|
|
9617
|
+
};
|
|
9545
9618
|
const SliderOrientation = Orientation;
|
|
9546
9619
|
const SliderMode = {
|
|
9547
9620
|
singleValue: "single-value"
|
|
@@ -9699,12 +9772,7 @@ class Slider extends FASTElement {
|
|
|
9699
9772
|
return Object.freeze(Array.from(this.elementInternals.labels));
|
|
9700
9773
|
}
|
|
9701
9774
|
sizeChanged(prev, next) {
|
|
9702
|
-
|
|
9703
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
9704
|
-
}
|
|
9705
|
-
if (next) {
|
|
9706
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
9707
|
-
}
|
|
9775
|
+
swapStates(this.elementInternals, prev, next, SliderSize);
|
|
9708
9776
|
}
|
|
9709
9777
|
handleChange(_, propertyName) {
|
|
9710
9778
|
switch (propertyName) {
|
|
@@ -9965,12 +10033,7 @@ class Slider extends FASTElement {
|
|
|
9965
10033
|
}
|
|
9966
10034
|
orientationChanged(prev, next) {
|
|
9967
10035
|
this.elementInternals.ariaOrientation = next ?? Orientation.horizontal;
|
|
9968
|
-
|
|
9969
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
9970
|
-
}
|
|
9971
|
-
if (next) {
|
|
9972
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
9973
|
-
}
|
|
10036
|
+
swapStates(this.elementInternals, prev, next, Orientation);
|
|
9974
10037
|
if (this.$fastController.isConnected) {
|
|
9975
10038
|
this.setSliderPosition(this.direction);
|
|
9976
10039
|
}
|
|
@@ -10153,6 +10216,20 @@ const definition$a = Slider.compose({
|
|
|
10153
10216
|
|
|
10154
10217
|
definition$a.define(FluentDesignSystem.registry);
|
|
10155
10218
|
|
|
10219
|
+
const SpinnerAppearance = {
|
|
10220
|
+
primary: "primary",
|
|
10221
|
+
inverted: "inverted"
|
|
10222
|
+
};
|
|
10223
|
+
const SpinnerSize = {
|
|
10224
|
+
tiny: "tiny",
|
|
10225
|
+
extraSmall: "extra-small",
|
|
10226
|
+
small: "small",
|
|
10227
|
+
medium: "medium",
|
|
10228
|
+
large: "large",
|
|
10229
|
+
extraLarge: "extra-large",
|
|
10230
|
+
huge: "huge"
|
|
10231
|
+
};
|
|
10232
|
+
|
|
10156
10233
|
var __defProp$7 = Object.defineProperty;
|
|
10157
10234
|
var __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor;
|
|
10158
10235
|
var __decorateClass$7 = (decorators, target, key, kind) => {
|
|
@@ -10180,12 +10257,7 @@ class Spinner extends BaseSpinner {
|
|
|
10180
10257
|
* @param next - the next state
|
|
10181
10258
|
*/
|
|
10182
10259
|
sizeChanged(prev, next) {
|
|
10183
|
-
|
|
10184
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
10185
|
-
}
|
|
10186
|
-
if (next) {
|
|
10187
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
10188
|
-
}
|
|
10260
|
+
swapStates(this.elementInternals, prev, next, SpinnerSize);
|
|
10189
10261
|
}
|
|
10190
10262
|
/**
|
|
10191
10263
|
* Handles changes to appearance attribute custom states
|
|
@@ -10193,12 +10265,7 @@ class Spinner extends BaseSpinner {
|
|
|
10193
10265
|
* @param next - the next state
|
|
10194
10266
|
*/
|
|
10195
10267
|
appearanceChanged(prev, next) {
|
|
10196
|
-
|
|
10197
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
10198
|
-
}
|
|
10199
|
-
if (next) {
|
|
10200
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
10201
|
-
}
|
|
10268
|
+
swapStates(this.elementInternals, prev, next, SpinnerAppearance);
|
|
10202
10269
|
}
|
|
10203
10270
|
}
|
|
10204
10271
|
__decorateClass$7([attr], Spinner.prototype, "size", 2);
|
|
@@ -10740,6 +10807,11 @@ const TablistAppearance = {
|
|
|
10740
10807
|
subtle: "subtle",
|
|
10741
10808
|
transparent: "transparent"
|
|
10742
10809
|
};
|
|
10810
|
+
const TablistSize = {
|
|
10811
|
+
small: "small",
|
|
10812
|
+
medium: "medium",
|
|
10813
|
+
large: "large"
|
|
10814
|
+
};
|
|
10743
10815
|
const TablistOrientation = Orientation;
|
|
10744
10816
|
|
|
10745
10817
|
var __defProp$4 = Object.defineProperty;
|
|
@@ -10831,12 +10903,7 @@ class BaseTablist extends FASTElement {
|
|
|
10831
10903
|
*/
|
|
10832
10904
|
orientationChanged(prev, next) {
|
|
10833
10905
|
this.elementInternals.ariaOrientation = next ?? TablistOrientation.horizontal;
|
|
10834
|
-
|
|
10835
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
10836
|
-
}
|
|
10837
|
-
if (next) {
|
|
10838
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
10839
|
-
}
|
|
10906
|
+
swapStates(this.elementInternals, prev, next, TablistOrientation);
|
|
10840
10907
|
if (this.$fastController.isConnected) {
|
|
10841
10908
|
this.setTabs();
|
|
10842
10909
|
}
|
|
@@ -10986,23 +11053,13 @@ class Tablist extends BaseTablist {
|
|
|
10986
11053
|
* @internal
|
|
10987
11054
|
*/
|
|
10988
11055
|
appearanceChanged(prev, next) {
|
|
10989
|
-
|
|
10990
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
10991
|
-
}
|
|
10992
|
-
if (next) {
|
|
10993
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
10994
|
-
}
|
|
11056
|
+
swapStates(this.elementInternals, prev, next, TablistAppearance);
|
|
10995
11057
|
}
|
|
10996
11058
|
/**
|
|
10997
11059
|
* @internal
|
|
10998
11060
|
*/
|
|
10999
11061
|
sizeChanged(prev, next) {
|
|
11000
|
-
|
|
11001
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
11002
|
-
}
|
|
11003
|
-
if (next) {
|
|
11004
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
11005
|
-
}
|
|
11062
|
+
swapStates(this.elementInternals, prev, next, TablistSize);
|
|
11006
11063
|
}
|
|
11007
11064
|
/**
|
|
11008
11065
|
* calculateAnimationProperties
|
|
@@ -11126,6 +11183,11 @@ const definition$4 = Tablist.compose({
|
|
|
11126
11183
|
|
|
11127
11184
|
definition$4.define(FluentDesignSystem.registry);
|
|
11128
11185
|
|
|
11186
|
+
const TextAreaSize = {
|
|
11187
|
+
small: "small",
|
|
11188
|
+
medium: "medium",
|
|
11189
|
+
large: "large"
|
|
11190
|
+
};
|
|
11129
11191
|
const TextAreaAppearance = {
|
|
11130
11192
|
outline: "outline",
|
|
11131
11193
|
filledLighter: "filled-lighter",
|
|
@@ -11214,13 +11276,8 @@ class BaseTextArea extends FASTElement {
|
|
|
11214
11276
|
}
|
|
11215
11277
|
}
|
|
11216
11278
|
resizeChanged(prev, next) {
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
}
|
|
11220
|
-
if (next) {
|
|
11221
|
-
toggleState(this.elementInternals, `resize-${next}`, true);
|
|
11222
|
-
}
|
|
11223
|
-
toggleState(this.elementInternals, `resize`, [TextAreaResize.both, TextAreaResize.horizontal, TextAreaResize.vertical].includes(this.resize));
|
|
11279
|
+
swapStates(this.elementInternals, prev, next, TextAreaResize, "resize-");
|
|
11280
|
+
toggleState(this.elementInternals, "resize", hasMatchingState(TextAreaResize, next) && next !== TextAreaResize.none);
|
|
11224
11281
|
}
|
|
11225
11282
|
/**
|
|
11226
11283
|
* The length of the current value.
|
|
@@ -11574,25 +11631,18 @@ class TextArea extends BaseTextArea {
|
|
|
11574
11631
|
});
|
|
11575
11632
|
}
|
|
11576
11633
|
appearanceChanged(prev, next) {
|
|
11577
|
-
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
if (!next || !Array.from(Object.values(TextAreaAppearance)).includes(next)) {
|
|
11581
|
-
toggleState(this.elementInternals, TextAreaAppearance.outline, true);
|
|
11634
|
+
toggleState(this.elementInternals, prev, false);
|
|
11635
|
+
if (hasMatchingState(TextAreaAppearance, next)) {
|
|
11636
|
+
toggleState(this.elementInternals, next, true);
|
|
11582
11637
|
} else {
|
|
11583
|
-
|
|
11638
|
+
this.appearance = TextAreaAppearance.outline;
|
|
11584
11639
|
}
|
|
11585
11640
|
}
|
|
11586
11641
|
blockChanged() {
|
|
11587
11642
|
toggleState(this.elementInternals, "block", this.block);
|
|
11588
11643
|
}
|
|
11589
11644
|
sizeChanged(prev, next) {
|
|
11590
|
-
|
|
11591
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
11592
|
-
}
|
|
11593
|
-
if (next) {
|
|
11594
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
11595
|
-
}
|
|
11645
|
+
swapStates(this.elementInternals, prev, next, TextAreaSize);
|
|
11596
11646
|
}
|
|
11597
11647
|
/**
|
|
11598
11648
|
* @internal
|
|
@@ -11669,6 +11719,17 @@ const definition$3 = TextArea.compose({
|
|
|
11669
11719
|
|
|
11670
11720
|
definition$3.define(FluentDesignSystem.registry);
|
|
11671
11721
|
|
|
11722
|
+
const TextInputControlSize = {
|
|
11723
|
+
small: "small",
|
|
11724
|
+
medium: "medium",
|
|
11725
|
+
large: "large"
|
|
11726
|
+
};
|
|
11727
|
+
const TextInputAppearance = {
|
|
11728
|
+
outline: "outline",
|
|
11729
|
+
underline: "underline",
|
|
11730
|
+
filledLighter: "filled-lighter",
|
|
11731
|
+
filledDarker: "filled-darker"
|
|
11732
|
+
};
|
|
11672
11733
|
const TextInputType = {
|
|
11673
11734
|
email: "email",
|
|
11674
11735
|
password: "password",
|
|
@@ -12053,12 +12114,7 @@ class TextInput extends BaseTextInput {
|
|
|
12053
12114
|
* @param next - the next state
|
|
12054
12115
|
*/
|
|
12055
12116
|
appearanceChanged(prev, next) {
|
|
12056
|
-
|
|
12057
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
12058
|
-
}
|
|
12059
|
-
if (next) {
|
|
12060
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
12061
|
-
}
|
|
12117
|
+
swapStates(this.elementInternals, prev, next, TextInputAppearance);
|
|
12062
12118
|
}
|
|
12063
12119
|
/**
|
|
12064
12120
|
* Handles changes to `control-size` attribute custom states
|
|
@@ -12066,12 +12122,7 @@ class TextInput extends BaseTextInput {
|
|
|
12066
12122
|
* @param next - the next state
|
|
12067
12123
|
*/
|
|
12068
12124
|
controlSizeChanged(prev, next) {
|
|
12069
|
-
|
|
12070
|
-
toggleState(this.elementInternals, `${prev}`, false);
|
|
12071
|
-
}
|
|
12072
|
-
if (next) {
|
|
12073
|
-
toggleState(this.elementInternals, `${next}`, true);
|
|
12074
|
-
}
|
|
12125
|
+
swapStates(this.elementInternals, prev, next, TextInputControlSize);
|
|
12075
12126
|
}
|
|
12076
12127
|
}
|
|
12077
12128
|
__decorateClass$2([attr], TextInput.prototype, "appearance", 2);
|
|
@@ -12083,7 +12134,7 @@ applyMixins(TextInput, StartEnd);
|
|
|
12083
12134
|
const styles$2 = css`
|
|
12084
12135
|
${display("block")}
|
|
12085
12136
|
|
|
12086
|
-
:host{font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};max-width:400px}.label{display:flex;color:${colorNeutralForeground1};padding-bottom:${spacingVerticalXS};flex-shrink:0;padding-inline-end:${spacingHorizontalXS}}.label[hidden],:host(:empty) .label{display:none}.root{align-items:center;background-color:${colorNeutralBackground1};border:${strokeWidthThin} solid ${colorNeutralStroke1};border-bottom-color:${colorNeutralStrokeAccessible};border-radius:${borderRadiusMedium};box-sizing:border-box;height:32px;display:inline-flex;flex-direction:row;gap:${spacingHorizontalXXS};padding:0 ${spacingHorizontalMNudge};position:relative;width:100%}:has(.control:user-invalid){border-color:${colorPaletteRedBorder2}}.root::after{box-sizing:border-box;content:'';position:absolute;left:-1px;bottom:0px;right:-1px;height:max(2px,${borderRadiusMedium});border-radius:0 0 ${borderRadiusMedium} ${borderRadiusMedium};border-bottom:2px solid ${colorCompoundBrandStroke};clip-path:inset(calc(100% - 2px) 1px 0px);transform:scaleX(0);transition-property:transform;transition-duration:${durationUltraFast};transition-delay:${curveAccelerateMid}}.control{width:100%;height:100%;box-sizing:border-box;color:${colorNeutralForeground1};border-radius:${borderRadiusMedium};background:${colorTransparentBackground};font-family:${fontFamilyBase};font-weight:${fontWeightRegular};font-size:${fontSizeBase300};border:none;vertical-align:center}.control:focus-visible{outline:0;border:0}.control::placeholder{color:${colorNeutralForeground4}}:host ::slotted([slot='start']),:host ::slotted([slot='end']){display:flex;align-items:center;justify-content:center;color:${colorNeutralForeground3};font-size:${fontSizeBase500}}:host ::slotted([slot='start']){padding-right:${spacingHorizontalXXS}}:host ::slotted([slot='end']){padding-left:${spacingHorizontalXXS};gap:${spacingHorizontalXS}}:host(:hover) .root{border-color:${colorNeutralStroke1Hover};border-bottom-color:${colorNeutralStrokeAccessibleHover}}:host(:active) .root{border-color:${colorNeutralStroke1Pressed}}:host(:focus-within) .root{outline:transparent solid 2px;border-bottom:0}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${durationNormal};transition-delay:${curveDecelerateMid}}:host(:focus-within:active) .root:after{border-bottom-color:${colorCompoundBrandStrokePressed}}:host(${outlineState}:focus-within) .root{border:${strokeWidthThin} solid ${colorNeutralStroke1}}:host(:focus-within) .control{color:${colorNeutralForeground1}}:host([disabled]) .root{background:${colorTransparentBackground};border:${strokeWidthThin} solid ${colorNeutralStrokeDisabled}}:host([disabled]) .control::placeholder,:host([disabled]) ::slotted([slot='start']),:host([disabled]) ::slotted([slot='end']){color:${colorNeutralForegroundDisabled}}::selection{color:${colorNeutralForegroundInverted};background-color:${colorNeutralBackgroundInverted}}:host(${smallState}) .control{font-size:${fontSizeBase200};font-weight:${fontWeightRegular};line-height:${lineHeightBase200}}:host(${smallState}) .root{height:24px;gap:${spacingHorizontalXXS};padding:0 ${spacingHorizontalSNudge}}:host(${smallState}) ::slotted([slot='start']),:host(${smallState}) ::slotted([slot='end']){font-size:${fontSizeBase400}}:host(${largeState}) .control{font-size:${fontSizeBase400};font-weight:${fontWeightRegular};line-height:${lineHeightBase400}}:host(${largeState}) .root{height:40px;gap:${spacingHorizontalS};padding:0 ${spacingHorizontalM}}:host(${largeState}) ::slotted([slot='start']),:host(${largeState}) ::slotted([slot='end']){font-size:${fontSizeBase600}}:host(${underlineState
|
|
12137
|
+
:host{font-family:${fontFamilyBase};font-size:${fontSizeBase300};font-weight:${fontWeightRegular};line-height:${lineHeightBase300};max-width:400px}.label{display:flex;color:${colorNeutralForeground1};padding-bottom:${spacingVerticalXS};flex-shrink:0;padding-inline-end:${spacingHorizontalXS}}.label[hidden],:host(:empty) .label{display:none}.root{align-items:center;background-color:${colorNeutralBackground1};border:${strokeWidthThin} solid ${colorNeutralStroke1};border-bottom-color:${colorNeutralStrokeAccessible};border-radius:${borderRadiusMedium};box-sizing:border-box;height:32px;display:inline-flex;flex-direction:row;gap:${spacingHorizontalXXS};padding:0 ${spacingHorizontalMNudge};position:relative;width:100%}:has(.control:user-invalid){border-color:${colorPaletteRedBorder2}}.root::after{box-sizing:border-box;content:'';position:absolute;left:-1px;bottom:0px;right:-1px;height:max(2px,${borderRadiusMedium});border-radius:0 0 ${borderRadiusMedium} ${borderRadiusMedium};border-bottom:2px solid ${colorCompoundBrandStroke};clip-path:inset(calc(100% - 2px) 1px 0px);transform:scaleX(0);transition-property:transform;transition-duration:${durationUltraFast};transition-delay:${curveAccelerateMid}}.control{width:100%;height:100%;box-sizing:border-box;color:${colorNeutralForeground1};border-radius:${borderRadiusMedium};background:${colorTransparentBackground};font-family:${fontFamilyBase};font-weight:${fontWeightRegular};font-size:${fontSizeBase300};border:none;vertical-align:center}.control:focus-visible{outline:0;border:0}.control::placeholder{color:${colorNeutralForeground4}}:host ::slotted([slot='start']),:host ::slotted([slot='end']){display:flex;align-items:center;justify-content:center;color:${colorNeutralForeground3};font-size:${fontSizeBase500}}:host ::slotted([slot='start']){padding-right:${spacingHorizontalXXS}}:host ::slotted([slot='end']){padding-left:${spacingHorizontalXXS};gap:${spacingHorizontalXS}}:host(:hover) .root{border-color:${colorNeutralStroke1Hover};border-bottom-color:${colorNeutralStrokeAccessibleHover}}:host(:active) .root{border-color:${colorNeutralStroke1Pressed}}:host(:focus-within) .root{outline:transparent solid 2px;border-bottom:0}:host(:focus-within) .root::after{transform:scaleX(1);transition-property:transform;transition-duration:${durationNormal};transition-delay:${curveDecelerateMid}}:host(:focus-within:active) .root:after{border-bottom-color:${colorCompoundBrandStrokePressed}}:host(${outlineState}:focus-within) .root{border:${strokeWidthThin} solid ${colorNeutralStroke1}}:host(:focus-within) .control{color:${colorNeutralForeground1}}:host([disabled]) .root{background:${colorTransparentBackground};border:${strokeWidthThin} solid ${colorNeutralStrokeDisabled}}:host([disabled]) .control::placeholder,:host([disabled]) ::slotted([slot='start']),:host([disabled]) ::slotted([slot='end']){color:${colorNeutralForegroundDisabled}}::selection{color:${colorNeutralForegroundInverted};background-color:${colorNeutralBackgroundInverted}}:host(${smallState}) .control{font-size:${fontSizeBase200};font-weight:${fontWeightRegular};line-height:${lineHeightBase200}}:host(${smallState}) .root{height:24px;gap:${spacingHorizontalXXS};padding:0 ${spacingHorizontalSNudge}}:host(${smallState}) ::slotted([slot='start']),:host(${smallState}) ::slotted([slot='end']){font-size:${fontSizeBase400}}:host(${largeState}) .control{font-size:${fontSizeBase400};font-weight:${fontWeightRegular};line-height:${lineHeightBase400}}:host(${largeState}) .root{height:40px;gap:${spacingHorizontalS};padding:0 ${spacingHorizontalM}}:host(${largeState}) ::slotted([slot='start']),:host(${largeState}) ::slotted([slot='end']){font-size:${fontSizeBase600}}:host(${underlineState}) .root{background:${colorTransparentBackground};border:0;border-radius:0;border-bottom:${strokeWidthThin} solid ${colorNeutralStrokeAccessible}}:host(${underlineState}:hover) .root{border-bottom-color:${colorNeutralStrokeAccessibleHover}}:host(${underlineState}:active) .root{border-bottom-color:${colorNeutralStrokeAccessiblePressed}}:host(${underlineState}:focus-within) .root{border:0;border-bottom-color:${colorNeutralStrokeAccessiblePressed}}:host(${underlineState}[disabled]) .root{border-bottom-color:${colorNeutralStrokeDisabled}}:host(${filledLighterState}) .root,:host(${filledDarkerState}) .root{border:${strokeWidthThin} solid ${colorTransparentStroke};box-shadow:${shadow2}}:host(${filledLighterState}) .root{background:${colorNeutralBackground1}}:host(${filledDarkerState}) .root{background:${colorNeutralBackground3}}:host(${filledLighterState}:hover) .root,:host(${filledDarkerState}:hover) .root{border-color:${colorTransparentStrokeInteractive}}:host(${filledLighterState}:active) .root,:host(${filledDarkerState}:active) .root{border-color:${colorTransparentStrokeInteractive};background:${colorNeutralBackground3}}`;
|
|
12087
12138
|
|
|
12088
12139
|
function textInputTemplate(options = {}) {
|
|
12089
12140
|
return html`<template @beforeinput="${(x, c) => x.beforeinputHandler(c.event)}" @focusin="${(x, c) => x.focusinHandler(c.event)}" @keydown="${(x, c) => x.keydownHandler(c.event)}"><label part="label" for="control" class="label" ${ref("controlLabel")}><slot ${slotted({
|
|
@@ -12104,6 +12155,36 @@ const definition$2 = TextInput.compose({
|
|
|
12104
12155
|
|
|
12105
12156
|
definition$2.define(FluentDesignSystem.registry);
|
|
12106
12157
|
|
|
12158
|
+
const TextSize = {
|
|
12159
|
+
_100: "100",
|
|
12160
|
+
_200: "200",
|
|
12161
|
+
_300: "300",
|
|
12162
|
+
_400: "400",
|
|
12163
|
+
_500: "500",
|
|
12164
|
+
_600: "600",
|
|
12165
|
+
_700: "700",
|
|
12166
|
+
_800: "800",
|
|
12167
|
+
_900: "900",
|
|
12168
|
+
_1000: "1000"
|
|
12169
|
+
};
|
|
12170
|
+
const TextFont = {
|
|
12171
|
+
base: "base",
|
|
12172
|
+
numeric: "numeric",
|
|
12173
|
+
monospace: "monospace"
|
|
12174
|
+
};
|
|
12175
|
+
const TextWeight = {
|
|
12176
|
+
medium: "medium",
|
|
12177
|
+
regular: "regular",
|
|
12178
|
+
semibold: "semibold",
|
|
12179
|
+
bold: "bold"
|
|
12180
|
+
};
|
|
12181
|
+
const TextAlign = {
|
|
12182
|
+
start: "start",
|
|
12183
|
+
end: "end",
|
|
12184
|
+
center: "center",
|
|
12185
|
+
justify: "justify"
|
|
12186
|
+
};
|
|
12187
|
+
|
|
12107
12188
|
var __defProp$1 = Object.defineProperty;
|
|
12108
12189
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
12109
12190
|
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
@@ -12134,12 +12215,7 @@ class Text extends FASTElement {
|
|
|
12134
12215
|
* @param next - the next state
|
|
12135
12216
|
*/
|
|
12136
12217
|
sizeChanged(prev, next) {
|
|
12137
|
-
|
|
12138
|
-
toggleState(this.elementInternals, `size-${prev}`, false);
|
|
12139
|
-
}
|
|
12140
|
-
if (next) {
|
|
12141
|
-
toggleState(this.elementInternals, `size-${next}`, true);
|
|
12142
|
-
}
|
|
12218
|
+
swapStates(this.elementInternals, prev, next, TextSize, "size-");
|
|
12143
12219
|
}
|
|
12144
12220
|
/**
|
|
12145
12221
|
* Handles changes to font attribute custom states
|
|
@@ -12147,12 +12223,7 @@ class Text extends FASTElement {
|
|
|
12147
12223
|
* @param next - the next state
|
|
12148
12224
|
*/
|
|
12149
12225
|
fontChanged(prev, next) {
|
|
12150
|
-
|
|
12151
|
-
toggleState(this.elementInternals, prev, false);
|
|
12152
|
-
}
|
|
12153
|
-
if (next) {
|
|
12154
|
-
toggleState(this.elementInternals, next, true);
|
|
12155
|
-
}
|
|
12226
|
+
swapStates(this.elementInternals, prev, next, TextFont);
|
|
12156
12227
|
}
|
|
12157
12228
|
/**
|
|
12158
12229
|
* Handles changes to weight attribute custom states
|
|
@@ -12160,12 +12231,7 @@ class Text extends FASTElement {
|
|
|
12160
12231
|
* @param next - the next state
|
|
12161
12232
|
*/
|
|
12162
12233
|
weightChanged(prev, next) {
|
|
12163
|
-
|
|
12164
|
-
toggleState(this.elementInternals, prev, false);
|
|
12165
|
-
}
|
|
12166
|
-
if (next) {
|
|
12167
|
-
toggleState(this.elementInternals, next, true);
|
|
12168
|
-
}
|
|
12234
|
+
swapStates(this.elementInternals, prev, next, TextWeight);
|
|
12169
12235
|
}
|
|
12170
12236
|
/**
|
|
12171
12237
|
* Handles changes to align attribute custom states
|
|
@@ -12173,12 +12239,7 @@ class Text extends FASTElement {
|
|
|
12173
12239
|
* @param next - the next state
|
|
12174
12240
|
*/
|
|
12175
12241
|
alignChanged(prev, next) {
|
|
12176
|
-
|
|
12177
|
-
toggleState(this.elementInternals, prev, false);
|
|
12178
|
-
}
|
|
12179
|
-
if (next) {
|
|
12180
|
-
toggleState(this.elementInternals, next, true);
|
|
12181
|
-
}
|
|
12242
|
+
swapStates(this.elementInternals, prev, next, TextAlign);
|
|
12182
12243
|
}
|
|
12183
12244
|
connectedCallback() {
|
|
12184
12245
|
super.connectedCallback();
|
|
@@ -12233,14 +12294,10 @@ __decorateClass$1([attr], Text.prototype, "font", 2);
|
|
|
12233
12294
|
__decorateClass$1([attr], Text.prototype, "weight", 2);
|
|
12234
12295
|
__decorateClass$1([attr], Text.prototype, "align", 2);
|
|
12235
12296
|
|
|
12236
|
-
const nowrapState = css.partial`:is([state--nowrap], :state(nowrap))`;
|
|
12237
|
-
const truncateState = css.partial`:is([state--truncate], :state(truncate))`;
|
|
12238
|
-
const underlineState = css.partial`:is([state--underline], :state(underline))`;
|
|
12239
|
-
const strikethroughState = css.partial`:is([state--strikethrough], :state(strikethrough))`;
|
|
12240
12297
|
const styles$1 = css`
|
|
12241
12298
|
${display("inline")}
|
|
12242
12299
|
|
|
12243
|
-
:host{contain:content;font-family:${fontFamilyBase};font-size:${fontSizeBase300};line-height:${lineHeightBase300};font-weight:${fontWeightRegular};text-align:start}:host(${nowrapState}),:host(${nowrapState}) ::slotted(*){white-space:nowrap;overflow:hidden}:host(${truncateState}),:host(${truncateState}) ::slotted(*){text-overflow:ellipsis}:host(
|
|
12300
|
+
:host{contain:content;font-family:${fontFamilyBase};font-size:${fontSizeBase300};line-height:${lineHeightBase300};font-weight:${fontWeightRegular};text-align:start}:host(${nowrapState}),:host(${nowrapState}) ::slotted(*){white-space:nowrap;overflow:hidden}:host(${truncateState}),:host(${truncateState}) ::slotted(*){text-overflow:ellipsis}:host(${blockState}){display:block}:host(${italicState}){font-style:italic}:host(${underlineState}){text-decoration-line:underline}:host(${strikethroughState}){text-decoration-line:line-through}:host(${underlineState}${strikethroughState}){text-decoration-line:line-through underline}:host(${size100State}){font-size:${fontSizeBase100};line-height:${lineHeightBase100}}:host(${size200State}){font-size:${fontSizeBase200};line-height:${lineHeightBase200}}:host(${size400State}){font-size:${fontSizeBase400};line-height:${lineHeightBase400}}:host(${size500State}){font-size:${fontSizeBase500};line-height:${lineHeightBase500}}:host(${size600State}){font-size:${fontSizeBase600};line-height:${lineHeightBase600}}:host(${size700State}){font-size:${fontSizeHero700};line-height:${lineHeightHero700}}:host(${size800State}){font-size:${fontSizeHero800};line-height:${lineHeightHero800}}:host(${size900State}){font-size:${fontSizeHero900};line-height:${lineHeightHero900}}:host(${size1000State}){font-size:${fontSizeHero1000};line-height:${lineHeightHero1000}}:host(${monospaceState}){font-family:${fontFamilyMonospace}}:host(${numericState}){font-family:${fontFamilyNumeric}}:host(${mediumState}){font-weight:${fontWeightMedium}}:host(${semiboldState}){font-weight:${fontWeightSemibold}}:host(${boldState}){font-weight:${fontWeightBold}}:host(${centerState}){text-align:center}:host(${endState}){text-align:end}:host(${justifyState}){text-align:justify}::slotted(*){font:inherit;line-height:inherit;text-decoration-line:inherit;text-align:inherit;text-decoration-line:inherit;margin:0}`;
|
|
12244
12301
|
|
|
12245
12302
|
const template$1 = html`<slot></slot>`;
|
|
12246
12303
|
|