@alfadocs/ui-kit 0.25.0 → 0.25.1

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.25.0",
3
+ "packageVersion": "0.25.1",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -1,18 +1,18 @@
1
1
  import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { forwardRef as T, useRef as g, useImperativeHandle as A, useCallback as C, useMemo as I } from "react";
2
+ import { forwardRef as A, useRef as p, useImperativeHandle as C, useCallback as x, useMemo as I } from "react";
3
3
  import { c as N } from "../../_chunks/index-D2ZczOXr.js";
4
4
  import { useTranslation as E } from "react-i18next";
5
5
  import { I as o } from "../../_chunks/icon-button-C4CGcYuz.js";
6
6
  import { I as R } from "../../_chunks/icon-button-group-DeV3FpNY.js";
7
7
  import { D as r } from "../../_chunks/dropdown-menu-DZxwF23X.js";
8
- import { S as x } from "../../_chunks/switch-D916VW86.js";
9
- import { c as v, a as M, L as _ } from "../../_chunks/locale-picker-BxEUUPW7.js";
10
- import { u as H } from "../../_chunks/use-locale-BkCIHujH.js";
11
- import { u as O } from "../../_chunks/use-theme-B1cwAXJR.js";
12
- import { u as P } from "../../_chunks/registry-C9nwlNyL.js";
8
+ import { S as M } from "../../_chunks/switch-D916VW86.js";
9
+ import { c as v, a as _, L as H } from "../../_chunks/locale-picker-BxEUUPW7.js";
10
+ import { u as O } from "../../_chunks/use-locale-BkCIHujH.js";
11
+ import { u as P } from "../../_chunks/use-theme-B1cwAXJR.js";
12
+ import { u as j } from "../../_chunks/registry-C9nwlNyL.js";
13
13
  import { S as K } from "../../_chunks/settings-ca2Yi9R8.js";
14
- import { S as j, M as D, a as V } from "../../_chunks/sun-Eweh5fvi.js";
15
- const z = {
14
+ import { S as D, M as z, a as V } from "../../_chunks/sun-Eweh5fvi.js";
15
+ const B = {
16
16
  id: "header-settings",
17
17
  capabilities: ["view_change"],
18
18
  state: {},
@@ -53,19 +53,19 @@ const z = {
53
53
  }
54
54
  }
55
55
  };
56
- function B(t, i) {
56
+ function G(t, i) {
57
57
  if (!(typeof window > "u"))
58
58
  try {
59
59
  window.localStorage.setItem(t, i);
60
60
  } catch {
61
61
  }
62
62
  }
63
- function G(t) {
63
+ function W(t) {
64
64
  if (typeof document > "u") return;
65
65
  const i = document.documentElement;
66
66
  i.lang = t, i.dir = v[t].dir;
67
67
  }
68
- const W = N("ds:inline-flex ds:items-center", {
68
+ const F = N("ds:inline-flex ds:items-center", {
69
69
  variants: {
70
70
  align: {
71
71
  start: "",
@@ -73,30 +73,31 @@ const W = N("ds:inline-flex ds:items-center", {
73
73
  }
74
74
  },
75
75
  defaultVariants: { align: "end" }
76
- }), F = [
76
+ }), U = [
77
77
  "ds:w-[20rem] ds:p-[var(--spacing-xs)]",
78
78
  "ds:rounded-[var(--radius-md)] ds:border ds:border-border",
79
79
  "ds:bg-background ds:text-foreground ds:shadow-[var(--shadow-lg)]"
80
- ].join(" "), U = T(
80
+ ].join(" "), Y = A(
81
81
  (t, i) => {
82
82
  const {
83
- align: p = "end",
84
- disabled: y = !1,
85
- className: S,
83
+ align: g = "end",
84
+ size: y = "md",
85
+ disabled: S = !1,
86
+ className: w,
86
87
  id: m,
87
- ...w
88
- } = t, { t: s } = E(), n = O(), { setLocale: h } = H(), u = g(null);
89
- A(i, () => u.current, []);
90
- const f = C(
88
+ ...L
89
+ } = t, { t: s } = E(), n = P(), { setLocale: h } = O(), u = p(null);
90
+ C(i, () => u.current, []);
91
+ const f = x(
91
92
  (a) => {
92
- h(a), G(a), B(_, a);
93
+ h(a), W(a), G(H, a);
93
94
  },
94
95
  [h]
95
- ), b = g(f);
96
+ ), b = p(f);
96
97
  b.current = f;
97
- const c = g(n);
98
+ const c = p(n);
98
99
  c.current = n;
99
- const L = I(
100
+ const k = I(
100
101
  () => ({
101
102
  setLocale: (a) => {
102
103
  Object.prototype.hasOwnProperty.call(v, a) && b.current(a);
@@ -106,21 +107,22 @@ const W = N("ds:inline-flex ds:items-center", {
106
107
  }),
107
108
  []
108
109
  );
109
- P(z, L, m);
110
- const k = n.accessibility === "accessible";
110
+ j(B, k, m);
111
+ const T = n.accessibility === "accessible";
111
112
  return /* @__PURE__ */ e(
112
113
  "div",
113
114
  {
114
115
  ref: u,
115
116
  "data-component": "header-settings",
116
117
  "data-component-id": m,
117
- className: W({ align: p, className: S }),
118
- ...w,
118
+ className: F({ align: g, className: w }),
119
+ ...L,
119
120
  children: /* @__PURE__ */ d(r.Root, { children: [
120
121
  /* @__PURE__ */ e(r.Trigger, { asChild: !0, children: /* @__PURE__ */ e(
121
122
  o,
122
123
  {
123
- disabled: y,
124
+ size: y,
125
+ disabled: S,
124
126
  icon: /* @__PURE__ */ e(K, { "aria-hidden": !0 }),
125
127
  "aria-label": s("navigation.headerSettings.trigger")
126
128
  }
@@ -128,9 +130,9 @@ const W = N("ds:inline-flex ds:items-center", {
128
130
  /* @__PURE__ */ e(r.Portal, { children: /* @__PURE__ */ d(
129
131
  r.Content,
130
132
  {
131
- align: p,
133
+ align: g,
132
134
  sideOffset: 8,
133
- className: F,
135
+ className: U,
134
136
  onKeyDownCapture: (a) => {
135
137
  const l = a.target;
136
138
  (l == null ? void 0 : l.tagName) === "INPUT" && // Always allow Escape so the menu can close.
@@ -143,8 +145,17 @@ const W = N("ds:inline-flex ds:items-center", {
143
145
  {
144
146
  role: "group",
145
147
  "aria-label": s("navigation.headerSettings.language.label"),
146
- className: "ds:py-[var(--spacing-xs)]",
147
- children: /* @__PURE__ */ e(M.SearchList, {})
148
+ className: [
149
+ "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-xs)]",
150
+ // Stretch the compact LocalePicker to the full menu
151
+ // width so it reads as a single row affordance (not
152
+ // a centred pill). The picker's root is
153
+ // inline-flex; the `*:` child selector + `flex-1`
154
+ // gives it `flex: 1 1 0%` once it's a child of the
155
+ // flex container we make this div into.
156
+ "ds:flex ds:[&>*]:flex-1"
157
+ ].join(" "),
158
+ children: /* @__PURE__ */ e(_, { variant: "compact" })
148
159
  }
149
160
  ),
150
161
  /* @__PURE__ */ e(r.Separator, {}),
@@ -168,7 +179,7 @@ const W = N("ds:inline-flex ds:items-center", {
168
179
  /* @__PURE__ */ e(
169
180
  o,
170
181
  {
171
- icon: /* @__PURE__ */ e(j, { "aria-hidden": !0 }),
182
+ icon: /* @__PURE__ */ e(D, { "aria-hidden": !0 }),
172
183
  "aria-label": s("navigation.headerSettings.appearance.light"),
173
184
  value: "light"
174
185
  }
@@ -176,7 +187,7 @@ const W = N("ds:inline-flex ds:items-center", {
176
187
  /* @__PURE__ */ e(
177
188
  o,
178
189
  {
179
- icon: /* @__PURE__ */ e(D, { "aria-hidden": !0 }),
190
+ icon: /* @__PURE__ */ e(z, { "aria-hidden": !0 }),
180
191
  "aria-label": s("navigation.headerSettings.appearance.dark"),
181
192
  value: "dark"
182
193
  }
@@ -206,12 +217,12 @@ const W = N("ds:inline-flex ds:items-center", {
206
217
  ),
207
218
  className: "ds:px-[var(--spacing-sm)] ds:py-[var(--spacing-sm)]",
208
219
  children: /* @__PURE__ */ e(
209
- x,
220
+ M,
210
221
  {
211
222
  label: s("navigation.headerSettings.appearance.accessible"),
212
223
  labelSide: "start",
213
224
  size: "sm",
214
- checked: k,
225
+ checked: T,
215
226
  onCheckedChange: (a) => n.setAccessibility(a ? "accessible" : "default")
216
227
  }
217
228
  )
@@ -225,8 +236,8 @@ const W = N("ds:inline-flex ds:items-center", {
225
236
  );
226
237
  }
227
238
  );
228
- U.displayName = "HeaderSettings";
239
+ Y.displayName = "HeaderSettings";
229
240
  export {
230
- U as HeaderSettings
241
+ Y as HeaderSettings
231
242
  };
232
243
  //# sourceMappingURL=index.js.map