braid-design-system 34.8.2 → 34.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/dist/color-mode/query-param.d.cts +1 -1
- package/dist/color-mode/query-param.d.mts +1 -1
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.mjs +3 -2
- package/dist/lib/components/Avatar/Avatar.cjs +213 -0
- package/dist/lib/components/Avatar/Avatar.css.cjs +31 -0
- package/dist/lib/components/Avatar/Avatar.css.d.cts +4 -0
- package/dist/lib/components/Avatar/Avatar.css.d.mts +4 -0
- package/dist/lib/components/Avatar/Avatar.css.mjs +29 -0
- package/dist/lib/components/Avatar/Avatar.d.cts +21 -0
- package/dist/lib/components/Avatar/Avatar.d.mts +21 -0
- package/dist/lib/components/Avatar/Avatar.mjs +211 -0
- package/dist/lib/components/Avatar/Avatar.playroom.cjs +14 -0
- package/dist/lib/components/Avatar/Avatar.playroom.d.cts +8 -0
- package/dist/lib/components/Avatar/Avatar.playroom.d.mts +8 -0
- package/dist/lib/components/Avatar/Avatar.playroom.mjs +14 -0
- package/dist/lib/components/Drawer/Drawer.cjs +26 -0
- package/dist/lib/components/Drawer/Drawer.d.cts +15 -4
- package/dist/lib/components/Drawer/Drawer.d.mts +15 -4
- package/dist/lib/components/Drawer/Drawer.mjs +25 -0
- package/dist/lib/components/Heading/Heading.cjs +2 -1
- package/dist/lib/components/Heading/Heading.mjs +3 -2
- package/dist/lib/components/List/List.cjs +16 -16
- package/dist/lib/components/List/List.mjs +16 -16
- package/dist/lib/components/Rating/Rating.cjs +48 -20
- package/dist/lib/components/Rating/Rating.css.cjs +34 -0
- package/dist/lib/components/Rating/Rating.css.mjs +31 -1
- package/dist/lib/components/Rating/Rating.d.cts +11 -2
- package/dist/lib/components/Rating/Rating.d.mts +11 -2
- package/dist/lib/components/Rating/Rating.mjs +50 -22
- package/dist/lib/components/Text/Text.cjs +2 -1
- package/dist/lib/components/Text/Text.mjs +2 -1
- package/dist/lib/components/index.d.cts +2 -1
- package/dist/lib/components/index.d.mts +2 -1
- package/dist/lib/components/private/InlineField/StyledInput.cjs +3 -4
- package/dist/lib/components/private/InlineField/StyledInput.mjs +3 -4
- package/dist/lib/components/private/Modal/Modal.cjs +6 -2
- package/dist/lib/components/private/Modal/Modal.mjs +6 -2
- package/dist/lib/components/private/Modal/ModalContent.cjs +104 -71
- package/dist/lib/components/private/Modal/ModalContent.mjs +104 -71
- package/dist/lib/components/private/Skeleton/Skeleton.cjs +14 -0
- package/dist/lib/components/private/Skeleton/Skeleton.css.cjs +25 -0
- package/dist/lib/components/private/Skeleton/Skeleton.css.mjs +25 -0
- package/dist/lib/components/private/Skeleton/Skeleton.mjs +14 -0
- package/dist/lib/css/atoms/sprinkles.css.d.cts +1 -1
- package/dist/lib/css/atoms/sprinkles.css.d.mts +1 -1
- package/dist/lib/css/typography.css.cjs +12 -0
- package/dist/lib/css/typography.css.mjs +12 -2
- package/dist/lib/playroom/components.cjs +2 -0
- package/dist/lib/playroom/components.d.cts +2 -1
- package/dist/lib/playroom/components.d.mts +2 -1
- package/dist/lib/playroom/components.mjs +2 -1
- package/dist/lib/playroom/snippets/Avatar.cjs +41 -0
- package/dist/lib/playroom/snippets/Avatar.mjs +41 -0
- package/dist/lib/playroom/snippets/CardList.cjs +1 -1
- package/dist/lib/playroom/snippets/CardList.mjs +1 -1
- package/dist/lib/playroom/snippets.cjs +2 -10
- package/dist/lib/playroom/snippets.mjs +94 -102
- package/dist/lib/themes/docs/tokens.cjs +4 -4
- package/dist/lib/themes/docs/tokens.mjs +4 -4
- package/dist/lib/themes/wireframe/tokens.cjs +1 -1
- package/dist/lib/themes/wireframe/tokens.mjs +1 -1
- package/dist/node_modules/.pnpm/{@capsizecss_metrics@4.2.0 → @capsizecss_metrics@4.3.0}/node_modules/@capsizecss/metrics/entireMetricsCollection/appleSystem/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@capsizecss_metrics@4.2.0 → @capsizecss_metrics@4.3.0}/node_modules/@capsizecss/metrics/entireMetricsCollection/appleSystem/index.mjs +1 -1
- package/dist/node_modules/.pnpm/{@capsizecss_metrics@4.2.0 → @capsizecss_metrics@4.3.0}/node_modules/@capsizecss/metrics/entireMetricsCollection/courierNew/index.cjs +1 -1
- package/dist/node_modules/.pnpm/{@capsizecss_metrics@4.2.0 → @capsizecss_metrics@4.3.0}/node_modules/@capsizecss/metrics/entireMetricsCollection/courierNew/index.mjs +1 -1
- package/dist/playroom/components.cjs +2 -0
- package/dist/playroom/components.d.cts +2 -1
- package/dist/playroom/components.d.mts +2 -1
- package/dist/playroom/components.mjs +2 -1
- package/package.json +3 -3
- package/dist/lib/playroom/snippets/DividedList.cjs +0 -8
- package/dist/lib/playroom/snippets/DividedList.mjs +0 -8
- package/dist/lib/playroom/snippets/Form.cjs +0 -12
- package/dist/lib/playroom/snippets/Form.mjs +0 -12
- package/dist/lib/playroom/snippets/SteppedSection.cjs +0 -8
- package/dist/lib/playroom/snippets/SteppedSection.mjs +0 -8
- package/dist/lib/playroom/snippets/TabbedSection.cjs +0 -8
- package/dist/lib/playroom/snippets/TabbedSection.mjs +0 -8
- package/dist/lib/playroom/snippets/TableSection.cjs +0 -8
- package/dist/lib/playroom/snippets/TableSection.mjs +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# braid-design-system
|
|
2
2
|
|
|
3
|
+
## 34.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **Rating:** Add support for a review count ([#2159](https://github.com/seek-oss/braid-design-system/pull/2159))
|
|
8
|
+
|
|
9
|
+
`reviewText` is a full phrase, so the caller controls translation and pluralisation. Provide `reviewLink` to render it as a link. `onClick` is optional and requires `reviewLink`.
|
|
10
|
+
|
|
11
|
+
**EXAMPLE USAGE:**
|
|
12
|
+
|
|
13
|
+
```jsx
|
|
14
|
+
<Rating rating={4.2} reviewText="128 reviews" reviewLink="/reviews" />
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- **Drawer:** Allow omitting the visible title when an `aria-label` names the dialog ([#2148](https://github.com/seek-oss/braid-design-system/pull/2148))
|
|
18
|
+
|
|
19
|
+
A `title` is no longer required. Provide either a `title` or an `aria-label`. Use `description` with a `title`, or `aria-description` with an `aria-label`. When untitled, content starts directly below the close button.
|
|
20
|
+
|
|
21
|
+
**EXAMPLE USAGE:**
|
|
22
|
+
|
|
23
|
+
```jsx
|
|
24
|
+
<Drawer
|
|
25
|
+
aria-label="Example Title"
|
|
26
|
+
aria-description="An optional description of the Drawer content"
|
|
27
|
+
open={open}
|
|
28
|
+
onClose={setOpen}
|
|
29
|
+
>
|
|
30
|
+
...
|
|
31
|
+
</Drawer>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
- **Avatar:** Add component ([#2153](https://github.com/seek-oss/braid-design-system/pull/2153))
|
|
35
|
+
|
|
36
|
+
A rounded-square identity mark for a person or company, providing a choice between an image, initials from `name`, a provided `icon`, or `IconProfile`.
|
|
37
|
+
|
|
38
|
+
**EXAMPLE USAGE:**
|
|
39
|
+
|
|
40
|
+
```jsx
|
|
41
|
+
<Avatar name="Leia Organa" />
|
|
42
|
+
<Avatar icon={<IconCompany />} />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- **Text, Heading:** Improve subscript & superscript sizing ([#2145](https://github.com/seek-oss/braid-design-system/pull/2145))
|
|
48
|
+
|
|
49
|
+
- Optimise internal logic to remove excess function calls ([#2158](https://github.com/seek-oss/braid-design-system/pull/2158))
|
|
50
|
+
|
|
51
|
+
- **Dialog, Drawer:** Ensure documentation previews remain behind the top navigation while scrolling ([#2155](https://github.com/seek-oss/braid-design-system/pull/2155))
|
|
52
|
+
|
|
3
53
|
## 34.8.2
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
|
@@ -43,6 +43,6 @@ declare const colorModeQueryParamCheck: string;
|
|
|
43
43
|
*
|
|
44
44
|
* @returns Braid color mode preference as query string parameter
|
|
45
45
|
*/
|
|
46
|
-
declare const getColorModeQueryParam: () => "
|
|
46
|
+
declare const getColorModeQueryParam: () => "" | "_bdsdm=1" | "_bdsdm=2" | "_bdsdm=0";
|
|
47
47
|
//#endregion
|
|
48
48
|
export { colorModeQueryParamCheck, getColorModeQueryParam };
|
|
@@ -43,6 +43,6 @@ declare const colorModeQueryParamCheck: string;
|
|
|
43
43
|
*
|
|
44
44
|
* @returns Braid color mode preference as query string parameter
|
|
45
45
|
*/
|
|
46
|
-
declare const getColorModeQueryParam: () => "
|
|
46
|
+
declare const getColorModeQueryParam: () => "" | "_bdsdm=1" | "_bdsdm=2" | "_bdsdm=0";
|
|
47
47
|
//#endregion
|
|
48
48
|
export { colorModeQueryParamCheck, getColorModeQueryParam };
|
package/dist/index.cjs
CHANGED
|
@@ -141,6 +141,8 @@ const require_FieldLabel = require("./lib/components/FieldLabel/FieldLabel.cjs")
|
|
|
141
141
|
const require_FieldMessage = require("./lib/components/FieldMessage/FieldMessage.cjs");
|
|
142
142
|
const require_Autosuggest = require("./lib/components/Autosuggest/Autosuggest.cjs");
|
|
143
143
|
const require_filterSuggestions = require("./lib/components/Autosuggest/filterSuggestions.cjs");
|
|
144
|
+
const require_Heading = require("./lib/components/Heading/Heading.cjs");
|
|
145
|
+
const require_Avatar = require("./lib/components/Avatar/Avatar.cjs");
|
|
144
146
|
const require_Badge = require("./lib/components/Badge/Badge.cjs");
|
|
145
147
|
const require_BoxRenderer = require("./lib/components/Box/BoxRenderer.cjs");
|
|
146
148
|
const require_ButtonLink = require("./lib/components/ButtonLink/ButtonLink.cjs");
|
|
@@ -148,7 +150,6 @@ const require_Card = require("./lib/components/Card/Card.cjs");
|
|
|
148
150
|
const require_Checkbox = require("./lib/components/Checkbox/Checkbox.cjs");
|
|
149
151
|
const require_CheckboxStandalone = require("./lib/components/Checkbox/CheckboxStandalone.cjs");
|
|
150
152
|
const require_ContentBlock = require("./lib/components/ContentBlock/ContentBlock.cjs");
|
|
151
|
-
const require_Heading = require("./lib/components/Heading/Heading.cjs");
|
|
152
153
|
const require_Dialog = require("./lib/components/Dialog/Dialog.cjs");
|
|
153
154
|
const require_TextLink = require("./lib/components/TextLink/TextLink.cjs");
|
|
154
155
|
const require_TextLinkButton = require("./lib/components/TextLinkButton/TextLinkButton.cjs");
|
|
@@ -201,6 +202,7 @@ exports.AccordionItem = require_AccordionItem.AccordionItem;
|
|
|
201
202
|
exports.Actions = require_Actions.Actions;
|
|
202
203
|
exports.Alert = require_Alert.Alert;
|
|
203
204
|
exports.Autosuggest = require_Autosuggest.Autosuggest;
|
|
205
|
+
exports.Avatar = require_Avatar.Avatar;
|
|
204
206
|
exports.Badge = require_Badge.Badge;
|
|
205
207
|
exports.Bleed = require_Bleed.Bleed;
|
|
206
208
|
exports.Box = require_Box.PublicBox;
|
package/dist/index.d.cts
CHANGED
|
@@ -18,6 +18,7 @@ import { FieldLabel } from "./lib/components/FieldLabel/FieldLabel.cjs";
|
|
|
18
18
|
import { FieldMessage } from "./lib/components/FieldMessage/FieldMessage.cjs";
|
|
19
19
|
import { Autosuggest } from "./lib/components/Autosuggest/Autosuggest.cjs";
|
|
20
20
|
import { filterSuggestions } from "./lib/components/Autosuggest/filterSuggestions.cjs";
|
|
21
|
+
import { Avatar } from "./lib/components/Avatar/Avatar.cjs";
|
|
21
22
|
import { Bleed } from "./lib/components/Bleed/Bleed.cjs";
|
|
22
23
|
import { BoxRenderer } from "./lib/components/Box/BoxRenderer.cjs";
|
|
23
24
|
import { ButtonIcon } from "./lib/components/ButtonIcon/ButtonIcon.cjs";
|
|
@@ -196,4 +197,4 @@ import { IconWorkExperience } from "./lib/components/icons/IconWorkExperience/Ic
|
|
|
196
197
|
import { IconZoomIn } from "./lib/components/icons/IconZoomIn/IconZoomIn.cjs";
|
|
197
198
|
import { IconZoomOut } from "./lib/components/icons/IconZoomOut/IconZoomOut.cjs";
|
|
198
199
|
import { LinkComponent } from "./lib/components/index.cjs";
|
|
199
|
-
export { Accordion, AccordionItem, Actions, Alert, Autosuggest, Badge, Bleed, PublicBox as Box, BoxRenderer, BraidPortal, BraidProvider, Button, ButtonIcon, ButtonLink, Card, Checkbox, CheckboxStandalone, Column, Columns, ContentBlock, Dialog, Disclosure, Divider, Drawer, Dropdown, FieldLabel, FieldMessage, Heading, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompanyVerified, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconImageBroken, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPhotoAdd, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline, Link, LinkComponent, List, Loader, MenuItem, MenuItemCheckbox, MenuItemDivider, MenuItemLink, MenuRenderer, MonthPicker, Notice, OverflowMenu, Page, PageBlock, Pagination, PasswordField, RadioGroup, RadioItem, Rating, Secondary, Spread, Stack, Step, Stepper, Strong, Tab, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs, TabsProvider, Tag, Text, TextDropdown, TextField, TextLink, TextLinkButton, Textarea, ThemeNameConsumer, Tiles, ToastProvider, Toggle, TooltipRenderer, filterSuggestions, makeLinkComponent, useColor, useResponsiveValue, useSpace, useThemeName, useToast };
|
|
200
|
+
export { Accordion, AccordionItem, Actions, Alert, Autosuggest, Avatar, Badge, Bleed, PublicBox as Box, BoxRenderer, BraidPortal, BraidProvider, Button, ButtonIcon, ButtonLink, Card, Checkbox, CheckboxStandalone, Column, Columns, ContentBlock, Dialog, Disclosure, Divider, Drawer, Dropdown, FieldLabel, FieldMessage, Heading, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompanyVerified, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconImageBroken, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPhotoAdd, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline, Link, LinkComponent, List, Loader, MenuItem, MenuItemCheckbox, MenuItemDivider, MenuItemLink, MenuRenderer, MonthPicker, Notice, OverflowMenu, Page, PageBlock, Pagination, PasswordField, RadioGroup, RadioItem, Rating, Secondary, Spread, Stack, Step, Stepper, Strong, Tab, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs, TabsProvider, Tag, Text, TextDropdown, TextField, TextLink, TextLinkButton, Textarea, ThemeNameConsumer, Tiles, ToastProvider, Toggle, TooltipRenderer, filterSuggestions, makeLinkComponent, useColor, useResponsiveValue, useSpace, useThemeName, useToast };
|
package/dist/index.d.mts
CHANGED
|
@@ -18,6 +18,7 @@ import { FieldLabel } from "./lib/components/FieldLabel/FieldLabel.mjs";
|
|
|
18
18
|
import { FieldMessage } from "./lib/components/FieldMessage/FieldMessage.mjs";
|
|
19
19
|
import { Autosuggest } from "./lib/components/Autosuggest/Autosuggest.mjs";
|
|
20
20
|
import { filterSuggestions } from "./lib/components/Autosuggest/filterSuggestions.mjs";
|
|
21
|
+
import { Avatar } from "./lib/components/Avatar/Avatar.mjs";
|
|
21
22
|
import { Bleed } from "./lib/components/Bleed/Bleed.mjs";
|
|
22
23
|
import { BoxRenderer } from "./lib/components/Box/BoxRenderer.mjs";
|
|
23
24
|
import { ButtonIcon } from "./lib/components/ButtonIcon/ButtonIcon.mjs";
|
|
@@ -196,4 +197,4 @@ import { IconWorkExperience } from "./lib/components/icons/IconWorkExperience/Ic
|
|
|
196
197
|
import { IconZoomIn } from "./lib/components/icons/IconZoomIn/IconZoomIn.mjs";
|
|
197
198
|
import { IconZoomOut } from "./lib/components/icons/IconZoomOut/IconZoomOut.mjs";
|
|
198
199
|
import { LinkComponent } from "./lib/components/index.mjs";
|
|
199
|
-
export { Accordion, AccordionItem, Actions, Alert, Autosuggest, Badge, Bleed, PublicBox as Box, BoxRenderer, BraidPortal, BraidProvider, Button, ButtonIcon, ButtonLink, Card, Checkbox, CheckboxStandalone, Column, Columns, ContentBlock, Dialog, Disclosure, Divider, Drawer, Dropdown, FieldLabel, FieldMessage, Heading, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompanyVerified, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconImageBroken, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPhotoAdd, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline, Link, LinkComponent, List, Loader, MenuItem, MenuItemCheckbox, MenuItemDivider, MenuItemLink, MenuRenderer, MonthPicker, Notice, OverflowMenu, Page, PageBlock, Pagination, PasswordField, RadioGroup, RadioItem, Rating, Secondary, Spread, Stack, Step, Stepper, Strong, Tab, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs, TabsProvider, Tag, Text, TextDropdown, TextField, TextLink, TextLinkButton, Textarea, ThemeNameConsumer, Tiles, ToastProvider, Toggle, TooltipRenderer, filterSuggestions, makeLinkComponent, useColor, useResponsiveValue, useSpace, useThemeName, useToast };
|
|
200
|
+
export { Accordion, AccordionItem, Actions, Alert, Autosuggest, Avatar, Badge, Bleed, PublicBox as Box, BoxRenderer, BraidPortal, BraidProvider, Button, ButtonIcon, ButtonLink, Card, Checkbox, CheckboxStandalone, Column, Columns, ContentBlock, Dialog, Disclosure, Divider, Drawer, Dropdown, FieldLabel, FieldMessage, Heading, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompanyVerified, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconImageBroken, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPhotoAdd, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline, Link, LinkComponent, List, Loader, MenuItem, MenuItemCheckbox, MenuItemDivider, MenuItemLink, MenuRenderer, MonthPicker, Notice, OverflowMenu, Page, PageBlock, Pagination, PasswordField, RadioGroup, RadioItem, Rating, Secondary, Spread, Stack, Step, Stepper, Strong, Tab, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs, TabsProvider, Tag, Text, TextDropdown, TextField, TextLink, TextLinkButton, Textarea, ThemeNameConsumer, Tiles, ToastProvider, Toggle, TooltipRenderer, filterSuggestions, makeLinkComponent, useColor, useResponsiveValue, useSpace, useThemeName, useToast };
|
package/dist/index.mjs
CHANGED
|
@@ -140,6 +140,8 @@ import { FieldLabel } from "./lib/components/FieldLabel/FieldLabel.mjs";
|
|
|
140
140
|
import { FieldMessage } from "./lib/components/FieldMessage/FieldMessage.mjs";
|
|
141
141
|
import { Autosuggest } from "./lib/components/Autosuggest/Autosuggest.mjs";
|
|
142
142
|
import { filterSuggestions } from "./lib/components/Autosuggest/filterSuggestions.mjs";
|
|
143
|
+
import { Heading } from "./lib/components/Heading/Heading.mjs";
|
|
144
|
+
import { Avatar } from "./lib/components/Avatar/Avatar.mjs";
|
|
143
145
|
import { Badge } from "./lib/components/Badge/Badge.mjs";
|
|
144
146
|
import { BoxRenderer } from "./lib/components/Box/BoxRenderer.mjs";
|
|
145
147
|
import { ButtonLink } from "./lib/components/ButtonLink/ButtonLink.mjs";
|
|
@@ -147,7 +149,6 @@ import { Card } from "./lib/components/Card/Card.mjs";
|
|
|
147
149
|
import { Checkbox } from "./lib/components/Checkbox/Checkbox.mjs";
|
|
148
150
|
import { CheckboxStandalone } from "./lib/components/Checkbox/CheckboxStandalone.mjs";
|
|
149
151
|
import { ContentBlock } from "./lib/components/ContentBlock/ContentBlock.mjs";
|
|
150
|
-
import { Heading } from "./lib/components/Heading/Heading.mjs";
|
|
151
152
|
import { Dialog } from "./lib/components/Dialog/Dialog.mjs";
|
|
152
153
|
import { TextLink } from "./lib/components/TextLink/TextLink.mjs";
|
|
153
154
|
import { TextLinkButton } from "./lib/components/TextLinkButton/TextLinkButton.mjs";
|
|
@@ -195,4 +196,4 @@ import { TextField } from "./lib/components/TextField/TextField.mjs";
|
|
|
195
196
|
import { Tiles } from "./lib/components/Tiles/Tiles.mjs";
|
|
196
197
|
import { Toggle } from "./lib/components/Toggle/Toggle.mjs";
|
|
197
198
|
import { ToastProvider, useToast } from "./lib/components/useToast/ToastContext.mjs";
|
|
198
|
-
export { Accordion, AccordionItem, Actions, Alert, Autosuggest, Badge, Bleed, PublicBox as Box, BoxRenderer, BraidPortal, BraidProvider, Button, ButtonIcon, ButtonLink, Card, Checkbox, CheckboxStandalone, Column, Columns, ContentBlock, Dialog, Disclosure, Divider, Drawer, Dropdown, FieldLabel, FieldMessage, Heading, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompanyVerified, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconImageBroken, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPhotoAdd, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline, Link, List, Loader, MenuItem, MenuItemCheckbox, MenuItemDivider, MenuItemLink, MenuRenderer, MonthPicker, Notice, OverflowMenu, Page, PageBlock, Pagination, PasswordField, RadioGroup, RadioItem, Rating, Secondary, Spread, Stack, Step, Stepper, Strong, Tab, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs, TabsProvider, Tag, Text, TextDropdown, TextField, TextLink, TextLinkButton, Textarea, ThemeNameConsumer, Tiles, ToastProvider, Toggle, TooltipRenderer, filterSuggestions, makeLinkComponent, useColor, useResponsiveValue, useSpace, useThemeName, useToast };
|
|
199
|
+
export { Accordion, AccordionItem, Actions, Alert, Autosuggest, Avatar, Badge, Bleed, PublicBox as Box, BoxRenderer, BraidPortal, BraidProvider, Button, ButtonIcon, ButtonLink, Card, Checkbox, CheckboxStandalone, Column, Columns, ContentBlock, Dialog, Disclosure, Divider, Drawer, Dropdown, FieldLabel, FieldMessage, Heading, Hidden, HiddenVisually, IconAI, IconAdd, IconArrow, IconAttachment, IconBluetooth, IconBold, IconBookmark, IconBulletList, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompanyVerified, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconImageBroken, IconInfo, IconInvoice, IconItalic, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconLocation, IconMail, IconMessage, IconMicrophone, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconNumberedList, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPhotoAdd, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRedo, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialTiktok, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, IconTitle, IconUndo, IconUpload, IconVideo, IconVisibility, IconWorkExperience, IconZoomIn, IconZoomOut, Inline, Link, List, Loader, MenuItem, MenuItemCheckbox, MenuItemDivider, MenuItemLink, MenuRenderer, MonthPicker, Notice, OverflowMenu, Page, PageBlock, Pagination, PasswordField, RadioGroup, RadioItem, Rating, Secondary, Spread, Stack, Step, Stepper, Strong, Tab, TabPanel, TabPanels, Table, TableBody, TableCell, TableFooter, TableHeader, TableHeaderCell, TableRow, Tabs, TabsProvider, Tag, Text, TextDropdown, TextField, TextLink, TextLinkButton, Textarea, ThemeNameConsumer, Tiles, ToastProvider, Toggle, TooltipRenderer, filterSuggestions, makeLinkComponent, useColor, useResponsiveValue, useSpace, useThemeName, useToast };
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
const require_runtime = require("../../../_virtual/_rolldown/runtime.cjs");
|
|
2
|
+
const require_palette = require("../../color/palette.cjs");
|
|
3
|
+
const require_buildDataAttributes = require("../private/buildDataAttributes.cjs");
|
|
4
|
+
const require_Box = require("../Box/Box.cjs");
|
|
5
|
+
const require_Text = require("../Text/Text.cjs");
|
|
6
|
+
const require_IconImageBroken = require("../icons/IconImageBroken/IconImageBroken.cjs");
|
|
7
|
+
const require_IconProfile = require("../icons/IconProfile/IconProfile.cjs");
|
|
8
|
+
const require_virtualTouchable_css = require("../private/touchable/virtualTouchable.css.cjs");
|
|
9
|
+
const require_Heading = require("../Heading/Heading.cjs");
|
|
10
|
+
const require_Skeleton = require("../private/Skeleton/Skeleton.cjs");
|
|
11
|
+
const require_Avatar_css = require("./Avatar.css.cjs");
|
|
12
|
+
let assert = require("assert");
|
|
13
|
+
assert = require_runtime.__toESM(assert, 1);
|
|
14
|
+
let react = require("react");
|
|
15
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
|
+
//#region src/lib/components/Avatar/Avatar.tsx
|
|
17
|
+
const backgroundColours = [
|
|
18
|
+
{
|
|
19
|
+
value: require_palette.palette.seekPink[200],
|
|
20
|
+
type: "customLight"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: require_palette.palette.seekBlueLight[200],
|
|
24
|
+
type: "customLight"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
value: require_palette.palette.orange[200],
|
|
28
|
+
type: "customLight"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: require_palette.palette.red[200],
|
|
32
|
+
type: "customLight"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: require_palette.palette.purple[200],
|
|
36
|
+
type: "customLight"
|
|
37
|
+
}
|
|
38
|
+
];
|
|
39
|
+
const isNonSvgDataUri = (src) => /^data:/i.test(src) && !/^data:image\/svg/i.test(src);
|
|
40
|
+
const isEmptyDecodedImage = (img) => img.naturalWidth === 0 && img.naturalHeight === 0;
|
|
41
|
+
const rasterDataUriFailedToDecode = (img) => img.complete && isEmptyDecodedImage(img) && isNonSvgDataUri(img.src);
|
|
42
|
+
const avatarSizeToBorderRadius = {
|
|
43
|
+
xxlarge: "large",
|
|
44
|
+
xlarge: "large",
|
|
45
|
+
large: "standard",
|
|
46
|
+
standard: "standard",
|
|
47
|
+
small: "standard",
|
|
48
|
+
xsmall: "small"
|
|
49
|
+
};
|
|
50
|
+
const avatarSizeToTextSize = {
|
|
51
|
+
xxlarge: "large",
|
|
52
|
+
xlarge: "large",
|
|
53
|
+
large: "large",
|
|
54
|
+
standard: "standard",
|
|
55
|
+
small: "small",
|
|
56
|
+
xsmall: "xsmall"
|
|
57
|
+
};
|
|
58
|
+
const AvatarTextContent = ({ size, children }) => {
|
|
59
|
+
if (size !== "xxlarge") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
60
|
+
weight: "strong",
|
|
61
|
+
size: avatarSizeToTextSize[size],
|
|
62
|
+
baseline: false,
|
|
63
|
+
children
|
|
64
|
+
});
|
|
65
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Heading.Heading, {
|
|
66
|
+
level: "3",
|
|
67
|
+
component: "span",
|
|
68
|
+
children
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const letterRegex = /^\p{L}/u;
|
|
72
|
+
const getInitials = (fullName) => {
|
|
73
|
+
for (const character of fullName) if (letterRegex.test(character)) return character.toLocaleUpperCase();
|
|
74
|
+
return null;
|
|
75
|
+
};
|
|
76
|
+
const backgroundColourForName = (name) => {
|
|
77
|
+
let hash = 0;
|
|
78
|
+
for (let i = 0; i < name.length; i++) hash = name.charCodeAt(i) + ((hash << 5) - hash);
|
|
79
|
+
return backgroundColours[Math.abs(hash) % backgroundColours.length];
|
|
80
|
+
};
|
|
81
|
+
const assertIconHasNoSize = (icon) => {
|
|
82
|
+
(0, assert.default)((0, react.isValidElement)(icon) && icon.props.size === void 0, "Icons cannot set the 'size' prop when passed to an Avatar component");
|
|
83
|
+
};
|
|
84
|
+
const isAvatarSize = (value) => value in require_Avatar_css.size;
|
|
85
|
+
const resolveAvatarSize = (size) => isAvatarSize(size) ? size : "standard";
|
|
86
|
+
const Avatar = (0, react.forwardRef)(({ name = "", "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, size: sizeProp = "standard", loading = false, imageUrl, icon, onClick, tabIndex, data, ...restProps }, ref) => {
|
|
87
|
+
const size$1 = resolveAvatarSize(sizeProp);
|
|
88
|
+
const focusable = tabIndex != null;
|
|
89
|
+
(0, assert.default)(!onClick || Boolean(ariaLabel), "Avatar with onClick requires aria-label so the button has an accessible name.");
|
|
90
|
+
(0, assert.default)(!focusable || Boolean(ariaLabel), "Avatar with tabIndex requires aria-label so the focusable avatar has an accessible name.");
|
|
91
|
+
if (icon) assertIconHasNoSize(icon);
|
|
92
|
+
const [imageError, setImageError] = (0, react.useState)(false);
|
|
93
|
+
const [imageLoaded, setImageLoaded] = (0, react.useState)(false);
|
|
94
|
+
const [imageSource, setImageSource] = (0, react.useState)(imageUrl);
|
|
95
|
+
const [loadingSource, setLoadingSource] = (0, react.useState)(loading);
|
|
96
|
+
const imageRef = (0, react.useRef)(null);
|
|
97
|
+
if (imageUrl !== imageSource || loading !== loadingSource) {
|
|
98
|
+
setImageSource(imageUrl);
|
|
99
|
+
setLoadingSource(loading);
|
|
100
|
+
setImageError(false);
|
|
101
|
+
setImageLoaded(false);
|
|
102
|
+
}
|
|
103
|
+
(0, react.useLayoutEffect)(() => {
|
|
104
|
+
setImageError(false);
|
|
105
|
+
const img = imageRef.current;
|
|
106
|
+
if (img && rasterDataUriFailedToDecode(img)) {
|
|
107
|
+
setImageError(true);
|
|
108
|
+
setImageLoaded(false);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
setImageLoaded(Boolean(img?.complete));
|
|
112
|
+
if (!img || typeof img.decode !== "function" || !/^data:/i.test(img.src) || /^data:image\/svg/i.test(img.src)) return;
|
|
113
|
+
let cancelled = false;
|
|
114
|
+
img.decode().then(() => {
|
|
115
|
+
if (cancelled) return;
|
|
116
|
+
if (rasterDataUriFailedToDecode(img)) setImageError(true);
|
|
117
|
+
}, () => {
|
|
118
|
+
if (!cancelled) setImageError(true);
|
|
119
|
+
});
|
|
120
|
+
return () => {
|
|
121
|
+
cancelled = true;
|
|
122
|
+
};
|
|
123
|
+
}, [imageUrl, loading]);
|
|
124
|
+
const labelled = Boolean(ariaLabel);
|
|
125
|
+
const clickable = Boolean(onClick);
|
|
126
|
+
const borderRadius = avatarSizeToBorderRadius[size$1];
|
|
127
|
+
let a11yProps;
|
|
128
|
+
if (clickable) a11yProps = {
|
|
129
|
+
component: "button",
|
|
130
|
+
type: "button",
|
|
131
|
+
onClick,
|
|
132
|
+
"aria-label": ariaLabel
|
|
133
|
+
};
|
|
134
|
+
else if (labelled) a11yProps = {
|
|
135
|
+
role: "img",
|
|
136
|
+
"aria-label": ariaLabel
|
|
137
|
+
};
|
|
138
|
+
else if (!focusable) a11yProps = { "aria-hidden": true };
|
|
139
|
+
else a11yProps = {};
|
|
140
|
+
let content;
|
|
141
|
+
let colour = null;
|
|
142
|
+
if (loading) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Skeleton.Skeleton, {});
|
|
143
|
+
else if (imageUrl && imageError) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AvatarTextContent, {
|
|
144
|
+
size: size$1,
|
|
145
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconImageBroken.IconImageBroken, {})
|
|
146
|
+
});
|
|
147
|
+
else if (imageUrl) content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
|
|
148
|
+
component: "img",
|
|
149
|
+
ref: imageRef,
|
|
150
|
+
src: imageUrl,
|
|
151
|
+
alt: "",
|
|
152
|
+
"aria-hidden": true,
|
|
153
|
+
width: "full",
|
|
154
|
+
height: "full",
|
|
155
|
+
className: require_Avatar_css.image,
|
|
156
|
+
opacity: imageLoaded ? void 0 : 0,
|
|
157
|
+
onError: () => setImageError(true),
|
|
158
|
+
onLoad: () => {
|
|
159
|
+
const img = imageRef.current;
|
|
160
|
+
if (img && isEmptyDecodedImage(img) && isNonSvgDataUri(img.src)) {
|
|
161
|
+
setImageError(true);
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
setImageLoaded(true);
|
|
165
|
+
}
|
|
166
|
+
}, imageUrl);
|
|
167
|
+
else {
|
|
168
|
+
const resolvedInitials = getInitials(name);
|
|
169
|
+
const showCustomIcon = resolvedInitials === null && Boolean(icon);
|
|
170
|
+
let textContent = resolvedInitials;
|
|
171
|
+
if (showCustomIcon) textContent = icon;
|
|
172
|
+
else if (resolvedInitials === null) textContent = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_IconProfile.IconProfile, {});
|
|
173
|
+
colour = resolvedInitials && !showCustomIcon ? backgroundColourForName(name) : null;
|
|
174
|
+
content = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AvatarTextContent, {
|
|
175
|
+
size: size$1,
|
|
176
|
+
children: textContent
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
|
|
180
|
+
ref,
|
|
181
|
+
tabIndex,
|
|
182
|
+
"aria-describedby": ariaDescribedBy,
|
|
183
|
+
position: "relative",
|
|
184
|
+
cursor: clickable ? "pointer" : void 0,
|
|
185
|
+
borderRadius,
|
|
186
|
+
background: colour?.type ?? "neutralLight",
|
|
187
|
+
outline: !clickable && focusable ? "focus" : void 0,
|
|
188
|
+
className: {
|
|
189
|
+
[require_Avatar_css.size[size$1]]: true,
|
|
190
|
+
[require_Avatar_css.keyline]: true,
|
|
191
|
+
[require_virtualTouchable_css.virtualTouchable]: clickable && (size$1 === "xsmall" || size$1 === "small")
|
|
192
|
+
},
|
|
193
|
+
style: colour ? { background: colour.value } : void 0,
|
|
194
|
+
...a11yProps,
|
|
195
|
+
...require_buildDataAttributes.default({
|
|
196
|
+
data,
|
|
197
|
+
validateRestProps: restProps
|
|
198
|
+
}),
|
|
199
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Box.Box, {
|
|
200
|
+
display: "flex",
|
|
201
|
+
alignItems: "center",
|
|
202
|
+
justifyContent: "center",
|
|
203
|
+
width: "full",
|
|
204
|
+
height: "full",
|
|
205
|
+
overflow: "hidden",
|
|
206
|
+
borderRadius,
|
|
207
|
+
children: content
|
|
208
|
+
})
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
Avatar.displayName = "Avatar";
|
|
212
|
+
//#endregion
|
|
213
|
+
exports.Avatar = Avatar;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const require_vars_css = require("../../themes/vars.css.cjs");
|
|
2
|
+
let _vanilla_extract_css_fileScope = require("@vanilla-extract/css/fileScope");
|
|
3
|
+
let _vanilla_extract_css = require("@vanilla-extract/css");
|
|
4
|
+
//#region src/lib/components/Avatar/Avatar.css.ts
|
|
5
|
+
(0, _vanilla_extract_css_fileScope.setFileScope)("src/lib/components/Avatar/Avatar.css.ts", "braid-design-system");
|
|
6
|
+
const size = (0, _vanilla_extract_css.styleVariants)({
|
|
7
|
+
xsmall: 24,
|
|
8
|
+
small: 32,
|
|
9
|
+
standard: 48,
|
|
10
|
+
large: 64,
|
|
11
|
+
xlarge: 80,
|
|
12
|
+
xxlarge: 96
|
|
13
|
+
}, (pixels) => ({
|
|
14
|
+
height: pixels,
|
|
15
|
+
width: pixels
|
|
16
|
+
}), "size");
|
|
17
|
+
const keyline = (0, _vanilla_extract_css.style)({
|
|
18
|
+
borderWidth: require_vars_css.vars.borderWidth.standard,
|
|
19
|
+
borderStyle: "solid",
|
|
20
|
+
borderColor: require_vars_css.vars.backgroundColor.surface
|
|
21
|
+
}, "keyline");
|
|
22
|
+
const image = (0, _vanilla_extract_css.style)({
|
|
23
|
+
objectFit: "cover",
|
|
24
|
+
transition: "opacity 200ms ease-in-out",
|
|
25
|
+
"@media": { "screen and (prefers-reduced-motion)": { transition: "none" } }
|
|
26
|
+
}, "image");
|
|
27
|
+
(0, _vanilla_extract_css_fileScope.endFileScope)();
|
|
28
|
+
//#endregion
|
|
29
|
+
exports.image = image;
|
|
30
|
+
exports.keyline = keyline;
|
|
31
|
+
exports.size = size;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { vars } from "../../themes/vars.css.mjs";
|
|
2
|
+
import { endFileScope, setFileScope } from "@vanilla-extract/css/fileScope";
|
|
3
|
+
import { style, styleVariants } from "@vanilla-extract/css";
|
|
4
|
+
//#region src/lib/components/Avatar/Avatar.css.ts
|
|
5
|
+
setFileScope("src/lib/components/Avatar/Avatar.css.ts", "braid-design-system");
|
|
6
|
+
const size = styleVariants({
|
|
7
|
+
xsmall: 24,
|
|
8
|
+
small: 32,
|
|
9
|
+
standard: 48,
|
|
10
|
+
large: 64,
|
|
11
|
+
xlarge: 80,
|
|
12
|
+
xxlarge: 96
|
|
13
|
+
}, (pixels) => ({
|
|
14
|
+
height: pixels,
|
|
15
|
+
width: pixels
|
|
16
|
+
}), "size");
|
|
17
|
+
const keyline = style({
|
|
18
|
+
borderWidth: vars.borderWidth.standard,
|
|
19
|
+
borderStyle: "solid",
|
|
20
|
+
borderColor: vars.backgroundColor.surface
|
|
21
|
+
}, "keyline");
|
|
22
|
+
const image = style({
|
|
23
|
+
objectFit: "cover",
|
|
24
|
+
transition: "opacity 200ms ease-in-out",
|
|
25
|
+
"@media": { "screen and (prefers-reduced-motion)": { transition: "none" } }
|
|
26
|
+
}, "image");
|
|
27
|
+
endFileScope();
|
|
28
|
+
//#endregion
|
|
29
|
+
export { image, keyline, size };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataAttributeMap } from "../private/buildDataAttributes.cjs";
|
|
2
|
+
import { BoxProps } from "../Box/Box.cjs";
|
|
3
|
+
import { size } from "./Avatar.css.cjs";
|
|
4
|
+
import { MouseEventHandler, ReactElement } from "react";
|
|
5
|
+
//#region src/lib/components/Avatar/Avatar.d.ts
|
|
6
|
+
type AvatarSize = keyof typeof size;
|
|
7
|
+
interface AvatarProps {
|
|
8
|
+
size?: AvatarSize;
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
'aria-describedby'?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
imageUrl?: string;
|
|
13
|
+
icon?: ReactElement;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
16
|
+
tabIndex?: BoxProps['tabIndex'];
|
|
17
|
+
data?: DataAttributeMap;
|
|
18
|
+
}
|
|
19
|
+
declare const Avatar: import("react").ForwardRefExoticComponent<AvatarProps & import("react").RefAttributes<HTMLElement>>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Avatar, AvatarProps };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { DataAttributeMap } from "../private/buildDataAttributes.mjs";
|
|
2
|
+
import { BoxProps } from "../Box/Box.mjs";
|
|
3
|
+
import { size } from "./Avatar.css.mjs";
|
|
4
|
+
import { MouseEventHandler, ReactElement } from "react";
|
|
5
|
+
//#region src/lib/components/Avatar/Avatar.d.ts
|
|
6
|
+
type AvatarSize = keyof typeof size;
|
|
7
|
+
interface AvatarProps {
|
|
8
|
+
size?: AvatarSize;
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
'aria-describedby'?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
imageUrl?: string;
|
|
13
|
+
icon?: ReactElement;
|
|
14
|
+
loading?: boolean;
|
|
15
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
|
16
|
+
tabIndex?: BoxProps['tabIndex'];
|
|
17
|
+
data?: DataAttributeMap;
|
|
18
|
+
}
|
|
19
|
+
declare const Avatar: import("react").ForwardRefExoticComponent<AvatarProps & import("react").RefAttributes<HTMLElement>>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Avatar, AvatarProps };
|