@telia/teddy 0.4.4 → 0.4.6
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/components/card/card-illustration.d.ts +1 -1
- package/dist/components/channel-button/channel-button-root.d.ts +3 -3
- package/dist/components/channel-button/index.d.ts +3 -3
- package/dist/components/checkbox/checkbox-group.d.ts +1 -1
- package/dist/components/checkbox/index.d.ts +1 -1
- package/dist/components/chip/chip-indicator.d.ts +2 -2
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/color-dot/index.d.ts +1 -1
- package/dist/components/expandable-card/expandable-card-button.d.ts +2 -2
- package/dist/components/expandable-card/index.d.ts +3 -3
- package/dist/components/flip-card/flip-card-back.cjs +39 -0
- package/dist/components/flip-card/flip-card-back.d.ts +27 -0
- package/dist/components/flip-card/flip-card-back.js +39 -0
- package/dist/components/flip-card/flip-card-footer.cjs +22 -0
- package/dist/components/flip-card/flip-card-footer.d.ts +14 -0
- package/dist/components/flip-card/flip-card-footer.js +22 -0
- package/dist/components/flip-card/flip-card-front.cjs +29 -0
- package/dist/components/flip-card/flip-card-front.d.ts +21 -0
- package/dist/components/flip-card/flip-card-front.js +29 -0
- package/dist/components/flip-card/flip-card-root.cjs +132 -0
- package/dist/components/flip-card/flip-card-root.d.ts +60 -0
- package/dist/components/flip-card/flip-card-root.js +132 -0
- package/dist/components/flip-card/flip-card-trigger.cjs +36 -0
- package/dist/components/flip-card/flip-card-trigger.d.ts +63 -0
- package/dist/components/flip-card/flip-card-trigger.js +36 -0
- package/dist/components/flip-card/index.cjs +18 -0
- package/dist/components/flip-card/index.d.ts +154 -0
- package/dist/components/flip-card/index.js +18 -0
- package/dist/components/icon/utils.d.ts +1 -1
- package/dist/components/index.cjs +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -0
- package/dist/components/modal/modal-close.cjs +1 -0
- package/dist/components/modal/modal-close.js +1 -0
- package/dist/components/navigation-menu/navigation-menu.cjs +1 -0
- package/dist/components/navigation-menu/navigation-menu.js +1 -0
- package/dist/components/notabene/notabene-icon.d.ts +2 -2
- package/dist/components/notification/index.d.ts +1 -1
- package/dist/components/notification/notification-icon.d.ts +2 -2
- package/dist/components/notification/notification-root.d.ts +1 -1
- package/dist/components/radio-card-group/radio-card-group-content.cjs +1 -0
- package/dist/components/radio-card-group/radio-card-group-content.js +1 -0
- package/dist/components/radio-card-group/radio-card-group-item-title.cjs +1 -0
- package/dist/components/radio-card-group/radio-card-group-item-title.js +1 -0
- package/dist/components/radio-card-group/radio-card-group-item.cjs +1 -0
- package/dist/components/radio-card-group/radio-card-group-item.js +1 -0
- package/dist/components/scroll-area/index.cjs +4 -3
- package/dist/components/scroll-area/index.d.ts +6 -3
- package/dist/components/scroll-area/index.js +3 -2
- package/dist/components/scroll-area/scroll-area-bar.cjs +6 -250
- package/dist/components/scroll-area/scroll-area-bar.js +6 -233
- package/dist/components/scroll-area/scroll-area-button.cjs +2 -2
- package/dist/components/scroll-area/scroll-area-button.d.ts +2 -2
- package/dist/components/scroll-area/scroll-area-button.js +1 -1
- package/dist/components/scroll-area/scroll-area-corner.cjs +2 -2
- package/dist/components/scroll-area/scroll-area-corner.js +1 -1
- package/dist/components/scroll-area/scroll-area-item.cjs +3 -3
- package/dist/components/scroll-area/scroll-area-item.js +1 -1
- package/dist/components/scroll-area/scroll-area-root.cjs +4 -5
- package/dist/components/scroll-area/scroll-area-root.d.ts +25 -3
- package/dist/components/scroll-area/scroll-area-root.js +1 -2
- package/dist/components/scroll-area/scroll-area-thumb.cjs +251 -6
- package/dist/components/scroll-area/scroll-area-thumb.js +234 -6
- package/dist/components/tabs/index.cjs +12 -13
- package/dist/components/tabs/index.d.ts +112 -56
- package/dist/components/tabs/index.js +12 -13
- package/dist/components/tabs/tabs-content.d.ts +2 -0
- package/dist/components/tabs/tabs-root.d.ts +10 -0
- package/dist/components/tabs/tabs-scroll-button.d.ts +2 -2
- package/dist/components/tabs/tabs-scroll.cjs +1 -1
- package/dist/components/tabs/tabs-scroll.d.ts +3 -1
- package/dist/components/tabs/tabs-scroll.js +1 -1
- package/dist/components/text-field/index.d.ts +2 -2
- package/dist/components/text-field/text-field-button.d.ts +2 -2
- package/dist/components/toggle/toggle.d.ts +2 -2
- package/dist/main.cjs +2 -0
- package/dist/main.js +2 -0
- package/dist/style.css +3373 -3307
- package/dist/utils/generate-styling/grid.d.ts +24 -24
- package/dist/utils/generate-styling/index.d.ts +16 -16
- package/dist/utils/generate-styling/util.d.ts +2 -2
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ export type IllustrationProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
|
9
9
|
/** The illustration for the card */
|
|
10
10
|
export declare const Illustration: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
11
11
|
/** The inset allows make the image bleed out to the edges */
|
|
12
|
-
inset?: "all" | "top" | "bottom" | "left" | "right" | "top-left" | "
|
|
12
|
+
inset?: "all" | "top" | "bottom" | "left" | "right" | "top-right-left" | "bottom-left-right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-bottom" | "left-right" | undefined;
|
|
13
13
|
rounded?: boolean | undefined;
|
|
14
14
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
15
15
|
export {};
|
|
@@ -12,7 +12,7 @@ export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.
|
|
|
12
12
|
loading?: boolean | undefined;
|
|
13
13
|
fullWidth?: boolean | undefined;
|
|
14
14
|
size?: "sm" | "md" | "lg" | undefined;
|
|
15
|
-
variant?: "
|
|
15
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
16
16
|
borderStyle?: ("default" | "dashed") | undefined;
|
|
17
17
|
} & {
|
|
18
18
|
iconOnly: true;
|
|
@@ -24,11 +24,11 @@ export declare const Root: React.ForwardRefExoticComponent<Omit<Omit<Omit<React.
|
|
|
24
24
|
loading?: boolean | undefined;
|
|
25
25
|
fullWidth?: boolean | undefined;
|
|
26
26
|
size?: "sm" | "md" | "lg" | undefined;
|
|
27
|
-
variant?: "
|
|
27
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
28
28
|
borderStyle?: ("default" | "dashed") | undefined;
|
|
29
29
|
} & {
|
|
30
30
|
iconOnly?: false | undefined;
|
|
31
31
|
"aria-label"?: string | undefined;
|
|
32
|
-
} & React.RefAttributes<HTMLButtonElement>, "ref">, "aria-label" | "loading" | "size" | "
|
|
32
|
+
} & React.RefAttributes<HTMLButtonElement>, "ref">, "aria-label" | "loading" | "size" | "borderStyle" | "variant" | "fullWidth" | "iconOnly"> & {
|
|
33
33
|
as?: "div" | "span" | undefined;
|
|
34
34
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -35,7 +35,7 @@ declare const ChannelButton: import('react').ForwardRefExoticComponent<Omit<Omit
|
|
|
35
35
|
loading?: boolean | undefined;
|
|
36
36
|
fullWidth?: boolean | undefined;
|
|
37
37
|
size?: "sm" | "md" | "lg" | undefined;
|
|
38
|
-
variant?: "
|
|
38
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
39
39
|
borderStyle?: ("default" | "dashed") | undefined;
|
|
40
40
|
} & {
|
|
41
41
|
iconOnly: true;
|
|
@@ -47,12 +47,12 @@ declare const ChannelButton: import('react').ForwardRefExoticComponent<Omit<Omit
|
|
|
47
47
|
loading?: boolean | undefined;
|
|
48
48
|
fullWidth?: boolean | undefined;
|
|
49
49
|
size?: "sm" | "md" | "lg" | undefined;
|
|
50
|
-
variant?: "
|
|
50
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
51
51
|
borderStyle?: ("default" | "dashed") | undefined;
|
|
52
52
|
} & {
|
|
53
53
|
iconOnly?: false | undefined;
|
|
54
54
|
"aria-label"?: string | undefined;
|
|
55
|
-
} & import('react').RefAttributes<HTMLButtonElement>, "ref">, "aria-label" | "loading" | "size" | "
|
|
55
|
+
} & import('react').RefAttributes<HTMLButtonElement>, "ref">, "aria-label" | "loading" | "size" | "borderStyle" | "variant" | "fullWidth" | "iconOnly"> & {
|
|
56
56
|
as?: "div" | "span" | undefined;
|
|
57
57
|
} & import('react').RefAttributes<HTMLButtonElement>> & {
|
|
58
58
|
/**
|
|
@@ -34,7 +34,7 @@ export declare const Group: React.ForwardRefExoticComponent<Omit<Omit<import('..
|
|
|
34
34
|
} & import('../../utils/generate-styling/flex').FlexLayout & {
|
|
35
35
|
as: "div";
|
|
36
36
|
asChild?: false | undefined;
|
|
37
|
-
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "
|
|
37
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>, "ref">, "defaultValue" | "direction" | "value" | "onValueChange"> & {
|
|
38
38
|
name?: string | undefined;
|
|
39
39
|
required?: boolean | undefined;
|
|
40
40
|
disabled?: boolean | undefined;
|
|
@@ -41,7 +41,7 @@ export declare const CheckboxGroup: import('react').ForwardRefExoticComponent<Om
|
|
|
41
41
|
} & import('../../utils/generate-styling/flex.ts').FlexLayout & {
|
|
42
42
|
as: "div";
|
|
43
43
|
asChild?: false | undefined;
|
|
44
|
-
} & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>, "ref">, "
|
|
44
|
+
} & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import('react').RefAttributes<HTMLDivElement>, "ref">, "defaultValue" | "direction" | "value" | "onValueChange"> & {
|
|
45
45
|
name?: string | undefined;
|
|
46
46
|
required?: boolean | undefined;
|
|
47
47
|
disabled?: boolean | undefined;
|
|
@@ -3,7 +3,7 @@ import { Icon } from '../icon';
|
|
|
3
3
|
|
|
4
4
|
export type IndicatorProps = Partial<React.ComponentPropsWithoutRef<typeof Icon>>;
|
|
5
5
|
export declare const Indicator: React.ForwardRefExoticComponent<Partial<Omit<React.SVGProps<SVGSVGElement> & {
|
|
6
|
-
name: "link" | "map" | "menu" | "search" | "summary" | "time" | "video" | "filter" | "image" | "stop" | "
|
|
7
|
-
size?: ("
|
|
6
|
+
name: "link" | "map" | "menu" | "search" | "summary" | "time" | "video" | "filter" | "image" | "stop" | "key" | "x" | "download" | "split" | "alert" | "radio" | "email" | "copy" | "add" | "reverse" | "infinite" | "visible" | "help" | "zoom-out" | "zoom" | "close" | "error" | "focus" | "play" | "alarm-off" | "alarm-on" | "attachment" | "bookmark-filled" | "bookmark" | "copy-filled" | "dislike" | "edit" | "heart-filled" | "heart" | "invisible" | "like" | "lock-open" | "lock" | "login" | "logout" | "maximize" | "minimize" | "mute" | "password-invisible" | "password-visible" | "play-filled" | "remove-filled" | "remove" | "save" | "send" | "settings" | "share" | "shortcut" | "shuffle" | "skip-back-10sec" | "skip-back-30sec" | "skip-forward-10sec" | "skip-forward-30sec" | "star-filled" | "star" | "switch-arrows" | "sync" | "tv-next" | "tv-pause" | "tv-previous" | "tv-stop" | "upload" | "volume" | "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" | "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" | "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" | "food" | "fraud" | "getting-started" | "home-care" | "job-search" | "layers" | "measuring-health" | "moisture" | "offering" | "offshore" | "optimization" | "pebble" | "pet-dog" | "pin" | "plane" | "plus-minus" | "police" | "power-grid" | "present" | "press-button" | "price" | "pulse" | "recycle" | "reservation" | "route" | "ruler" | "satellite" | "secured-1" | "secured-2" | "security-camera" | "shopping" | "smart-connect" | "snowflake" | "speedometer" | "spyware" | "suitcase" | "sustainability" | "tag" | "temperature" | "thinking" | "train" | "transfer" | "undo" | "wavelength" | "weather" | "world" | "android" | "apple" | "bankid-norway" | "bankid" | "facebook" | "instagram" | "linkedin" | "snapchat" | "telia-logo" | "whatsapp" | "windows" | "youtube" | "alert-filled" | "check-circle-filled" | "check-circle" | "error-filled" | "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" | "grid-view" | "list-view" | "minus-bold" | "minus" | "more-horizontal" | "more-vertical" | "plus" | "services" | "sorter" | "table-view";
|
|
7
|
+
size?: ("sm" | "md" | "lg" | "xl" | "xs" | "font" | "xxs") | undefined;
|
|
8
8
|
children?: React.ReactNode;
|
|
9
9
|
}, "ref">> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -5,8 +5,8 @@ import { ItemProps } from './chip-item';
|
|
|
5
5
|
export declare const Chip: import('react').ForwardRefExoticComponent<RootProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
6
6
|
Item: import('react').ForwardRefExoticComponent<ItemProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
Indicator: import('react').ForwardRefExoticComponent<Partial<Omit<import('react').SVGProps<SVGSVGElement> & {
|
|
8
|
-
name: "link" | "map" | "menu" | "search" | "summary" | "time" | "video" | "filter" | "image" | "stop" | "
|
|
9
|
-
size?: ("
|
|
8
|
+
name: "link" | "map" | "menu" | "search" | "summary" | "time" | "video" | "filter" | "image" | "stop" | "key" | "x" | "download" | "split" | "alert" | "radio" | "email" | "copy" | "add" | "reverse" | "infinite" | "visible" | "help" | "zoom-out" | "zoom" | "close" | "error" | "focus" | "play" | "alarm-off" | "alarm-on" | "attachment" | "bookmark-filled" | "bookmark" | "copy-filled" | "dislike" | "edit" | "heart-filled" | "heart" | "invisible" | "like" | "lock-open" | "lock" | "login" | "logout" | "maximize" | "minimize" | "mute" | "password-invisible" | "password-visible" | "play-filled" | "remove-filled" | "remove" | "save" | "send" | "settings" | "share" | "shortcut" | "shuffle" | "skip-back-10sec" | "skip-back-30sec" | "skip-forward-10sec" | "skip-forward-30sec" | "star-filled" | "star" | "switch-arrows" | "sync" | "tv-next" | "tv-pause" | "tv-previous" | "tv-stop" | "upload" | "volume" | "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" | "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" | "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" | "food" | "fraud" | "getting-started" | "home-care" | "job-search" | "layers" | "measuring-health" | "moisture" | "offering" | "offshore" | "optimization" | "pebble" | "pet-dog" | "pin" | "plane" | "plus-minus" | "police" | "power-grid" | "present" | "press-button" | "price" | "pulse" | "recycle" | "reservation" | "route" | "ruler" | "satellite" | "secured-1" | "secured-2" | "security-camera" | "shopping" | "smart-connect" | "snowflake" | "speedometer" | "spyware" | "suitcase" | "sustainability" | "tag" | "temperature" | "thinking" | "train" | "transfer" | "undo" | "wavelength" | "weather" | "world" | "android" | "apple" | "bankid-norway" | "bankid" | "facebook" | "instagram" | "linkedin" | "snapchat" | "telia-logo" | "whatsapp" | "windows" | "youtube" | "alert-filled" | "check-circle-filled" | "check-circle" | "error-filled" | "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" | "grid-view" | "list-view" | "minus-bold" | "minus" | "more-horizontal" | "more-vertical" | "plus" | "services" | "sorter" | "table-view";
|
|
9
|
+
size?: ("sm" | "md" | "lg" | "xl" | "xs" | "font" | "xxs") | undefined;
|
|
10
10
|
children?: import('react').ReactNode;
|
|
11
11
|
}, "ref">> & import('react').RefAttributes<SVGSVGElement>>;
|
|
12
12
|
};
|
|
@@ -6,7 +6,7 @@ export declare const ColorDot: import('react').ForwardRefExoticComponent<Omit<({
|
|
|
6
6
|
as?: "div" | undefined;
|
|
7
7
|
} & Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">), "children"> & {
|
|
8
8
|
color: string;
|
|
9
|
-
size: "
|
|
9
|
+
size: "sm" | "md" | "lg" | "xs";
|
|
10
10
|
bordered?: boolean | undefined;
|
|
11
11
|
wide?: boolean | undefined;
|
|
12
12
|
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -12,7 +12,7 @@ export declare const Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<Reac
|
|
|
12
12
|
loading?: boolean | undefined;
|
|
13
13
|
fullWidth?: boolean | undefined;
|
|
14
14
|
size?: "sm" | "md" | "lg" | undefined;
|
|
15
|
-
variant?: "
|
|
15
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
16
16
|
borderStyle?: ("default" | "dashed") | undefined;
|
|
17
17
|
} & {
|
|
18
18
|
iconOnly: true;
|
|
@@ -24,7 +24,7 @@ export declare const Button: React.ForwardRefExoticComponent<Omit<Omit<Omit<Reac
|
|
|
24
24
|
loading?: boolean | undefined;
|
|
25
25
|
fullWidth?: boolean | undefined;
|
|
26
26
|
size?: "sm" | "md" | "lg" | undefined;
|
|
27
|
-
variant?: "
|
|
27
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
28
28
|
borderStyle?: ("default" | "dashed") | undefined;
|
|
29
29
|
} & {
|
|
30
30
|
iconOnly?: false | undefined;
|
|
@@ -27,7 +27,7 @@ export declare const ExpandableCard: import('react').ForwardRefExoticComponent<R
|
|
|
27
27
|
loading?: boolean | undefined;
|
|
28
28
|
fullWidth?: boolean | undefined;
|
|
29
29
|
size?: "sm" | "md" | "lg" | undefined;
|
|
30
|
-
variant?: "
|
|
30
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
31
31
|
borderStyle?: ("default" | "dashed") | undefined;
|
|
32
32
|
} & {
|
|
33
33
|
iconOnly: true;
|
|
@@ -39,13 +39,13 @@ export declare const ExpandableCard: import('react').ForwardRefExoticComponent<R
|
|
|
39
39
|
loading?: boolean | undefined;
|
|
40
40
|
fullWidth?: boolean | undefined;
|
|
41
41
|
size?: "sm" | "md" | "lg" | undefined;
|
|
42
|
-
variant?: "
|
|
42
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
43
43
|
borderStyle?: ("default" | "dashed") | undefined;
|
|
44
44
|
} & {
|
|
45
45
|
iconOnly?: false | undefined;
|
|
46
46
|
"aria-label"?: string | undefined;
|
|
47
47
|
} & import('react').RefAttributes<HTMLButtonElement>, "ref">, "variant"> & {
|
|
48
|
-
variant?: "
|
|
48
|
+
variant?: "text" | "list-item" | "primary" | "secondary" | "destructive" | "tertiary-purple" | "expressive" | "primary-negative" | "secondary-negative" | "destructive-negative" | "tertiary-purple-negative" | "text-negative" | "expressive-negative" | undefined;
|
|
49
49
|
position?: "left" | "right" | undefined;
|
|
50
50
|
} & import('react').RefAttributes<HTMLButtonElement>>;
|
|
51
51
|
Indicator: import('react').ForwardRefExoticComponent<Omit<IndicatorProps, "ref"> & import('react').RefAttributes<SVGSVGElement>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 components_flipCard_flipCardRoot = require("./flip-card-root.cjs");
|
|
7
|
+
const components_card_index = require("../card/index.cjs");
|
|
8
|
+
const components_scrollArea_index = require("../scroll-area/index.cjs");
|
|
9
|
+
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
10
|
+
const BackContext = React.createContext({});
|
|
11
|
+
const Back = React.forwardRef(
|
|
12
|
+
({ className, variant, children, wrapperClassName, "aria-label": ariaLabel, ...props }, forwardRef) => {
|
|
13
|
+
const { flipped, backId, backRef } = React.useContext(components_flipCard_flipCardRoot.FlipContext);
|
|
14
|
+
const ref = utils_composeRefs.useComposedRefs(forwardRef, backRef);
|
|
15
|
+
const classesOuter = clsx(
|
|
16
|
+
[components_flipCard_flipCardRoot.styles[`${components_flipCard_flipCardRoot.rootClassName}__back`]],
|
|
17
|
+
{
|
|
18
|
+
[components_flipCard_flipCardRoot.styles[`${components_flipCard_flipCardRoot.rootClassName}__card--hidden`]]: !flipped
|
|
19
|
+
},
|
|
20
|
+
wrapperClassName
|
|
21
|
+
);
|
|
22
|
+
const classesInner = clsx([components_flipCard_flipCardRoot.styles[`${components_flipCard_flipCardRoot.rootClassName}__back-inner`]], className);
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BackContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsxRuntime.jsx(components_card_index.Card, { variant, className: classesOuter, children: /* @__PURE__ */ jsxRuntime.jsx(components_scrollArea_index.ScrollArea, { viewPortClassName: components_flipCard_flipCardRoot.styles[`${components_flipCard_flipCardRoot.rootClassName}__scroll-area-view-port`], children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
24
|
+
components_card_index.Card,
|
|
25
|
+
{
|
|
26
|
+
id: backId,
|
|
27
|
+
role: "region",
|
|
28
|
+
"aria-label": ariaLabel || "Bakside innhold",
|
|
29
|
+
...props,
|
|
30
|
+
ref,
|
|
31
|
+
className: classesInner,
|
|
32
|
+
children
|
|
33
|
+
}
|
|
34
|
+
) }) }) });
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
Back.displayName = "Back";
|
|
38
|
+
exports.Back = Back;
|
|
39
|
+
exports.BackContext = BackContext;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Card } from '../card';
|
|
3
|
+
|
|
4
|
+
export type BackProps = React.ComponentPropsWithoutRef<typeof Card> & {
|
|
5
|
+
/**
|
|
6
|
+
* Additional CSS class name to apply to the outer wrapper element of the back side.
|
|
7
|
+
* Use this for custom styling of the outer card container.
|
|
8
|
+
*/
|
|
9
|
+
wrapperClassName?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Content to display on the back side of the card.
|
|
12
|
+
*
|
|
13
|
+
* Since Back is a Card component, you should use Card subcomponents inside it:
|
|
14
|
+
* Card.Heading, Card.Description, Card.Content, Card.Illustration, etc.
|
|
15
|
+
*
|
|
16
|
+
* Note: The back content is automatically wrapped in a ScrollArea
|
|
17
|
+
* to handle overflow content if it exceeds the dimensions established by the Front component.
|
|
18
|
+
*/
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The accessible name for the back side content.
|
|
22
|
+
* If not provided, it will use "Bakside innhold" as the default.
|
|
23
|
+
*/
|
|
24
|
+
'aria-label'?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare const BackContext: React.Context<Pick<BackProps, "variant">>;
|
|
27
|
+
export declare const Back: React.ForwardRefExoticComponent<BackProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useContext } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { FlipContext, s as styles, rootClassName } from "./flip-card-root.js";
|
|
5
|
+
import { Card } from "../card/index.js";
|
|
6
|
+
import { ScrollArea } from "../scroll-area/index.js";
|
|
7
|
+
import { useComposedRefs } from "../../utils/composeRefs.js";
|
|
8
|
+
const BackContext = React__default.createContext({});
|
|
9
|
+
const Back = React__default.forwardRef(
|
|
10
|
+
({ className, variant, children, wrapperClassName, "aria-label": ariaLabel, ...props }, forwardRef) => {
|
|
11
|
+
const { flipped, backId, backRef } = useContext(FlipContext);
|
|
12
|
+
const ref = useComposedRefs(forwardRef, backRef);
|
|
13
|
+
const classesOuter = clsx(
|
|
14
|
+
[styles[`${rootClassName}__back`]],
|
|
15
|
+
{
|
|
16
|
+
[styles[`${rootClassName}__card--hidden`]]: !flipped
|
|
17
|
+
},
|
|
18
|
+
wrapperClassName
|
|
19
|
+
);
|
|
20
|
+
const classesInner = clsx([styles[`${rootClassName}__back-inner`]], className);
|
|
21
|
+
return /* @__PURE__ */ jsx(BackContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsx(Card, { variant, className: classesOuter, children: /* @__PURE__ */ jsx(ScrollArea, { viewPortClassName: styles[`${rootClassName}__scroll-area-view-port`], children: /* @__PURE__ */ jsx(
|
|
22
|
+
Card,
|
|
23
|
+
{
|
|
24
|
+
id: backId,
|
|
25
|
+
role: "region",
|
|
26
|
+
"aria-label": ariaLabel || "Bakside innhold",
|
|
27
|
+
...props,
|
|
28
|
+
ref,
|
|
29
|
+
className: classesInner,
|
|
30
|
+
children
|
|
31
|
+
}
|
|
32
|
+
) }) }) });
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
Back.displayName = "Back";
|
|
36
|
+
export {
|
|
37
|
+
Back,
|
|
38
|
+
BackContext
|
|
39
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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 components_flipCard_flipCardRoot = require("./flip-card-root.cjs");
|
|
7
|
+
const components_flipCard_flipCardBack = require("./flip-card-back.cjs");
|
|
8
|
+
const Footer = React.forwardRef(
|
|
9
|
+
({ className, children, ...props }, forwardRef) => {
|
|
10
|
+
const { variant: backVariant } = React.useContext(components_flipCard_flipCardBack.BackContext);
|
|
11
|
+
const classes = clsx(
|
|
12
|
+
[components_flipCard_flipCardRoot.styles[`${components_flipCard_flipCardRoot.rootClassName}__footer`]],
|
|
13
|
+
{
|
|
14
|
+
[components_flipCard_flipCardRoot.styles[`${components_flipCard_flipCardRoot.rootClassName}__footer--${backVariant}`]]: !!backVariant
|
|
15
|
+
},
|
|
16
|
+
className
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, ref: forwardRef, className: classes, children });
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
Footer.displayName = "Footer";
|
|
22
|
+
exports.Footer = Footer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type FooterProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
4
|
+
/**
|
|
5
|
+
* The content to display in the footer, typically a trigger button
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
};
|
|
9
|
+
export declare const Footer: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
/**
|
|
11
|
+
* The content to display in the footer, typically a trigger button
|
|
12
|
+
*/
|
|
13
|
+
children: React.ReactNode;
|
|
14
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useContext } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { s as styles, rootClassName } from "./flip-card-root.js";
|
|
5
|
+
import { BackContext } from "./flip-card-back.js";
|
|
6
|
+
const Footer = React__default.forwardRef(
|
|
7
|
+
({ className, children, ...props }, forwardRef) => {
|
|
8
|
+
const { variant: backVariant } = useContext(BackContext);
|
|
9
|
+
const classes = clsx(
|
|
10
|
+
[styles[`${rootClassName}__footer`]],
|
|
11
|
+
{
|
|
12
|
+
[styles[`${rootClassName}__footer--${backVariant}`]]: !!backVariant
|
|
13
|
+
},
|
|
14
|
+
className
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx("div", { ...props, ref: forwardRef, className: classes, children });
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
Footer.displayName = "Footer";
|
|
20
|
+
export {
|
|
21
|
+
Footer
|
|
22
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
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 components_flipCard_flipCardRoot = require("./flip-card-root.cjs");
|
|
7
|
+
const components_card_index = require("../card/index.cjs");
|
|
8
|
+
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
9
|
+
const Front = React.forwardRef(
|
|
10
|
+
({ className, children, "aria-label": ariaLabel, ...props }, forwardRef) => {
|
|
11
|
+
const { frontId, frontRef } = React.useContext(components_flipCard_flipCardRoot.FlipContext);
|
|
12
|
+
const ref = utils_composeRefs.useComposedRefs(forwardRef, frontRef);
|
|
13
|
+
const classes = clsx([components_flipCard_flipCardRoot.styles[`${components_flipCard_flipCardRoot.rootClassName}__front`]], className);
|
|
14
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
15
|
+
components_card_index.Card,
|
|
16
|
+
{
|
|
17
|
+
...props,
|
|
18
|
+
ref,
|
|
19
|
+
className: classes,
|
|
20
|
+
id: frontId,
|
|
21
|
+
role: "region",
|
|
22
|
+
"aria-label": ariaLabel || "Forside innhold",
|
|
23
|
+
children
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
Front.displayName = "Front";
|
|
29
|
+
exports.Front = Front;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Card } from '../card';
|
|
3
|
+
|
|
4
|
+
export type FrontProps = React.ComponentPropsWithoutRef<typeof Card> & {
|
|
5
|
+
/**
|
|
6
|
+
* Content to display on the front side of the card.
|
|
7
|
+
*
|
|
8
|
+
* Since Front is a Card component, you should use Card subcomponents inside it:
|
|
9
|
+
* Card.Heading, Card.Description, Card.Content, Card.Illustration, etc.
|
|
10
|
+
*
|
|
11
|
+
* The Front component determines the overall dimensions of the FlipCard.
|
|
12
|
+
* Both front and back sides will have the same dimensions.
|
|
13
|
+
*/
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The accessible name for the front side content.
|
|
17
|
+
* If not provided, it will use "Forside innhold" as the default.
|
|
18
|
+
*/
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const Front: React.ForwardRefExoticComponent<FrontProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import React__default, { useContext } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { FlipContext, s as styles, rootClassName } from "./flip-card-root.js";
|
|
5
|
+
import { Card } from "../card/index.js";
|
|
6
|
+
import { useComposedRefs } from "../../utils/composeRefs.js";
|
|
7
|
+
const Front = React__default.forwardRef(
|
|
8
|
+
({ className, children, "aria-label": ariaLabel, ...props }, forwardRef) => {
|
|
9
|
+
const { frontId, frontRef } = useContext(FlipContext);
|
|
10
|
+
const ref = useComposedRefs(forwardRef, frontRef);
|
|
11
|
+
const classes = clsx([styles[`${rootClassName}__front`]], className);
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
13
|
+
Card,
|
|
14
|
+
{
|
|
15
|
+
...props,
|
|
16
|
+
ref,
|
|
17
|
+
className: classes,
|
|
18
|
+
id: frontId,
|
|
19
|
+
role: "region",
|
|
20
|
+
"aria-label": ariaLabel || "Forside innhold",
|
|
21
|
+
children
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
Front.displayName = "Front";
|
|
27
|
+
export {
|
|
28
|
+
Front
|
|
29
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
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 reactUseControllableState = require("@radix-ui/react-use-controllable-state");
|
|
7
|
+
const utils_composeRefs = require("../../utils/composeRefs.cjs");
|
|
8
|
+
const styles = {
|
|
9
|
+
"teddy-flip-card": "_teddy-flip-card_1is05_1",
|
|
10
|
+
"teddy-flip-card--flipped": "_teddy-flip-card--flipped_1is05_12",
|
|
11
|
+
"teddy-flip-card__front": "_teddy-flip-card__front_1is05_15",
|
|
12
|
+
"teddy-flip-card__back": "_teddy-flip-card__back_1is05_19",
|
|
13
|
+
"teddy-flip-card__back-inner": "_teddy-flip-card__back-inner_1is05_31",
|
|
14
|
+
"teddy-flip-card__scroll-area-view-port": "_teddy-flip-card__scroll-area-view-port_1is05_38",
|
|
15
|
+
"teddy-flip-card__footer": "_teddy-flip-card__footer_1is05_42",
|
|
16
|
+
"teddy-flip-card__footer--purple-light": "_teddy-flip-card__footer--purple-light_1is05_50",
|
|
17
|
+
"teddy-flip-card__footer--purple-dark": "_teddy-flip-card__footer--purple-dark_1is05_53",
|
|
18
|
+
"teddy-flip-card__footer--beige": "_teddy-flip-card__footer--beige_1is05_56",
|
|
19
|
+
"teddy-flip-card__footer--beige-light": "_teddy-flip-card__footer--beige-light_1is05_59",
|
|
20
|
+
"teddy-flip-card__footer--gray": "_teddy-flip-card__footer--gray_1is05_62",
|
|
21
|
+
"teddy-flip-card__footer--white": "_teddy-flip-card__footer--white_1is05_65"
|
|
22
|
+
};
|
|
23
|
+
const rootClassName = "teddy-flip-card";
|
|
24
|
+
const FlipContext = React.createContext({
|
|
25
|
+
flipped: false,
|
|
26
|
+
setFlipped: () => void 0,
|
|
27
|
+
frontId: "",
|
|
28
|
+
backId: "",
|
|
29
|
+
frontRef: void 0,
|
|
30
|
+
backRef: void 0
|
|
31
|
+
});
|
|
32
|
+
const FALLBACK_ANIMATION_DURATION = 500;
|
|
33
|
+
function parseTimeToMs(time) {
|
|
34
|
+
if (time.endsWith("ms")) {
|
|
35
|
+
return parseFloat(time);
|
|
36
|
+
} else if (time.endsWith("s")) {
|
|
37
|
+
return parseFloat(time) * 1e3;
|
|
38
|
+
}
|
|
39
|
+
return FALLBACK_ANIMATION_DURATION;
|
|
40
|
+
}
|
|
41
|
+
const Root = React.forwardRef(
|
|
42
|
+
({
|
|
43
|
+
className,
|
|
44
|
+
defaultFlipped,
|
|
45
|
+
onFlippedChange,
|
|
46
|
+
flipped: flippedProp,
|
|
47
|
+
children,
|
|
48
|
+
"aria-label": ariaLabel,
|
|
49
|
+
id,
|
|
50
|
+
...props
|
|
51
|
+
}, forwardRef) => {
|
|
52
|
+
const [flipped, setFlipped] = reactUseControllableState.useControllableState({
|
|
53
|
+
onChange: onFlippedChange,
|
|
54
|
+
prop: flippedProp,
|
|
55
|
+
defaultProp: defaultFlipped
|
|
56
|
+
});
|
|
57
|
+
const internalRef = React.useRef(null);
|
|
58
|
+
const composedRef = utils_composeRefs.useComposedRefs(forwardRef, internalRef);
|
|
59
|
+
const frontRef = React.useRef(null);
|
|
60
|
+
const backRef = React.useRef(null);
|
|
61
|
+
const timerRef = React.useRef();
|
|
62
|
+
const [animationDuration, setAnimationDuration] = React.useState(FALLBACK_ANIMATION_DURATION);
|
|
63
|
+
const uniqueId = id || `flip-card-${Math.random().toString(36).substring(2, 9)}`;
|
|
64
|
+
const frontId = `${uniqueId}-front`;
|
|
65
|
+
const backId = `${uniqueId}-back`;
|
|
66
|
+
const classes = clsx(
|
|
67
|
+
[styles[`${rootClassName}`]],
|
|
68
|
+
{
|
|
69
|
+
[styles[`${rootClassName}--flipped`]]: flipped
|
|
70
|
+
},
|
|
71
|
+
className
|
|
72
|
+
);
|
|
73
|
+
React.useLayoutEffect(() => {
|
|
74
|
+
if (internalRef.current) {
|
|
75
|
+
const computedStyle = window.getComputedStyle(internalRef.current);
|
|
76
|
+
const transitionDuration = computedStyle.getPropertyValue("transition-duration");
|
|
77
|
+
if (transitionDuration) {
|
|
78
|
+
const durationMs = parseTimeToMs(transitionDuration);
|
|
79
|
+
setAnimationDuration(durationMs + 50);
|
|
80
|
+
}
|
|
81
|
+
if (frontRef.current) {
|
|
82
|
+
const frontSize = frontRef.current.getBoundingClientRect();
|
|
83
|
+
internalRef.current.style.width = `${frontSize.width}px`;
|
|
84
|
+
internalRef.current.style.height = `${frontSize.height}px`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}, []);
|
|
88
|
+
React.useEffect(() => {
|
|
89
|
+
if (!frontRef.current || !backRef.current)
|
|
90
|
+
return;
|
|
91
|
+
if (timerRef.current) {
|
|
92
|
+
clearTimeout(timerRef.current);
|
|
93
|
+
}
|
|
94
|
+
frontRef.current.style.display = "";
|
|
95
|
+
backRef.current.style.display = "";
|
|
96
|
+
timerRef.current = setTimeout(() => {
|
|
97
|
+
if (frontRef.current && backRef.current) {
|
|
98
|
+
if (flipped) {
|
|
99
|
+
frontRef.current.style.display = "none";
|
|
100
|
+
} else {
|
|
101
|
+
backRef.current.style.display = "none";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}, animationDuration);
|
|
105
|
+
}, [flipped, animationDuration]);
|
|
106
|
+
React.useEffect(() => {
|
|
107
|
+
return () => {
|
|
108
|
+
if (timerRef.current) {
|
|
109
|
+
clearTimeout(timerRef.current);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
}, []);
|
|
113
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FlipContext.Provider, { value: { flipped, setFlipped, frontId, backId, frontRef, backRef }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
...props,
|
|
117
|
+
ref: composedRef,
|
|
118
|
+
className: classes,
|
|
119
|
+
role: "region",
|
|
120
|
+
"aria-label": ariaLabel || "Flip card",
|
|
121
|
+
"aria-roledescription": "flip card",
|
|
122
|
+
"aria-live": "polite",
|
|
123
|
+
children
|
|
124
|
+
}
|
|
125
|
+
) });
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
Root.displayName = "Root";
|
|
129
|
+
exports.FlipContext = FlipContext;
|
|
130
|
+
exports.Root = Root;
|
|
131
|
+
exports.rootClassName = rootClassName;
|
|
132
|
+
exports.styles = styles;
|