@byline/i18n 3.11.2 → 3.12.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.
@@ -3,6 +3,7 @@ import { useContext, useState } from "react";
3
3
  import { CheckIcon, Dropdown, GlobeIcon } from "@byline/ui/react";
4
4
  import classnames from "classnames";
5
5
  import { I18nContext } from "./i18n-context.js";
6
+ import language_menu_module from "./language-menu.module.js";
6
7
  function LanguageMenu({ className, color, disabled }) {
7
8
  const context = useContext(I18nContext);
8
9
  const [busy, setBusy] = useState(false);
@@ -30,14 +31,14 @@ function LanguageMenu({ className, color, disabled }) {
30
31
  type: "button",
31
32
  "aria-label": active?.nativeName ?? activeLocale,
32
33
  disabled: isDisabled,
33
- className: "component--byline-language-menu rounded flex items-center justify-between gap-1 outline-none disabled:opacity-50"
34
+ className: classnames('component--byline-language-menu', language_menu_module.trigger)
34
35
  }),
35
36
  children: [
36
37
  /*#__PURE__*/ jsx(GlobeIcon, {
37
38
  svgClassName: color
38
39
  }),
39
40
  /*#__PURE__*/ jsx("span", {
40
- className: classnames(color, 'hidden sm:inline mr-[4px]'),
41
+ className: classnames(color, language_menu_module.label),
41
42
  children: active?.nativeName ?? activeLocale
42
43
  })
43
44
  ]
@@ -46,23 +47,24 @@ function LanguageMenu({ className, color, disabled }) {
46
47
  children: /*#__PURE__*/ jsx(Dropdown.Content, {
47
48
  align: "center",
48
49
  sideOffset: 10,
49
- className: classnames('z-40 rounded radix-side-bottom:animate-slide-down radix-side-top:animate-slide-up', 'w-32 px-1.5 py-1 shadow-md', 'bg-white dark:bg-canvas-800 border dark:border-canvas-700 shadow'),
50
+ className: language_menu_module.content,
50
51
  children: localeDefinitions.map((def)=>{
51
52
  const isActive = def.code === activeLocale;
52
53
  return /*#__PURE__*/ jsx(Dropdown.Item, {
53
54
  onClick: ()=>handleSelect(def.code),
55
+ className: language_menu_module.item,
54
56
  children: /*#__PURE__*/ jsxs("div", {
55
- className: "flex",
57
+ className: language_menu_module.row,
56
58
  children: [
57
59
  /*#__PURE__*/ jsx("span", {
58
- className: "inline-block w-[22px]",
60
+ className: language_menu_module.checkCol,
59
61
  children: isActive && /*#__PURE__*/ jsx(CheckIcon, {
60
62
  width: "18px",
61
63
  height: "18px"
62
64
  })
63
65
  }),
64
66
  /*#__PURE__*/ jsx("span", {
65
- className: "text-left inline-block w-full flex-1 self-start text-black dark:text-gray-300",
67
+ className: language_menu_module.itemLabel,
66
68
  children: def.nativeName
67
69
  })
68
70
  ]
@@ -0,0 +1,10 @@
1
+ import "./language-menu_module.css";
2
+ const language_menu_module = {
3
+ trigger: "trigger-pxoSoA",
4
+ label: "label-mXnla0",
5
+ content: "content-kpGLEq",
6
+ row: "row-WcMFps",
7
+ checkCol: "checkCol-djBJoL",
8
+ itemLabel: "itemLabel-k0RYeM"
9
+ };
10
+ export default language_menu_module;
@@ -0,0 +1,52 @@
1
+ @layer base, byline-base, theme, byline-theme, byline-functional, byline-typography, components;
2
+
3
+ @layer byline-components {
4
+ .trigger-pxoSoA {
5
+ justify-content: space-between;
6
+ align-items: center;
7
+ gap: var(--gap-1);
8
+ color: inherit;
9
+ border-radius: var(--border-radius-sm);
10
+ outline: none;
11
+ display: flex;
12
+ }
13
+
14
+ .trigger-pxoSoA:disabled {
15
+ opacity: .5;
16
+ }
17
+
18
+ .label-mXnla0 {
19
+ margin-right: 4px;
20
+ display: none;
21
+ }
22
+
23
+ @media (min-width: 640px) {
24
+ .label-mXnla0 {
25
+ display: inline;
26
+ }
27
+ }
28
+
29
+ .byline-dropdown-content.content-kpGLEq {
30
+ width: 7rem;
31
+ padding: 4px 6px;
32
+ }
33
+
34
+ .row-WcMFps {
35
+ display: flex;
36
+ }
37
+
38
+ .checkCol-djBJoL {
39
+ width: 22px;
40
+ display: inline-block;
41
+ }
42
+
43
+ .itemLabel-k0RYeM {
44
+ text-align: left;
45
+ flex: 1;
46
+ align-self: flex-start;
47
+ width: 100%;
48
+ }
49
+ }
50
+
51
+ @layer utilities, byline-utilities;
52
+
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "type": "module",
5
5
  "license": "MPL-2.0",
6
- "version": "3.11.2",
6
+ "version": "3.12.0",
7
7
  "engines": {
8
8
  "node": ">=20.9.0"
9
9
  },
@@ -56,7 +56,7 @@
56
56
  "intl-messageformat": "^11.2.7",
57
57
  "negotiator": "^1.0.0",
58
58
  "npm-run-all": "^4.1.5",
59
- "@byline/ui": "3.11.2"
59
+ "@byline/ui": "3.12.0"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "react": "^19.0.0",