@astryxdesign/core 0.6.3-canary.2c831e4 → 0.6.3-canary.3263b99
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/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +13 -28
- package/dist/Chat/ChatMessageBubble.d.ts +2 -0
- package/dist/Chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/Chat/ChatMessageBubble.js +5 -3
- package/dist/Dialog/DialogHeader.d.ts.map +1 -1
- package/dist/Dialog/DialogHeader.js +4 -4
- package/dist/Icon/Icon.d.ts +6 -31
- package/dist/Icon/Icon.d.ts.map +1 -1
- package/dist/Icon/Icon.js +8 -71
- package/dist/Icon/IconDefaultSizeContext.d.ts +4 -0
- package/dist/Icon/IconDefaultSizeContext.d.ts.map +1 -0
- package/dist/Icon/IconDefaultSizeContext.js +18 -0
- package/dist/Icon/IconSize.stylex.d.ts +65 -0
- package/dist/Icon/IconSize.stylex.d.ts.map +1 -0
- package/dist/Icon/IconSize.stylex.js +75 -0
- package/dist/Item/Item.d.ts +1 -1
- package/dist/Item/Item.d.ts.map +1 -1
- package/dist/Item/Item.js +4 -3
- package/dist/List/List.d.ts +19 -1
- package/dist/List/List.d.ts.map +1 -1
- package/dist/List/List.js +9 -2
- package/dist/List/ListContext.d.ts +1 -0
- package/dist/List/ListContext.d.ts.map +1 -1
- package/dist/List/ListContext.js +2 -1
- package/dist/List/ListItem.d.ts +1 -1
- package/dist/List/ListItem.d.ts.map +1 -1
- package/dist/List/ListItem.js +9 -2
- package/dist/MetadataList/MetadataList.js +3 -3
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +9 -2
- package/dist/astryx.css +7 -2
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +4 -0
- package/package.json +3 -3
- package/src/Button/Button.doc.mjs +4 -4
- package/src/Button/Button.tsx +15 -13
- package/src/Chat/ChatMessageBubble.doc.mjs +28 -15
- package/src/Chat/ChatMessageBubble.spec.md +263 -0
- package/src/Chat/ChatMessageBubble.test.tsx +93 -0
- package/src/Chat/ChatMessageBubble.tsx +8 -3
- package/src/Chat/__tests__/ChatMessageBubble.a11y.chromium.spec.ts +457 -0
- package/src/Chat/__tests__/ChatMessageBubble.auditProvenance.test.ts +91 -0
- package/src/Chat/__tests__/ChatMessageBubble.auditProvenance.ts +91 -0
- package/src/Dialog/Dialog.doc.mjs +2 -0
- package/src/Dialog/DialogHeader.doc.mjs +10 -0
- package/src/Dialog/DialogHeader.test.tsx +70 -3
- package/src/Dialog/DialogHeader.tsx +14 -5
- package/src/Dialog/modules/DialogHeader.spec.md +62 -40
- package/src/DropdownMenu/DropdownMenu.test.tsx +5 -2
- package/src/Icon/Icon.doc.mjs +7 -5
- package/src/Icon/Icon.spec.md +81 -40
- package/src/Icon/Icon.test.tsx +6 -3
- package/src/Icon/Icon.tsx +20 -68
- package/src/Icon/IconDefaultSizeContext.ts +23 -0
- package/src/Icon/IconSize.stylex.ts +70 -0
- package/src/IconButton/IconButton.doc.mjs +3 -3
- package/src/IconButton/IconButton.test.tsx +40 -0
- package/src/Item/Item.doc.mjs +4 -0
- package/src/Item/Item.tsx +9 -3
- package/src/List/List.doc.mjs +6 -0
- package/src/List/List.test.tsx +117 -1
- package/src/List/List.tsx +22 -2
- package/src/List/ListContext.tsx +3 -1
- package/src/List/ListItem.source-build.test.mjs +41 -0
- package/src/List/ListItem.tsx +26 -2
- package/src/MetadataList/MetadataList.test.tsx +4 -2
- package/src/MetadataList/MetadataList.tsx +3 -3
- package/src/Selector/Selector.tsx +11 -1
- package/src/Selector/__tests__/Selector.a11y.chromium.spec.ts +45 -0
- package/src/theme/derivedVarRegistry.test.ts +7 -0
- package/src/theme/derivedVarRegistry.ts +1 -0
- package/src/theme/generateThemeRules.test.ts +27 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../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AAM,CAAC,EACrB,KAAK,EACL,OAAqB,EACrB,IAAI,EAAE,QAAQ,EACd,IAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,eAAuB,EACvB,WAAW,EACX,IAAI,EACJ,UAAkB,EAClB,KAAK,EACL,SAAkB,EAClB,QAAQ,EACR,UAAU,EACV,OAAO,EACP,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,SAAS,CA8PzB;yBAvRe,MAAM"}
|
package/dist/Button/Button.js
CHANGED
|
@@ -24,6 +24,8 @@ import "../theme/tokens.stylex.js";
|
|
|
24
24
|
import { colorVars, sizeVars, spacingVars, radiusVars, borderVars, durationVars, easeVars, fontWeightVars, typeScaleVars, shadowVars, focusVars } from "../theme/tokens.stylex.js";
|
|
25
25
|
import { Spinner } from "../Spinner/index.js";
|
|
26
26
|
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
27
|
+
import { IconDefaultSizeProvider } from "../Icon/IconDefaultSizeContext.js";
|
|
28
|
+
import { iconBoxSizeStyles } from "../Icon/IconSize.stylex.js";
|
|
27
29
|
import { EDGE_COMP_ATTR } from "../Layout/edgeCompensation.stylex.js";
|
|
28
30
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
29
31
|
import { useButtonGroup } from "../ButtonGroup/ButtonGroupContext.js";
|
|
@@ -132,32 +134,6 @@ const sizeStyles = {
|
|
|
132
134
|
}
|
|
133
135
|
};
|
|
134
136
|
|
|
135
|
-
/**
|
|
136
|
-
* Icon size per button size.
|
|
137
|
-
* Matches Icon sizing: sm/md=16px, lg=20px.
|
|
138
|
-
* fontSize is set so emoji and text-based icons scale correctly.
|
|
139
|
-
*/
|
|
140
|
-
const iconSizeStyles = {
|
|
141
|
-
sm: {
|
|
142
|
-
kzqmXN: "x1kky2od",
|
|
143
|
-
kZKoxP: "xlup9mm",
|
|
144
|
-
kGuDYH: "x1j61zf2",
|
|
145
|
-
$$css: true
|
|
146
|
-
},
|
|
147
|
-
md: {
|
|
148
|
-
kzqmXN: "x1kky2od",
|
|
149
|
-
kZKoxP: "xlup9mm",
|
|
150
|
-
kGuDYH: "x1j61zf2",
|
|
151
|
-
$$css: true
|
|
152
|
-
},
|
|
153
|
-
lg: {
|
|
154
|
-
kzqmXN: "xw4jnvo",
|
|
155
|
-
kZKoxP: "x1qx5ct2",
|
|
156
|
-
kGuDYH: "xwsyq91",
|
|
157
|
-
$$css: true
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
137
|
/**
|
|
162
138
|
* Resting elevation for floating buttons (e.g. a FAB). `none` is the default
|
|
163
139
|
* flat button; `low`/`med`/`high` map to the shadow token scale. 'none' stays
|
|
@@ -221,6 +197,11 @@ const variants = {
|
|
|
221
197
|
* Button size type derived from the sizeStyles StyleX object
|
|
222
198
|
*/
|
|
223
199
|
|
|
200
|
+
const iconSizeByButtonSize = {
|
|
201
|
+
sm: 'sm',
|
|
202
|
+
md: 'sm',
|
|
203
|
+
lg: 'md'
|
|
204
|
+
};
|
|
224
205
|
const spinnerReveal = "x18re5ia-B";
|
|
225
206
|
const contentHide = "x188b6p3-B";
|
|
226
207
|
|
|
@@ -457,6 +438,7 @@ export function Button({
|
|
|
457
438
|
size,
|
|
458
439
|
elevation: buttonGroup ? 'none' : elevation
|
|
459
440
|
}), sharedStylexProps, className, style);
|
|
441
|
+
const iconSize = iconSizeByButtonSize[size];
|
|
460
442
|
const buttonContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
461
443
|
children: [isLoadingState && /*#__PURE__*/_jsx("span", {
|
|
462
444
|
...{
|
|
@@ -476,8 +458,11 @@ export function Button({
|
|
|
476
458
|
...stylex.props(styles.contentWrapper, isLoadingState && (delaySpinner ? loadingStyles.hiddenContentDelayed : loadingStyles.hiddenContent)),
|
|
477
459
|
"aria-hidden": isLoadingState || undefined,
|
|
478
460
|
children: [icon && /*#__PURE__*/_jsx("span", {
|
|
479
|
-
...stylex.props(styles.iconWrapper,
|
|
480
|
-
children:
|
|
461
|
+
...stylex.props(styles.iconWrapper, iconBoxSizeStyles[iconSize]),
|
|
462
|
+
children: /*#__PURE__*/_jsx(IconDefaultSizeProvider, {
|
|
463
|
+
value: iconSize,
|
|
464
|
+
children: icon
|
|
465
|
+
})
|
|
481
466
|
}), isIconOnly ? null : /*#__PURE__*/_jsx("span", {
|
|
482
467
|
...{
|
|
483
468
|
className: "xb3r6kr xlyipyv xeuugli"
|
|
@@ -43,6 +43,7 @@ export interface ChatMessageBubbleProps extends BaseProps<HTMLDivElement> {
|
|
|
43
43
|
variant?: ChatMessageBubbleVariant;
|
|
44
44
|
/**
|
|
45
45
|
* Sender name rendered above the bubble, aligned with bubble text padding.
|
|
46
|
+
* Non-rendering scalar values omit the aligned wrapper; numeric zero remains.
|
|
46
47
|
* Use when the first content in a message is a bubble.
|
|
47
48
|
* If the first content is raw (no bubble), use ChatMessage's `name`
|
|
48
49
|
* prop instead.
|
|
@@ -50,6 +51,7 @@ export interface ChatMessageBubbleProps extends BaseProps<HTMLDivElement> {
|
|
|
50
51
|
name?: ReactNode;
|
|
51
52
|
/**
|
|
52
53
|
* Metadata content rendered below the bubble, aligned with bubble text padding.
|
|
54
|
+
* Non-rendering scalar values omit the aligned wrapper; numeric zero remains.
|
|
53
55
|
* Use when the last content in a message is a bubble.
|
|
54
56
|
* If the last content is raw (no bubble), use ChatMessage's `metadata`
|
|
55
57
|
* prop instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMessageBubble.d.ts","sourceRoot":"","sources":["../../src/Chat/ChatMessageBubble.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAWrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAC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AgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,OAAkB,EAClB,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,MAAM,EACrB,GAAG,EACH,GAAG,IAAI,EACR,EAAE,sBAAsB,+BA6FxB;yBA1Ge,iBAAiB"}
|
|
@@ -31,7 +31,7 @@ import * as stylex from '@stylexjs/stylex';
|
|
|
31
31
|
import "../theme/tokens.stylex.js";
|
|
32
32
|
import { colorVars, spacingVars, radiusVars, typeScaleVars, typographyVars } from "../theme/tokens.stylex.js";
|
|
33
33
|
import { useChatMessageContext } from "./ChatContext.js";
|
|
34
|
-
import { mergeProps } from "../utils/index.js";
|
|
34
|
+
import { isRenderable, mergeProps } from "../utils/index.js";
|
|
35
35
|
import { themeProps } from "../utils/themeProps.js";
|
|
36
36
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
37
37
|
// =============================================================================
|
|
@@ -204,8 +204,10 @@ export function ChatMessageBubble({
|
|
|
204
204
|
const senderStyle = variant === 'ghost' ? styles.ghost : isUser ? styles.user : styles.assistant;
|
|
205
205
|
const groupStyle = group === 'first' ? isUser ? styles.groupFirstUser : styles.groupFirstAssistant : group === 'middle' ? isUser ? styles.groupMiddleUser : styles.groupMiddleAssistant : group === 'last' ? isUser ? styles.groupLastUser : styles.groupLastAssistant : null;
|
|
206
206
|
const metadataPaddingStyle = density === 'compact' ? styles.metadataPaddingCompact : density === 'spacious' ? styles.metadataPaddingSpacious : styles.metadataPaddingBalanced;
|
|
207
|
+
const hasName = isRenderable(name);
|
|
208
|
+
const hasMetadata = isRenderable(metadata);
|
|
207
209
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
208
|
-
children: [
|
|
210
|
+
children: [hasName && /*#__PURE__*/_jsx("div", {
|
|
209
211
|
"data-chat-name": true,
|
|
210
212
|
...stylex.props(metadataPaddingStyle, styles.nameRow, styles.headerReducedGap, isUser && styles.alignEnd),
|
|
211
213
|
children: name
|
|
@@ -219,7 +221,7 @@ export function ChatMessageBubble({
|
|
|
219
221
|
density
|
|
220
222
|
}), stylex.props(styles.content, density === 'compact' && styles.radiusCompact, senderStyle, paddingStyle, variant === 'ghost' && styles.paddingBlockNone, groupStyle, width != null && dynamicStyles.sizing(width), xstyle), className, styleProp),
|
|
221
223
|
children: children
|
|
222
|
-
}),
|
|
224
|
+
}), hasMetadata && /*#__PURE__*/_jsx("div", {
|
|
223
225
|
...stylex.props(metadataPaddingStyle, styles.metadataReducedGap, isUser && styles.alignEnd),
|
|
224
226
|
children: metadata
|
|
225
227
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogHeader.d.ts","sourceRoot":"","sources":["../../src/Dialog/DialogHeader.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAoB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAQxD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AA2C5C,MAAM,WAAW,iBAAkB,SAAQ,SAAS,CAAC,cAAc,CAAC;IAClE,wCAAwC;IACxC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;;;OAKG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IAE5C;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC;IAExD;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;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,+BAuGnB;yBApHe,YAAY"}
|
|
@@ -101,9 +101,9 @@ export function DialogHeader({
|
|
|
101
101
|
className: "x78zum5 x1cy8zhl x1qughib xjcht0a"
|
|
102
102
|
}),
|
|
103
103
|
children: [startContent && /*#__PURE__*/_jsx("div", {
|
|
104
|
-
...{
|
|
104
|
+
...mergeProps(themeProps('dialog-header-start-content'), {
|
|
105
105
|
className: "x78zum5 x6s0dn4 x1txdalj x2lah0s"
|
|
106
|
-
},
|
|
106
|
+
}),
|
|
107
107
|
children: startContent
|
|
108
108
|
}), /*#__PURE__*/_jsxs("div", {
|
|
109
109
|
...mergeProps(themeProps('dialog-header-title-block'), {
|
|
@@ -123,7 +123,7 @@ export function DialogHeader({
|
|
|
123
123
|
children: subtitle
|
|
124
124
|
})]
|
|
125
125
|
}), (endContent || onOpenChange) && /*#__PURE__*/_jsxs("div", {
|
|
126
|
-
...{
|
|
126
|
+
...mergeProps(themeProps('dialog-header-end-content'), {
|
|
127
127
|
0: {
|
|
128
128
|
className: "x78zum5 x6s0dn4 x1txdalj x2lah0s"
|
|
129
129
|
},
|
|
@@ -136,7 +136,7 @@ export function DialogHeader({
|
|
|
136
136
|
3: {
|
|
137
137
|
className: "x78zum5 x6s0dn4 x1txdalj x2lah0s xhzvc8f x3kzqx6"
|
|
138
138
|
}
|
|
139
|
-
}[!!shouldCompensateEndBlock << 1 | !!shouldCompensateEndInline << 0],
|
|
139
|
+
}[!!shouldCompensateEndBlock << 1 | !!shouldCompensateEndInline << 0]),
|
|
140
140
|
children: [endContent, onOpenChange && /*#__PURE__*/_jsx(Button, {
|
|
141
141
|
variant: "ghost",
|
|
142
142
|
label: t('@astryx.dialog.close'),
|
package/dist/Icon/Icon.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ import React, { type ComponentType, type SVGProps } from 'react';
|
|
|
21
21
|
import * as stylex from '@stylexjs/stylex';
|
|
22
22
|
import type { StyleXStyles } from '@stylexjs/stylex';
|
|
23
23
|
import type { IconName, NamespacedIconName } from './globalIconRegistry';
|
|
24
|
+
import { type IconSize } from './IconSize.stylex';
|
|
25
|
+
export type { IconSize } from './IconSize.stylex';
|
|
24
26
|
declare const colorStyles: Readonly<{
|
|
25
27
|
readonly primary: Readonly<{
|
|
26
28
|
readonly color: stylex.StyleXClassNameFor<"color", "light-dark(#0A1317, #DFE2E5)">;
|
|
@@ -80,35 +82,7 @@ declare const colorStyles: Readonly<{
|
|
|
80
82
|
readonly color: stylex.StyleXClassNameFor<"color", "light-dark(#5B08D8, #7952FF)">;
|
|
81
83
|
}>;
|
|
82
84
|
}>;
|
|
83
|
-
/**
|
|
84
|
-
* Size styles for direct SVG icon components.
|
|
85
|
-
* Uses width/height only — SVG components handle their own viewBox scaling.
|
|
86
|
-
*
|
|
87
|
-
* Sizes are expressed in `rem` (relative to the root font-size) so icons scale
|
|
88
|
-
* in step with text when the document font-size changes, matching the rest of
|
|
89
|
-
* the design system's rem-based type scale. Values are the px-equivalents at a
|
|
90
|
-
* 16px root: 12px → 0.75rem, 16px → 1rem, 20px → 1.25rem, 24px → 1.5rem.
|
|
91
|
-
*/
|
|
92
|
-
declare const sizeStyles: Readonly<{
|
|
93
|
-
readonly xsm: Readonly<{
|
|
94
|
-
readonly width: stylex.StyleXClassNameFor<"width", "0.75rem">;
|
|
95
|
-
readonly height: stylex.StyleXClassNameFor<"height", "0.75rem">;
|
|
96
|
-
}>;
|
|
97
|
-
readonly sm: Readonly<{
|
|
98
|
-
readonly width: stylex.StyleXClassNameFor<"width", "1rem">;
|
|
99
|
-
readonly height: stylex.StyleXClassNameFor<"height", "1rem">;
|
|
100
|
-
}>;
|
|
101
|
-
readonly md: Readonly<{
|
|
102
|
-
readonly width: stylex.StyleXClassNameFor<"width", "1.25rem">;
|
|
103
|
-
readonly height: stylex.StyleXClassNameFor<"height", "1.25rem">;
|
|
104
|
-
}>;
|
|
105
|
-
readonly lg: Readonly<{
|
|
106
|
-
readonly width: stylex.StyleXClassNameFor<"width", "1.5rem">;
|
|
107
|
-
readonly height: stylex.StyleXClassNameFor<"height", "1.5rem">;
|
|
108
|
-
}>;
|
|
109
|
-
}>;
|
|
110
85
|
export type IconColor = keyof typeof colorStyles;
|
|
111
|
-
export type IconSize = keyof typeof sizeStyles;
|
|
112
86
|
/**
|
|
113
87
|
* Type for icon components that can be passed to Icon.
|
|
114
88
|
* Use this type when accepting an icon prop in other components.
|
|
@@ -140,7 +114,9 @@ export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'color'
|
|
|
140
114
|
* - 'sm': 1rem (16px at a 16px root)
|
|
141
115
|
* - 'md': 1.25rem (20px at a 16px root)
|
|
142
116
|
* - 'lg': 1.5rem (24px at a 16px root)
|
|
143
|
-
*
|
|
117
|
+
*
|
|
118
|
+
* An explicit value wins. When omitted, Icon uses the nearest default supplied
|
|
119
|
+
* by an owning Astryx component for its icon slot, then falls back to 'md'.
|
|
144
120
|
*/
|
|
145
121
|
size?: IconSize;
|
|
146
122
|
/**
|
|
@@ -195,7 +171,7 @@ export interface IconProps extends Omit<SVGProps<SVGSVGElement>, 'ref' | 'color'
|
|
|
195
171
|
* <Icon icon="close" size="md" color="primary" />
|
|
196
172
|
* ```
|
|
197
173
|
*/
|
|
198
|
-
export declare function Icon({ icon, color, size, label, ref, className, style, xstyle, ...props }: IconProps): React.JSX.Element;
|
|
174
|
+
export declare function Icon({ icon, color, size: sizeProp, label, ref, className, style, xstyle, ...props }: IconProps): React.JSX.Element;
|
|
199
175
|
export declare namespace Icon {
|
|
200
176
|
var displayName: string;
|
|
201
177
|
}
|
|
@@ -210,5 +186,4 @@ export declare function renderIconSlot(icon: React.ReactNode | IconType, props?:
|
|
|
210
186
|
size?: IconSize;
|
|
211
187
|
color?: IconColor;
|
|
212
188
|
}): React.ReactNode;
|
|
213
|
-
export {};
|
|
214
189
|
//# sourceMappingURL=Icon.d.ts.map
|
package/dist/Icon/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.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G,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC/B;;;;;;OAMG;IACH,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,kBAAkB,CAAC;IAC/C;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAyBD;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,KAAiB,EACjB,IAAI,EAAE,QAAQ,EACd,KAAK,EACL,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,KAAK,EACT,EAAE,SAAS,qBAkDX;yBA5De,IAAI;;;AAqIpB;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,KAAK,CAAC,SAAS,GAAG,QAAQ,EAChC,KAAK,CAAC,EAAE;IAAC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAC,GAC3C,KAAK,CAAC,SAAS,CAYjB"}
|
package/dist/Icon/Icon.js
CHANGED
|
@@ -29,11 +29,13 @@ import { useThemeName } from "../theme/useTheme.js";
|
|
|
29
29
|
import { getIcon } from "./globalIconRegistry.js";
|
|
30
30
|
import { mergeProps } from "../utils/index.js";
|
|
31
31
|
import { themeProps } from "../utils/themeProps.js";
|
|
32
|
-
|
|
32
|
+
import { useIconSize } from "./IconDefaultSizeContext.js";
|
|
33
|
+
import { iconBoxSizeStyles, iconSizeStyles } from "./IconSize.stylex.js";
|
|
34
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
33
35
|
// =============================================================================
|
|
34
36
|
// Styles
|
|
35
37
|
// =============================================================================
|
|
36
|
-
|
|
38
|
+
|
|
37
39
|
const styles = {
|
|
38
40
|
root: {
|
|
39
41
|
kmuXW: "x2lah0s",
|
|
@@ -126,72 +128,6 @@ const colorStyles = {
|
|
|
126
128
|
}
|
|
127
129
|
};
|
|
128
130
|
|
|
129
|
-
/**
|
|
130
|
-
* Size styles for direct SVG icon components.
|
|
131
|
-
* Uses width/height only — SVG components handle their own viewBox scaling.
|
|
132
|
-
*
|
|
133
|
-
* Sizes are expressed in `rem` (relative to the root font-size) so icons scale
|
|
134
|
-
* in step with text when the document font-size changes, matching the rest of
|
|
135
|
-
* the design system's rem-based type scale. Values are the px-equivalents at a
|
|
136
|
-
* 16px root: 12px → 0.75rem, 16px → 1rem, 20px → 1.25rem, 24px → 1.5rem.
|
|
137
|
-
*/
|
|
138
|
-
const sizeStyles = {
|
|
139
|
-
xsm: {
|
|
140
|
-
kzqmXN: "x1jw3ynk",
|
|
141
|
-
kZKoxP: "xvle69y",
|
|
142
|
-
$$css: true
|
|
143
|
-
},
|
|
144
|
-
sm: {
|
|
145
|
-
kzqmXN: "xcdlrvm",
|
|
146
|
-
kZKoxP: "x1l36t39",
|
|
147
|
-
$$css: true
|
|
148
|
-
},
|
|
149
|
-
md: {
|
|
150
|
-
kzqmXN: "xwqq7k2",
|
|
151
|
-
kZKoxP: "xmll18r",
|
|
152
|
-
$$css: true
|
|
153
|
-
},
|
|
154
|
-
lg: {
|
|
155
|
-
kzqmXN: "xp8d6y2",
|
|
156
|
-
kZKoxP: "xam5rvr",
|
|
157
|
-
$$css: true
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Size styles for string-based (registry) icons.
|
|
163
|
-
* Includes fontSize so that 1em-based icons from the registry scale correctly.
|
|
164
|
-
*
|
|
165
|
-
* Expressed in `rem` for the same reason as {@link sizeStyles} — icons track the
|
|
166
|
-
* root font-size instead of being locked to absolute pixels.
|
|
167
|
-
*/
|
|
168
|
-
const spanSizeStyles = {
|
|
169
|
-
xsm: {
|
|
170
|
-
kzqmXN: "x1jw3ynk",
|
|
171
|
-
kZKoxP: "xvle69y",
|
|
172
|
-
kGuDYH: "xboafo0",
|
|
173
|
-
$$css: true
|
|
174
|
-
},
|
|
175
|
-
sm: {
|
|
176
|
-
kzqmXN: "xcdlrvm",
|
|
177
|
-
kZKoxP: "x1l36t39",
|
|
178
|
-
kGuDYH: "x1jchvi3",
|
|
179
|
-
$$css: true
|
|
180
|
-
},
|
|
181
|
-
md: {
|
|
182
|
-
kzqmXN: "xwqq7k2",
|
|
183
|
-
kZKoxP: "xmll18r",
|
|
184
|
-
kGuDYH: "x1603h9y",
|
|
185
|
-
$$css: true
|
|
186
|
-
},
|
|
187
|
-
lg: {
|
|
188
|
-
kzqmXN: "xp8d6y2",
|
|
189
|
-
kZKoxP: "xam5rvr",
|
|
190
|
-
kGuDYH: "xngnso2",
|
|
191
|
-
$$css: true
|
|
192
|
-
}
|
|
193
|
-
};
|
|
194
|
-
|
|
195
131
|
// =============================================================================
|
|
196
132
|
// Types
|
|
197
133
|
// =============================================================================
|
|
@@ -241,7 +177,7 @@ function getIconA11yProps(label) {
|
|
|
241
177
|
export function Icon({
|
|
242
178
|
icon,
|
|
243
179
|
color = 'inherit',
|
|
244
|
-
size
|
|
180
|
+
size: sizeProp,
|
|
245
181
|
label,
|
|
246
182
|
ref,
|
|
247
183
|
className,
|
|
@@ -249,6 +185,7 @@ export function Icon({
|
|
|
249
185
|
xstyle,
|
|
250
186
|
...props
|
|
251
187
|
}) {
|
|
188
|
+
const size = useIconSize(sizeProp);
|
|
252
189
|
// Derive ARIA from `label`: decorative (aria-hidden) by default, or a
|
|
253
190
|
// meaningful image (role="img" + aria-label) when `label` is non-empty.
|
|
254
191
|
const a11yProps = getIconA11yProps(label);
|
|
@@ -279,7 +216,7 @@ export function Icon({
|
|
|
279
216
|
...mergeProps(themeProps('icon', {
|
|
280
217
|
size,
|
|
281
218
|
color
|
|
282
|
-
}), stylex.props(styles.root, colorStyles[color],
|
|
219
|
+
}), stylex.props(styles.root, colorStyles[color], iconSizeStyles[size], xstyle), className ?? undefined, style),
|
|
283
220
|
...props
|
|
284
221
|
});
|
|
285
222
|
}
|
|
@@ -324,7 +261,7 @@ function IconFromRegistry({
|
|
|
324
261
|
...mergeProps(themeProps('icon', {
|
|
325
262
|
size,
|
|
326
263
|
color
|
|
327
|
-
}), stylex.props(styles.span, colorStyles[color],
|
|
264
|
+
}), stylex.props(styles.span, colorStyles[color], iconBoxSizeStyles[size], xstyle), className ?? undefined, style),
|
|
328
265
|
children: resolvedIcon
|
|
329
266
|
});
|
|
330
267
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IconSize } from './IconSize.stylex';
|
|
2
|
+
export declare const IconDefaultSizeProvider: import("react").Provider<"xsm" | "sm" | "lg" | "md" | null>;
|
|
3
|
+
export declare function useIconSize(size: IconSize | undefined): IconSize;
|
|
4
|
+
//# sourceMappingURL=IconDefaultSizeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconDefaultSizeContext.d.ts","sourceRoot":"","sources":["../../src/Icon/IconDefaultSizeContext.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAKhD,eAAO,MAAM,uBAAuB,6DAAkC,CAAC;AAEvE,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAGhE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
'use client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @file IconDefaultSizeContext.ts
|
|
7
|
+
* @input Uses React context and an optional Icon size prop
|
|
8
|
+
* @output Supplies a component-owned default size to descendant Icon instances
|
|
9
|
+
* @position Internal Icon sizing context; consumed by Icon and icon-slot owners
|
|
10
|
+
*/
|
|
11
|
+
import { createContext, use } from 'react';
|
|
12
|
+
const IconDefaultSizeContext = /*#__PURE__*/createContext(null);
|
|
13
|
+
IconDefaultSizeContext.displayName = 'IconDefaultSizeContext';
|
|
14
|
+
export const IconDefaultSizeProvider = IconDefaultSizeContext.Provider;
|
|
15
|
+
export function useIconSize(size) {
|
|
16
|
+
const contextualSize = use(IconDefaultSizeContext);
|
|
17
|
+
return size ?? contextualSize ?? 'md';
|
|
18
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file IconSize.stylex.ts
|
|
3
|
+
* @input Defines the Icon size scale
|
|
4
|
+
* @output Exports shared Icon size types and StyleX styles
|
|
5
|
+
* @position Internal Icon sizing source; consumed by Icon and icon-slot owners
|
|
6
|
+
*/
|
|
7
|
+
import * as stylex from '@stylexjs/stylex';
|
|
8
|
+
/**
|
|
9
|
+
* Icon sizes are expressed in `rem` so they scale with the root font-size.
|
|
10
|
+
* Values are the px-equivalents at a 16px root: 12, 16, 20, and 24px.
|
|
11
|
+
*/
|
|
12
|
+
declare const iconSizeValues: {
|
|
13
|
+
readonly xsm: "0.75rem";
|
|
14
|
+
readonly sm: "1rem";
|
|
15
|
+
readonly md: "1.25rem";
|
|
16
|
+
readonly lg: "1.5rem";
|
|
17
|
+
};
|
|
18
|
+
export type IconSize = keyof typeof iconSizeValues;
|
|
19
|
+
/** Size styles for direct SVG icon components. */
|
|
20
|
+
export declare const iconSizeStyles: Readonly<{
|
|
21
|
+
readonly xsm: Readonly<{
|
|
22
|
+
readonly width: stylex.StyleXClassNameFor<"width", "0.75rem">;
|
|
23
|
+
readonly height: stylex.StyleXClassNameFor<"height", "0.75rem">;
|
|
24
|
+
}>;
|
|
25
|
+
readonly sm: Readonly<{
|
|
26
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1rem">;
|
|
27
|
+
readonly height: stylex.StyleXClassNameFor<"height", "1rem">;
|
|
28
|
+
}>;
|
|
29
|
+
readonly md: Readonly<{
|
|
30
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1.25rem">;
|
|
31
|
+
readonly height: stylex.StyleXClassNameFor<"height", "1.25rem">;
|
|
32
|
+
}>;
|
|
33
|
+
readonly lg: Readonly<{
|
|
34
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1.5rem">;
|
|
35
|
+
readonly height: stylex.StyleXClassNameFor<"height", "1.5rem">;
|
|
36
|
+
}>;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Size styles for icon boxes and string-based registry icons. `fontSize`
|
|
40
|
+
* keeps 1em-based icons in step with the box.
|
|
41
|
+
*/
|
|
42
|
+
export declare const iconBoxSizeStyles: Readonly<{
|
|
43
|
+
readonly xsm: Readonly<{
|
|
44
|
+
readonly width: stylex.StyleXClassNameFor<"width", "0.75rem">;
|
|
45
|
+
readonly height: stylex.StyleXClassNameFor<"height", "0.75rem">;
|
|
46
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "0.75rem">;
|
|
47
|
+
}>;
|
|
48
|
+
readonly sm: Readonly<{
|
|
49
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1rem">;
|
|
50
|
+
readonly height: stylex.StyleXClassNameFor<"height", "1rem">;
|
|
51
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "1rem">;
|
|
52
|
+
}>;
|
|
53
|
+
readonly md: Readonly<{
|
|
54
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1.25rem">;
|
|
55
|
+
readonly height: stylex.StyleXClassNameFor<"height", "1.25rem">;
|
|
56
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "1.25rem">;
|
|
57
|
+
}>;
|
|
58
|
+
readonly lg: Readonly<{
|
|
59
|
+
readonly width: stylex.StyleXClassNameFor<"width", "1.5rem">;
|
|
60
|
+
readonly height: stylex.StyleXClassNameFor<"height", "1.5rem">;
|
|
61
|
+
readonly fontSize: stylex.StyleXClassNameFor<"fontSize", "1.5rem">;
|
|
62
|
+
}>;
|
|
63
|
+
}>;
|
|
64
|
+
export {};
|
|
65
|
+
//# sourceMappingURL=IconSize.stylex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IconSize.stylex.d.ts","sourceRoot":"","sources":["../../src/Icon/IconSize.stylex.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAE3C;;;GAGG;AACH,QAAA,MAAM,cAAc;;;;;CAKV,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,cAAc,CAAC;AAEnD,kDAAkD;AAClD,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;EAiBzB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;EAqB5B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file IconSize.stylex.ts
|
|
5
|
+
* @input Defines the Icon size scale
|
|
6
|
+
* @output Exports shared Icon size types and StyleX styles
|
|
7
|
+
* @position Internal Icon sizing source; consumed by Icon and icon-slot owners
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import * as stylex from '@stylexjs/stylex';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Icon sizes are expressed in `rem` so they scale with the root font-size.
|
|
14
|
+
* Values are the px-equivalents at a 16px root: 12, 16, 20, and 24px.
|
|
15
|
+
*/
|
|
16
|
+
const iconSizeValues = {
|
|
17
|
+
xsm: '0.75rem',
|
|
18
|
+
sm: '1rem',
|
|
19
|
+
md: '1.25rem',
|
|
20
|
+
lg: '1.5rem'
|
|
21
|
+
};
|
|
22
|
+
/** Size styles for direct SVG icon components. */
|
|
23
|
+
export const iconSizeStyles = {
|
|
24
|
+
xsm: {
|
|
25
|
+
kzqmXN: "x1jw3ynk",
|
|
26
|
+
kZKoxP: "xvle69y",
|
|
27
|
+
$$css: true
|
|
28
|
+
},
|
|
29
|
+
sm: {
|
|
30
|
+
kzqmXN: "xcdlrvm",
|
|
31
|
+
kZKoxP: "x1l36t39",
|
|
32
|
+
$$css: true
|
|
33
|
+
},
|
|
34
|
+
md: {
|
|
35
|
+
kzqmXN: "xwqq7k2",
|
|
36
|
+
kZKoxP: "xmll18r",
|
|
37
|
+
$$css: true
|
|
38
|
+
},
|
|
39
|
+
lg: {
|
|
40
|
+
kzqmXN: "xp8d6y2",
|
|
41
|
+
kZKoxP: "xam5rvr",
|
|
42
|
+
$$css: true
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Size styles for icon boxes and string-based registry icons. `fontSize`
|
|
48
|
+
* keeps 1em-based icons in step with the box.
|
|
49
|
+
*/
|
|
50
|
+
export const iconBoxSizeStyles = {
|
|
51
|
+
xsm: {
|
|
52
|
+
kzqmXN: "x1jw3ynk",
|
|
53
|
+
kZKoxP: "xvle69y",
|
|
54
|
+
kGuDYH: "xboafo0",
|
|
55
|
+
$$css: true
|
|
56
|
+
},
|
|
57
|
+
sm: {
|
|
58
|
+
kzqmXN: "xcdlrvm",
|
|
59
|
+
kZKoxP: "x1l36t39",
|
|
60
|
+
kGuDYH: "x1jchvi3",
|
|
61
|
+
$$css: true
|
|
62
|
+
},
|
|
63
|
+
md: {
|
|
64
|
+
kzqmXN: "xwqq7k2",
|
|
65
|
+
kZKoxP: "xmll18r",
|
|
66
|
+
kGuDYH: "x1603h9y",
|
|
67
|
+
$$css: true
|
|
68
|
+
},
|
|
69
|
+
lg: {
|
|
70
|
+
kzqmXN: "xp8d6y2",
|
|
71
|
+
kZKoxP: "xam5rvr",
|
|
72
|
+
kGuDYH: "xngnso2",
|
|
73
|
+
$$css: true
|
|
74
|
+
}
|
|
75
|
+
};
|
package/dist/Item/Item.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Item.tsx
|
|
3
3
|
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
4
|
-
* @output Exports Item component, ItemProps type
|
|
4
|
+
* @output Exports Item component, ItemProps type; publishes the shared inline inset
|
|
5
5
|
* @position Core layout primitive; consumed by index.ts, tested by Item.test.tsx
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update these files to stay in sync:
|
package/dist/Item/Item.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../src/Item/Item.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAgB,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAUpD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAgB5C,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAC3C,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;AAE9D,MAAM,WAAW,SAAU,SAAQ,SAAS,CAAC,WAAW,CAAC;IACvD,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAE7B;;;OAGG;IACH,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,MAAM,CAAC;IAE3B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IAEzB;;;OAGG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;;OAGG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IAEvB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH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L,WAAW,EACX,UAAU,EACV,KAAgB,EAChB,OAAoB,EACpB,UAAU,EACV,gBAAgB,EAChB,MAAkB,EAClB,OAAO,EACP,cAAc,EACd,IAAI,EACJ,MAAM,EAAE,eAAe,EACvB,GAAG,EAAE,YAAY,EACjB,aAAqB,EACrB,UAAkB,EAClB,UAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,IAAI,EACJ,GAAG,SAAS,EACb,EAAE,SAAS,+BAmOX;yBA7Pe,IAAI"}
|
package/dist/Item/Item.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file Item.tsx
|
|
7
7
|
* @input Uses React, ReactNode, StyleXStyles, theme tokens, useClickableContainer
|
|
8
|
-
* @output Exports Item component, ItemProps type
|
|
8
|
+
* @output Exports Item component, ItemProps type; publishes the shared inline inset
|
|
9
9
|
* @position Core layout primitive; consumed by index.ts, tested by Item.test.tsx
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update these files to stay in sync:
|
|
@@ -53,7 +53,8 @@ const styles = {
|
|
|
53
53
|
k1xSpc: "x78zum5",
|
|
54
54
|
kGNEyG: "x6s0dn4",
|
|
55
55
|
kOIVth: "x1txdalj",
|
|
56
|
-
|
|
56
|
+
"--_item-inset-inline": "xw1s368",
|
|
57
|
+
kg3NbH: "xaip428",
|
|
57
58
|
kVAEAm: "x1n2onr6",
|
|
58
59
|
kB7OPa: "x9f619",
|
|
59
60
|
k9WMMc: "x1yc453h",
|
|
@@ -149,7 +150,7 @@ const densityStyles = {
|
|
|
149
150
|
},
|
|
150
151
|
spacious: {
|
|
151
152
|
k8WAf4: "x8o8v82",
|
|
152
|
-
|
|
153
|
+
"--_item-inset-inline": "x1ytau7y",
|
|
153
154
|
$$css: true
|
|
154
155
|
}
|
|
155
156
|
};
|
package/dist/List/List.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file List.tsx
|
|
3
3
|
* @input Uses React, ReactNode, StyleXStyles, theme tokens, ListContext
|
|
4
|
+
* with optional inline edge compensation
|
|
4
5
|
* @output Exports List component, ListProps, ListDensity, ListStyle types
|
|
5
6
|
* @position Core implementation; consumed by index.ts, tested by List.test.tsx
|
|
6
7
|
*
|
|
@@ -35,6 +36,19 @@ export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement
|
|
|
35
36
|
* @default false
|
|
36
37
|
*/
|
|
37
38
|
hasDividers?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Compensates for each item's built-in inline inset, up to the container
|
|
41
|
+
* padding available on each edge. Use "inline" to bring row content toward
|
|
42
|
+
* sibling content such as a section heading. Content aligns when the
|
|
43
|
+
* container padding is at least the item inset; smaller padding leaves
|
|
44
|
+
* some inset uncompensated.
|
|
45
|
+
* The cancelling margin reads the same variable the items derive their
|
|
46
|
+
* inline padding from, so it tracks density and theme padding overrides
|
|
47
|
+
* automatically. Hover and selection backgrounds still extend past the
|
|
48
|
+
* text by the inset.
|
|
49
|
+
* Omit to leave item positions unchanged.
|
|
50
|
+
*/
|
|
51
|
+
edgeCompensation?: 'inline';
|
|
38
52
|
/**
|
|
39
53
|
* Header content rendered above the list.
|
|
40
54
|
* Semantically associated via aria-labelledby.
|
|
@@ -63,6 +77,10 @@ export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement
|
|
|
63
77
|
* Renders semantic `<ul>` or `<ol>` elements with configurable density,
|
|
64
78
|
* dividers, marker styles, and an optional header.
|
|
65
79
|
*
|
|
80
|
+
* Set `edgeCompensation="inline"` to compensate for the items' inline inset
|
|
81
|
+
* up to the container padding available on each edge, for alignment with
|
|
82
|
+
* sibling content such as a section heading.
|
|
83
|
+
*
|
|
66
84
|
* @example
|
|
67
85
|
* ```
|
|
68
86
|
* <List>
|
|
@@ -75,7 +93,7 @@ export interface ListProps extends BaseProps<HTMLUListElement | HTMLOListElement
|
|
|
75
93
|
* </List>
|
|
76
94
|
* ```
|
|
77
95
|
*/
|
|
78
|
-
export declare function List({ children, density, hasDividers, header, listStyle, start, xstyle, className, style, 'data-testid': testId, ref, ...props }: ListProps): import("react").JSX.Element;
|
|
96
|
+
export declare function List({ children, density, hasDividers, edgeCompensation, header, listStyle, start, xstyle, className, style, 'data-testid': testId, ref, ...props }: ListProps): import("react").JSX.Element;
|
|
79
97
|
export declare namespace List {
|
|
80
98
|
var displayName: string;
|
|
81
99
|
}
|