@astryxdesign/core 0.5.0-canary.f4d494c → 0.5.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.
- package/dist/Avatar/Avatar.d.ts +1 -25
- package/dist/Avatar/Avatar.d.ts.map +1 -1
- package/dist/Avatar/Avatar.js +9 -43
- package/dist/Avatar/index.d.ts +2 -2
- package/dist/Avatar/index.d.ts.map +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/AvatarGroup/AvatarGroup.d.ts +2 -9
- package/dist/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroup.js +2 -5
- package/dist/AvatarGroup/AvatarGroupContext.d.ts +1 -2
- package/dist/AvatarGroup/AvatarGroupContext.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.d.ts.map +1 -1
- package/dist/AvatarGroup/AvatarGroupOverflow.js +6 -10
- package/dist/DateInput/DateInput.d.ts +0 -43
- package/dist/DateInput/DateInput.d.ts.map +1 -1
- package/dist/DateInput/DateInput.js +0 -19
- package/dist/DateInput/index.d.ts +1 -1
- package/dist/DateInput/index.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/HoverCard/HoverCard.js +3 -52
- package/dist/HoverCard/useHoverCard.d.ts +2 -11
- package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
- package/dist/HoverCard/useHoverCard.js +0 -2
- package/dist/Indicator/CheckboxIndicator.d.ts.map +1 -1
- package/dist/Indicator/CheckboxIndicator.js +2 -6
- package/dist/Kbd/Kbd.d.ts.map +1 -1
- package/dist/Kbd/Kbd.js +26 -2
- package/dist/astryx.css +0 -21
- package/dist/hooks/useHotkeys.d.ts.map +1 -1
- package/dist/hooks/useHotkeys.js +25 -3
- package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
- package/dist/theme/derivedVarRegistry.js +0 -4
- package/dist/theme/syntax/tokens.d.ts +1 -1
- package/dist/theme/syntax/tokens.d.ts.map +1 -1
- package/dist/theme/syntax/tokens.js +2 -5
- package/package.json +3 -3
- package/src/Avatar/Avatar.doc.mjs +2 -12
- package/src/Avatar/Avatar.test.tsx +0 -80
- package/src/Avatar/Avatar.tsx +14 -64
- package/src/Avatar/index.ts +2 -2
- package/src/AvatarGroup/AvatarGroup.doc.mjs +2 -8
- package/src/AvatarGroup/AvatarGroup.test.tsx +0 -24
- package/src/AvatarGroup/AvatarGroup.tsx +4 -12
- package/src/AvatarGroup/AvatarGroupContext.ts +3 -5
- package/src/AvatarGroup/AvatarGroupOverflow.tsx +4 -10
- package/src/DateInput/DateInput.doc.mjs +0 -16
- package/src/DateInput/DateInput.tsx +0 -52
- package/src/DateInput/DateInputTouch.test.tsx +9 -32
- package/src/DateInput/index.ts +0 -1
- package/src/HoverCard/HoverCard.test.tsx +4 -84
- package/src/HoverCard/HoverCard.tsx +3 -65
- package/src/HoverCard/useHoverCard.tsx +2 -15
- package/src/Indicator/CheckboxIndicator.tsx +8 -14
- package/src/Indicator/Indicator.doc.mjs +0 -2
- package/src/Kbd/Kbd.test.tsx +17 -0
- package/src/Kbd/Kbd.tsx +26 -2
- package/src/hooks/useHotkeys.test.ts +18 -0
- package/src/hooks/useHotkeys.ts +25 -3
- package/src/theme/derivedVarRegistry.test.ts +0 -1
- package/src/theme/derivedVarRegistry.ts +0 -1
- package/src/theme/syntax/tokens.ts +2 -5
- package/dist/DateInput/NativeDateField.d.ts +0 -10
- package/dist/DateInput/NativeDateField.d.ts.map +0 -1
- package/dist/DateInput/NativeDateField.js +0 -477
- package/dist/utils/isApplePlatform.d.ts +0 -18
- package/dist/utils/isApplePlatform.d.ts.map +0 -1
- package/dist/utils/isApplePlatform.js +0 -37
- package/src/DateInput/NativeDateField.test.tsx +0 -565
- package/src/DateInput/NativeDateField.tsx +0 -623
- package/src/utils/isApplePlatform.test.ts +0 -61
- package/src/utils/isApplePlatform.ts +0 -37
package/dist/Avatar/Avatar.d.ts
CHANGED
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { type ReactNode } from 'react';
|
|
18
18
|
import type { BaseProps } from '../BaseProps';
|
|
19
|
-
import * as stylex from '@stylexjs/stylex';
|
|
20
19
|
import type { LinkComponentType } from '../Link/types';
|
|
21
20
|
/**
|
|
22
21
|
* Named size options.
|
|
@@ -34,25 +33,10 @@ type AvatarNumericSize = 16 | 20 | 24 | 32 | 36 | 40 | 48 | 60 | 64 | 72 | 96 |
|
|
|
34
33
|
* Avatar size - can be a named size or a specific pixel value
|
|
35
34
|
*/
|
|
36
35
|
export type AvatarSize = AvatarNamedSize | AvatarNumericSize;
|
|
37
|
-
/**
|
|
38
|
-
* Avatar shape options
|
|
39
|
-
*/
|
|
40
|
-
export type AvatarShape = 'circle' | 'rounded' | 'square';
|
|
41
36
|
/**
|
|
42
37
|
* Resolves named sizes to their numeric pixel values
|
|
43
38
|
*/
|
|
44
39
|
export declare function resolveSize(size: AvatarSize): number;
|
|
45
|
-
export declare const shapeStyles: Readonly<{
|
|
46
|
-
readonly circle: Readonly<{
|
|
47
|
-
readonly '--_avatar-radius': stylex.StyleXClassNameFor<"--_avatar-radius", "9999px">;
|
|
48
|
-
}>;
|
|
49
|
-
readonly rounded: Readonly<{
|
|
50
|
-
readonly '--_avatar-radius': stylex.StyleXClassNameFor<"--_avatar-radius", "8px">;
|
|
51
|
-
}>;
|
|
52
|
-
readonly square: Readonly<{
|
|
53
|
-
readonly '--_avatar-radius': stylex.StyleXClassNameFor<"--_avatar-radius", "0px">;
|
|
54
|
-
}>;
|
|
55
|
-
}>;
|
|
56
40
|
export interface AvatarProps extends BaseProps<HTMLDivElement> {
|
|
57
41
|
/** Ref forwarded to the root element */
|
|
58
42
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -85,14 +69,6 @@ export interface AvatarProps extends BaseProps<HTMLDivElement> {
|
|
|
85
69
|
* @default 'md'
|
|
86
70
|
*/
|
|
87
71
|
size?: AvatarSize;
|
|
88
|
-
/**
|
|
89
|
-
* Shape variant of the avatar.
|
|
90
|
-
* - 'circle': Full circle (default)
|
|
91
|
-
* - 'rounded': Rounded square
|
|
92
|
-
* - 'square': Sharp square
|
|
93
|
-
* @default 'circle'
|
|
94
|
-
*/
|
|
95
|
-
shape?: AvatarShape;
|
|
96
72
|
/**
|
|
97
73
|
* The primary image source for the avatar.
|
|
98
74
|
*/
|
|
@@ -171,7 +147,7 @@ export interface AvatarProps extends BaseProps<HTMLDivElement> {
|
|
|
171
147
|
* <Avatar src="/user.jpg" name="John Doe" onClick={() => openProfile()} />
|
|
172
148
|
* ```
|
|
173
149
|
*/
|
|
174
|
-
export declare function Avatar({ alt, 'data-testid': testId, fallbackSrc, name, size,
|
|
150
|
+
export declare function Avatar({ alt, 'data-testid': testId, fallbackSrc, name, size, src, status, tooltip, href, as, target, rel, onClick, xstyle, className, style, ref, ...props }: AvatarProps): import("react").JSX.Element;
|
|
175
151
|
export declare namespace Avatar {
|
|
176
152
|
var displayName: string;
|
|
177
153
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/Avatar/Avatar.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAsB5C,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AA4BrD;;;;;;GAMG;AACH,KAAK,eAAe,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,G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C;CAChD;AAwHD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,EACrB,GAAG,EACH,aAAa,EAAE,MAAM,EACrB,WAAW,EACX,IAAI,EACJ,IAAW,EACX,GAAG,EACH,MAAM,EACN,OAAc,EACd,IAAI,EACJ,EAAE,EACF,MAAM,EACN,GAAG,EACH,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,+BAkVb;yBArWe,MAAM"}
|
package/dist/Avatar/Avatar.js
CHANGED
|
@@ -77,10 +77,6 @@ const INITIALS_FONT_SIZE_RATIO = 0.4;
|
|
|
77
77
|
* Avatar size - can be a named size or a specific pixel value
|
|
78
78
|
*/
|
|
79
79
|
|
|
80
|
-
/**
|
|
81
|
-
* Avatar shape options
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
80
|
/**
|
|
85
81
|
* Resolves named sizes to their numeric pixel values
|
|
86
82
|
*/
|
|
@@ -102,28 +98,6 @@ export function resolveSize(size) {
|
|
|
102
98
|
}
|
|
103
99
|
}
|
|
104
100
|
|
|
105
|
-
// Sets one local custom property rather than `borderRadius` directly, so
|
|
106
|
-
// every clipping/ring surface that needs the shape's radius (the wrapper,
|
|
107
|
-
// the interactive focus ring, the content div that actually clips via
|
|
108
|
-
// `overflow: hidden`, and AvatarGroupOverflow's "+N" indicator) reads the
|
|
109
|
-
// same value instead of each hardcoding its own borderRadius independently.
|
|
110
|
-
// A theme override only has to reach this one property, not fight the
|
|
111
|
-
// per-surface StyleX class order to change the shape everywhere at once.
|
|
112
|
-
export const shapeStyles = {
|
|
113
|
-
circle: {
|
|
114
|
-
"--_avatar-radius": "xeincmr",
|
|
115
|
-
$$css: true
|
|
116
|
-
},
|
|
117
|
-
rounded: {
|
|
118
|
-
"--_avatar-radius": "xdarwi0",
|
|
119
|
-
$$css: true
|
|
120
|
-
},
|
|
121
|
-
square: {
|
|
122
|
-
"--_avatar-radius": "x877142",
|
|
123
|
-
$$css: true
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
101
|
/**
|
|
128
102
|
* Base styles for the avatar
|
|
129
103
|
* Uses a wrapper/content structure so status isn't clipped by overflow:hidden
|
|
@@ -133,7 +107,7 @@ const styles = {
|
|
|
133
107
|
kVAEAm: "x1n2onr6",
|
|
134
108
|
k1xSpc: "x3nfvp2",
|
|
135
109
|
kmuXW: "x2lah0s",
|
|
136
|
-
kaIpWk: "
|
|
110
|
+
kaIpWk: "xjspbzw",
|
|
137
111
|
$$css: true
|
|
138
112
|
},
|
|
139
113
|
fallback: {
|
|
@@ -164,7 +138,7 @@ const styles = {
|
|
|
164
138
|
kVVagm: "xln7xf2",
|
|
165
139
|
kybGjl: "x1hl2dhg",
|
|
166
140
|
kkrTdU: "x1ypdohk x16khyan",
|
|
167
|
-
kaIpWk: "
|
|
141
|
+
kaIpWk: "xjspbzw",
|
|
168
142
|
$$css: true
|
|
169
143
|
}
|
|
170
144
|
};
|
|
@@ -194,20 +168,15 @@ const dynamicStyles = {
|
|
|
194
168
|
fontSize: size => [_temp, {
|
|
195
169
|
"--x-fontSize": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(`${size * INITIALS_FONT_SIZE_RATIO}px`)
|
|
196
170
|
}],
|
|
197
|
-
|
|
171
|
+
statusPosition: size => [_temp2, {
|
|
198
172
|
"--x-bottom": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(size * CIRCLE_EDGE_OFFSET_RATIO),
|
|
199
173
|
"--x-insetInlineEnd": (val => typeof val === "number" ? val + "px" : val != null ? val : undefined)(size * CIRCLE_EDGE_OFFSET_RATIO)
|
|
200
|
-
}]
|
|
201
|
-
statusPositionCorner: {
|
|
202
|
-
krVfgx: "x1ey2m1c",
|
|
203
|
-
kt4wiu: "xtijo5x",
|
|
204
|
-
k3aq6I: "xv8yid9 x10fxb7p",
|
|
205
|
-
$$css: true
|
|
206
|
-
}
|
|
174
|
+
}]
|
|
207
175
|
};
|
|
208
176
|
const BORDER_WIDTH = 2;
|
|
209
177
|
const groupStyles = {
|
|
210
178
|
ring: {
|
|
179
|
+
kaIpWk: "xjspbzw",
|
|
211
180
|
kMzoRj: "xdh2fpr",
|
|
212
181
|
ksu8eU: "x1y0btm7",
|
|
213
182
|
kVAM5u: "x1touxvs",
|
|
@@ -364,7 +333,6 @@ export function Avatar({
|
|
|
364
333
|
fallbackSrc,
|
|
365
334
|
name,
|
|
366
335
|
size = 'md',
|
|
367
|
-
shape = 'circle',
|
|
368
336
|
src,
|
|
369
337
|
status,
|
|
370
338
|
tooltip = true,
|
|
@@ -416,7 +384,6 @@ export function Avatar({
|
|
|
416
384
|
} : undefined;
|
|
417
385
|
const avatarGroup = useAvatarGroup();
|
|
418
386
|
const resolvedSize = avatarGroup?.size ?? size;
|
|
419
|
-
const resolvedShape = avatarGroup?.shape ?? shape;
|
|
420
387
|
const numericSize = useMemo(() => resolveSize(resolvedSize), [resolvedSize]);
|
|
421
388
|
|
|
422
389
|
// Resolve the tooltip content:
|
|
@@ -520,7 +487,7 @@ export function Avatar({
|
|
|
520
487
|
const visualContent = /*#__PURE__*/_jsxs(_Fragment, {
|
|
521
488
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
522
489
|
...{
|
|
523
|
-
className: "x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xb3r6kr x87ps6o
|
|
490
|
+
className: "x78zum5 x6s0dn4 xl56j7k xh8yej3 x5yr21d xjspbzw xb3r6kr x87ps6o"
|
|
524
491
|
},
|
|
525
492
|
children: [showImage && /*#__PURE__*/_jsx("img", {
|
|
526
493
|
src: src,
|
|
@@ -552,7 +519,7 @@ export function Avatar({
|
|
|
552
519
|
})
|
|
553
520
|
})]
|
|
554
521
|
}), status && /*#__PURE__*/_jsx("div", {
|
|
555
|
-
...stylex.props(styles.status,
|
|
522
|
+
...stylex.props(styles.status, dynamicStyles.statusPosition(numericSize)),
|
|
556
523
|
children: status
|
|
557
524
|
})]
|
|
558
525
|
});
|
|
@@ -562,9 +529,8 @@ export function Avatar({
|
|
|
562
529
|
// tooltip tab-stop focus ring all live here so the interactive
|
|
563
530
|
// `<a>`/`<button>` and the static `<div>` carry the exact same box.
|
|
564
531
|
const rootStylexProps = mergeProps(themeProps('avatar', {
|
|
565
|
-
size: resolvedSize
|
|
566
|
-
|
|
567
|
-
}), focusOutlineProps.focusVisible(styles.wrapper, dynamicStyles.size(numericSize), isInteractive && styles.interactive, avatarGroup && groupStyles.ring, avatarGroup && groupStyles.overlap, avatarGroup && groupDynamicStyles.overlap(-avatarGroup.overlap), shapeStyles[resolvedShape], xstyle), className, style);
|
|
532
|
+
size: resolvedSize
|
|
533
|
+
}), focusOutlineProps.focusVisible(styles.wrapper, dynamicStyles.size(numericSize), isInteractive && styles.interactive, avatarGroup && groupStyles.ring, avatarGroup && groupStyles.overlap, avatarGroup && groupDynamicStyles.overlap(-avatarGroup.overlap), xstyle), className, style);
|
|
568
534
|
let rootElement;
|
|
569
535
|
|
|
570
536
|
// `props` is typed for the default `<div>` root (its event handlers are
|
package/dist/Avatar/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file index.ts
|
|
3
3
|
* @input Imports Avatar component and types from Avatar.tsx, AvatarStatusDot from AvatarStatusDot.tsx
|
|
4
|
-
* @output Exports Avatar, AvatarProps, AvatarSize,
|
|
4
|
+
* @output Exports Avatar, AvatarProps, AvatarSize, AvatarStatusDot, AvatarStatusDotProps, AvatarStatusDotVariant
|
|
5
5
|
* @position Component entry point; re-exported by /packages/core/src/index.ts
|
|
6
6
|
*
|
|
7
7
|
* SYNC: When modified, update this header and /packages/core/src/Avatar/Avatar.doc.mjs
|
|
@@ -32,7 +32,7 @@ export interface AvatarStatusDotVariantMap {
|
|
|
32
32
|
error: true;
|
|
33
33
|
}
|
|
34
34
|
export { Avatar, resolveSize } from './Avatar';
|
|
35
|
-
export type { AvatarProps, AvatarSize
|
|
35
|
+
export type { AvatarProps, AvatarSize } from './Avatar';
|
|
36
36
|
export { AvatarStatusDot } from './AvatarStatusDot';
|
|
37
37
|
export type { AvatarStatusDotProps, AvatarStatusDotVariant, } from './AvatarStatusDot';
|
|
38
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Avatar/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;CACb;AAED,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAC,WAAW,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Avatar/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,IAAI,CAAC;IACd,OAAO,EAAE,IAAI,CAAC;IACd,KAAK,EAAE,IAAI,CAAC;CACb;AAED,OAAO,EAAC,MAAM,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,UAAU,CAAC;AACtD,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,YAAY,EACV,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC"}
|
package/dist/Avatar/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @file index.ts
|
|
7
7
|
* @input Imports Avatar component and types from Avatar.tsx, AvatarStatusDot from AvatarStatusDot.tsx
|
|
8
|
-
* @output Exports Avatar, AvatarProps, AvatarSize,
|
|
8
|
+
* @output Exports Avatar, AvatarProps, AvatarSize, AvatarStatusDot, AvatarStatusDotProps, AvatarStatusDotVariant
|
|
9
9
|
* @position Component entry point; re-exported by /packages/core/src/index.ts
|
|
10
10
|
*
|
|
11
11
|
* SYNC: When modified, update this header and /packages/core/src/Avatar/Avatar.doc.mjs
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { type ReactNode } from 'react';
|
|
24
24
|
import type { BaseProps } from '../BaseProps';
|
|
25
|
-
import { type
|
|
25
|
+
import { type AvatarSize } from '../Avatar';
|
|
26
26
|
export interface AvatarGroupProps extends BaseProps<HTMLDivElement> {
|
|
27
27
|
/** Ref forwarded to the root element. */
|
|
28
28
|
ref?: React.Ref<HTMLDivElement>;
|
|
@@ -38,13 +38,6 @@ export interface AvatarGroupProps extends BaseProps<HTMLDivElement> {
|
|
|
38
38
|
* @default 'md'
|
|
39
39
|
*/
|
|
40
40
|
size?: AvatarSize;
|
|
41
|
-
/**
|
|
42
|
-
* Shape applied to all avatars via context, overriding each avatar's own
|
|
43
|
-
* `shape` prop so a group stays visually uniform. Also applied to the
|
|
44
|
-
* `AvatarGroupOverflow` "+N" indicator, so it matches the group.
|
|
45
|
-
* @default 'circle'
|
|
46
|
-
*/
|
|
47
|
-
shape?: AvatarShape;
|
|
48
41
|
/**
|
|
49
42
|
* Test ID for integration testing.
|
|
50
43
|
*/
|
|
@@ -68,7 +61,7 @@ export interface AvatarGroupProps extends BaseProps<HTMLDivElement> {
|
|
|
68
61
|
* </AvatarGroup>
|
|
69
62
|
* ```
|
|
70
63
|
*/
|
|
71
|
-
export declare function AvatarGroup({ children, size,
|
|
64
|
+
export declare function AvatarGroup({ children, size, 'data-testid': testId, 'aria-label': ariaLabelFromProps, 'aria-describedby': ariaDescribedByFromProps, onKeyDown, onFocus, xstyle, className, style, ref, ...props }: AvatarGroupProps): ReactNode;
|
|
72
65
|
export declare namespace AvatarGroup {
|
|
73
66
|
var displayName: string;
|
|
74
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAc,KAAK,
|
|
1
|
+
{"version":3,"file":"AvatarGroup.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAA2B,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC/D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAc,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAcvD,MAAM,WAAW,gBAAiB,SAAQ,SAAS,CAAC,cAAc,CAAC;IACjE,yCAAyC;IACzC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAChC;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AASD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,IAAW,EACX,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,kBAAkB,EAChC,kBAAkB,EAAE,wBAAwB,EAC5C,SAAS,EACT,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,SAAS,CAmE9B;yBAhFe,WAAW"}
|
|
@@ -66,7 +66,6 @@ const styles = {
|
|
|
66
66
|
export function AvatarGroup({
|
|
67
67
|
children,
|
|
68
68
|
size = 'md',
|
|
69
|
-
shape = 'circle',
|
|
70
69
|
'data-testid': testId,
|
|
71
70
|
'aria-label': ariaLabelFromProps,
|
|
72
71
|
'aria-describedby': ariaDescribedByFromProps,
|
|
@@ -84,10 +83,9 @@ export function AvatarGroup({
|
|
|
84
83
|
const overlap = Math.round(numericSize * OVERLAP_RATIO);
|
|
85
84
|
const contextValue = useMemo(() => ({
|
|
86
85
|
size,
|
|
87
|
-
shape,
|
|
88
86
|
overlap,
|
|
89
87
|
numericSize
|
|
90
|
-
}), [size,
|
|
88
|
+
}), [size, overlap, numericSize]);
|
|
91
89
|
|
|
92
90
|
// The keyboard hint and roving tab stop only make sense once the group has
|
|
93
91
|
// interactive children. Detect their presence from the rendered DOM after
|
|
@@ -129,8 +127,7 @@ export function AvatarGroup({
|
|
|
129
127
|
onKeyDown: composeEventHandlers(onKeyDown, handleKeyDown),
|
|
130
128
|
onFocus: composeEventHandlers(onFocus, handleFocus),
|
|
131
129
|
...mergeProps(themeProps('avatar-group', {
|
|
132
|
-
size
|
|
133
|
-
shape
|
|
130
|
+
size
|
|
134
131
|
}), stylex.props(styles.root, xstyle), className, style),
|
|
135
132
|
children: [children, hasInteractiveItems && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
136
133
|
id: hintId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroupContext.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupContext.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"AvatarGroupContext.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupContext.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,yDACsB,CAAC;AAGtD,wBAAgB,cAAc,IAAI,uBAAuB,GAAG,IAAI,CAE/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAa5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAQ5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"AvatarGroupOverflow.d.ts","sourceRoot":"","sources":["../../src/AvatarGroup/AvatarGroupOverflow.tsx"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAa5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAQ5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,SAAS,CAAC,WAAW,CAAC,EACtB,SAAS,CACV;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IAErB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAqFD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,IAAI,EACR,EAAE,wBAAwB,GAAG,SAAS,CA+DtC;yBAxEe,mBAAmB"}
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import * as stylex from '@stylexjs/stylex';
|
|
17
17
|
import "../theme/tokens.stylex.js";
|
|
18
|
-
import { colorVars, typographyVars, typeScaleVars, fontWeightVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
19
|
-
import { shapeStyles } from "../Avatar/Avatar.js";
|
|
18
|
+
import { colorVars, typographyVars, typeScaleVars, fontWeightVars, radiusVars, spacingVars } from "../theme/tokens.stylex.js";
|
|
20
19
|
import { mergeProps } from "../utils/index.js";
|
|
21
20
|
import { resolveSize } from "../Avatar/index.js";
|
|
22
21
|
import { useAvatarGroup } from "./AvatarGroupContext.js";
|
|
@@ -32,7 +31,7 @@ const styles = {
|
|
|
32
31
|
k1xSpc: "x3nfvp2",
|
|
33
32
|
kGNEyG: "x6s0dn4",
|
|
34
33
|
kjj79g: "xl56j7k",
|
|
35
|
-
kaIpWk: "
|
|
34
|
+
kaIpWk: "xjspbzw",
|
|
36
35
|
kWkggS: "x10xzikg",
|
|
37
36
|
kMwMTN: "xv1l7n4",
|
|
38
37
|
kMv6JI: "x9ynric",
|
|
@@ -110,7 +109,6 @@ export function AvatarGroupOverflow({
|
|
|
110
109
|
const t = useTranslator();
|
|
111
110
|
const group = useAvatarGroup();
|
|
112
111
|
const size = group?.size ?? 'md';
|
|
113
|
-
const shape = group?.shape ?? 'circle';
|
|
114
112
|
const numericSize = group?.numericSize ?? resolveSize('md');
|
|
115
113
|
const overlap = group?.overlap ?? 0;
|
|
116
114
|
|
|
@@ -131,9 +129,8 @@ export function AvatarGroupOverflow({
|
|
|
131
129
|
"aria-label": label,
|
|
132
130
|
"data-avatar-item": "",
|
|
133
131
|
...mergeProps(themeProps('avatar-group-overflow', {
|
|
134
|
-
size
|
|
135
|
-
|
|
136
|
-
}), focusOutlineProps.focusVisible(styles.base, styles.button, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), shapeStyles[shape], xstyle), className, style),
|
|
132
|
+
size
|
|
133
|
+
}), focusOutlineProps.focusVisible(styles.base, styles.button, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), xstyle), className, style),
|
|
137
134
|
children: content
|
|
138
135
|
});
|
|
139
136
|
}
|
|
@@ -142,9 +139,8 @@ export function AvatarGroupOverflow({
|
|
|
142
139
|
...rest,
|
|
143
140
|
"aria-label": label,
|
|
144
141
|
...mergeProps(themeProps('avatar-group-overflow', {
|
|
145
|
-
size
|
|
146
|
-
|
|
147
|
-
}), stylex.props(styles.base, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), shapeStyles[shape], xstyle), className, style),
|
|
142
|
+
size
|
|
143
|
+
}), stylex.props(styles.base, styles.overlap, dynamicStyles.size(numericSize), dynamicStyles.fontSize(numericSize), dynamicStyles.overlap(-overlap), xstyle), className, style),
|
|
148
144
|
children: content
|
|
149
145
|
});
|
|
150
146
|
}
|
|
@@ -31,16 +31,6 @@ export type DateInputSize = keyof typeof sizeStyles;
|
|
|
31
31
|
* types stay in compile-time lockstep: renaming or removing one of these
|
|
32
32
|
* members from `TimestampFormat` breaks this type at build time.
|
|
33
33
|
*/
|
|
34
|
-
/**
|
|
35
|
-
* When DateInput hands date picking to the browser/OS instead of its own
|
|
36
|
-
* surfaces.
|
|
37
|
-
*
|
|
38
|
-
* - `'touch'`: native on touch devices (coarse pointer), Astryx's calendar
|
|
39
|
-
* popover on mouse-driven ones
|
|
40
|
-
* - `'always'`: native wherever the browser supports `<input type="date">`
|
|
41
|
-
* - `'never'`: Astryx's own pickers everywhere
|
|
42
|
-
*/
|
|
43
|
-
export type DateInputNativePicker = 'touch' | 'always' | 'never';
|
|
44
34
|
export type DateInputFormat = Extract<TimestampFormat, 'date' | 'date_long' | 'date_weekday' | 'system_date'>;
|
|
45
35
|
export type { InputStatus as DateInputStatus, InputStatusType as DateInputStatusType, } from '../Field';
|
|
46
36
|
import type { BaseProps } from '../BaseProps';
|
|
@@ -212,39 +202,6 @@ export interface DateInputProps extends Omit<BaseProps, 'onChange' | 'defaultVal
|
|
|
212
202
|
* ```
|
|
213
203
|
*/
|
|
214
204
|
format?: DateInputFormat | ((value: ISODateString) => string);
|
|
215
|
-
/**
|
|
216
|
-
* When date picking is handed to the browser/OS instead of Astryx's own
|
|
217
|
-
* surfaces: the field becomes an `<input type="date">` and the platform
|
|
218
|
-
* draws the picker — the iOS wheel, the Android calendar dialog — with the
|
|
219
|
-
* OS's own hit areas, momentum scrolling, locale and accessibility
|
|
220
|
-
* settings.
|
|
221
|
-
*
|
|
222
|
-
* - `'touch'` (default): native on touch devices (coarse pointer), the text
|
|
223
|
-
* field and calendar popover on mouse-driven ones
|
|
224
|
-
* - `'always'`: native wherever the browser supports `<input type="date">`
|
|
225
|
-
* - `'never'`: Astryx's own pickers everywhere — the touch picker on a
|
|
226
|
-
* finger, the calendar popover on a mouse
|
|
227
|
-
*
|
|
228
|
-
* `format` and `placeholder` still apply in native mode: DateInput paints
|
|
229
|
-
* the closed field's text itself, over the control. `numberOfMonths` and
|
|
230
|
-
* `weekStartsOn` do not — they describe a calendar grid the native picker
|
|
231
|
-
* does not have — so a field that needs either should pass `'never'`.
|
|
232
|
-
*
|
|
233
|
-
* `min` and `max` are forwarded, but note that a native picker may not
|
|
234
|
-
* *show* them: on iOS they are constraint-validation flags rather than
|
|
235
|
-
* clamps, so an out-of-range date can be selected and is refused on commit
|
|
236
|
-
* (announced to assistive technology) rather than being greyed out in the
|
|
237
|
-
* picker. `dateConstraints` is enforced the same way, on commit, and is
|
|
238
|
-
* reason enough to prefer `'never'` on a field that uses it.
|
|
239
|
-
*
|
|
240
|
-
* @default 'touch'
|
|
241
|
-
* @example
|
|
242
|
-
* ```
|
|
243
|
-
* // Astryx's own touch picker instead of the platform's
|
|
244
|
-
* <DateInput label="Event date" value={date} onChange={setDate} nativePicker="never" />
|
|
245
|
-
* ```
|
|
246
|
-
*/
|
|
247
|
-
nativePicker?: DateInputNativePicker;
|
|
248
205
|
}
|
|
249
206
|
/**
|
|
250
207
|
* A date picker that fits the pointer it is being used with.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAOlB,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"DateInput.d.ts","sourceRoot":"","sources":["../../src/DateInput/DateInput.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAS3C,OAAO,EAGL,KAAK,WAAW,EAKhB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AAOlB,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,aAAa,EACnB,MAAM,aAAa,CAAC;AAcrB,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAiDlD,QAAA,MAAM,UAAU;;;;;;;;;;;;;EAad,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,UAAU,CAAC;AAEpD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CACnC,e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AE,aAAa,CAAC,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC;IAEzD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,kBAAkB,CAAC;IAEnC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;IAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,EAAE,eAAe,GAAG,CAAC,CAAC,KAAK,EAAE,aAAa,KAAK,MAAM,CAAC,CAAC;CAC/D;AAmeD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,+BAQ9C;yBARe,SAAS"}
|
|
@@ -32,7 +32,6 @@ import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
|
|
|
32
32
|
import { useMediaQuery } from "../hooks/useMediaQuery.js";
|
|
33
33
|
import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
|
|
34
34
|
import { usePopover } from "../Popover/index.js";
|
|
35
|
-
import { NativeDateField } from "./NativeDateField.js";
|
|
36
35
|
import { TouchDateField } from "./TouchDateField.js";
|
|
37
36
|
import { useTooltip } from "../Tooltip/index.js";
|
|
38
37
|
import { getInputARIA, isImeKeyEvent, parseDateInput } from "../utils/index.js";
|
|
@@ -88,15 +87,6 @@ const sizeStyles = {
|
|
|
88
87
|
* types stay in compile-time lockstep: renaming or removing one of these
|
|
89
88
|
* members from `TimestampFormat` breaks this type at build time.
|
|
90
89
|
*/
|
|
91
|
-
/**
|
|
92
|
-
* When DateInput hands date picking to the browser/OS instead of its own
|
|
93
|
-
* surfaces.
|
|
94
|
-
*
|
|
95
|
-
* - `'touch'`: native on touch devices (coarse pointer), Astryx's calendar
|
|
96
|
-
* popover on mouse-driven ones
|
|
97
|
-
* - `'always'`: native wherever the browser supports `<input type="date">`
|
|
98
|
-
* - `'never'`: Astryx's own pickers everywhere
|
|
99
|
-
*/
|
|
100
90
|
|
|
101
91
|
// Re-export shared types for convenience
|
|
102
92
|
|
|
@@ -570,15 +560,6 @@ PointerDateField.displayName = 'PointerDateField';
|
|
|
570
560
|
*/
|
|
571
561
|
export function DateInput(props) {
|
|
572
562
|
const isTouch = useMediaQuery(TOUCH_POINTER_QUERY);
|
|
573
|
-
const nativePicker = props.nativePicker ?? 'touch';
|
|
574
|
-
|
|
575
|
-
// The platform's picker, where the consumer asked for it — see the
|
|
576
|
-
// `nativePicker` prop for what that trades away.
|
|
577
|
-
if (nativePicker === 'always' || nativePicker === 'touch' && isTouch) {
|
|
578
|
-
return /*#__PURE__*/_jsx(NativeDateField, {
|
|
579
|
-
...props
|
|
580
|
-
});
|
|
581
|
-
}
|
|
582
563
|
return isTouch ? /*#__PURE__*/_jsx(TouchDateField, {
|
|
583
564
|
...props
|
|
584
565
|
}) : /*#__PURE__*/_jsx(PointerDateField, {
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* @position Package entry point for DateInput
|
|
6
6
|
*/
|
|
7
7
|
export { DateInput } from './DateInput';
|
|
8
|
-
export type { DateInputProps, DateInputSize, DateInputFormat,
|
|
8
|
+
export type { DateInputProps, DateInputSize, DateInputFormat, DateInputStatus, DateInputStatusType, } from './DateInput';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DateInput/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,YAAY,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/DateInput/index.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,YAAY,EACV,cAAc,EACd,aAAa,EACb,eAAe,EACf,eAAe,EACf,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/HoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAsB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAG7E,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAC,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AAiBxB,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,SAAS,EACT,QAAQ,GAAG,WAAW,GAAG,OAAO,CACjC;IACC;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IAC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 +115,8 @@ export function HoverCard({
|
|
|
115
115
|
|
|
116
116
|
// Use combined ref for position + interaction
|
|
117
117
|
hoverCard.ref(firstChild);
|
|
118
|
-
if (label) {
|
|
119
|
-
// When named, the hover card is a dialog. The trigger should advertise the
|
|
120
|
-
// popup relationship with aria-haspopup/aria-expanded, not describe the
|
|
121
|
-
// trigger with the dialog's content (aria-describedby is for plain-text
|
|
122
|
-
// descriptions, not navigable regions). See #5049.
|
|
123
|
-
//
|
|
124
|
-
// Merge rather than overwrite: the trigger may already carry its own
|
|
125
|
-
// popup semantics (e.g. a menu button wrapped in a labelled HoverCard),
|
|
126
|
-
// so preserve the existing values and restore them on cleanup.
|
|
127
|
-
const existingHaspopup = firstChild.getAttribute('aria-haspopup');
|
|
128
|
-
const existingControls = firstChild.getAttribute('aria-controls');
|
|
129
|
-
const existingExpanded = firstChild.getAttribute('aria-expanded');
|
|
130
|
-
firstChild.setAttribute('aria-haspopup', 'dialog');
|
|
131
|
-
// Only point aria-controls at the layer while it is open and in the DOM.
|
|
132
|
-
// While closed, useLayer leaves only an inert <template> marker, so the
|
|
133
|
-
// id would reference nothing. DateInput gates it the same way. The
|
|
134
|
-
// trigger's own aria-controls (if any) is preserved either way.
|
|
135
|
-
if (hoverCard.isOpen) {
|
|
136
|
-
firstChild.setAttribute('aria-controls', mergeIds(existingControls, hoverCard.id) ?? '');
|
|
137
|
-
} else if (existingControls) {
|
|
138
|
-
firstChild.setAttribute('aria-controls', existingControls);
|
|
139
|
-
} else {
|
|
140
|
-
firstChild.removeAttribute('aria-controls');
|
|
141
|
-
}
|
|
142
|
-
firstChild.setAttribute('aria-expanded', String(hoverCard.isOpen));
|
|
143
|
-
return () => {
|
|
144
|
-
hoverCard.ref(null);
|
|
145
|
-
if (existingHaspopup) {
|
|
146
|
-
firstChild.setAttribute('aria-haspopup', existingHaspopup);
|
|
147
|
-
} else {
|
|
148
|
-
firstChild.removeAttribute('aria-haspopup');
|
|
149
|
-
}
|
|
150
|
-
if (existingControls) {
|
|
151
|
-
firstChild.setAttribute('aria-controls', existingControls);
|
|
152
|
-
} else {
|
|
153
|
-
firstChild.removeAttribute('aria-controls');
|
|
154
|
-
}
|
|
155
|
-
if (existingExpanded) {
|
|
156
|
-
firstChild.setAttribute('aria-expanded', existingExpanded);
|
|
157
|
-
} else {
|
|
158
|
-
firstChild.removeAttribute('aria-expanded');
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
118
|
|
|
163
|
-
//
|
|
164
|
-
// so keep the previous description relationship until a naming decision is
|
|
165
|
-
// made for the no-label case (tracked in #5049).
|
|
119
|
+
// Set aria-describedby, merging with existing
|
|
166
120
|
const existingDescribedBy = firstChild.getAttribute('aria-describedby');
|
|
167
121
|
firstChild.setAttribute('aria-describedby', mergeIds(existingDescribedBy, hoverCard.describedBy) ?? '');
|
|
168
122
|
return () => {
|
|
@@ -173,7 +127,7 @@ export function HoverCard({
|
|
|
173
127
|
firstChild.removeAttribute('aria-describedby');
|
|
174
128
|
}
|
|
175
129
|
};
|
|
176
|
-
}, [textOnly,
|
|
130
|
+
}, [textOnly, hoverCard.ref, hoverCard.describedBy]);
|
|
177
131
|
|
|
178
132
|
// While closed, useLayer leaves only an inert <template> marker at this JSX
|
|
179
133
|
// position. When the card needs to open, it uses that marker to keep the
|
|
@@ -191,10 +145,7 @@ export function HoverCard({
|
|
|
191
145
|
children: [/*#__PURE__*/_jsx("span", {
|
|
192
146
|
ref: hoverCard.ref,
|
|
193
147
|
tabIndex: 0,
|
|
194
|
-
"aria-
|
|
195
|
-
"aria-controls": label && hoverCard.isOpen ? hoverCard.id : undefined,
|
|
196
|
-
"aria-expanded": label ? hoverCard.isOpen : undefined,
|
|
197
|
-
"aria-describedby": label ? undefined : hoverCard.describedBy,
|
|
148
|
+
"aria-describedby": hoverCard.describedBy,
|
|
198
149
|
...{
|
|
199
150
|
0: {
|
|
200
151
|
className: "xt0psk2"
|
|
@@ -124,19 +124,10 @@ export interface HoverCardReturn {
|
|
|
124
124
|
*/
|
|
125
125
|
anchorId: string;
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*/
|
|
130
|
-
id: string;
|
|
131
|
-
/**
|
|
132
|
-
* Deprecated alias of `id`. Kept for backwards compatibility; prefer `id`.
|
|
127
|
+
* ID for aria-describedby on the trigger element.
|
|
128
|
+
* Caller should compose with other IDs using mergeIds utility.
|
|
133
129
|
*/
|
|
134
130
|
describedBy: string;
|
|
135
|
-
/**
|
|
136
|
-
* Whether the hover card is currently open.
|
|
137
|
-
* Useful for driving `aria-expanded` on the trigger.
|
|
138
|
-
*/
|
|
139
|
-
isOpen: boolean;
|
|
140
131
|
/**
|
|
141
132
|
* Render function for hover card content.
|
|
142
133
|
* Returns anchor-positioned popover element.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHoverCard.d.ts","sourceRoot":"","sources":["../../src/HoverCard/useHoverCard.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,WAAW,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,0BAA0B,CAAC;AA6BlC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC;IAE3B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;;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BAAgB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,eAAe,CA2a5E"}
|
|
@@ -425,9 +425,7 @@ export function useHoverCard(options = {}) {
|
|
|
425
425
|
positionRef: layer.ref,
|
|
426
426
|
interactionRef,
|
|
427
427
|
anchorId: layer.anchorId,
|
|
428
|
-
id: layer.id,
|
|
429
428
|
describedBy: layer.id,
|
|
430
|
-
isOpen: layer.isOpen,
|
|
431
429
|
renderHoverCard,
|
|
432
430
|
show: layer.show,
|
|
433
431
|
hide: layer.hide
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxIndicator.d.ts","sourceRoot":"","sources":["../../src/Indicator/CheckboxIndicator.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAwI5C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,IAAW,EACX,UAAkB,EAClB,QAAQ,EACR,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,IAAI,EACR,EAAE,cAAc,CAAC,gBAAgB,CAAC,+
|
|
1
|
+
{"version":3,"file":"CheckboxIndicator.d.ts","sourceRoot":"","sources":["../../src/Indicator/CheckboxIndicator.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAC;AAwI5C;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,IAAW,EACX,UAAkB,EAClB,QAAQ,EACR,GAAG,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,IAAI,EACR,EAAE,cAAc,CAAC,gBAAgB,CAAC,+BAwElC;yBAlFe,iBAAiB"}
|