@uni-design-system/uni-angular 10.2.0 → 10.3.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uni-design-system/uni-angular",
3
- "version": "10.2.0",
3
+ "version": "10.3.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,7 +22,7 @@
22
22
  "@angular/core": "^21.2.0",
23
23
  "@angular/forms": "^21.2.0",
24
24
  "@emotion/css": "^11.0.0",
25
- "@uni-design-system/uni-core": "^10.2.0"
25
+ "@uni-design-system/uni-core": "^10.3.0"
26
26
  },
27
27
  "module": "fesm2022/uni-design-system-uni-angular.mjs",
28
28
  "typings": "types/uni-design-system-uni-angular.d.ts",
@@ -1403,6 +1403,15 @@ var buildComponents = (c) => ({
1403
1403
  cursor: "pointer",
1404
1404
  transition: "all 0.28s ease"
1405
1405
  },
1406
+ variantOptions: {
1407
+ primary: { focusColor: "primary" },
1408
+ secondary: { focusColor: "secondary" },
1409
+ tertiary: { focusColor: "tertiary" },
1410
+ warn: { focusColor: "warn" },
1411
+ success: { focusColor: "success" },
1412
+ disabled: { focusColor: "disabled" },
1413
+ ghost: { focusColor: "primary" }
1414
+ },
1406
1415
  variants: {
1407
1416
  ghost: {
1408
1417
  backgroundColor: "transparent",
@@ -1474,30 +1483,45 @@ var buildComponents = (c) => ({
1474
1483
  },
1475
1484
  iconButton: {
1476
1485
  options: { borderRadius: "max" },
1486
+ variantOptions: {
1487
+ primary: { focusColor: "primary" },
1488
+ secondary: { focusColor: "secondary" },
1489
+ tertiary: { focusColor: "tertiary" },
1490
+ warn: { focusColor: "warn" },
1491
+ success: { focusColor: "success" },
1492
+ disabled: { focusColor: "disabled" },
1493
+ ghost: { focusColor: "primary" }
1494
+ },
1477
1495
  variants: {
1478
1496
  ghost: {
1479
1497
  backgroundColor: "transparent",
1480
- color: "currentcolor"
1498
+ color: "currentcolor",
1499
+ "&:hover": { backgroundColor: "rgba(0,0,0,0.1)" }
1481
1500
  },
1482
1501
  primary: {
1483
1502
  backgroundColor: c.primary,
1484
- color: c["on-primary"]
1503
+ color: c["on-primary"],
1504
+ "&:hover": { boxShadow: BaseShadows.raised }
1485
1505
  },
1486
1506
  secondary: {
1487
1507
  backgroundColor: c.secondary,
1488
- color: c["on-secondary"]
1508
+ color: c["on-secondary"],
1509
+ "&:hover": { boxShadow: BaseShadows.raised }
1489
1510
  },
1490
1511
  tertiary: {
1491
1512
  backgroundColor: c.tertiary,
1492
- color: c["on-tertiary"]
1513
+ color: c["on-tertiary"],
1514
+ "&:hover": { boxShadow: BaseShadows.raised }
1493
1515
  },
1494
1516
  warn: {
1495
1517
  backgroundColor: c.warn,
1496
- color: c["on-warn"]
1518
+ color: c["on-warn"],
1519
+ "&:hover": { boxShadow: BaseShadows.raised }
1497
1520
  },
1498
1521
  success: {
1499
1522
  backgroundColor: c.success,
1500
- color: c["on-success"]
1523
+ color: c["on-success"],
1524
+ "&:hover": { boxShadow: BaseShadows.raised }
1501
1525
  },
1502
1526
  disabled: {
1503
1527
  backgroundColor: "transparent !important",
@@ -2159,7 +2183,7 @@ var UniThemes = {
2159
2183
  Object.keys(UniThemes)[0];
2160
2184
  //#endregion
2161
2185
  //#region package.json
2162
- var version = "10.2.0";
2186
+ var version = "10.3.0";
2163
2187
  //#endregion
2164
2188
  //#region schematics-src/ng-add/transforms.ts
2165
2189
  var addDependencies = (packageJsonText, deps) => {
@@ -3682,6 +3682,27 @@ declare class UniBreadcrumbComponent extends BaseComponent<UniBreadcrumbOptions>
3682
3682
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniBreadcrumbComponent, "uni-breadcrumb", never, { "items": { "alias": "items"; "required": true; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "itemClicked": "itemClicked"; }, never, never, true, never>;
3683
3683
  }
3684
3684
 
3685
+ /**
3686
+ * What a variant means for a button, as theme data the component reads.
3687
+ *
3688
+ * Only the keyboard-focus indicator lives here. Everything else a variant does
3689
+ * to a button is ordinary CSS and belongs in its `variants` style block; the
3690
+ * ring is different because it is drawn *outside* the element, so it cannot
3691
+ * take its colour from the fill and has to be named separately.
3692
+ */
3693
+ interface UniButtonVariant {
3694
+ /**
3695
+ * Keyboard-focus ring colour (WCAG 2.4.7).
3696
+ *
3697
+ * Falls back to the reserved `primary` accent. It must never resolve to
3698
+ * nothing: the ring used to take the variant *name* as a colour token, which
3699
+ * left `ghost` with a transparent outline and every unthemed or
3700
+ * consumer-registered intent with `2px solid undefined` — dropped by the CSS
3701
+ * parser, so the ring simply vanished while `outline-offset` survived and
3702
+ * kept the layout looking correct.
3703
+ */
3704
+ focusColor?: ColorKey;
3705
+ }
3685
3706
  /** Theme-level options for `uni-text-button`, resolved by token name. */
3686
3707
  interface UniButtonOptions {
3687
3708
  /**
@@ -3712,7 +3733,7 @@ declare class RippleDirective {
3712
3733
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<RippleDirective, "[uniRipple]", never, {}, {}, never, never, true, never>;
3713
3734
  }
3714
3735
 
3715
- declare class UniButtonComponent extends BaseComponent<UniButtonOptions> {
3736
+ declare class UniButtonComponent extends BaseComponent<UniButtonOptions, UniButtonVariant> {
3716
3737
  readonly disable: _angular_core.InputSignal<boolean>;
3717
3738
  readonly loading: _angular_core.InputSignal<boolean>;
3718
3739
  readonly fullWidth: _angular_core.InputSignal<boolean>;
@@ -3720,6 +3741,23 @@ declare class UniButtonComponent extends BaseComponent<UniButtonOptions> {
3720
3741
  readonly symbolRight: _angular_core.InputSignal<string>;
3721
3742
  spinnerBox: string;
3722
3743
  protected readonly className: _angular_core.Signal<string>;
3744
+ /**
3745
+ * The focus ring's colour, from the variant's theme entry.
3746
+ *
3747
+ * This used to be `colors[variant()]` — the variant *name* resolved as a
3748
+ * colour token. That held together only while every variant happened to also
3749
+ * be a colour, and it failed silently in both directions: `ghost` resolves to
3750
+ * `transparent`, and `light`/`onLight`/`dark`/`onDark` (and any name a
3751
+ * consumer registers) resolve to nothing, emitting `2px solid undefined`
3752
+ * which the parser drops. `outline-offset` survived either way, so the
3753
+ * element still shifted on focus and the missing ring went unnoticed.
3754
+ *
3755
+ * Falls back to the reserved `primary` accent rather than to `currentColor`:
3756
+ * the ring is drawn outside the element, so on a filled button
3757
+ * `currentColor` is the label colour and would sit near-invisibly against
3758
+ * the page rather than the button.
3759
+ */
3760
+ private readonly focusRingColor;
3723
3761
  symbolSize: _angular_core.Signal<number>;
3724
3762
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UniButtonComponent, never>;
3725
3763
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniButtonComponent, "button[uni-text-button], button[text-button]", never, { "disable": { "alias": "disable"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "fullWidth": { "alias": "fullWidth"; "required": false; "isSignal": true; }; "symbolLeft": { "alias": "symbolLeft"; "required": false; "isSignal": true; }; "symbolRight": { "alias": "symbolRight"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof RippleDirective; inputs: {}; outputs: {}; }]>;
@@ -4922,11 +4960,20 @@ declare class UniIconComponent {
4922
4960
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniIconComponent, "uni-icon", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
4923
4961
  }
4924
4962
 
4963
+ /**
4964
+ * What a variant means for an icon button, as theme data the component reads.
4965
+ * Mirrors `uni-button`'s: only the focus ring needs naming, because it is drawn
4966
+ * outside the element and so cannot take its colour from the fill.
4967
+ */
4968
+ interface UniIconButtonVariant {
4969
+ /** Keyboard-focus ring colour (WCAG 2.4.7). Falls back to `primary`. */
4970
+ focusColor?: ColorKey;
4971
+ }
4925
4972
  declare class UniIconButtonComponent {
4926
4973
  private theme;
4927
4974
  config: _angular_core.Signal<_uni_design_system_uni_core.ComponentTheme<{
4928
4975
  borderRadius?: RadiiSize;
4929
- }, object>>;
4976
+ }, UniIconButtonVariant>>;
4930
4977
  /**
4931
4978
  * Accessible name for the button. Alternative to projecting text content
4932
4979
  * (`<button icon-button>Close</button>`); one of the two is required for
@@ -4951,6 +4998,13 @@ declare class UniIconButtonComponent {
4951
4998
  */
4952
4999
  protected readonly glyphSize: _angular_core.Signal<string | number>;
4953
5000
  protected readonly className: _angular_core.Signal<string>;
5001
+ /**
5002
+ * The focus ring's colour, from the variant's theme entry — never from the
5003
+ * variant *name*, which is what left `uni-button`'s ring transparent on
5004
+ * `ghost` and absent on every unthemed intent. Falls back to the reserved
5005
+ * `primary` accent so a ring always renders.
5006
+ */
5007
+ private readonly focusRingColor;
4954
5008
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<UniIconButtonComponent, never>;
4955
5009
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<UniIconButtonComponent, "button[uni-icon-button], button[icon-button]", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "iconName": { "alias": "iconName"; "required": false; "isSignal": true; }; "symbolName": { "alias": "symbolName"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "disable": { "alias": "disable"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "opticalSize": { "alias": "opticalSize"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof RippleDirective; inputs: {}; outputs: {}; }]>;
4956
5010
  }