@astryxdesign/core 0.2.0-canary.29e72af → 0.2.0-canary.3d3d463

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 Center.tsx
3
- * @input Uses React, StyleX for centering styles
3
+ * @input Uses React, StyleX for centering styles, Layout padding.stylex for spacing-scale padding
4
4
  * @output Exports Center component and CenterProps
5
5
  * @position Center component for centering children horizontally/vertically
6
6
  *
@@ -12,7 +12,7 @@
12
12
  */
13
13
  import type { ReactNode } from 'react';
14
14
  import type { BaseProps } from '../BaseProps';
15
- import type { SizeValue } from '../utils/types';
15
+ import type { SizeValue, SpacingStep } from '../utils/types';
16
16
  export type CenterAxis = 'both' | 'horizontal' | 'vertical';
17
17
  export interface CenterProps extends BaseProps<HTMLDivElement> {
18
18
  /** Ref forwarded to the root element */
@@ -45,6 +45,23 @@ export interface CenterProps extends BaseProps<HTMLDivElement> {
45
45
  * Numbers are treated as pixels, strings are used as-is (e.g., '100%').
46
46
  */
47
47
  minHeight?: SizeValue;
48
+ /**
49
+ * Inner padding on all sides, using the spacing scale.
50
+ * Accepts numeric spacing steps: 0, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 8, 10.
51
+ *
52
+ * Matches the `padding` prop on `Stack`, `Card`, `LayoutContent`, and `LayoutPanel`.
53
+ */
54
+ padding?: SpacingStep;
55
+ /**
56
+ * Inline (horizontal) padding, using the spacing scale.
57
+ * Overrides `padding` on the inline axis when both are set.
58
+ */
59
+ paddingInline?: SpacingStep;
60
+ /**
61
+ * Block (vertical) padding, using the spacing scale.
62
+ * Overrides `padding` on the block axis when both are set.
63
+ */
64
+ paddingBlock?: SpacingStep;
48
65
  /**
49
66
  * Whether to make the container inline-flex (useful for text/icons).
50
67
  * @default false
@@ -68,7 +85,7 @@ export interface CenterProps extends BaseProps<HTMLDivElement> {
68
85
  * </Center>
69
86
  * ```
70
87
  */
71
- export declare function Center({ axis, width, height, maxWidth, minHeight, isInline, children, xstyle, className, style, ref, ...props }: CenterProps): import("react").JSX.Element;
88
+ export declare function Center({ axis, width, height, maxWidth, minHeight, padding, paddingInline, paddingBlock, isInline, children, xstyle, className, style, ref, ...props }: CenterProps): import("react").JSX.Element;
72
89
  export declare namespace Center {
73
90
  var displayName: string;
74
91
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Center.d.ts","sourceRoot":"","sources":["../../src/Center/Center.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAE5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAkC9C,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;AAE5D,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC5D,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,MAAM,CAAC,EACrB,IAAa,EACb,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAgB,EAChB,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH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EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,+BAgCb;yBAhDe,MAAM"}
@@ -4,7 +4,7 @@
4
4
 
5
5
  /**
6
6
  * @file Center.tsx
7
- * @input Uses React, StyleX for centering styles
7
+ * @input Uses React, StyleX for centering styles, Layout padding.stylex for spacing-scale padding
8
8
  * @output Exports Center component and CenterProps
9
9
  * @position Center component for centering children horizontally/vertically
10
10
  *
@@ -15,6 +15,7 @@
15
15
  * - /packages/cli/templates/blocks/components/Center/ (showcase blocks)
16
16
  */
17
17
  import * as stylex from '@stylexjs/stylex';
18
+ import { paddingInlineStyles, paddingBlockStyles } from "../Layout/padding.stylex.js";
18
19
  import { mergeProps } from "../utils/index.js";
19
20
  import { themeProps } from "../utils/themeProps.js";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -71,6 +72,9 @@ export function Center({
71
72
  height,
72
73
  maxWidth,
73
74
  minHeight,
75
+ padding,
76
+ paddingInline,
77
+ paddingBlock,
74
78
  isInline = false,
75
79
  children,
76
80
  xstyle,
@@ -79,9 +83,13 @@ export function Center({
79
83
  ref,
80
84
  ...props
81
85
  }) {
86
+ // Resolve padding to per-axis values: `padding` sets both axes; `paddingInline`
87
+ // / `paddingBlock` take precedence on their own axis when provided.
88
+ const resolvedPaddingInline = paddingInline ?? padding;
89
+ const resolvedPaddingBlock = paddingBlock ?? padding;
82
90
  const stylexProps = mergeProps(themeProps('center', {
83
91
  axis
84
- }), stylex.props(isInline ? styles.inline : styles.base, (axis === 'both' || axis === 'vertical') && styles.alignItemsCenter, (axis === 'both' || axis === 'horizontal') && styles.justifyContentCenter, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), xstyle), className, style);
92
+ }), stylex.props(isInline ? styles.inline : styles.base, (axis === 'both' || axis === 'vertical') && styles.alignItemsCenter, (axis === 'both' || axis === 'horizontal') && styles.justifyContentCenter, dynamicStyles.sizing(width ?? null, height ?? null, maxWidth ?? null, minHeight ?? null), resolvedPaddingInline != null && paddingInlineStyles[resolvedPaddingInline], resolvedPaddingBlock != null && paddingBlockStyles[resolvedPaddingBlock], xstyle), className, style);
85
93
  return /*#__PURE__*/_jsx("div", {
86
94
  ref: ref,
87
95
  ...stylexProps,
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAYtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqE5C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,SAAS,EACT,MAAM,GAAG,cAAc,GAAG,UAAU,CACrC;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,0BAA0B,+BAuE5B;yBAlFe,qBAAqB"}
1
+ {"version":3,"file":"DropdownMenuRadioItem.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuRadioItem.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAErE,OAAO,EAAiB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAYtD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqE5C,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,SAAS,EACT,MAAM,GAAG,cAAc,GAAG,UAAU,CACrC;IACC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,KAAK,EACL,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,UAAU,EACV,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,0BAA0B,+BAgF5B;yBA3Fe,qBAAqB"}
@@ -157,7 +157,11 @@ export function DropdownMenuRadioItem({
157
157
  disabled: isDisabled ? 'disabled' : null
158
158
  }), stylex.props(styles.circle, circleSizeStyles[controlSize], isChecked ? styles.checked : styles.unchecked)),
159
159
  children: isChecked && /*#__PURE__*/_jsx("span", {
160
- ...stylex.props(styles.dot, dotSizeStyles[controlSize])
160
+ ...mergeProps(themeProps('dropdown-menu-radio-dot', {
161
+ size: controlSize,
162
+ checked: 'checked',
163
+ disabled: isDisabled ? 'disabled' : null
164
+ }), stylex.props(styles.dot, dotSizeStyles[controlSize]))
161
165
  })
162
166
  }),
163
167
  startContent: icon ? renderIconSlot(icon, {
@@ -1 +1 @@
1
- {"version":3,"file":"DropdownMenuSubMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuSubMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAc,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAoB5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0F5C,UAAU,4BAA6B,SAAQ,IAAI,CACjD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,8CAA8C;IAC9C,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E;;;;;;;;OAQG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,SAAS,CA2UX;yBA7Ue,mBAAmB"}
1
+ {"version":3,"file":"DropdownMenuSubMenu.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/DropdownMenuSubMenu.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAc,EAOZ,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,EAAuB,KAAK,QAAQ,EAAC,MAAM,SAAS,CAAC;AAoB5D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA0F5C,UAAU,4BAA6B,SAAQ,IAAI,CACjD,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;IAC5B,8CAA8C;IAC9C,KAAK,EAAE,SAAS,CAAC;IACjB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,mCAAmC;IACnC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,4BAA4B;IAC5E;;;;;;;;OAQG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,wBAAwB,GAC9B,SAAS,CAmVX;yBArVe,mBAAmB"}
@@ -355,16 +355,16 @@ export function DropdownMenuSubMenu(props) {
355
355
  }
356
356
  }), [menuSize, close, menuCtx]);
357
357
  const endAffordance = hasSpinner ? /*#__PURE__*/_jsx("span", {
358
- ...{
358
+ ...mergeProps(themeProps('dropdown-menu-indicator-icon'), {
359
359
  className: "x78zum5 x6s0dn4"
360
- },
360
+ }),
361
361
  children: /*#__PURE__*/_jsx(Spinner, {
362
362
  size: "sm"
363
363
  })
364
364
  }) : /*#__PURE__*/_jsx("span", {
365
- ...{
365
+ ...mergeProps(themeProps('dropdown-menu-indicator-icon'), {
366
366
  className: "x78zum5 x6s0dn4"
367
- },
367
+ }),
368
368
  children: /*#__PURE__*/_jsx(Icon, {
369
369
  icon: "chevronRight",
370
370
  size: "sm",
@@ -1 +1 @@
1
- {"version":3,"file":"renderDropdownItems.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/renderDropdownItems.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAWrC,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AAyBxB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,SAAS,CA6D1E"}
1
+ {"version":3,"file":"renderDropdownItems.d.ts","sourceRoot":"","sources":["../../src/DropdownMenu/renderDropdownItems.tsx"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAYrC,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,gBAAgB,CAAC;AAyBxB;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,EAAE,GAAG,SAAS,CAwE1E"}
@@ -12,6 +12,7 @@ import { DropdownMenuItem } from "./DropdownMenuItem.js";
12
12
  import { DropdownMenuSubMenu } from "./DropdownMenuSubMenu.js";
13
13
  import "../theme/tokens.stylex.js";
14
14
  import { spacingVars, typographyVars, typeScaleVars, colorVars } from "../theme/tokens.stylex.js";
15
+ import { mergeProps, themeProps } from "../utils/index.js";
15
16
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
17
  const styles = {
17
18
  divider: {
@@ -36,17 +37,18 @@ export function renderDropdownItems(items) {
36
37
  const option = items[i];
37
38
  if ('type' in option && option.type === 'divider') {
38
39
  elements.push(/*#__PURE__*/_jsx(Divider, {
39
- xstyle: styles.divider
40
+ xstyle: styles.divider,
41
+ ...themeProps('dropdown-menu-divider')
40
42
  }, `divider-${i}`));
41
43
  } else if ('type' in option && option.type === 'section') {
42
44
  elements.push(/*#__PURE__*/_jsxs("div", {
43
45
  role: "group",
44
46
  "aria-label": option.title,
45
47
  children: [option.title && /*#__PURE__*/_jsx("div", {
46
- ...{
47
- className: "xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"
48
- },
49
48
  "aria-hidden": "true",
49
+ ...mergeProps(themeProps('dropdown-menu-section-heading'), {
50
+ className: "xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"
51
+ }),
50
52
  children: option.title
51
53
  }), option.items.map(item => /*#__PURE__*/_jsx(DropdownMenuItem, {
52
54
  icon: item.icon,