braid-design-system 33.12.2 → 33.12.4
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/CHANGELOG.md +28 -6
- package/dist/index.d.mts +22 -6
- package/dist/index.d.ts +22 -6
- package/dist/lib/components/TooltipRenderer/TooltipRenderer.cjs +64 -73
- package/dist/lib/components/TooltipRenderer/TooltipRenderer.css.cjs +9 -7
- package/dist/lib/components/TooltipRenderer/TooltipRenderer.css.mjs +9 -7
- package/dist/lib/components/TooltipRenderer/TooltipRenderer.mjs +65 -74
- package/dist/lib/components/private/Popover/Popover.cjs +90 -125
- package/dist/lib/components/private/Popover/Popover.css.cjs +0 -21
- package/dist/lib/components/private/Popover/Popover.css.mjs +2 -23
- package/dist/lib/components/private/Popover/Popover.mjs +92 -127
- package/dist/lib/playroom/components.cjs +6 -0
- package/dist/lib/playroom/components.mjs +8 -1
- package/dist/playroom/components.cjs +4 -5
- package/dist/playroom/components.d.mts +1 -1
- package/dist/playroom/components.d.ts +1 -1
- package/dist/playroom/components.mjs +1 -2
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# braid-design-system
|
|
2
2
|
|
|
3
|
+
## 33.12.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- **Autosuggest, MenuRenderer, OverflowMenu, TooltipRenderer**: Ensure `TooltipRenderer` is correctly positioned on Android devices ([#1926](https://github.com/seek-oss/braid-design-system/pull/1926))
|
|
8
|
+
|
|
9
|
+
Additionally, adjust `TooltipRenderer` positioning at screen edges, removing extra edge spacing.
|
|
10
|
+
This ensures the tooltip arrow is more closely aligned with the trigger when the trigger is near the edge of the screen.
|
|
11
|
+
|
|
12
|
+
## 33.12.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- **TooltipRenderer:** Ensure Chinese text is not wrapped incorrectly ([#1916](https://github.com/seek-oss/braid-design-system/pull/1916))
|
|
17
|
+
|
|
18
|
+
Right aligned tooltip triggers with tooltips containing long unbroken Chinese text are no longer forcibly broken across many lines.
|
|
19
|
+
This was due to the use of `overflow-wrap: break-word;` used to break long strings of Latin characters—guarding against broken layouts.
|
|
20
|
+
|
|
21
|
+
For Chinese, Japanese and Korean (CJK) character sets, to avoid the unwanted line breaks it is recommened to apply the `word-break: keep-all;` CSS property.
|
|
22
|
+
|
|
23
|
+
See [MDN reference] for more information.
|
|
24
|
+
|
|
25
|
+
[MDN reference]: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/word-break#keep-all
|
|
26
|
+
|
|
3
27
|
## 33.12.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -2478,9 +2502,8 @@ For more detail on the specific changes in this release, please read on.
|
|
|
2478
2502
|
```jsx
|
|
2479
2503
|
// playroom.config.js
|
|
2480
2504
|
module.exports = {
|
|
2481
|
-
frameComponent:
|
|
2482
|
-
'braid-design-system/playroom/FrameComponent',
|
|
2483
|
-
),
|
|
2505
|
+
frameComponent:
|
|
2506
|
+
require.resolve('braid-design-system/playroom/FrameComponent'),
|
|
2484
2507
|
components: require.resolve('braid-design-system/playroom/components'),
|
|
2485
2508
|
snippets: require.resolve('braid-design-system/playroom/snippets'),
|
|
2486
2509
|
scope: require.resolve('braid-design-system/playroom/scope'),
|
|
@@ -2625,9 +2648,8 @@ For more detail on the specific changes in this release, please read on.
|
|
|
2625
2648
|
```jsx
|
|
2626
2649
|
// playroom.config.js
|
|
2627
2650
|
module.exports = {
|
|
2628
|
-
frameComponent:
|
|
2629
|
-
'braid-design-system/playroom/FrameComponent.tsx',
|
|
2630
|
-
),
|
|
2651
|
+
frameComponent:
|
|
2652
|
+
require.resolve('braid-design-system/playroom/FrameComponent.tsx'),
|
|
2631
2653
|
components: require.resolve('braid-design-system/playroom/components.ts'),
|
|
2632
2654
|
snippets: require.resolve('braid-design-system/playroom/snippets.ts'),
|
|
2633
2655
|
scope: require.resolve('braid-design-system/playroom/scope.ts'),
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { ForwardRefRenderFunction, AnchorHTMLAttributes, ComponentType, ReactNode, ReactElement, AllHTMLAttributes, ElementType, RefAttributes, Ref, RefObject, KeyboardEvent, MouseEvent, FormEvent, RefCallback } from 'react';
|
|
3
|
-
import { FontMetrics } from '@capsizecss/core';
|
|
4
3
|
import * as clsx from 'clsx';
|
|
5
4
|
import { ClassValue } from 'clsx';
|
|
6
5
|
import { Optional } from 'utility-types';
|
|
6
|
+
import { FontMetrics } from '@capsizecss/core';
|
|
7
7
|
import * as _vanilla_extract_sprinkles from '@vanilla-extract/sprinkles';
|
|
8
8
|
import { ConditionalValue, RequiredConditionalValue } from '@vanilla-extract/sprinkles';
|
|
9
9
|
import { StyleRule } from '@vanilla-extract/css';
|
|
@@ -303,23 +303,23 @@ type BraidTheme = ReturnType<typeof makeBraidTheme>;
|
|
|
303
303
|
interface LinkComponentProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
304
304
|
href: string;
|
|
305
305
|
}
|
|
306
|
-
declare const makeLinkComponent: (render: ForwardRefRenderFunction<HTMLAnchorElement, LinkComponentProps>) => {
|
|
306
|
+
declare const makeLinkComponent$1: (render: ForwardRefRenderFunction<HTMLAnchorElement, LinkComponentProps>) => {
|
|
307
307
|
readonly __forwardRef__: react.ForwardRefExoticComponent<LinkComponentProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
308
308
|
};
|
|
309
|
-
type LinkComponent$1 = ReturnType<typeof makeLinkComponent> | ComponentType<LinkComponentProps>;
|
|
309
|
+
type LinkComponent$1 = ReturnType<typeof makeLinkComponent$1> | ComponentType<LinkComponentProps>;
|
|
310
310
|
interface BraidProviderProps {
|
|
311
311
|
theme: BraidTheme;
|
|
312
312
|
styleBody?: boolean;
|
|
313
313
|
linkComponent?: LinkComponent$1;
|
|
314
314
|
children: ReactNode;
|
|
315
315
|
}
|
|
316
|
-
declare const BraidProvider: ({ theme, styleBody, linkComponent, children, }: BraidProviderProps) => react.JSX.Element;
|
|
316
|
+
declare const BraidProvider$1: ({ theme, styleBody, linkComponent, children, }: BraidProviderProps) => react.JSX.Element;
|
|
317
317
|
|
|
318
318
|
interface BraidPortalProps {
|
|
319
319
|
children: ReactNode;
|
|
320
320
|
container?: Element;
|
|
321
321
|
}
|
|
322
|
-
declare const BraidPortal: ({ children, container }: BraidPortalProps) => react.ReactPortal;
|
|
322
|
+
declare const BraidPortal$1: ({ children, container }: BraidPortalProps) => react.ReactPortal;
|
|
323
323
|
|
|
324
324
|
interface ThemeNameConsumerProps {
|
|
325
325
|
children(name: string): ReactElement;
|
|
@@ -3421,6 +3421,13 @@ interface LoaderProps {
|
|
|
3421
3421
|
declare const Loader: ({ size, "aria-label": ariaLabel, delayVisibility, data, ...restProps }: LoaderProps) => react.JSX.Element;
|
|
3422
3422
|
|
|
3423
3423
|
type Placement = 'top' | 'bottom';
|
|
3424
|
+
interface PopoverPlacementData {
|
|
3425
|
+
placement: Placement;
|
|
3426
|
+
arrow?: {
|
|
3427
|
+
x?: number;
|
|
3428
|
+
y?: number;
|
|
3429
|
+
};
|
|
3430
|
+
}
|
|
3424
3431
|
interface PopoverProps {
|
|
3425
3432
|
id?: string;
|
|
3426
3433
|
role: NonNullable<AllHTMLAttributes<HTMLElement>['role'] | false>;
|
|
@@ -3433,8 +3440,10 @@ interface PopoverProps {
|
|
|
3433
3440
|
modal?: boolean;
|
|
3434
3441
|
open: boolean;
|
|
3435
3442
|
onClose?: () => void;
|
|
3443
|
+
onPlacementChange?: (data: PopoverPlacementData) => void;
|
|
3436
3444
|
triggerRef: RefObject<HTMLElement | null>;
|
|
3437
3445
|
enterFocusRef?: RefObject<HTMLElement | null>;
|
|
3446
|
+
arrowRef?: RefObject<HTMLElement | null>;
|
|
3438
3447
|
children: ReactNode;
|
|
3439
3448
|
}
|
|
3440
3449
|
|
|
@@ -5209,6 +5218,13 @@ interface PlaceholderProps {
|
|
|
5209
5218
|
}
|
|
5210
5219
|
declare const Placeholder: ({ label, width, height, shape, image, imageSize, }: PlaceholderProps) => react.JSX.Element;
|
|
5211
5220
|
|
|
5221
|
+
/**
|
|
5222
|
+
* Override Braid exports that we don't want in Playroom
|
|
5223
|
+
*/
|
|
5224
|
+
declare const BraidPortal: undefined;
|
|
5225
|
+
declare const BraidProvider: undefined;
|
|
5226
|
+
declare const makeLinkComponent: undefined;
|
|
5227
|
+
|
|
5212
5228
|
declare function useScope(): {
|
|
5213
5229
|
setDefaultState: (key: string, value: any) => void;
|
|
5214
5230
|
getState: (key: string) => any;
|
|
@@ -5360,5 +5376,5 @@ declare const _default: {
|
|
|
5360
5376
|
code: string;
|
|
5361
5377
|
}[];
|
|
5362
5378
|
|
|
5363
|
-
export { Accordion$1 as Accordion, Accordion as Accordion$1, AccordionItem$1 as AccordionItem, AccordionItem as AccordionItem$1, Actions, Alert$1 as Alert, Alert as Alert$1, Autosuggest$1 as Autosuggest, Autosuggest as Autosuggest$1, Badge$1 as Badge, Badge as Badge$1, Bleed$1 as Bleed, Bleed as Bleed$1, PublicBox as Box, Box as Box$1, BoxRenderer, BraidPortal, BraidProvider, BraidTestProvider, Button$1 as Button, Button as Button$1, ButtonIcon$1 as ButtonIcon, ButtonIcon as ButtonIcon$1, ButtonLink$1 as ButtonLink, ButtonLink as ButtonLink$1, Card$1 as Card, Card as Card$1, Checkbox$1 as Checkbox, Checkbox as Checkbox$1, CheckboxStandalone$1 as CheckboxStandalone, CheckboxStandalone as CheckboxStandalone$1, Column, Columns$1 as Columns, Columns as Columns$1, ContentBlock, Dialog$1 as Dialog, Dialog as Dialog$1, Disclosure$1 as Disclosure, Disclosure as Disclosure$1, Divider, Drawer$1 as Drawer, Drawer as Drawer$1, Dropdown$1 as Dropdown, Dropdown as Dropdown$1, FieldLabel$1 as FieldLabel, FieldLabel as FieldLabel$1, FieldMessage$1 as FieldMessage, FieldMessage as FieldMessage$1, Heading$1 as Heading, Heading as Heading$1, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconList, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline$1 as Inline, Inline as Inline$1, Link$1 as Link, Link as Link$1, List$1 as List, List as List$1, Loader, MenuItem$1 as MenuItem, MenuItem as MenuItem$1, MenuItemCheckbox$1 as MenuItemCheckbox, MenuItemCheckbox as MenuItemCheckbox$1, MenuItemDivider, MenuItemLink$1 as MenuItemLink, MenuItemLink as MenuItemLink$1, MenuRenderer, MonthPicker$1 as MonthPicker, MonthPicker as MonthPicker$1, Notice$1 as Notice, Notice as Notice$1, OverflowMenu, Page, PageBlock, Pagination$1 as Pagination, Pagination as Pagination$1, PasswordField$1 as PasswordField, PasswordField as PasswordField$1, Placeholder, RadioGroup$1 as RadioGroup, RadioGroup as RadioGroup$1, RadioItem, Rating$1 as Rating, Rating as Rating$1, Secondary, Spread$1 as Spread, Spread as Spread$1, Stack$1 as Stack, Stack as Stack$1, Step$1 as Step, Stepper, Strong, Tab$1 as Tab, Tab as Tab$1, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs$1 as Tabs, Tabs as Tabs$1, TabsProvider, Tag$1 as Tag, Tag as Tag$1, Text, TextDropdown$1 as TextDropdown, TextDropdown as TextDropdown$1, TextField$1 as TextField, TextField as TextField$1, TextLink, TextLinkButton, Textarea$1 as Textarea, Textarea as Textarea$1, ThemeNameConsumer, Tiles$1 as Tiles, Tiles as Tiles$1, ToastProvider, Toggle$1 as Toggle, Toggle as Toggle$1, TooltipRenderer, _default$1 as _default, _default as _default$1, _default$6 as _default$2, _default$2 as _default$3, _default$4, _default$5, _default$3 as _default$6, atoms, breakpoints, colorModeStyle, filterSuggestions, globalHeadingStyle, globalTextStyle, makeLinkComponent, outlineStyle, responsiveStyle, useColor, useResponsiveValue, useScope, useSpace, useThemeName, useToast, vars };
|
|
5379
|
+
export { Accordion$1 as Accordion, Accordion as Accordion$1, AccordionItem$1 as AccordionItem, AccordionItem as AccordionItem$1, Actions, Alert$1 as Alert, Alert as Alert$1, Autosuggest$1 as Autosuggest, Autosuggest as Autosuggest$1, Badge$1 as Badge, Badge as Badge$1, Bleed$1 as Bleed, Bleed as Bleed$1, PublicBox as Box, Box as Box$1, BoxRenderer, BraidPortal$1 as BraidPortal, BraidPortal as BraidPortal$1, BraidProvider$1 as BraidProvider, BraidProvider as BraidProvider$1, BraidTestProvider, Button$1 as Button, Button as Button$1, ButtonIcon$1 as ButtonIcon, ButtonIcon as ButtonIcon$1, ButtonLink$1 as ButtonLink, ButtonLink as ButtonLink$1, Card$1 as Card, Card as Card$1, Checkbox$1 as Checkbox, Checkbox as Checkbox$1, CheckboxStandalone$1 as CheckboxStandalone, CheckboxStandalone as CheckboxStandalone$1, Column, Columns$1 as Columns, Columns as Columns$1, ContentBlock, Dialog$1 as Dialog, Dialog as Dialog$1, Disclosure$1 as Disclosure, Disclosure as Disclosure$1, Divider, Drawer$1 as Drawer, Drawer as Drawer$1, Dropdown$1 as Dropdown, Dropdown as Dropdown$1, FieldLabel$1 as FieldLabel, FieldLabel as FieldLabel$1, FieldMessage$1 as FieldMessage, FieldMessage as FieldMessage$1, Heading$1 as Heading, Heading as Heading$1, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconList, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline$1 as Inline, Inline as Inline$1, Link$1 as Link, Link as Link$1, List$1 as List, List as List$1, Loader, MenuItem$1 as MenuItem, MenuItem as MenuItem$1, MenuItemCheckbox$1 as MenuItemCheckbox, MenuItemCheckbox as MenuItemCheckbox$1, MenuItemDivider, MenuItemLink$1 as MenuItemLink, MenuItemLink as MenuItemLink$1, MenuRenderer, MonthPicker$1 as MonthPicker, MonthPicker as MonthPicker$1, Notice$1 as Notice, Notice as Notice$1, OverflowMenu, Page, PageBlock, Pagination$1 as Pagination, Pagination as Pagination$1, PasswordField$1 as PasswordField, PasswordField as PasswordField$1, Placeholder, RadioGroup$1 as RadioGroup, RadioGroup as RadioGroup$1, RadioItem, Rating$1 as Rating, Rating as Rating$1, Secondary, Spread$1 as Spread, Spread as Spread$1, Stack$1 as Stack, Stack as Stack$1, Step$1 as Step, Stepper, Strong, Tab$1 as Tab, Tab as Tab$1, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs$1 as Tabs, Tabs as Tabs$1, TabsProvider, Tag$1 as Tag, Tag as Tag$1, Text, TextDropdown$1 as TextDropdown, TextDropdown as TextDropdown$1, TextField$1 as TextField, TextField as TextField$1, TextLink, TextLinkButton, Textarea$1 as Textarea, Textarea as Textarea$1, ThemeNameConsumer, Tiles$1 as Tiles, Tiles as Tiles$1, ToastProvider, Toggle$1 as Toggle, Toggle as Toggle$1, TooltipRenderer, _default$1 as _default, _default as _default$1, _default$6 as _default$2, _default$2 as _default$3, _default$4, _default$5, _default$3 as _default$6, atoms, breakpoints, colorModeStyle, filterSuggestions, globalHeadingStyle, globalTextStyle, makeLinkComponent$1 as makeLinkComponent, makeLinkComponent as makeLinkComponent$1, outlineStyle, responsiveStyle, useColor, useResponsiveValue, useScope, useSpace, useThemeName, useToast, vars };
|
|
5364
5380
|
export type { Breakpoint, LinkComponent };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { ForwardRefRenderFunction, AnchorHTMLAttributes, ComponentType, ReactNode, ReactElement, AllHTMLAttributes, ElementType, RefAttributes, Ref, RefObject, KeyboardEvent, MouseEvent, FormEvent, RefCallback } from 'react';
|
|
3
|
-
import { FontMetrics } from '@capsizecss/core';
|
|
4
3
|
import * as clsx from 'clsx';
|
|
5
4
|
import { ClassValue } from 'clsx';
|
|
6
5
|
import { Optional } from 'utility-types';
|
|
6
|
+
import { FontMetrics } from '@capsizecss/core';
|
|
7
7
|
import * as _vanilla_extract_sprinkles from '@vanilla-extract/sprinkles';
|
|
8
8
|
import { ConditionalValue, RequiredConditionalValue } from '@vanilla-extract/sprinkles';
|
|
9
9
|
import { StyleRule } from '@vanilla-extract/css';
|
|
@@ -303,23 +303,23 @@ type BraidTheme = ReturnType<typeof makeBraidTheme>;
|
|
|
303
303
|
interface LinkComponentProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
304
304
|
href: string;
|
|
305
305
|
}
|
|
306
|
-
declare const makeLinkComponent: (render: ForwardRefRenderFunction<HTMLAnchorElement, LinkComponentProps>) => {
|
|
306
|
+
declare const makeLinkComponent$1: (render: ForwardRefRenderFunction<HTMLAnchorElement, LinkComponentProps>) => {
|
|
307
307
|
readonly __forwardRef__: react.ForwardRefExoticComponent<LinkComponentProps & react.RefAttributes<HTMLAnchorElement>>;
|
|
308
308
|
};
|
|
309
|
-
type LinkComponent$1 = ReturnType<typeof makeLinkComponent> | ComponentType<LinkComponentProps>;
|
|
309
|
+
type LinkComponent$1 = ReturnType<typeof makeLinkComponent$1> | ComponentType<LinkComponentProps>;
|
|
310
310
|
interface BraidProviderProps {
|
|
311
311
|
theme: BraidTheme;
|
|
312
312
|
styleBody?: boolean;
|
|
313
313
|
linkComponent?: LinkComponent$1;
|
|
314
314
|
children: ReactNode;
|
|
315
315
|
}
|
|
316
|
-
declare const BraidProvider: ({ theme, styleBody, linkComponent, children, }: BraidProviderProps) => react.JSX.Element;
|
|
316
|
+
declare const BraidProvider$1: ({ theme, styleBody, linkComponent, children, }: BraidProviderProps) => react.JSX.Element;
|
|
317
317
|
|
|
318
318
|
interface BraidPortalProps {
|
|
319
319
|
children: ReactNode;
|
|
320
320
|
container?: Element;
|
|
321
321
|
}
|
|
322
|
-
declare const BraidPortal: ({ children, container }: BraidPortalProps) => react.ReactPortal;
|
|
322
|
+
declare const BraidPortal$1: ({ children, container }: BraidPortalProps) => react.ReactPortal;
|
|
323
323
|
|
|
324
324
|
interface ThemeNameConsumerProps {
|
|
325
325
|
children(name: string): ReactElement;
|
|
@@ -3421,6 +3421,13 @@ interface LoaderProps {
|
|
|
3421
3421
|
declare const Loader: ({ size, "aria-label": ariaLabel, delayVisibility, data, ...restProps }: LoaderProps) => react.JSX.Element;
|
|
3422
3422
|
|
|
3423
3423
|
type Placement = 'top' | 'bottom';
|
|
3424
|
+
interface PopoverPlacementData {
|
|
3425
|
+
placement: Placement;
|
|
3426
|
+
arrow?: {
|
|
3427
|
+
x?: number;
|
|
3428
|
+
y?: number;
|
|
3429
|
+
};
|
|
3430
|
+
}
|
|
3424
3431
|
interface PopoverProps {
|
|
3425
3432
|
id?: string;
|
|
3426
3433
|
role: NonNullable<AllHTMLAttributes<HTMLElement>['role'] | false>;
|
|
@@ -3433,8 +3440,10 @@ interface PopoverProps {
|
|
|
3433
3440
|
modal?: boolean;
|
|
3434
3441
|
open: boolean;
|
|
3435
3442
|
onClose?: () => void;
|
|
3443
|
+
onPlacementChange?: (data: PopoverPlacementData) => void;
|
|
3436
3444
|
triggerRef: RefObject<HTMLElement | null>;
|
|
3437
3445
|
enterFocusRef?: RefObject<HTMLElement | null>;
|
|
3446
|
+
arrowRef?: RefObject<HTMLElement | null>;
|
|
3438
3447
|
children: ReactNode;
|
|
3439
3448
|
}
|
|
3440
3449
|
|
|
@@ -5209,6 +5218,13 @@ interface PlaceholderProps {
|
|
|
5209
5218
|
}
|
|
5210
5219
|
declare const Placeholder: ({ label, width, height, shape, image, imageSize, }: PlaceholderProps) => react.JSX.Element;
|
|
5211
5220
|
|
|
5221
|
+
/**
|
|
5222
|
+
* Override Braid exports that we don't want in Playroom
|
|
5223
|
+
*/
|
|
5224
|
+
declare const BraidPortal: undefined;
|
|
5225
|
+
declare const BraidProvider: undefined;
|
|
5226
|
+
declare const makeLinkComponent: undefined;
|
|
5227
|
+
|
|
5212
5228
|
declare function useScope(): {
|
|
5213
5229
|
setDefaultState: (key: string, value: any) => void;
|
|
5214
5230
|
getState: (key: string) => any;
|
|
@@ -5360,5 +5376,5 @@ declare const _default: {
|
|
|
5360
5376
|
code: string;
|
|
5361
5377
|
}[];
|
|
5362
5378
|
|
|
5363
|
-
export { Accordion$1 as Accordion, Accordion as Accordion$1, AccordionItem$1 as AccordionItem, AccordionItem as AccordionItem$1, Actions, Alert$1 as Alert, Alert as Alert$1, Autosuggest$1 as Autosuggest, Autosuggest as Autosuggest$1, Badge$1 as Badge, Badge as Badge$1, Bleed$1 as Bleed, Bleed as Bleed$1, PublicBox as Box, Box as Box$1, BoxRenderer, BraidPortal, BraidProvider, BraidTestProvider, Button$1 as Button, Button as Button$1, ButtonIcon$1 as ButtonIcon, ButtonIcon as ButtonIcon$1, ButtonLink$1 as ButtonLink, ButtonLink as ButtonLink$1, Card$1 as Card, Card as Card$1, Checkbox$1 as Checkbox, Checkbox as Checkbox$1, CheckboxStandalone$1 as CheckboxStandalone, CheckboxStandalone as CheckboxStandalone$1, Column, Columns$1 as Columns, Columns as Columns$1, ContentBlock, Dialog$1 as Dialog, Dialog as Dialog$1, Disclosure$1 as Disclosure, Disclosure as Disclosure$1, Divider, Drawer$1 as Drawer, Drawer as Drawer$1, Dropdown$1 as Dropdown, Dropdown as Dropdown$1, FieldLabel$1 as FieldLabel, FieldLabel as FieldLabel$1, FieldMessage$1 as FieldMessage, FieldMessage as FieldMessage$1, Heading$1 as Heading, Heading as Heading$1, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconList, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline$1 as Inline, Inline as Inline$1, Link$1 as Link, Link as Link$1, List$1 as List, List as List$1, Loader, MenuItem$1 as MenuItem, MenuItem as MenuItem$1, MenuItemCheckbox$1 as MenuItemCheckbox, MenuItemCheckbox as MenuItemCheckbox$1, MenuItemDivider, MenuItemLink$1 as MenuItemLink, MenuItemLink as MenuItemLink$1, MenuRenderer, MonthPicker$1 as MonthPicker, MonthPicker as MonthPicker$1, Notice$1 as Notice, Notice as Notice$1, OverflowMenu, Page, PageBlock, Pagination$1 as Pagination, Pagination as Pagination$1, PasswordField$1 as PasswordField, PasswordField as PasswordField$1, Placeholder, RadioGroup$1 as RadioGroup, RadioGroup as RadioGroup$1, RadioItem, Rating$1 as Rating, Rating as Rating$1, Secondary, Spread$1 as Spread, Spread as Spread$1, Stack$1 as Stack, Stack as Stack$1, Step$1 as Step, Stepper, Strong, Tab$1 as Tab, Tab as Tab$1, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs$1 as Tabs, Tabs as Tabs$1, TabsProvider, Tag$1 as Tag, Tag as Tag$1, Text, TextDropdown$1 as TextDropdown, TextDropdown as TextDropdown$1, TextField$1 as TextField, TextField as TextField$1, TextLink, TextLinkButton, Textarea$1 as Textarea, Textarea as Textarea$1, ThemeNameConsumer, Tiles$1 as Tiles, Tiles as Tiles$1, ToastProvider, Toggle$1 as Toggle, Toggle as Toggle$1, TooltipRenderer, _default$1 as _default, _default as _default$1, _default$6 as _default$2, _default$2 as _default$3, _default$4, _default$5, _default$3 as _default$6, atoms, breakpoints, colorModeStyle, filterSuggestions, globalHeadingStyle, globalTextStyle, makeLinkComponent, outlineStyle, responsiveStyle, useColor, useResponsiveValue, useScope, useSpace, useThemeName, useToast, vars };
|
|
5379
|
+
export { Accordion$1 as Accordion, Accordion as Accordion$1, AccordionItem$1 as AccordionItem, AccordionItem as AccordionItem$1, Actions, Alert$1 as Alert, Alert as Alert$1, Autosuggest$1 as Autosuggest, Autosuggest as Autosuggest$1, Badge$1 as Badge, Badge as Badge$1, Bleed$1 as Bleed, Bleed as Bleed$1, PublicBox as Box, Box as Box$1, BoxRenderer, BraidPortal$1 as BraidPortal, BraidPortal as BraidPortal$1, BraidProvider$1 as BraidProvider, BraidProvider as BraidProvider$1, BraidTestProvider, Button$1 as Button, Button as Button$1, ButtonIcon$1 as ButtonIcon, ButtonIcon as ButtonIcon$1, ButtonLink$1 as ButtonLink, ButtonLink as ButtonLink$1, Card$1 as Card, Card as Card$1, Checkbox$1 as Checkbox, Checkbox as Checkbox$1, CheckboxStandalone$1 as CheckboxStandalone, CheckboxStandalone as CheckboxStandalone$1, Column, Columns$1 as Columns, Columns as Columns$1, ContentBlock, Dialog$1 as Dialog, Dialog as Dialog$1, Disclosure$1 as Disclosure, Disclosure as Disclosure$1, Divider, Drawer$1 as Drawer, Drawer as Drawer$1, Dropdown$1 as Dropdown, Dropdown as Dropdown$1, FieldLabel$1 as FieldLabel, FieldLabel as FieldLabel$1, FieldMessage$1 as FieldMessage, FieldMessage as FieldMessage$1, Heading$1 as Heading, Heading as Heading$1, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconList, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline$1 as Inline, Inline as Inline$1, Link$1 as Link, Link as Link$1, List$1 as List, List as List$1, Loader, MenuItem$1 as MenuItem, MenuItem as MenuItem$1, MenuItemCheckbox$1 as MenuItemCheckbox, MenuItemCheckbox as MenuItemCheckbox$1, MenuItemDivider, MenuItemLink$1 as MenuItemLink, MenuItemLink as MenuItemLink$1, MenuRenderer, MonthPicker$1 as MonthPicker, MonthPicker as MonthPicker$1, Notice$1 as Notice, Notice as Notice$1, OverflowMenu, Page, PageBlock, Pagination$1 as Pagination, Pagination as Pagination$1, PasswordField$1 as PasswordField, PasswordField as PasswordField$1, Placeholder, RadioGroup$1 as RadioGroup, RadioGroup as RadioGroup$1, RadioItem, Rating$1 as Rating, Rating as Rating$1, Secondary, Spread$1 as Spread, Spread as Spread$1, Stack$1 as Stack, Stack as Stack$1, Step$1 as Step, Stepper, Strong, Tab$1 as Tab, Tab as Tab$1, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs$1 as Tabs, Tabs as Tabs$1, TabsProvider, Tag$1 as Tag, Tag as Tag$1, Text, TextDropdown$1 as TextDropdown, TextDropdown as TextDropdown$1, TextField$1 as TextField, TextField as TextField$1, TextLink, TextLinkButton, Textarea$1 as Textarea, Textarea as Textarea$1, ThemeNameConsumer, Tiles$1 as Tiles, Tiles as Tiles$1, ToastProvider, Toggle$1 as Toggle, Toggle as Toggle$1, TooltipRenderer, _default$1 as _default, _default as _default$1, _default$6 as _default$2, _default$2 as _default$3, _default$4, _default$5, _default$3 as _default$6, atoms, breakpoints, colorModeStyle, filterSuggestions, globalHeadingStyle, globalTextStyle, makeLinkComponent$1 as makeLinkComponent, makeLinkComponent as makeLinkComponent$1, outlineStyle, responsiveStyle, useColor, useResponsiveValue, useScope, useSpace, useThemeName, useToast, vars };
|
|
5364
5380
|
export type { Breakpoint, LinkComponent };
|
|
@@ -7,16 +7,15 @@ const lib_hooks_useFallbackId_cjs = require("../../hooks/useFallbackId.cjs");
|
|
|
7
7
|
const lib_hooks_useIsomorphicLayoutEffect_cjs = require("../../hooks/useIsomorphicLayoutEffect.cjs");
|
|
8
8
|
const lib_components_Box_Box_cjs = require("../Box/Box.cjs");
|
|
9
9
|
const lib_components_private_Popover_Popover_cjs = require("../private/Popover/Popover.cjs");
|
|
10
|
-
const lib_components_private_animationTimeout_cjs = require("../private/animationTimeout.cjs");
|
|
11
10
|
const lib_components_private_defaultTextProps_cjs = require("../private/defaultTextProps.cjs");
|
|
12
11
|
const lib_components_useSpace_useSpace_cjs = require("../useSpace/useSpace.cjs");
|
|
13
12
|
const lib_components_useThemeName_useThemeName_cjs = require("../useThemeName/useThemeName.cjs");
|
|
14
13
|
const lib_components_TooltipRenderer_TooltipRenderer_css_cjs = require("./TooltipRenderer.css.cjs");
|
|
15
14
|
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
16
15
|
const isMobile__default = /* @__PURE__ */ _interopDefaultCompat(isMobile);
|
|
17
|
-
const edgeOffset = "xxsmall";
|
|
18
16
|
const offsetSpace = "small";
|
|
19
17
|
const StaticTooltipContext = react.createContext(false);
|
|
18
|
+
const clamp = (min, value, max) => Math.max(min, Math.min(value, max));
|
|
20
19
|
const TooltipTextDefaultsProvider = ({
|
|
21
20
|
children
|
|
22
21
|
}) => {
|
|
@@ -31,35 +30,59 @@ const TooltipTextDefaultsProvider = ({
|
|
|
31
30
|
);
|
|
32
31
|
};
|
|
33
32
|
const TooltipContent = ({
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
placement,
|
|
34
|
+
arrowPosition,
|
|
35
|
+
arrowRef,
|
|
36
36
|
children
|
|
37
|
-
}) =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
37
|
+
}) => {
|
|
38
|
+
const arrowX = arrowPosition?.x;
|
|
39
|
+
const arrowY = arrowPosition?.y;
|
|
40
|
+
const { space, grid } = lib_components_useSpace_useSpace_cjs.useSpace();
|
|
41
|
+
const edgeOffsetInPx = grid * space.xsmall;
|
|
42
|
+
const arrowWidthOffset = parseFloat(lib_components_TooltipRenderer_TooltipRenderer_css_cjs.constants.arrowSize) * 2;
|
|
43
|
+
const [tooltipWidth, setTooltipWidth] = react.useState(0);
|
|
44
|
+
const tooltipContainerRef = react.useRef(null);
|
|
45
|
+
lib_hooks_useIsomorphicLayoutEffect_cjs.useIsomorphicLayoutEffect(() => {
|
|
46
|
+
if (!tooltipContainerRef.current) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const { width } = tooltipContainerRef.current.getBoundingClientRect();
|
|
50
|
+
setTooltipWidth(width);
|
|
51
|
+
}, [children]);
|
|
52
|
+
const clampedArrowX = arrowX !== void 0 && tooltipWidth > 0 ? clamp(
|
|
53
|
+
edgeOffsetInPx,
|
|
54
|
+
arrowX,
|
|
55
|
+
tooltipWidth - edgeOffsetInPx - arrowWidthOffset
|
|
56
|
+
) : arrowX;
|
|
57
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
58
|
+
lib_components_Box_Box_cjs.Box,
|
|
59
|
+
{
|
|
60
|
+
ref: tooltipContainerRef,
|
|
61
|
+
textAlign: "left",
|
|
62
|
+
boxShadow: "large",
|
|
63
|
+
background: "neutral",
|
|
64
|
+
borderRadius: "large",
|
|
65
|
+
padding: "small",
|
|
66
|
+
className: [lib_components_TooltipRenderer_TooltipRenderer_css_cjs.maxWidth, lib_components_TooltipRenderer_TooltipRenderer_css_cjs.translateZ0],
|
|
67
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(TooltipTextDefaultsProvider, { children: [
|
|
68
|
+
/* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { className: lib_components_TooltipRenderer_TooltipRenderer_css_cjs.overflowWrap, zIndex: 1, position: "relative", children }),
|
|
69
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
+
lib_components_Box_Box_cjs.Box,
|
|
71
|
+
{
|
|
72
|
+
ref: arrowRef,
|
|
73
|
+
position: "fixed",
|
|
74
|
+
background: "neutral",
|
|
75
|
+
className: lib_components_TooltipRenderer_TooltipRenderer_css_cjs.arrow[placement ?? "top"],
|
|
76
|
+
style: dynamic.assignInlineVars({
|
|
77
|
+
[lib_components_TooltipRenderer_TooltipRenderer_css_cjs.arrowX]: clampedArrowX !== void 0 ? `${clampedArrowX}px` : void 0,
|
|
78
|
+
[lib_components_TooltipRenderer_TooltipRenderer_css_cjs.arrowY]: arrowY !== void 0 ? `${arrowY}px` : void 0
|
|
79
|
+
})
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] })
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
};
|
|
63
86
|
const TooltipRenderer = ({
|
|
64
87
|
id,
|
|
65
88
|
tooltip,
|
|
@@ -67,16 +90,11 @@ const TooltipRenderer = ({
|
|
|
67
90
|
children
|
|
68
91
|
}) => {
|
|
69
92
|
const resolvedId = lib_hooks_useFallbackId_cjs.useFallbackId(id);
|
|
70
|
-
const tooltipRef = react.useRef(null);
|
|
71
93
|
const triggerRef = react.useRef(null);
|
|
94
|
+
const arrowRef = react.useRef(null);
|
|
72
95
|
const [open, setOpen] = react.useState(false);
|
|
73
|
-
const [
|
|
74
|
-
|
|
75
|
-
);
|
|
76
|
-
const [tooltipPosition, setTooltipPosition] = react.useState(
|
|
77
|
-
void 0
|
|
78
|
-
);
|
|
79
|
-
const { grid, space } = lib_components_useSpace_useSpace_cjs.useSpace();
|
|
96
|
+
const [resolvedPlacement, setResolvedPlacement] = react.useState(placement);
|
|
97
|
+
const [arrowPosition, setArrowPosition] = react.useState();
|
|
80
98
|
const isStatic = react.useContext(StaticTooltipContext);
|
|
81
99
|
const isMobileDevice = react.useRef(isMobile__default.default()).current;
|
|
82
100
|
const onScreen = react.useRef(null);
|
|
@@ -136,38 +154,6 @@ const TooltipRenderer = ({
|
|
|
136
154
|
}
|
|
137
155
|
};
|
|
138
156
|
}, [open, isMobileDevice]);
|
|
139
|
-
const handleTooltipPosition = () => {
|
|
140
|
-
const setPositions = () => {
|
|
141
|
-
if (tooltipRef.current) {
|
|
142
|
-
setTooltipPosition(tooltipRef.current.getBoundingClientRect());
|
|
143
|
-
}
|
|
144
|
-
if (triggerRef.current) {
|
|
145
|
-
setTriggerPosition(triggerRef.current.getBoundingClientRect());
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
setTimeout(() => {
|
|
149
|
-
const frameId = requestAnimationFrame(setPositions);
|
|
150
|
-
return () => cancelAnimationFrame(frameId);
|
|
151
|
-
}, lib_components_private_animationTimeout_cjs.animationTimeout / 2);
|
|
152
|
-
};
|
|
153
|
-
lib_hooks_useIsomorphicLayoutEffect_cjs.useIsomorphicLayoutEffect(() => {
|
|
154
|
-
if (!showTooltip) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
handleTooltipPosition();
|
|
158
|
-
window.addEventListener("resize", handleTooltipPosition);
|
|
159
|
-
return () => {
|
|
160
|
-
window.removeEventListener("resize", handleTooltipPosition);
|
|
161
|
-
};
|
|
162
|
-
}, [showTooltip]);
|
|
163
|
-
let inferredPlacement = placement;
|
|
164
|
-
let arrowLeftOffset = 0;
|
|
165
|
-
if (tooltipPosition && triggerPosition) {
|
|
166
|
-
inferredPlacement = tooltipPosition.top > triggerPosition.top ? "bottom" : "top";
|
|
167
|
-
const edgeOffsetInPx = space[edgeOffset] * grid;
|
|
168
|
-
const tooltipLeftToTriggerLeft = triggerPosition.left - tooltipPosition.left - edgeOffsetInPx;
|
|
169
|
-
arrowLeftOffset = tooltipLeftToTriggerLeft + triggerPosition.width / 2;
|
|
170
|
-
}
|
|
171
157
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
172
158
|
children({
|
|
173
159
|
triggerProps: {
|
|
@@ -183,7 +169,6 @@ const TooltipRenderer = ({
|
|
|
183
169
|
{
|
|
184
170
|
id: resolvedId,
|
|
185
171
|
role: "tooltip",
|
|
186
|
-
ref: tooltipRef,
|
|
187
172
|
offsetSpace,
|
|
188
173
|
align: "center",
|
|
189
174
|
placement,
|
|
@@ -192,12 +177,18 @@ const TooltipRenderer = ({
|
|
|
192
177
|
modal: false,
|
|
193
178
|
open: showTooltip,
|
|
194
179
|
onClose: !isStatic ? () => setOpen(false) : void 0,
|
|
180
|
+
onPlacementChange: ({ placement: newPlacement, arrow }) => {
|
|
181
|
+
setResolvedPlacement(newPlacement);
|
|
182
|
+
setArrowPosition(arrow);
|
|
183
|
+
},
|
|
195
184
|
triggerRef,
|
|
185
|
+
arrowRef,
|
|
196
186
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
197
187
|
TooltipContent,
|
|
198
188
|
{
|
|
199
|
-
|
|
200
|
-
|
|
189
|
+
placement: resolvedPlacement,
|
|
190
|
+
arrowPosition,
|
|
191
|
+
arrowRef,
|
|
201
192
|
children: tooltip
|
|
202
193
|
}
|
|
203
194
|
)
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
const fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
3
|
const css = require("@vanilla-extract/css");
|
|
4
4
|
const cssUtils = require("@vanilla-extract/css-utils");
|
|
5
|
-
const lib_css_atoms_atomicProperties_cjs = require("../../css/atoms/atomicProperties.cjs");
|
|
6
5
|
const lib_themes_vars_css_cjs = require("../../themes/vars.css.cjs");
|
|
7
6
|
fileScope.setFileScope("src/lib/components/TooltipRenderer/TooltipRenderer.css.ts", "braid-design-system");
|
|
8
7
|
const constants = {
|
|
@@ -13,18 +12,19 @@ const maxWidth = css.style({
|
|
|
13
12
|
maxWidth: constants.maxWidth
|
|
14
13
|
}, "maxWidth");
|
|
15
14
|
const overflowWrap = css.style({
|
|
16
|
-
overflowWrap: "break-word"
|
|
15
|
+
overflowWrap: "break-word",
|
|
16
|
+
wordBreak: "keep-all"
|
|
17
17
|
}, "overflowWrap");
|
|
18
18
|
const translateZ0 = css.style({
|
|
19
19
|
transform: "translateZ(0)"
|
|
20
20
|
}, "translateZ0");
|
|
21
21
|
const borderRadius = lib_themes_vars_css_cjs.vars.borderRadius.small;
|
|
22
22
|
const offset = cssUtils.calc(constants.arrowSize).divide(2).negate().toString();
|
|
23
|
-
const
|
|
24
|
-
const
|
|
23
|
+
const arrowX = css.createVar("arrowX");
|
|
24
|
+
const arrowY = css.createVar("arrowY");
|
|
25
25
|
const baseArrow = css.style({
|
|
26
|
-
left:
|
|
27
|
-
|
|
26
|
+
left: arrowX,
|
|
27
|
+
top: arrowY,
|
|
28
28
|
visibility: "hidden",
|
|
29
29
|
":before": {
|
|
30
30
|
visibility: "visible",
|
|
@@ -51,7 +51,9 @@ const arrow = css.styleVariants({
|
|
|
51
51
|
}, "arrow");
|
|
52
52
|
fileScope.endFileScope();
|
|
53
53
|
exports.arrow = arrow;
|
|
54
|
-
exports.
|
|
54
|
+
exports.arrowX = arrowX;
|
|
55
|
+
exports.arrowY = arrowY;
|
|
56
|
+
exports.constants = constants;
|
|
55
57
|
exports.maxWidth = maxWidth;
|
|
56
58
|
exports.overflowWrap = overflowWrap;
|
|
57
59
|
exports.translateZ0 = translateZ0;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
|
|
2
2
|
import { style, styleVariants, createVar } from "@vanilla-extract/css";
|
|
3
3
|
import { calc } from "@vanilla-extract/css-utils";
|
|
4
|
-
import { space } from "../../css/atoms/atomicProperties.mjs";
|
|
5
4
|
import { vars } from "../../themes/vars.css.mjs";
|
|
6
5
|
setFileScope("src/lib/components/TooltipRenderer/TooltipRenderer.css.ts", "braid-design-system");
|
|
7
6
|
const constants = {
|
|
@@ -12,18 +11,19 @@ const maxWidth = style({
|
|
|
12
11
|
maxWidth: constants.maxWidth
|
|
13
12
|
}, "maxWidth");
|
|
14
13
|
const overflowWrap = style({
|
|
15
|
-
overflowWrap: "break-word"
|
|
14
|
+
overflowWrap: "break-word",
|
|
15
|
+
wordBreak: "keep-all"
|
|
16
16
|
}, "overflowWrap");
|
|
17
17
|
const translateZ0 = style({
|
|
18
18
|
transform: "translateZ(0)"
|
|
19
19
|
}, "translateZ0");
|
|
20
20
|
const borderRadius = vars.borderRadius.small;
|
|
21
21
|
const offset = calc(constants.arrowSize).divide(2).negate().toString();
|
|
22
|
-
const
|
|
23
|
-
const
|
|
22
|
+
const arrowX = createVar("arrowX");
|
|
23
|
+
const arrowY = createVar("arrowY");
|
|
24
24
|
const baseArrow = style({
|
|
25
|
-
left:
|
|
26
|
-
|
|
25
|
+
left: arrowX,
|
|
26
|
+
top: arrowY,
|
|
27
27
|
visibility: "hidden",
|
|
28
28
|
":before": {
|
|
29
29
|
visibility: "visible",
|
|
@@ -51,7 +51,9 @@ const arrow = styleVariants({
|
|
|
51
51
|
endFileScope();
|
|
52
52
|
export {
|
|
53
53
|
arrow,
|
|
54
|
-
|
|
54
|
+
arrowX,
|
|
55
|
+
arrowY,
|
|
56
|
+
constants,
|
|
55
57
|
maxWidth,
|
|
56
58
|
overflowWrap,
|
|
57
59
|
translateZ0
|