@telia/teddy 0.3.5 → 0.3.7
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/index.cjs +30 -31
- package/dist/components/card/index.d.ts +236 -42
- package/dist/components/card/index.js +30 -31
- package/dist/components/drawer/drawer-close.cjs +1 -1
- package/dist/components/drawer/drawer-close.d.ts +6 -1
- package/dist/components/drawer/drawer-close.js +1 -1
- package/package.json +1 -1
|
@@ -15,35 +15,34 @@ const components_card_cardAvailability = require("./card-availability.cjs");
|
|
|
15
15
|
const components_card_cardColorDots = require("./card-color-dots.cjs");
|
|
16
16
|
const components_card_cardPrice = require("./card-price.cjs");
|
|
17
17
|
const components_card_cardCarousel = require("./card-carousel.cjs");
|
|
18
|
-
components_card_card.Root
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
});
|
|
18
|
+
const Card = components_card_card.Root;
|
|
19
|
+
Card.displayName = "Card";
|
|
20
|
+
Card.Heading = components_card_cardHeading.Heading;
|
|
21
|
+
Card.Heading.displayName = "Card.Heading";
|
|
22
|
+
Card.Button = components_card_cardButton.Button;
|
|
23
|
+
Card.Button.displayName = "Card.Button";
|
|
24
|
+
Card.Content = components_card_cardContent.Content;
|
|
25
|
+
Card.Content.displayName = "Card.Content";
|
|
26
|
+
Card.Illustration = components_card_cardIllustration.Illustration;
|
|
27
|
+
Card.Illustration.displayName = "Card.Illustration";
|
|
28
|
+
Card.Line = components_card_cardLine.Line;
|
|
29
|
+
Card.Line.displayName = "Card.Line";
|
|
30
|
+
Card.Link = components_card_cardLink.Link;
|
|
31
|
+
Card.Link.displayName = "Card.Link";
|
|
32
|
+
Card.Slot = components_card_cardSlot.Slot;
|
|
33
|
+
Card.Slot.displayName = "Card.Slot";
|
|
34
|
+
Card.Footer = components_card_cardFooter.Footer;
|
|
35
|
+
Card.Footer.displayName = "Card.Footer";
|
|
36
|
+
Card.Overline = components_card_cardOverline.Overline;
|
|
37
|
+
Card.Overline.displayName = "Card.Overline";
|
|
38
|
+
Card.Description = components_card_cardDescription.Description;
|
|
39
|
+
Card.Description.displayName = "Card.Description";
|
|
40
|
+
Card.Availability = components_card_cardAvailability.Availability;
|
|
41
|
+
Card.Availability.displayName = "Card.Availability";
|
|
42
|
+
Card.ColorDots = components_card_cardColorDots.ColorDots;
|
|
43
|
+
Card.ColorDots.displayName = "Card.ColorDots";
|
|
44
|
+
Card.Price = components_card_cardPrice.Price;
|
|
45
|
+
Card.Price.displayName = "Card.Price";
|
|
46
|
+
Card.ImageSlider = components_card_cardCarousel.ImageSlider;
|
|
47
|
+
Card.ImageSlider.displayName = "Card.ImageSlider";
|
|
49
48
|
exports.Card = Card;
|
|
@@ -1,47 +1,20 @@
|
|
|
1
|
-
import { HeadingProps } from './card-heading';
|
|
1
|
+
import { Heading, HeadingProps } from './card-heading';
|
|
2
2
|
import { RootProps } from './card';
|
|
3
|
-
import { ButtonProps } from './card-button';
|
|
4
|
-
import { ContentProps } from './card-content';
|
|
5
|
-
import { IllustrationProps } from './card-illustration';
|
|
6
|
-
import { LineProps } from './card-line';
|
|
7
|
-
import { LinkProps } from './card-link';
|
|
8
|
-
import { SlotProps } from './card-slot';
|
|
9
|
-
import { FooterProps } from './card-footer';
|
|
10
|
-
import { OverlineProps } from './card-overline';
|
|
11
|
-
import { DescriptionProps } from './card-description';
|
|
12
|
-
import { AvailabilityProps } from './card-availability';
|
|
13
|
-
import { ColorDotsProps } from './card-color-dots';
|
|
14
|
-
import { PriceProps } from './card-price';
|
|
15
|
-
import { ImageSliderProps } from './card-carousel';
|
|
3
|
+
import { Button, ButtonProps } from './card-button';
|
|
4
|
+
import { Content, ContentProps } from './card-content';
|
|
5
|
+
import { Illustration, IllustrationProps } from './card-illustration';
|
|
6
|
+
import { Line, LineProps } from './card-line';
|
|
7
|
+
import { Link, LinkProps } from './card-link';
|
|
8
|
+
import { Slot, SlotProps } from './card-slot';
|
|
9
|
+
import { Footer, FooterProps } from './card-footer';
|
|
10
|
+
import { Overline, OverlineProps } from './card-overline';
|
|
11
|
+
import { Description, DescriptionProps } from './card-description';
|
|
12
|
+
import { Availability, AvailabilityProps } from './card-availability';
|
|
13
|
+
import { ColorDots, ColorDotsProps } from './card-color-dots';
|
|
14
|
+
import { Price, PriceProps } from './card-price';
|
|
15
|
+
import { ImageSlider, ImageSliderProps } from './card-carousel';
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
Heading: import('react').ForwardRefExoticComponent<HeadingProps & import('react').RefAttributes<HTMLHeadingElement>>;
|
|
19
|
-
Button: import('react').ForwardRefExoticComponent<ButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
20
|
-
Content: import('react').ForwardRefExoticComponent<ContentProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
21
|
-
Illustration: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
22
|
-
inset?: "all" | "top" | "bottom" | "left" | "right" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top-right-left" | "bottom-left-right" | "top-bottom" | "left-right" | undefined;
|
|
23
|
-
rounded?: boolean | undefined;
|
|
24
|
-
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
25
|
-
Line: import('react').ForwardRefExoticComponent<LineProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
26
|
-
Link: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
27
|
-
asChild?: boolean | undefined;
|
|
28
|
-
disableVisited?: boolean | undefined;
|
|
29
|
-
ensureTargetArea?: boolean | undefined;
|
|
30
|
-
silent?: boolean | undefined;
|
|
31
|
-
variant: "text" | "navigation" | "text-negative" | "standalone" | "standalone-negative" | "navigation-negative";
|
|
32
|
-
} & import('react').RefAttributes<HTMLAnchorElement>, "ref"> & import('react').RefAttributes<HTMLAnchorElement>>;
|
|
33
|
-
Overline: import('react').ForwardRefExoticComponent<OverlineProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
34
|
-
Slot: import('react').ForwardRefExoticComponent<SlotProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
35
|
-
Footer: import('react').ForwardRefExoticComponent<FooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
36
|
-
Description: import('react').ForwardRefExoticComponent<DescriptionProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
37
|
-
Availability: import('react').ForwardRefExoticComponent<Partial<Omit<import('..').AlertBadgeProps & import('react').RefAttributes<HTMLSpanElement>, "ref">> & {
|
|
38
|
-
statusText: string;
|
|
39
|
-
} & import('react').RefAttributes<HTMLDivElement>>;
|
|
40
|
-
ColorDots: import('react').ForwardRefExoticComponent<ColorDotsProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
41
|
-
Price: import('react').ForwardRefExoticComponent<PriceProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
42
|
-
ImageSlider: import('react').ForwardRefExoticComponent<ImageSliderProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
43
|
-
};
|
|
44
|
-
export type CardProps = {
|
|
17
|
+
type CardProps = {
|
|
45
18
|
Root: RootProps;
|
|
46
19
|
Heading: HeadingProps;
|
|
47
20
|
Button: ButtonProps;
|
|
@@ -58,3 +31,224 @@ export type CardProps = {
|
|
|
58
31
|
Price: PriceProps;
|
|
59
32
|
ImageSlider: ImageSliderProps;
|
|
60
33
|
};
|
|
34
|
+
/**
|
|
35
|
+
* Card is a versatile container component that can be used to display various types of content in a structured and consistent way.
|
|
36
|
+
* It supports different variants, layouts, and can be used for both static and interactive content.
|
|
37
|
+
*
|
|
38
|
+
* @component
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Basic card with default layout
|
|
42
|
+
* <Card>
|
|
43
|
+
* <Card.Heading>Basic Card</Card.Heading>
|
|
44
|
+
* <Card.Content>
|
|
45
|
+
* <Text>Some content here</Text>
|
|
46
|
+
* </Card.Content>
|
|
47
|
+
* </Card>
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Navigation card with vertical layout
|
|
51
|
+
* <Card layout="navigation-vertical">
|
|
52
|
+
* <Card.Heading>Product Card</Card.Heading>
|
|
53
|
+
* <Card.Content>
|
|
54
|
+
* <Card.Button>View Details</Card.Button>
|
|
55
|
+
* </Card.Content>
|
|
56
|
+
* </Card>
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Product card with product layout
|
|
60
|
+
* <Card layout="product">
|
|
61
|
+
* <Card.Illustration>
|
|
62
|
+
* <Image src="product.jpg" alt="Product" />
|
|
63
|
+
* </Card.Illustration>
|
|
64
|
+
* <Card.Heading>Product Name</Card.Heading>
|
|
65
|
+
* <Card.Price>99.99</Card.Price>
|
|
66
|
+
* <Card.Content>
|
|
67
|
+
* <Text>Product description</Text>
|
|
68
|
+
* </Card.Content>
|
|
69
|
+
* </Card.Footer>
|
|
70
|
+
* </Card>
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Rich card with background image
|
|
74
|
+
* <Card layout="rich-card" backgroundImageSrc="background.jpg" imageGradient="light">
|
|
75
|
+
* <Card.Heading>Featured Content</Card.Heading>
|
|
76
|
+
* <Card.Description>Rich content with background image</Card.Description>
|
|
77
|
+
* <Card.Content>
|
|
78
|
+
* <Card.Button>Learn More</Card.Button>
|
|
79
|
+
* </Card.Content>
|
|
80
|
+
* </Card>
|
|
81
|
+
*/
|
|
82
|
+
declare const Card: import('react').ForwardRefExoticComponent<RootProps & import('react').RefAttributes<HTMLDivElement>> & {
|
|
83
|
+
/**
|
|
84
|
+
* Main title of the card. Renders the internal Heading component.
|
|
85
|
+
* Should be used to provide clear context about the card's content.
|
|
86
|
+
*
|
|
87
|
+
* @component
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* <Card.Heading>Product Name</Card.Heading>
|
|
91
|
+
*/
|
|
92
|
+
Heading: typeof Heading;
|
|
93
|
+
/**
|
|
94
|
+
* Interactive button for navigation cards.
|
|
95
|
+
* When used, the entire card becomes interactive through ref forwarding.
|
|
96
|
+
* Should not be used together with Card.Link in the same card.
|
|
97
|
+
* Works best with navigation layouts (navigation-vertical, navigation-horizontal-small, etc.).
|
|
98
|
+
*
|
|
99
|
+
* @component
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* <Card.Content>
|
|
103
|
+
* <Card.Button>View Details</Card.Button>
|
|
104
|
+
* </Card.Content>
|
|
105
|
+
*/
|
|
106
|
+
Button: typeof Button;
|
|
107
|
+
/**
|
|
108
|
+
* Main content area of the card.
|
|
109
|
+
* Should wrap the primary content of the card.
|
|
110
|
+
* Layout and positioning are determined by the card's layout prop.
|
|
111
|
+
*
|
|
112
|
+
* @component
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* <Card.Content>
|
|
116
|
+
* <Text>Main content goes here</Text>
|
|
117
|
+
* </Card.Content>
|
|
118
|
+
*/
|
|
119
|
+
Content: typeof Content;
|
|
120
|
+
/**
|
|
121
|
+
* Container for images or illustrations.
|
|
122
|
+
* Handles proper sizing and positioning of visual content.
|
|
123
|
+
* Particularly important for product and rich card layouts.
|
|
124
|
+
*
|
|
125
|
+
* @component
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* <Card.Illustration>
|
|
129
|
+
* <Image src="product.jpg" alt="Product" />
|
|
130
|
+
* </Card.Illustration>
|
|
131
|
+
*/
|
|
132
|
+
Illustration: typeof Illustration;
|
|
133
|
+
/**
|
|
134
|
+
* Divider line between sections of the card.
|
|
135
|
+
* Used to create visual separation between content blocks.
|
|
136
|
+
* Common in product and rich card layouts.
|
|
137
|
+
*
|
|
138
|
+
* @component
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* <Card.Line />
|
|
142
|
+
*/
|
|
143
|
+
Line: typeof Line;
|
|
144
|
+
/**
|
|
145
|
+
* Alternative to Card.Button for navigation cards.
|
|
146
|
+
* When used, the entire card becomes interactive through ref forwarding.
|
|
147
|
+
* Should not be used together with Card.Button in the same card.
|
|
148
|
+
* Works best with navigation layouts.
|
|
149
|
+
*
|
|
150
|
+
* @component
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* <Card.Content>
|
|
154
|
+
* <Card.Link>Learn More</Card.Link>
|
|
155
|
+
* </Card.Content>
|
|
156
|
+
*/
|
|
157
|
+
Link: typeof Link;
|
|
158
|
+
/**
|
|
159
|
+
* Flexible container for badges, icons, or other small elements.
|
|
160
|
+
* Can be positioned using the align prop.
|
|
161
|
+
* Common in product cards for badges and status indicators.
|
|
162
|
+
*
|
|
163
|
+
* @component
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* <Card.Slot align="top-right">
|
|
167
|
+
* <Badge>New</Badge>
|
|
168
|
+
* </Card.Slot>
|
|
169
|
+
*/
|
|
170
|
+
Slot: typeof Slot;
|
|
171
|
+
/**
|
|
172
|
+
* Footer section of the card.
|
|
173
|
+
* Typically used for additional actions or information.
|
|
174
|
+
* Common in product cards for action buttons.
|
|
175
|
+
*
|
|
176
|
+
* @component
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* <Card.Footer>
|
|
180
|
+
* <Button>Add to Cart</Button>
|
|
181
|
+
* </Card.Footer>
|
|
182
|
+
*/
|
|
183
|
+
Footer: typeof Footer;
|
|
184
|
+
/**
|
|
185
|
+
* Text displayed above the heading.
|
|
186
|
+
* Used for additional context or categorization.
|
|
187
|
+
* Common in product and rich card layouts.
|
|
188
|
+
*
|
|
189
|
+
* @component
|
|
190
|
+
*
|
|
191
|
+
* @example
|
|
192
|
+
* <Card.Overline>Featured Product</Card.Overline>
|
|
193
|
+
*/
|
|
194
|
+
Overline: typeof Overline;
|
|
195
|
+
/**
|
|
196
|
+
* Short description text for the card.
|
|
197
|
+
* Provides additional context about the card's content.
|
|
198
|
+
* Common in product and rich card layouts.
|
|
199
|
+
*
|
|
200
|
+
* @component
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* <Card.Description>Limited time offer</Card.Description>
|
|
204
|
+
*/
|
|
205
|
+
Description: typeof Description;
|
|
206
|
+
/**
|
|
207
|
+
* Shows availability status of a product or service.
|
|
208
|
+
* Primarily used in product card layouts.
|
|
209
|
+
*
|
|
210
|
+
* @component
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* <Card.Availability>In Stock</Card.Availability>
|
|
214
|
+
*/
|
|
215
|
+
Availability: typeof Availability;
|
|
216
|
+
/**
|
|
217
|
+
* Displays color options or variants.
|
|
218
|
+
* Useful for product cards with multiple color choices.
|
|
219
|
+
* Primarily used in product card layouts.
|
|
220
|
+
*
|
|
221
|
+
* @component
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* <Card.ColorDots colors={['red', 'blue', 'green']} />
|
|
225
|
+
*/
|
|
226
|
+
ColorDots: typeof ColorDots;
|
|
227
|
+
/**
|
|
228
|
+
* Shows pricing information.
|
|
229
|
+
* Can display various price formats and options.
|
|
230
|
+
* Primarily used in product card layouts.
|
|
231
|
+
*
|
|
232
|
+
* @component
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* <Card.Price>99.99</Card.Price>
|
|
236
|
+
*/
|
|
237
|
+
Price: typeof Price;
|
|
238
|
+
/**
|
|
239
|
+
* Carousel component for displaying multiple images.
|
|
240
|
+
* Useful for product cards with multiple views.
|
|
241
|
+
* Primarily used in product card layouts.
|
|
242
|
+
*
|
|
243
|
+
* @component
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* <Card.ImageSlider>
|
|
247
|
+
* <Image src="view1.jpg" alt="View 1" />
|
|
248
|
+
* <Image src="view2.jpg" alt="View 2" />
|
|
249
|
+
* </Card.ImageSlider>
|
|
250
|
+
*/
|
|
251
|
+
ImageSlider: typeof ImageSlider;
|
|
252
|
+
};
|
|
253
|
+
export { Card };
|
|
254
|
+
export type { CardProps };
|
|
@@ -13,37 +13,36 @@ import { Availability } from "./card-availability.js";
|
|
|
13
13
|
import { ColorDots } from "./card-color-dots.js";
|
|
14
14
|
import { Price } from "./card-price.js";
|
|
15
15
|
import { ImageSlider } from "./card-carousel.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Heading.displayName = "Card.Heading";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
16
|
+
const Card = Root;
|
|
17
|
+
Card.displayName = "Card";
|
|
18
|
+
Card.Heading = Heading;
|
|
19
|
+
Card.Heading.displayName = "Card.Heading";
|
|
20
|
+
Card.Button = Button;
|
|
21
|
+
Card.Button.displayName = "Card.Button";
|
|
22
|
+
Card.Content = Content;
|
|
23
|
+
Card.Content.displayName = "Card.Content";
|
|
24
|
+
Card.Illustration = Illustration;
|
|
25
|
+
Card.Illustration.displayName = "Card.Illustration";
|
|
26
|
+
Card.Line = Line;
|
|
27
|
+
Card.Line.displayName = "Card.Line";
|
|
28
|
+
Card.Link = Link;
|
|
29
|
+
Card.Link.displayName = "Card.Link";
|
|
30
|
+
Card.Slot = Slot;
|
|
31
|
+
Card.Slot.displayName = "Card.Slot";
|
|
32
|
+
Card.Footer = Footer;
|
|
33
|
+
Card.Footer.displayName = "Card.Footer";
|
|
34
|
+
Card.Overline = Overline;
|
|
35
|
+
Card.Overline.displayName = "Card.Overline";
|
|
36
|
+
Card.Description = Description;
|
|
37
|
+
Card.Description.displayName = "Card.Description";
|
|
38
|
+
Card.Availability = Availability;
|
|
39
|
+
Card.Availability.displayName = "Card.Availability";
|
|
40
|
+
Card.ColorDots = ColorDots;
|
|
41
|
+
Card.ColorDots.displayName = "Card.ColorDots";
|
|
42
|
+
Card.Price = Price;
|
|
43
|
+
Card.Price.displayName = "Card.Price";
|
|
44
|
+
Card.ImageSlider = ImageSlider;
|
|
45
|
+
Card.ImageSlider.displayName = "Card.ImageSlider";
|
|
47
46
|
export {
|
|
48
47
|
Card
|
|
49
48
|
};
|
|
@@ -32,7 +32,7 @@ const Close = React.forwardRef(
|
|
|
32
32
|
[drawer_module.styles[`${components_drawer_drawerRoot.rootClassName}__close--floating`]]: props.slot === "floating",
|
|
33
33
|
className
|
|
34
34
|
});
|
|
35
|
-
return /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Close, { ...props, className: classes, ref: forwardedRef, asChild: true, children: props.children || /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "tertiary-purple", iconOnly: true, "aria-label": props["aria-label"], children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "close" }) }) });
|
|
35
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DrawerPrimitive__namespace.Close, { ...props, className: classes, ref: forwardedRef, asChild: true, children: props.children || /* @__PURE__ */ jsxRuntime.jsx(components_button_button.Button, { variant: "tertiary-purple", iconOnly: true, "aria-label": props["aria-label"] ?? "Lukk", children: /* @__PURE__ */ jsxRuntime.jsx(components_icon_icon.Icon, { name: "close" }) }) });
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
Close.displayName = "Close";
|
|
@@ -5,7 +5,12 @@ export type CloseProps = Omit<React.ComponentPropsWithoutRef<typeof DrawerPrimit
|
|
|
5
5
|
children: React.ReactElement;
|
|
6
6
|
slot: 'content';
|
|
7
7
|
} | {
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Accessibility purposes, providing a label for screen readers
|
|
10
|
+
*
|
|
11
|
+
* @default 'Lukk'
|
|
12
|
+
*/
|
|
13
|
+
['aria-label']?: string;
|
|
9
14
|
slot: 'floating';
|
|
10
15
|
children?: never;
|
|
11
16
|
});
|
|
@@ -13,7 +13,7 @@ const Close = React__default.forwardRef(
|
|
|
13
13
|
[styles[`${rootClassName}__close--floating`]]: props.slot === "floating",
|
|
14
14
|
className
|
|
15
15
|
});
|
|
16
|
-
return /* @__PURE__ */ jsx(DrawerPrimitive.Close, { ...props, className: classes, ref: forwardedRef, asChild: true, children: props.children || /* @__PURE__ */ jsx(Button, { variant: "tertiary-purple", iconOnly: true, "aria-label": props["aria-label"], children: /* @__PURE__ */ jsx(Icon, { name: "close" }) }) });
|
|
16
|
+
return /* @__PURE__ */ jsx(DrawerPrimitive.Close, { ...props, className: classes, ref: forwardedRef, asChild: true, children: props.children || /* @__PURE__ */ jsx(Button, { variant: "tertiary-purple", iconOnly: true, "aria-label": props["aria-label"] ?? "Lukk", children: /* @__PURE__ */ jsx(Icon, { name: "close" }) }) });
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
Close.displayName = "Close";
|