@eagami/ui 4.6.0 → 4.8.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": "@eagami/ui",
3
- "version": "4.6.0",
3
+ "version": "4.8.0",
4
4
  "description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -0,0 +1,38 @@
1
+ // Sign multiplier for horizontal translate animations: +1 in LTR, -1 in RTL, so
2
+ // a single `translateX(calc(<x> * var(--ea-rtl-sign)))` mirrors automatically.
3
+ :where(:root) {
4
+ --ea-rtl-sign: 1;
5
+ }
6
+
7
+ [dir='rtl'] {
8
+ --ea-rtl-sign: -1;
9
+ }
10
+
11
+ // Horizontally mirrors directional glyphs (prev/next chevrons, breadcrumb
12
+ // separators, transfer arrows) when an ancestor sets dir="rtl". Opt in by
13
+ // adding the `ea-rtl-flip` class to the icon element.
14
+ [dir='rtl'] .ea-rtl-flip {
15
+ transform: scaleX(-1);
16
+ }
17
+
18
+ // background-position has no logical keyword, so flip the paginator select's
19
+ // native chevron from the inline-end to the inline-start edge under RTL.
20
+ [dir='rtl'] .ea-paginator__select {
21
+ background-position: left 6px center;
22
+ }
23
+
24
+ // The tree disclosure chevron points toward the inline-start (left) when
25
+ // collapsed in RTL; the open state still rotates down. A 180deg turn keeps it in
26
+ // pure-rotation space so the expand transition stays smooth. Must live here, not
27
+ // the component, because the dir ancestor is outside its encapsulation scope.
28
+ [dir='rtl'] .ea-tree-node__chevron:not(.ea-tree-node__chevron--open) {
29
+ transform: rotate(180deg);
30
+ }
31
+
32
+ // Native fields use dir="auto" so typed LTR text stays LTR, but that resolves
33
+ // an empty field to LTR and parks its placeholder on the left. Pin them to the
34
+ // inline-end edge so every RTL field reads from the right like the others.
35
+ [dir='rtl'] input[dir='auto'],
36
+ [dir='rtl'] textarea[dir='auto'] {
37
+ text-align: right;
38
+ }
@@ -4,3 +4,4 @@
4
4
  @use 'tokens/index';
5
5
  @use 'reset';
6
6
  @use 'tooltip';
7
+ @use 'rtl';
@@ -7,7 +7,7 @@ import * as _eagami_ui from '@eagami/ui';
7
7
  * BCP 47 locale tags supported out of the box. Consumers select one of these
8
8
  * via `provideEagamiUi({ locale })` or `EagamiI18nService.setLocale()`.
9
9
  */
10
- type EagamiLocale = 'en' | 'de' | 'es-ES' | 'fr-FR' | 'is' | 'nl' | 'pl' | 'pt-BR' | 'el' | 'ru' | 'uk' | 'zh-CN';
10
+ type EagamiLocale = 'en' | 'de' | 'es-ES' | 'fr-FR' | 'is' | 'nl' | 'pl' | 'pt-BR' | 'el' | 'ru' | 'uk' | 'he' | 'ar' | 'hi' | 'zh-CN';
11
11
  /**
12
12
  * Display metadata for a built-in locale: the language's name in its own
13
13
  * language and a representative flag emoji.
@@ -16,6 +16,8 @@ interface EagamiLocaleMeta {
16
16
  locale: EagamiLocale;
17
17
  label: string;
18
18
  flag: string;
19
+ /** Reading direction of the locale's script, for consumers wiring `dir`. */
20
+ dir: 'ltr' | 'rtl';
19
21
  }
20
22
  /**
21
23
  * Display metadata for every built-in locale. The single source the Storybook
@@ -1575,8 +1577,11 @@ declare class DividerComponent {
1575
1577
  static ɵcmp: i0.ɵɵComponentDeclaration<DividerComponent, "ea-divider", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "thick": { "alias": "thick"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1576
1578
  }
1577
1579
 
1578
- /** Edge of the viewport from which the drawer slides in. */
1579
- type DrawerPosition = 'left' | 'right' | 'top' | 'bottom';
1580
+ /**
1581
+ * Edge of the viewport from which the drawer slides in. `start`/`end` are
1582
+ * direction-aware (start = left in LTR, right in RTL); `left`/`right` are fixed.
1583
+ */
1584
+ type DrawerPosition = 'left' | 'right' | 'top' | 'bottom' | 'start' | 'end';
1580
1585
  /** Width of the drawer panel along its primary axis. */
1581
1586
  type DrawerWidth = EaWidth;
1582
1587
  /**
@@ -2271,6 +2276,8 @@ interface PopoverPositionOptions {
2271
2276
  readonly margin?: number;
2272
2277
  /** Set the popover's width to match the anchor's. Useful for dropdown-style menus. */
2273
2278
  readonly matchAnchorWidth?: boolean;
2279
+ /** Right-to-left context. Swaps `-start`/`-end` alignment so they track the reading direction. */
2280
+ readonly rtl?: boolean;
2274
2281
  }
2275
2282
  interface Rect {
2276
2283
  readonly width: number;