@astryxdesign/core 0.2.0-canary.bdc7cde → 0.2.0-canary.c544487

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
  * @file FieldLabel.tsx
3
- * @input Uses React, Icon, IconType
3
+ * @input Uses React, Icon, IconType, useTranslator
4
4
  * @output Exports FieldLabel component, FieldLabelProps
5
5
  * @position Core label implementation; used by Field, CheckboxInput, Switch
6
6
  *
@@ -8,6 +8,7 @@
8
8
  * - /packages/core/src/Field/Field.doc.mjs (props table, features, implementation notes)
9
9
  * - /packages/core/src/Field/index.ts (exports if types change)
10
10
  * - /packages/cli/templates/blocks/components/Field/ (showcase blocks)
11
+ * - /packages/core/locales/en.json (@astryx.field.required / @astryx.field.optional)
11
12
  */
12
13
  import type { ReactNode } from 'react';
13
14
  import type { BaseProps } from '../BaseProps';
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLabel.d.ts","sourceRoot":"","sources":["../../src/Field/FieldLabel.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAU5C,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAkD5D,MAAM,WAAW,eAAgB,SAAQ,SAAS,CAAC,gBAAgB,CAAC;IAClE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAA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B;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,OAAO,EACP,OAAO,EACP,YAAoB,EACpB,aAAqB,EACrB,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,+BA+DjB;yBAjFe,UAAU"}
@@ -1,8 +1,10 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
+ 'use client';
4
+
3
5
  /**
4
6
  * @file FieldLabel.tsx
5
- * @input Uses React, Icon, IconType
7
+ * @input Uses React, Icon, IconType, useTranslator
6
8
  * @output Exports FieldLabel component, FieldLabelProps
7
9
  * @position Core label implementation; used by Field, CheckboxInput, Switch
8
10
  *
@@ -10,14 +12,15 @@
10
12
  * - /packages/core/src/Field/Field.doc.mjs (props table, features, implementation notes)
11
13
  * - /packages/core/src/Field/index.ts (exports if types change)
12
14
  * - /packages/cli/templates/blocks/components/Field/ (showcase blocks)
15
+ * - /packages/core/locales/en.json (@astryx.field.required / @astryx.field.optional)
13
16
  */
14
-
15
17
  import * as stylex from '@stylexjs/stylex';
16
18
  import { mergeProps } from "../utils/index.js";
17
19
  import "../theme/tokens.stylex.js";
18
20
  import { colorVars, fontWeightVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
19
21
  import { Icon, renderIconSlot } from "../Icon/index.js";
20
22
  import { Tooltip } from "../Tooltip/index.js";
23
+ import { useTranslator } from "../i18n/index.js";
21
24
  import { themeProps } from "../utils/themeProps.js";
22
25
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
23
26
  const styles = {
@@ -87,7 +90,8 @@ export function FieldLabel({
87
90
  ref,
88
91
  ...rest
89
92
  }) {
90
- const statusText = isOptional ? 'Optional' : isRequired ? 'Required' : null;
93
+ const t = useTranslator();
94
+ const statusText = isOptional ? t('@astryx.field.optional') : isRequired ? t('@astryx.field.required') : null;
91
95
 
92
96
  // A group label (e.g. for a radiogroup) must not be a literal `<label>`
93
97
  // element: a `<label>` semantically names a single form control and can't be
@@ -1 +1 @@
1
- {"version":3,"file":"TopNavMegaMenu.d.ts","sourceRoot":"","sources":["../../src/TopNav/TopNavMegaMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,EAKZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAmK5C,MAAM,WAAW,mBAAoB,SAAQ,SAAS,CAAC,iBAAiB,CAAC;IACvE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACnC,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gEAAgE;IAChE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,SAAS,CAAC,EA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vCe,cAAc"}
@@ -51,6 +51,12 @@ const styles = {
51
51
  k1tdAh: "x12p7p72",
52
52
  $$css: true
53
53
  },
54
+ panelViewportFit: {
55
+ k1xSpc: "x78zum5",
56
+ kXwgrk: "xdt5ytf",
57
+ kskxy: "xbhvqqn",
58
+ $$css: true
59
+ },
54
60
  drawerHeader: {
55
61
  kjj79g: "x1qughib",
56
62
  $$css: true
@@ -288,11 +294,11 @@ function DefaultMegaMenu({
288
294
  onMouseEnter: handleMouseEnter,
289
295
  onMouseLeave: handleMouseLeave,
290
296
  ...{
291
- className: "x1prclbq x11xkdxz x13fuv20 x1pc3f07 x1hviunn x1i5ehqx xb3r6kr"
297
+ className: "x1prclbq x11xkdxz x13fuv20 x1pc3f07 x1hviunn x1i5ehqx xb3r6kr x78zum5 xdt5ytf x2lwn1j"
292
298
  },
293
299
  children: /*#__PURE__*/_jsxs("div", {
294
300
  ...{
295
- className: "x78zum5 x1a02dak x1qh66ti x8o8v82 xrrkdod xyzno7u"
301
+ className: "x78zum5 x1a02dak x1qh66ti x8o8v82 xrrkdod x1m1aaou x9f619 x1odjw0f xish69e"
296
302
  },
297
303
  children: [items != null && /*#__PURE__*/_jsx("div", {
298
304
  ...{
@@ -313,7 +319,7 @@ function DefaultMegaMenu({
313
319
  }), {
314
320
  placement: 'below',
315
321
  alignment: slot,
316
- xstyle: styles.panelAnimation
322
+ xstyle: [styles.panelAnimation, styles.panelViewportFit]
317
323
  })]
318
324
  });
319
325
  }
package/dist/astryx.css CHANGED
@@ -1348,6 +1348,7 @@
1348
1348
  .x18s7i0i:not(#\#):not(#\#):not(#\#):not(#\#){max-height:176px}
1349
1349
  .x1xiyphd:not(#\#):not(#\#):not(#\#):not(#\#){max-height:240px}
1350
1350
  .xuyqlj2:not(#\#):not(#\#):not(#\#):not(#\#){max-height:300px}
1351
+ .xbhvqqn:not(#\#):not(#\#):not(#\#):not(#\#){max-height:calc(100% - var(--spacing-3))}
1351
1352
  .x7ab17h:not(#\#):not(#\#):not(#\#):not(#\#){max-height:none}
1352
1353
  .xenllk4:not(#\#):not(#\#):not(#\#):not(#\#){max-height:var(--container-max-height,none)}
1353
1354
  .x1jols5v:not(#\#):not(#\#):not(#\#):not(#\#){max-height:var(--x-maxHeight)}
@@ -1364,9 +1365,9 @@
1364
1365
  .x1ap80js:not(#\#):not(#\#):not(#\#):not(#\#){max-width:800px}
1365
1366
  .xq8v1hd:not(#\#):not(#\#):not(#\#):not(#\#){max-width:90%}
1366
1367
  .x95b5qq:not(#\#):not(#\#):not(#\#):not(#\#){max-width:90vw}
1367
- .xyzno7u:not(#\#):not(#\#):not(#\#):not(#\#){max-width:960px}
1368
1368
  .xl6temz:not(#\#):not(#\#):not(#\#):not(#\#){max-width:max(80%,280px)}
1369
1369
  .xxtfdz8:not(#\#):not(#\#):not(#\#):not(#\#){max-width:min(100%,calc(100vw - 32px))}
1370
+ .x1m1aaou:not(#\#):not(#\#):not(#\#):not(#\#){max-width:min(960px,calc(100dvw - var(--spacing-4)))}
1370
1371
  .x1x1rfll:not(#\#):not(#\#):not(#\#):not(#\#){max-width:none}
1371
1372
  .xjl2t3p:not(#\#):not(#\#):not(#\#):not(#\#){max-width:var(--layout-content-width,none)}
1372
1373
  .xf68679:not(#\#):not(#\#):not(#\#):not(#\#){max-width:var(--x-maxWidth)}