@telia/teddy 0.0.26 → 0.0.28
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/assets/{sprite.5636ec8e-teddy.svg → sprite.269ba410-teddy.svg} +3 -0
- package/dist/components/accordion/accordion-indicator.cjs +14 -3
- package/dist/components/accordion/accordion-indicator.js +15 -4
- package/dist/components/accordion/accordion-item.cjs +6 -1
- package/dist/components/accordion/accordion-item.d.ts +3 -0
- package/dist/components/accordion/accordion-item.js +8 -3
- package/dist/components/accordion/accordion-root.cjs +41 -14
- package/dist/components/accordion/accordion-root.d.ts +9 -5
- package/dist/components/accordion/accordion-root.js +41 -14
- package/dist/components/badge/alert-badge.cjs +19 -0
- package/dist/components/badge/alert-badge.d.ts +10 -0
- package/dist/components/badge/alert-badge.js +19 -0
- package/dist/components/badge/badge.cjs +13 -9
- package/dist/components/badge/badge.d.ts +2 -1
- package/dist/components/badge/badge.js +14 -10
- package/dist/components/badge/counter-badge.cjs +19 -0
- package/dist/components/badge/counter-badge.d.ts +10 -0
- package/dist/components/badge/counter-badge.js +19 -0
- package/dist/components/badge/index.cjs +4 -0
- package/dist/components/badge/index.d.ts +4 -0
- package/dist/components/badge/index.js +5 -1
- package/dist/components/button/button.cjs +27 -25
- package/dist/components/button/button.d.ts +2 -2
- package/dist/components/button/button.js +27 -25
- package/dist/components/card/card.d.ts +6 -2
- package/dist/components/chip/chip-indicator.cjs +1 -1
- package/dist/components/chip/chip-indicator.d.ts +2 -2
- package/dist/components/chip/chip-indicator.js +1 -1
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/drawer/drawer-close.cjs +2 -2
- package/dist/components/drawer/drawer-close.js +2 -2
- package/dist/components/drawer/drawer-content.cjs +3 -2
- package/dist/components/drawer/drawer-content.d.ts +3 -9
- package/dist/components/drawer/drawer-content.js +3 -2
- package/dist/components/drawer/drawer-description.cjs +1 -1
- package/dist/components/drawer/drawer-description.js +1 -1
- package/dist/components/drawer/drawer-footer.cjs +1 -1
- package/dist/components/drawer/drawer-footer.js +1 -1
- package/dist/components/drawer/drawer-overlay.cjs +1 -1
- package/dist/components/drawer/drawer-overlay.js +1 -1
- package/dist/components/drawer/drawer-title.cjs +1 -1
- package/dist/components/drawer/drawer-title.js +1 -1
- package/dist/components/field-error-text/field-error-text.cjs +1 -1
- package/dist/components/field-error-text/field-error-text.js +1 -1
- package/dist/components/flex/flex.cjs +1 -1
- package/dist/components/flex/flex.js +1 -1
- package/dist/components/icon/icon.cjs +3 -3
- package/dist/components/icon/icon.js +3 -3
- package/dist/components/icon/index.cjs +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/index.cjs +11 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +11 -1
- package/dist/components/input/input-clear-button.cjs +1 -1
- package/dist/components/input/input-clear-button.js +1 -1
- package/dist/components/input/input-group.cjs +11 -11
- package/dist/components/input/input-group.js +11 -11
- package/dist/components/input/input-indicator.cjs +1 -1
- package/dist/components/input/input-indicator.js +1 -1
- package/dist/components/list/index.cjs +16 -0
- package/dist/components/list/index.d.ts +47 -0
- package/dist/components/list/index.js +16 -0
- package/dist/components/list/list-content.cjs +14 -0
- package/dist/components/list/list-content.d.ts +4 -0
- package/dist/components/list/list-content.js +14 -0
- package/dist/components/list/list-illustration.cjs +23 -0
- package/dist/components/list/list-illustration.d.ts +9 -0
- package/dist/components/list/list-illustration.js +23 -0
- package/dist/components/list/list-item.cjs +12 -0
- package/dist/components/list/list-item.d.ts +4 -0
- package/dist/components/list/list-item.js +12 -0
- package/dist/components/list/list.cjs +52 -0
- package/dist/components/list/list.d.ts +43 -0
- package/dist/components/list/list.js +52 -0
- package/dist/components/modal/modal.cjs +6 -1
- package/dist/components/modal/modal.js +6 -1
- package/dist/components/navigation-menu/global-navigation/global-navigation-desktop.cjs +9 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-desktop.d.ts +4 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-desktop.js +9 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-mobile.cjs +21 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-mobile.d.ts +4 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-mobile.js +21 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.cjs +369 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.d.ts +8 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +369 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-root.cjs +12 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-root.d.ts +33 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-root.js +12 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-search-field.cjs +37 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-search-field.d.ts +10 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-search-field.js +37 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-search.cjs +12 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-search.d.ts +8 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-search.js +12 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-shopping-cart.cjs +11 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-shopping-cart.d.ts +4 -0
- package/dist/components/navigation-menu/global-navigation/global-navigation-shopping-cart.js +11 -0
- package/dist/components/navigation-menu/global-navigation/index.cjs +4 -0
- package/dist/components/navigation-menu/global-navigation/index.d.ts +6 -0
- package/dist/components/navigation-menu/global-navigation/index.js +4 -0
- package/dist/components/navigation-menu/global-navigation/utils.cjs +318 -0
- package/dist/components/navigation-menu/global-navigation/utils.d.ts +496 -0
- package/dist/components/navigation-menu/global-navigation/utils.js +318 -0
- package/dist/components/navigation-menu/index.cjs +2 -0
- package/dist/components/navigation-menu/index.d.ts +1 -0
- package/dist/components/navigation-menu/index.js +2 -0
- package/dist/components/navigation-menu/navigation-menu.cjs +49 -23
- package/dist/components/navigation-menu/navigation-menu.d.ts +6 -1
- package/dist/components/navigation-menu/navigation-menu.js +50 -24
- package/dist/components/notification/notification.cjs +1 -1
- package/dist/components/notification/notification.d.ts +11 -5
- package/dist/components/notification/notification.js +1 -1
- package/dist/components/scroll-area/index.d.ts +6 -2
- package/dist/components/scroll-area/scroll-area-bar.cjs +19 -13
- package/dist/components/scroll-area/scroll-area-bar.js +19 -13
- package/dist/components/scroll-area/scroll-area-button.cjs +1 -1
- package/dist/components/scroll-area/scroll-area-button.d.ts +6 -2
- package/dist/components/scroll-area/scroll-area-button.js +1 -1
- package/dist/components/tabs/index.cjs +6 -0
- package/dist/components/tabs/index.d.ts +8 -4
- package/dist/components/tabs/index.js +6 -0
- package/dist/components/tabs/tabs-root.cjs +5 -4
- package/dist/components/tabs/tabs-root.d.ts +1 -1
- package/dist/components/tabs/tabs-root.js +5 -4
- package/dist/components/tabs/tabs-scroll-button.d.ts +6 -2
- package/dist/components/tabs/tabs-trigger.cjs +2 -1
- package/dist/components/tabs/tabs-trigger.d.ts +1 -1
- package/dist/components/tabs/tabs-trigger.js +2 -1
- package/dist/components/text-field/index.d.ts +6 -2
- package/dist/components/text-field/text-field-button.d.ts +6 -2
- package/dist/components/toggle/toggle.cjs +5 -5
- package/dist/components/toggle/toggle.d.ts +2 -2
- package/dist/components/toggle/toggle.js +5 -5
- package/dist/components/tooltip/index.cjs +22 -0
- package/dist/components/tooltip/index.d.ts +40 -0
- package/dist/components/tooltip/index.js +22 -0
- package/dist/components/tooltip/tooltip-arrow.cjs +33 -0
- package/dist/components/tooltip/tooltip-arrow.d.ts +6 -0
- package/dist/components/tooltip/tooltip-arrow.js +16 -0
- package/dist/components/tooltip/tooltip-content.cjs +46 -0
- package/dist/components/tooltip/tooltip-content.d.ts +80 -0
- package/dist/components/tooltip/tooltip-content.js +29 -0
- package/dist/components/tooltip/tooltip-portal.cjs +26 -0
- package/dist/components/tooltip/tooltip-portal.d.ts +7 -0
- package/dist/components/tooltip/tooltip-portal.js +9 -0
- package/dist/components/tooltip/tooltip-provider.cjs +30 -0
- package/dist/components/tooltip/tooltip-provider.d.ts +9 -0
- package/dist/components/tooltip/tooltip-provider.js +13 -0
- package/dist/components/tooltip/tooltip-root.cjs +36 -0
- package/dist/components/tooltip/tooltip-root.d.ts +25 -0
- package/dist/components/tooltip/tooltip-root.js +19 -0
- package/dist/components/tooltip/tooltip-trigger.cjs +38 -0
- package/dist/components/tooltip/tooltip-trigger.d.ts +6 -0
- package/dist/components/tooltip/tooltip-trigger.js +21 -0
- package/dist/drawer.module-BZV0Appw.js +14 -0
- package/dist/drawer.module-rgUBNOkt.cjs +13 -0
- package/dist/icons/category.cjs +1 -0
- package/dist/icons/category.d.ts +3 -0
- package/dist/icons/category.js +1 -0
- package/dist/icons/name.cjs +1 -0
- package/dist/icons/name.d.ts +1 -1
- package/dist/icons/name.js +1 -0
- package/dist/main.cjs +11 -1
- package/dist/main.js +11 -1
- package/dist/style.css +948 -659
- package/dist/tooltip.module-D_3DOZOn.cjs +15 -0
- package/dist/tooltip.module-DnKU2XS4.js +16 -0
- package/dist/utils/generate-styling/index.cjs +12 -2
- package/dist/utils/generate-styling/index.d.ts +70 -3
- package/dist/utils/generate-styling/index.js +12 -2
- package/package.json +2 -1
- package/dist/drawer.module-BxsrDZFu.js +0 -14
- package/dist/drawer.module-CWDhohQm.cjs +0 -13
|
@@ -29,8 +29,8 @@ declare const Toggle: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHT
|
|
|
29
29
|
Input: React.ForwardRefExoticComponent<ToggleInputProps & React.RefAttributes<HTMLButtonElement>>;
|
|
30
30
|
Thumb: React.ForwardRefExoticComponent<Omit<SwitchPrimitive.SwitchThumbProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
|
|
31
31
|
Indicator: React.ForwardRefExoticComponent<Partial<Omit<React.SVGProps<SVGSVGElement> & {
|
|
32
|
-
name: "
|
|
33
|
-
size?: ("xxs" | "xs" | "sm" | "md" | "lg" | "xl"
|
|
32
|
+
name: "search" | "split" | "link" | "map" | "menu" | "summary" | "time" | "video" | "filter" | "image" | "stop" | "alarm-off" | "alarm-on" | "attachment" | "bookmark-filled" | "bookmark" | "copy-filled" | "copy" | "dislike" | "download" | "edit" | "heart-filled" | "heart" | "invisible" | "like" | "lock-open" | "lock" | "login" | "logout" | "maximize" | "minimize" | "mute" | "password-invisible" | "password-visible" | "play-filled" | "play" | "remove-filled" | "remove" | "save" | "send" | "settings" | "share" | "shortcut" | "shuffle" | "sync" | "skip-back-10sec" | "skip-back-30sec" | "skip-forward-10sec" | "skip-forward-30sec" | "star-filled" | "star" | "switch-arrows" | "tv-next" | "tv-pause" | "tv-previous" | "tv-stop" | "upload" | "visible" | "volume" | "zoom-out" | "zoom" | "connected-building" | "home" | "hospital" | "industry" | "premises-datacenter" | "premises-large" | "premises-medium" | "premises-small" | "premises" | "store" | "address-book" | "b2b-customer" | "care" | "chat-robot" | "chat" | "child-1" | "child-2" | "conversation" | "customer-dialogue" | "dsl-hub" | "email" | "end-user" | "handshake" | "headphones" | "letter" | "mms" | "new-contact" | "new-group" | "news" | "parental-guide" | "people-hub" | "people" | "portal" | "signature" | "smiley-happy" | "smiley-sad" | "sms" | "support" | "user-admin" | "vcard" | "voicemail" | "battery" | "bluetooth" | "broadband" | "broken-phone" | "cast" | "cloud-connect" | "connected" | "core-router" | "daas-device" | "data-transfer" | "desktop" | "devices" | "esim-simcard" | "esim" | "face-id" | "fiber" | "fingerprint" | "fiveg" | "fourg" | "home-installation" | "industrial-iot" | "internet" | "it-service" | "laptop" | "mobile-broadband" | "network" | "phone-recycling" | "phone-ringing" | "phone" | "rack" | "refill-card" | "remote-control" | "repair" | "roaming" | "router" | "secure-device" | "sense-car" | "server" | "service-device" | "service-supervision" | "slow-wifi" | "smart-wifi" | "smartphone" | "smartwatch" | "tablet" | "trade-phone" | "tv" | "usb" | "voice-switch" | "wallplug" | "wireless-off" | "wireless-weak" | "wireless" | "world-alert" | "world-off" | "world-question" | "bar-chart" | "doc" | "document-doc" | "document-edit" | "document-pdf" | "document-ppt" | "excel" | "folder-copy" | "folder-new" | "folder" | "gif" | "graph" | "media-content" | "org-chart" | "pie-chart" | "print" | "register" | "report" | "simcard" | "spell-check" | "credit-card" | "euro" | "invoice" | "kontantkort" | "kr" | "late-payment" | "money-back-euro" | "money-back-kr" | "money-euro" | "money-kr" | "pay-monthly-euro" | "pay-monthly-kr" | "pay-once-euro" | "pay-once-kr" | "payment-success" | "savings" | "wallet" | "airplay" | "camera" | "entertainment" | "external" | "film" | "games" | "megaphone" | "microphone" | "music" | "player-settings" | "record" | "stream" | "trailer" | "video-conference" | "activity-level" | "add" | "ai-robot" | "bag" | "basketball" | "blood-pressure" | "bulb" | "business-continuity" | "business-intelligence" | "calendar" | "cart" | "close-circle" | "cloud" | "coffee" | "compass" | "construction" | "cookie" | "delivery" | "drone" | "education" | "efficiency" | "environment" | "facemask" | "flag" | "focus" | "food" | "fraud" | "getting-started" | "home-care" | "infinite" | "job-search" | "key" | "layers" | "measuring-health" | "moisture" | "offering" | "offshore" | "optimization" | "pebble" | "pet-dog" | "pin" | "plane" | "plus-minus" | "police" | "power-grid" | "present" | "press-button" | "price" | "pulse" | "radio" | "recycle" | "reservation" | "reverse" | "route" | "ruler" | "satellite" | "secured-1" | "secured-2" | "security-camera" | "shopping" | "snowflake" | "speedometer" | "spyware" | "suitcase" | "sustainability" | "tag" | "temperature" | "thinking" | "train" | "transfer" | "undo" | "wavelength" | "weather" | "world" | "android" | "apple" | "bankid-norway" | "bankid" | "facebook" | "instagram" | "youtube" | "linkedin" | "snapchat" | "telia-logo" | "whatsapp" | "windows" | "x" | "alert-filled" | "alert" | "check-circle-filled" | "check-circle" | "error-filled" | "error" | "help" | "info-filled" | "info" | "question-filled" | "question" | "warning" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-subdirectory" | "arrow-up" | "card-view" | "checkmark-bold" | "checkmark" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "close" | "grid-view" | "list-view" | "minus-bold" | "minus" | "more-horizontal" | "more-vertical" | "plus" | "services" | "sorter" | "table-view";
|
|
33
|
+
size?: ("font" | "xxs" | "xs" | "sm" | "md" | "lg" | "xl") | undefined;
|
|
34
34
|
children?: React.ReactNode;
|
|
35
35
|
}, "ref">> & React.RefAttributes<SVGSVGElement>>;
|
|
36
36
|
};
|
|
@@ -2,14 +2,14 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import React__default from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
5
|
-
import "../../assets/sprite.
|
|
5
|
+
import "../../assets/sprite.269ba410-teddy.svg";
|
|
6
6
|
import { Icon } from "../icon/icon.js";
|
|
7
7
|
import { Label } from "../label/label.js";
|
|
8
8
|
const styles = {
|
|
9
|
-
"teddy-
|
|
10
|
-
"teddy-
|
|
11
|
-
"teddy-toggle__thumb": "_teddy-
|
|
12
|
-
"teddy-toggle__indicator": "_teddy-
|
|
9
|
+
"teddy-toggle__input": "_teddy-toggle__input_m5h3g_2",
|
|
10
|
+
"teddy-toggle": "_teddy-toggle_m5h3g_2",
|
|
11
|
+
"teddy-toggle__thumb": "_teddy-toggle__thumb_m5h3g_81",
|
|
12
|
+
"teddy-toggle__indicator": "_teddy-toggle__indicator_m5h3g_107"
|
|
13
13
|
};
|
|
14
14
|
const rootClassName = "teddy-toggle";
|
|
15
15
|
const ToggleContext = React__default.createContext(void 0);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const components_tooltip_tooltipRoot = require("./tooltip-root.cjs");
|
|
4
|
+
const components_tooltip_tooltipTrigger = require("./tooltip-trigger.cjs");
|
|
5
|
+
const components_tooltip_tooltipArrow = require("./tooltip-arrow.cjs");
|
|
6
|
+
const components_tooltip_tooltipContent = require("./tooltip-content.cjs");
|
|
7
|
+
const components_tooltip_tooltipPortal = require("./tooltip-portal.cjs");
|
|
8
|
+
const components_tooltip_tooltipProvider = require("./tooltip-provider.cjs");
|
|
9
|
+
components_tooltip_tooltipRoot.Root.displayName = "Tooltip";
|
|
10
|
+
components_tooltip_tooltipTrigger.Trigger.displayName = "Tooltip.Trigger";
|
|
11
|
+
components_tooltip_tooltipArrow.Arrow.displayName = "Tooltip.Arrow";
|
|
12
|
+
components_tooltip_tooltipContent.Content.displayName = "Tooltip.Content";
|
|
13
|
+
components_tooltip_tooltipPortal.Portal.displayName = "Tooltip.Portal";
|
|
14
|
+
components_tooltip_tooltipProvider.Provider.displayName = "Tooltip.Provider";
|
|
15
|
+
const Tooltip = Object.assign(components_tooltip_tooltipRoot.Root, {
|
|
16
|
+
Trigger: components_tooltip_tooltipTrigger.Trigger,
|
|
17
|
+
Arrow: components_tooltip_tooltipArrow.Arrow,
|
|
18
|
+
Content: components_tooltip_tooltipContent.Content,
|
|
19
|
+
Portal: components_tooltip_tooltipPortal.Portal,
|
|
20
|
+
Provider: components_tooltip_tooltipProvider.Provider
|
|
21
|
+
});
|
|
22
|
+
exports.Tooltip = Tooltip;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Root, RootProps } from './tooltip-root';
|
|
2
|
+
import { TriggerProps } from './tooltip-trigger';
|
|
3
|
+
import { ArrowProps } from './tooltip-arrow';
|
|
4
|
+
import { ContentProps } from './tooltip-content';
|
|
5
|
+
import { Portal, PortalProps } from './tooltip-portal';
|
|
6
|
+
import { Provider, ProviderProps } from './tooltip-provider';
|
|
7
|
+
|
|
8
|
+
export declare const Tooltip: typeof Root & {
|
|
9
|
+
Trigger: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-tooltip').TooltipTriggerProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
10
|
+
Arrow: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-tooltip').TooltipArrowProps & import('react').RefAttributes<SVGSVGElement>, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
11
|
+
Content: import('react').ForwardRefExoticComponent<Omit<import('@radix-ui/react-tooltip').TooltipContentProps & import('react').RefAttributes<HTMLDivElement>, "ref"> & {
|
|
12
|
+
hideArrow?: boolean | undefined;
|
|
13
|
+
'aria-label'?: string | undefined;
|
|
14
|
+
onEscapeKeyDown?: ((event: KeyboardEvent) => void) | undefined;
|
|
15
|
+
onPointerDownOutside?: ((event: CustomEvent<{
|
|
16
|
+
originalEvent: PointerEvent;
|
|
17
|
+
}>) => void) | undefined;
|
|
18
|
+
side?: "top" | "bottom" | "left" | "right" | undefined;
|
|
19
|
+
sideOffset?: number | undefined;
|
|
20
|
+
align?: "center" | "end" | "start" | undefined;
|
|
21
|
+
alignOffset?: number | undefined;
|
|
22
|
+
arrowPadding?: number | undefined;
|
|
23
|
+
avoidCollisions?: boolean | undefined;
|
|
24
|
+
collisionBoundary?: (Element | null) | (Element | null)[] | undefined;
|
|
25
|
+
collisionPadding?: number | Partial<Record<"top" | "bottom" | "left" | "right", number>> | undefined;
|
|
26
|
+
sticky?: "always" | "partial" | undefined;
|
|
27
|
+
hideWhenDetached?: boolean | undefined;
|
|
28
|
+
updatePositionStrategy?: "always" | "optimized" | undefined;
|
|
29
|
+
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
30
|
+
Portal: typeof Portal;
|
|
31
|
+
Provider: typeof Provider;
|
|
32
|
+
};
|
|
33
|
+
export type TooltipProps = {
|
|
34
|
+
Root: RootProps;
|
|
35
|
+
Trigger: TriggerProps;
|
|
36
|
+
Arrow: ArrowProps;
|
|
37
|
+
Content: ContentProps;
|
|
38
|
+
Portal: PortalProps;
|
|
39
|
+
Provider: ProviderProps;
|
|
40
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Root } from "./tooltip-root.js";
|
|
2
|
+
import { Trigger } from "./tooltip-trigger.js";
|
|
3
|
+
import { Arrow } from "./tooltip-arrow.js";
|
|
4
|
+
import { Content } from "./tooltip-content.js";
|
|
5
|
+
import { Portal } from "./tooltip-portal.js";
|
|
6
|
+
import { Provider } from "./tooltip-provider.js";
|
|
7
|
+
Root.displayName = "Tooltip";
|
|
8
|
+
Trigger.displayName = "Tooltip.Trigger";
|
|
9
|
+
Arrow.displayName = "Tooltip.Arrow";
|
|
10
|
+
Content.displayName = "Tooltip.Content";
|
|
11
|
+
Portal.displayName = "Tooltip.Portal";
|
|
12
|
+
Provider.displayName = "Tooltip.Provider";
|
|
13
|
+
const Tooltip = Object.assign(Root, {
|
|
14
|
+
Trigger,
|
|
15
|
+
Arrow,
|
|
16
|
+
Content,
|
|
17
|
+
Portal,
|
|
18
|
+
Provider
|
|
19
|
+
});
|
|
20
|
+
export {
|
|
21
|
+
Tooltip
|
|
22
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const clsx = require("clsx");
|
|
6
|
+
const tooltip_module = require("../../tooltip.module-D_3DOZOn.cjs");
|
|
7
|
+
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
8
|
+
const components_tooltip_tooltipRoot = require("./tooltip-root.cjs");
|
|
9
|
+
function _interopNamespaceDefault(e) {
|
|
10
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
11
|
+
if (e) {
|
|
12
|
+
for (const k in e) {
|
|
13
|
+
if (k !== "default") {
|
|
14
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: () => e[k]
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
26
|
+
const Arrow = React.forwardRef(
|
|
27
|
+
({ className, ...props }, forwardRef) => {
|
|
28
|
+
const classes = clsx([tooltip_module.styles[`${components_tooltip_tooltipRoot.rootClassName}__arrow`]], className);
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Arrow, { ...props, ref: forwardRef, className: classes });
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
Arrow.displayName = "Arrow";
|
|
33
|
+
exports.Arrow = Arrow;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
4
|
+
export type ArrowProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>;
|
|
5
|
+
/** An optional arrow element to render alongside the tooltip. This can be used to help visually link the trigger with the Tooltip.Content. Must be rendered inside Tooltip.Content. */
|
|
6
|
+
export declare const Arrow: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipArrowProps & React.RefAttributes<SVGSVGElement>, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { s as styles } from "../../tooltip.module-DnKU2XS4.js";
|
|
5
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
6
|
+
import { rootClassName } from "./tooltip-root.js";
|
|
7
|
+
const Arrow = React__default.forwardRef(
|
|
8
|
+
({ className, ...props }, forwardRef) => {
|
|
9
|
+
const classes = clsx([styles[`${rootClassName}__arrow`]], className);
|
|
10
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, { ...props, ref: forwardRef, className: classes });
|
|
11
|
+
}
|
|
12
|
+
);
|
|
13
|
+
Arrow.displayName = "Arrow";
|
|
14
|
+
export {
|
|
15
|
+
Arrow
|
|
16
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const clsx = require("clsx");
|
|
6
|
+
const tooltip_module = require("../../tooltip.module-D_3DOZOn.cjs");
|
|
7
|
+
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
8
|
+
const components_tooltip_tooltipRoot = require("./tooltip-root.cjs");
|
|
9
|
+
const reactSlot = require("@radix-ui/react-slot");
|
|
10
|
+
const components_tooltip_tooltipArrow = require("./tooltip-arrow.cjs");
|
|
11
|
+
function _interopNamespaceDefault(e) {
|
|
12
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
13
|
+
if (e) {
|
|
14
|
+
for (const k in e) {
|
|
15
|
+
if (k !== "default") {
|
|
16
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
17
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: () => e[k]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
n.default = e;
|
|
25
|
+
return Object.freeze(n);
|
|
26
|
+
}
|
|
27
|
+
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
28
|
+
const Content = React.forwardRef(
|
|
29
|
+
({ className, children, hideArrow, ...props }, forwardRef) => {
|
|
30
|
+
var _a;
|
|
31
|
+
const negative = (_a = React.useContext(components_tooltip_tooltipRoot.RootContext)) == null ? void 0 : _a.negative;
|
|
32
|
+
const classes = clsx(
|
|
33
|
+
[tooltip_module.styles[`${components_tooltip_tooltipRoot.rootClassName}__content`]],
|
|
34
|
+
{
|
|
35
|
+
[tooltip_module.styles[`${components_tooltip_tooltipRoot.rootClassName}--negative`]]: negative
|
|
36
|
+
},
|
|
37
|
+
className
|
|
38
|
+
);
|
|
39
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(TooltipPrimitive__namespace.Content, { sideOffset: -5, ...props, ref: forwardRef, className: classes, children: [
|
|
40
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slottable, { children }),
|
|
41
|
+
!hideArrow && /* @__PURE__ */ jsxRuntime.jsx(components_tooltip_tooltipArrow.Arrow, {})
|
|
42
|
+
] });
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
Content.displayName = "Content";
|
|
46
|
+
exports.Content = Content;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
4
|
+
export type ContentProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content> & {
|
|
5
|
+
hideArrow?: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* A more descriptive label for accessibility purpose
|
|
8
|
+
*/
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Event handler called when the escape key is down.
|
|
12
|
+
* Can be prevented.
|
|
13
|
+
*/
|
|
14
|
+
onEscapeKeyDown?: TooltipPrimitive.TooltipContentProps['onEscapeKeyDown'];
|
|
15
|
+
/**
|
|
16
|
+
* Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.
|
|
17
|
+
* Can be prevented.
|
|
18
|
+
*/
|
|
19
|
+
onPointerDownOutside?: TooltipPrimitive.TooltipContentProps['onPointerDownOutside'];
|
|
20
|
+
/** The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. */
|
|
21
|
+
side?: TooltipPrimitive.TooltipContentProps['side'];
|
|
22
|
+
/** The distance in pixels from the trigger. */
|
|
23
|
+
sideOffset?: TooltipPrimitive.TooltipContentProps['sideOffset'];
|
|
24
|
+
/** The preferred alignment against the trigger. May change when collisions occur. */
|
|
25
|
+
align?: TooltipPrimitive.TooltipContentProps['align'];
|
|
26
|
+
/** An offset in pixels from the `"start"` or `"end"` alignment options. */
|
|
27
|
+
alignOffset?: TooltipPrimitive.TooltipContentProps['alignOffset'];
|
|
28
|
+
/** The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners. */
|
|
29
|
+
arrowPadding?: TooltipPrimitive.TooltipContentProps['arrowPadding'];
|
|
30
|
+
/** When `true`, overrides the side andalign preferences to prevent collisions with boundary edges. */
|
|
31
|
+
avoidCollisions?: TooltipPrimitive.TooltipContentProps['avoidCollisions'];
|
|
32
|
+
/** The element used as the collision boundary. By default this is the viewport, though you can provide additional element(s) to be included in this check. */
|
|
33
|
+
collisionBoundary?: TooltipPrimitive.TooltipContentProps['collisionBoundary'];
|
|
34
|
+
/** The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: `{ top: 20, left: 20 }`. */
|
|
35
|
+
collisionPadding?: TooltipPrimitive.TooltipContentProps['collisionPadding'];
|
|
36
|
+
/** The sticky behavior on the align axis. `"partial"` will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst `"always"` will keep the content in the boundary regardless. */
|
|
37
|
+
sticky?: TooltipPrimitive.TooltipContentProps['sticky'];
|
|
38
|
+
/** Whether to hide the content when the trigger becomes fully occluded. */
|
|
39
|
+
hideWhenDetached?: TooltipPrimitive.TooltipContentProps['hideWhenDetached'];
|
|
40
|
+
updatePositionStrategy?: TooltipPrimitive.TooltipContentProps['updatePositionStrategy'];
|
|
41
|
+
};
|
|
42
|
+
/** The component that pops out when the tooltip is open. */
|
|
43
|
+
export declare const Content: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
44
|
+
hideArrow?: boolean | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* A more descriptive label for accessibility purpose
|
|
47
|
+
*/
|
|
48
|
+
'aria-label'?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Event handler called when the escape key is down.
|
|
51
|
+
* Can be prevented.
|
|
52
|
+
*/
|
|
53
|
+
onEscapeKeyDown?: TooltipPrimitive.TooltipContentProps['onEscapeKeyDown'];
|
|
54
|
+
/**
|
|
55
|
+
* Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.
|
|
56
|
+
* Can be prevented.
|
|
57
|
+
*/
|
|
58
|
+
onPointerDownOutside?: TooltipPrimitive.TooltipContentProps['onPointerDownOutside'];
|
|
59
|
+
/** The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. */
|
|
60
|
+
side?: TooltipPrimitive.TooltipContentProps['side'];
|
|
61
|
+
/** The distance in pixels from the trigger. */
|
|
62
|
+
sideOffset?: TooltipPrimitive.TooltipContentProps['sideOffset'];
|
|
63
|
+
/** The preferred alignment against the trigger. May change when collisions occur. */
|
|
64
|
+
align?: TooltipPrimitive.TooltipContentProps['align'];
|
|
65
|
+
/** An offset in pixels from the `"start"` or `"end"` alignment options. */
|
|
66
|
+
alignOffset?: TooltipPrimitive.TooltipContentProps['alignOffset'];
|
|
67
|
+
/** The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners. */
|
|
68
|
+
arrowPadding?: TooltipPrimitive.TooltipContentProps['arrowPadding'];
|
|
69
|
+
/** When `true`, overrides the side andalign preferences to prevent collisions with boundary edges. */
|
|
70
|
+
avoidCollisions?: TooltipPrimitive.TooltipContentProps['avoidCollisions'];
|
|
71
|
+
/** The element used as the collision boundary. By default this is the viewport, though you can provide additional element(s) to be included in this check. */
|
|
72
|
+
collisionBoundary?: TooltipPrimitive.TooltipContentProps['collisionBoundary'];
|
|
73
|
+
/** The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: `{ top: 20, left: 20 }`. */
|
|
74
|
+
collisionPadding?: TooltipPrimitive.TooltipContentProps['collisionPadding'];
|
|
75
|
+
/** The sticky behavior on the align axis. `"partial"` will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst `"always"` will keep the content in the boundary regardless. */
|
|
76
|
+
sticky?: TooltipPrimitive.TooltipContentProps['sticky'];
|
|
77
|
+
/** Whether to hide the content when the trigger becomes fully occluded. */
|
|
78
|
+
hideWhenDetached?: TooltipPrimitive.TooltipContentProps['hideWhenDetached'];
|
|
79
|
+
updatePositionStrategy?: TooltipPrimitive.TooltipContentProps['updatePositionStrategy'];
|
|
80
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { s as styles } from "../../tooltip.module-DnKU2XS4.js";
|
|
5
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
6
|
+
import { RootContext, rootClassName } from "./tooltip-root.js";
|
|
7
|
+
import { Slottable } from "@radix-ui/react-slot";
|
|
8
|
+
import { Arrow } from "./tooltip-arrow.js";
|
|
9
|
+
const Content = React__default.forwardRef(
|
|
10
|
+
({ className, children, hideArrow, ...props }, forwardRef) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const negative = (_a = React__default.useContext(RootContext)) == null ? void 0 : _a.negative;
|
|
13
|
+
const classes = clsx(
|
|
14
|
+
[styles[`${rootClassName}__content`]],
|
|
15
|
+
{
|
|
16
|
+
[styles[`${rootClassName}--negative`]]: negative
|
|
17
|
+
},
|
|
18
|
+
className
|
|
19
|
+
);
|
|
20
|
+
return /* @__PURE__ */ jsxs(TooltipPrimitive.Content, { sideOffset: -5, ...props, ref: forwardRef, className: classes, children: [
|
|
21
|
+
/* @__PURE__ */ jsx(Slottable, { children }),
|
|
22
|
+
!hideArrow && /* @__PURE__ */ jsx(Arrow, {})
|
|
23
|
+
] });
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
Content.displayName = "Content";
|
|
27
|
+
export {
|
|
28
|
+
Content
|
|
29
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
+
if (e) {
|
|
8
|
+
for (const k in e) {
|
|
9
|
+
if (k !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: () => e[k]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
22
|
+
function Portal(props) {
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Portal, { ...props });
|
|
24
|
+
}
|
|
25
|
+
Portal.displayName = "Portal";
|
|
26
|
+
exports.Portal = Portal;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
2
|
+
export type PortalProps = TooltipPrimitive.TooltipPortalProps;
|
|
3
|
+
/** When used, portals the content part into the body. */
|
|
4
|
+
export declare function Portal(props: PortalProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace Portal {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
5
|
+
const tokens_motion_variables = require("../../tokens/motion/variables.cjs");
|
|
6
|
+
const React = require("react");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
24
|
+
const ProviderContext = React.createContext(false);
|
|
25
|
+
function Provider({ delayDuration = parseInt(tokens_motion_variables.teddyMotionDuration400), ...props }) {
|
|
26
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ProviderContext.Provider, { value: true, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Provider, { delayDuration, ...props }) });
|
|
27
|
+
}
|
|
28
|
+
Provider.displayName = "Provider";
|
|
29
|
+
exports.Provider = Provider;
|
|
30
|
+
exports.ProviderContext = ProviderContext;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
export type ProviderProps = TooltipPrimitive.TooltipProviderProps;
|
|
4
|
+
export declare const ProviderContext: React.Context<boolean>;
|
|
5
|
+
/** Wraps your app to provide global functionality to your tooltips. */
|
|
6
|
+
export declare function Provider({ delayDuration, ...props }: ProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare namespace Provider {
|
|
8
|
+
var displayName: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
+
import { teddyMotionDuration400 } from "../../tokens/motion/variables.js";
|
|
4
|
+
import React__default from "react";
|
|
5
|
+
const ProviderContext = React__default.createContext(false);
|
|
6
|
+
function Provider({ delayDuration = parseInt(teddyMotionDuration400), ...props }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(ProviderContext.Provider, { value: true, children: /* @__PURE__ */ jsx(TooltipPrimitive.Provider, { delayDuration, ...props }) });
|
|
8
|
+
}
|
|
9
|
+
Provider.displayName = "Provider";
|
|
10
|
+
export {
|
|
11
|
+
Provider,
|
|
12
|
+
ProviderContext
|
|
13
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
6
|
+
const components_tooltip_tooltipProvider = require("./tooltip-provider.cjs");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
24
|
+
const rootClassName = "teddy-tooltip";
|
|
25
|
+
const RootContext = React.createContext(void 0);
|
|
26
|
+
function Root({ ...props }) {
|
|
27
|
+
const hasProvider = React.useContext(components_tooltip_tooltipProvider.ProviderContext);
|
|
28
|
+
if (!hasProvider) {
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RootContext.Provider, { value: { negative: props.negative }, children: /* @__PURE__ */ jsxRuntime.jsx(components_tooltip_tooltipProvider.Provider, { children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { ...props }) }) });
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RootContext.Provider, { value: { negative: props.negative }, children: /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Root, { ...props }) });
|
|
32
|
+
}
|
|
33
|
+
Root.displayName = "Root";
|
|
34
|
+
exports.Root = Root;
|
|
35
|
+
exports.RootContext = RootContext;
|
|
36
|
+
exports.rootClassName = rootClassName;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
4
|
+
export declare const rootClassName = "teddy-tooltip";
|
|
5
|
+
export declare const RootContext: React.Context<{
|
|
6
|
+
negative?: boolean | undefined;
|
|
7
|
+
} | undefined>;
|
|
8
|
+
export type RootProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Root> & {
|
|
9
|
+
/** The open state of the tooltip when it is initially rendered. Use when you do not need to control its open state. */
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
/** The controlled open state of the tooltip. Must be used in conjunction with onOpenChange. */
|
|
12
|
+
open?: boolean;
|
|
13
|
+
/** Event handler called when the open state of the tooltip changes. */
|
|
14
|
+
onOpenChange?(open: boolean): void;
|
|
15
|
+
/** Override the duration given to the `Provider` to customise the open delay for a specific tooltip. */
|
|
16
|
+
delayDuration?: number;
|
|
17
|
+
/** Prevents Tooltip.Content from remaining open when hovering. Disabling this has accessibility consequences. Inherits from Tooltip.Provider. */
|
|
18
|
+
disableHoverableContent?: boolean;
|
|
19
|
+
negative?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** Contains all the parts of a tooltip. */
|
|
22
|
+
export declare function Root({ ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare namespace Root {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
4
|
+
import { ProviderContext, Provider } from "./tooltip-provider.js";
|
|
5
|
+
const rootClassName = "teddy-tooltip";
|
|
6
|
+
const RootContext = React__default.createContext(void 0);
|
|
7
|
+
function Root({ ...props }) {
|
|
8
|
+
const hasProvider = React__default.useContext(ProviderContext);
|
|
9
|
+
if (!hasProvider) {
|
|
10
|
+
return /* @__PURE__ */ jsx(RootContext.Provider, { value: { negative: props.negative }, children: /* @__PURE__ */ jsx(Provider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { ...props }) }) });
|
|
11
|
+
}
|
|
12
|
+
return /* @__PURE__ */ jsx(RootContext.Provider, { value: { negative: props.negative }, children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, { ...props }) });
|
|
13
|
+
}
|
|
14
|
+
Root.displayName = "Root";
|
|
15
|
+
export {
|
|
16
|
+
Root,
|
|
17
|
+
RootContext,
|
|
18
|
+
rootClassName
|
|
19
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const clsx = require("clsx");
|
|
6
|
+
const tooltip_module = require("../../tooltip.module-D_3DOZOn.cjs");
|
|
7
|
+
const TooltipPrimitive = require("@radix-ui/react-tooltip");
|
|
8
|
+
const components_tooltip_tooltipRoot = require("./tooltip-root.cjs");
|
|
9
|
+
require("../../assets/sprite.269ba410-teddy.svg");
|
|
10
|
+
const components_icon_icon = require("../icon/icon.cjs");
|
|
11
|
+
const components_button_button = require("../button/button.cjs");
|
|
12
|
+
function _interopNamespaceDefault(e) {
|
|
13
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
14
|
+
if (e) {
|
|
15
|
+
for (const k in e) {
|
|
16
|
+
if (k !== "default") {
|
|
17
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: () => e[k]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
const TooltipPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TooltipPrimitive);
|
|
29
|
+
const Trigger = React.forwardRef(
|
|
30
|
+
({ className, children, ...props }, forwardRef) => {
|
|
31
|
+
var _a;
|
|
32
|
+
const classes = clsx([tooltip_module.styles[`${components_tooltip_tooltipRoot.rootClassName}__trigger`]], className);
|
|
33
|
+
const negative = (_a = React.useContext(components_tooltip_tooltipRoot.RootContext)) == null ? void 0 : _a.negative;
|
|
34
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TooltipPrimitive__namespace.Trigger, { asChild: !children, ...props, ref: forwardRef, className: classes, children: children || /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { iconOnly: true, "aria-label": "informasjon", variant: negative ? "tertiary-purple-negative" : "tertiary-purple", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "info" }) }) });
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
Trigger.displayName = "Trigger";
|
|
38
|
+
exports.Trigger = Trigger;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
4
|
+
export type TriggerProps = React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Trigger>;
|
|
5
|
+
/** The button that toggles the tooltip. By default, the Tooltip.Content will position itself against the trigger. */
|
|
6
|
+
export declare const Trigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { s as styles } from "../../tooltip.module-DnKU2XS4.js";
|
|
5
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
6
|
+
import { rootClassName, RootContext } from "./tooltip-root.js";
|
|
7
|
+
import "../../assets/sprite.269ba410-teddy.svg";
|
|
8
|
+
import { Icon } from "../icon/icon.js";
|
|
9
|
+
import { Button } from "../button/button.js";
|
|
10
|
+
const Trigger = React__default.forwardRef(
|
|
11
|
+
({ className, children, ...props }, forwardRef) => {
|
|
12
|
+
var _a;
|
|
13
|
+
const classes = clsx([styles[`${rootClassName}__trigger`]], className);
|
|
14
|
+
const negative = (_a = React__default.useContext(RootContext)) == null ? void 0 : _a.negative;
|
|
15
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, { asChild: !children, ...props, ref: forwardRef, className: classes, children: children || /* @__PURE__ */ jsx(Button, { iconOnly: true, "aria-label": "informasjon", variant: negative ? "tertiary-purple-negative" : "tertiary-purple", children: /* @__PURE__ */ jsx(Icon, { name: "info" }) }) });
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
Trigger.displayName = "Trigger";
|
|
19
|
+
export {
|
|
20
|
+
Trigger
|
|
21
|
+
};
|