braid-design-system 33.2.2 → 33.3.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 +63 -0
- package/dist/index.cjs +13 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +13 -0
- package/dist/lib/components/Accordion/Accordion.cjs +6 -4
- package/dist/lib/components/Accordion/Accordion.mjs +6 -4
- package/dist/lib/components/Accordion/AccordionItem.cjs +55 -55
- package/dist/lib/components/Accordion/AccordionItem.mjs +55 -55
- package/dist/lib/components/Badge/Badge.cjs +5 -3
- package/dist/lib/components/Badge/Badge.mjs +5 -3
- package/dist/lib/components/Badge/defaultBadgeProps.cjs +28 -0
- package/dist/lib/components/Badge/defaultBadgeProps.mjs +29 -0
- package/dist/lib/components/Button/Button.cjs +1 -0
- package/dist/lib/components/Button/Button.mjs +1 -0
- package/dist/lib/components/Columns/Columns.cjs +1 -0
- package/dist/lib/components/Columns/Columns.mjs +1 -0
- package/dist/lib/components/MenuItem/MenuItem.cjs +1 -1
- package/dist/lib/components/MenuItem/MenuItem.mjs +1 -1
- package/dist/lib/components/MenuItem/MenuItemLink.cjs +1 -1
- package/dist/lib/components/MenuItem/MenuItemLink.mjs +1 -1
- package/dist/lib/components/MenuItem/useMenuItem.cjs +39 -42
- package/dist/lib/components/MenuItem/useMenuItem.css.cjs +5 -0
- package/dist/lib/components/MenuItem/useMenuItem.css.mjs +6 -1
- package/dist/lib/components/MenuItem/useMenuItem.mjs +41 -44
- package/dist/lib/components/MenuItemCheckbox/MenuItemCheckbox.cjs +36 -43
- package/dist/lib/components/MenuItemCheckbox/MenuItemCheckbox.mjs +37 -44
- package/dist/lib/components/MenuRenderer/MenuRenderer.cjs +39 -24
- package/dist/lib/components/MenuRenderer/MenuRenderer.css.cjs +4 -3
- package/dist/lib/components/MenuRenderer/MenuRenderer.css.mjs +5 -4
- package/dist/lib/components/MenuRenderer/MenuRenderer.mjs +40 -25
- package/dist/lib/components/OverflowMenu/OverflowMenu.cjs +4 -1
- package/dist/lib/components/OverflowMenu/OverflowMenu.mjs +4 -1
- package/dist/lib/components/Table/Table.cjs +28 -0
- package/dist/lib/components/Table/Table.css.cjs +95 -0
- package/dist/lib/components/Table/Table.css.mjs +96 -0
- package/dist/lib/components/Table/Table.mjs +29 -0
- package/dist/lib/components/Table/TableBody.cjs +24 -0
- package/dist/lib/components/Table/TableBody.mjs +23 -0
- package/dist/lib/components/Table/TableCell.cjs +118 -0
- package/dist/lib/components/Table/TableCell.mjs +117 -0
- package/dist/lib/components/Table/TableContext.cjs +12 -0
- package/dist/lib/components/Table/TableContext.mjs +13 -0
- package/dist/lib/components/Table/TableFooter.cjs +28 -0
- package/dist/lib/components/Table/TableFooter.mjs +27 -0
- package/dist/lib/components/Table/TableHeader.cjs +28 -0
- package/dist/lib/components/Table/TableHeader.mjs +27 -0
- package/dist/lib/components/Table/TableRow.cjs +36 -0
- package/dist/lib/components/Table/TableRow.mjs +35 -0
- package/dist/lib/components/Text/Text.cjs +5 -2
- package/dist/lib/components/Text/Text.mjs +5 -2
- package/dist/lib/components/Tiles/Tiles.cjs +6 -5
- package/dist/lib/components/Tiles/Tiles.css.cjs +3 -3
- package/dist/lib/components/Tiles/Tiles.css.mjs +4 -4
- package/dist/lib/components/Tiles/Tiles.mjs +6 -5
- package/dist/lib/components/private/ScrollContainer/ScrollContainer.cjs +2 -2
- package/dist/lib/components/private/ScrollContainer/ScrollContainer.mjs +2 -2
- package/dist/lib/components/private/defaultTextProps.cjs +11 -6
- package/dist/lib/components/private/defaultTextProps.mjs +11 -6
- package/dist/lib/hooks/useIsomorphicLayoutEffect.cjs +3 -1
- package/dist/lib/hooks/useIsomorphicLayoutEffect.mjs +3 -1
- package/dist/lib/playroom/snippets/MenuRenderer.cjs +51 -0
- package/dist/lib/playroom/snippets/MenuRenderer.mjs +52 -0
- package/dist/lib/playroom/snippets/OverflowMenu.cjs +3 -0
- package/dist/lib/playroom/snippets/OverflowMenu.mjs +3 -0
- package/dist/lib/playroom/snippets/Table.cjs +179 -0
- package/dist/lib/playroom/snippets/Table.mjs +180 -0
- package/dist/lib/playroom/snippets.cjs +4 -0
- package/dist/lib/playroom/snippets.mjs +52 -48
- package/dist/playroom/components.cjs +13 -0
- package/dist/playroom/components.d.mts +1 -1
- package/dist/playroom/components.d.ts +1 -1
- package/dist/playroom/components.mjs +13 -0
- package/dist/wireframe.chunk.d.ts +57 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
1
|
# braid-design-system
|
|
2
2
|
|
|
3
|
+
## 33.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **Table:** Add component ([#1673](https://github.com/seek-oss/braid-design-system/pull/1673))
|
|
8
|
+
|
|
9
|
+
**EXAMPLE USAGE:**
|
|
10
|
+
|
|
11
|
+
```jsx
|
|
12
|
+
<Table label="Table example">
|
|
13
|
+
<TableHeader>
|
|
14
|
+
<TableRow>
|
|
15
|
+
<TableHeaderCell>...</TableHeaderCell>
|
|
16
|
+
<TableHeaderCell>...</TableHeaderCell>
|
|
17
|
+
<TableHeaderCell>...</TableHeaderCell>
|
|
18
|
+
</TableRow>
|
|
19
|
+
</TableHeader>
|
|
20
|
+
<TableBody>
|
|
21
|
+
<TableRow>
|
|
22
|
+
<TableCell>...</TableCell>
|
|
23
|
+
<TableCell>...</TableCell>
|
|
24
|
+
<TableCell>...</TableCell>
|
|
25
|
+
</TableRow>
|
|
26
|
+
...
|
|
27
|
+
</TableBody>
|
|
28
|
+
</Table>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- **MenuRenderer, OverflowMenu:** Add `small` size. ([#1675](https://github.com/seek-oss/braid-design-system/pull/1675))
|
|
32
|
+
|
|
33
|
+
Introduce a new `small` size for `MenuRenderer` and `OverflowMenu`.
|
|
34
|
+
This is available via the `size` prop, which supports the existing `standard` (default) and `small`.
|
|
35
|
+
|
|
36
|
+
**EXAMPLE USAGE:**
|
|
37
|
+
|
|
38
|
+
```jsx
|
|
39
|
+
<MenuRenderer size="small" ... />
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- **Tiles**: Fixes a bug where nested `Tiles` components could calculate their columns incorrectly. ([#1667](https://github.com/seek-oss/braid-design-system/pull/1667))
|
|
45
|
+
|
|
46
|
+
Previously, when using a `Tiles` component inside another `Tiles` component, the responsive column calculation could be incorrect in certain scenarios.
|
|
47
|
+
This change ensures nested `Tiles` elements always calculate their columns correctly.
|
|
48
|
+
|
|
49
|
+
- **Button, ButtonLink:** Ensure inner label is full width ([#1671](https://github.com/seek-oss/braid-design-system/pull/1671))
|
|
50
|
+
|
|
51
|
+
Ensuring the inner label element is full width to maintain backwards compatibility with previous block layout.
|
|
52
|
+
|
|
53
|
+
- **Columns:** Ensure component occupies available height ([#1672](https://github.com/seek-oss/braid-design-system/pull/1672))
|
|
54
|
+
|
|
55
|
+
Enables `Columns` content to occupy the available height of the parent container.
|
|
56
|
+
|
|
57
|
+
- **AccordionItem**: Simplify internal layout. ([#1674](https://github.com/seek-oss/braid-design-system/pull/1674))
|
|
58
|
+
|
|
59
|
+
- **Accordion, AccordionItem**: Adjust spacing values for improved visual balance. ([#1674](https://github.com/seek-oss/braid-design-system/pull/1674))
|
|
60
|
+
|
|
61
|
+
This change reduces the default spacing within `Accordion` and `AccordionItem` components at certain sizes, ensuring the content is better associated with the correct `AccordionItem`.
|
|
62
|
+
|
|
63
|
+
Within the `Accordion` component, the default space between `AccordionItem` components has been reduced for size `large` with dividers, and sizes `small` and `xsmall` without dividers.
|
|
64
|
+
Within the `AccordionItem` component, the space between the `label` and content has been reduced for sizes `large` and `small`.
|
|
65
|
+
|
|
3
66
|
## 33.2.2
|
|
4
67
|
|
|
5
68
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -62,6 +62,12 @@ const lib_components_Stack_Stack_cjs = require("./lib/components/Stack/Stack.cjs
|
|
|
62
62
|
const lib_components_Stepper_Step_cjs = require("./lib/components/Stepper/Step.cjs");
|
|
63
63
|
const lib_components_Stepper_Stepper_cjs = require("./lib/components/Stepper/Stepper.cjs");
|
|
64
64
|
const lib_components_Strong_Strong_cjs = require("./lib/components/Strong/Strong.cjs");
|
|
65
|
+
const lib_components_Table_Table_cjs = require("./lib/components/Table/Table.cjs");
|
|
66
|
+
const lib_components_Table_TableBody_cjs = require("./lib/components/Table/TableBody.cjs");
|
|
67
|
+
const lib_components_Table_TableCell_cjs = require("./lib/components/Table/TableCell.cjs");
|
|
68
|
+
const lib_components_Table_TableFooter_cjs = require("./lib/components/Table/TableFooter.cjs");
|
|
69
|
+
const lib_components_Table_TableHeader_cjs = require("./lib/components/Table/TableHeader.cjs");
|
|
70
|
+
const lib_components_Table_TableRow_cjs = require("./lib/components/Table/TableRow.cjs");
|
|
65
71
|
const lib_components_Tabs_Tab_cjs = require("./lib/components/Tabs/Tab.cjs");
|
|
66
72
|
const lib_components_Tabs_TabsProvider_cjs = require("./lib/components/Tabs/TabsProvider.cjs");
|
|
67
73
|
const lib_components_Tabs_Tabs_cjs = require("./lib/components/Tabs/Tabs.cjs");
|
|
@@ -243,6 +249,13 @@ exports.Stack = lib_components_Stack_Stack_cjs.Stack;
|
|
|
243
249
|
exports.Step = lib_components_Stepper_Step_cjs.Step;
|
|
244
250
|
exports.Stepper = lib_components_Stepper_Stepper_cjs.Stepper;
|
|
245
251
|
exports.Strong = lib_components_Strong_Strong_cjs.Strong;
|
|
252
|
+
exports.Table = lib_components_Table_Table_cjs.Table;
|
|
253
|
+
exports.TableBody = lib_components_Table_TableBody_cjs.TableBody;
|
|
254
|
+
exports.TableCell = lib_components_Table_TableCell_cjs.TableCell;
|
|
255
|
+
exports.TableHeaderCell = lib_components_Table_TableCell_cjs.TableHeaderCell;
|
|
256
|
+
exports.TableFooter = lib_components_Table_TableFooter_cjs.TableFooter;
|
|
257
|
+
exports.TableHeader = lib_components_Table_TableHeader_cjs.TableHeader;
|
|
258
|
+
exports.TableRow = lib_components_Table_TableRow_cjs.TableRow;
|
|
246
259
|
exports.Tab = lib_components_Tabs_Tab_cjs.Tab;
|
|
247
260
|
exports.TabsProvider = lib_components_Tabs_TabsProvider_cjs.TabsProvider;
|
|
248
261
|
exports.Tabs = lib_components_Tabs_Tabs_cjs.Tabs;
|
package/dist/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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, IconBookmark, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconInfo, IconInvoice, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconList, IconLocation, IconMail, IconMessage, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, 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, Tabs, TabsProvider, Tag, Text, TextDropdown, TextField, TextLink, TextLinkButton, Textarea, ThemeNameConsumer, Tiles, ToastProvider, Toggle, TooltipRenderer, filterSuggestions, makeLinkComponent, useColor, useResponsiveValue, useSpace, useThemeName, useToast } from './wireframe.chunk.js';
|
|
1
|
+
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, IconBookmark, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconInfo, IconInvoice, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconList, IconLocation, IconMail, IconMessage, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, 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 } from './wireframe.chunk.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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, IconBookmark, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconInfo, IconInvoice, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconList, IconLocation, IconMail, IconMessage, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, 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, Tabs, TabsProvider, Tag, Text, TextDropdown, TextField, TextLink, TextLinkButton, Textarea, ThemeNameConsumer, Tiles, ToastProvider, Toggle, TooltipRenderer, filterSuggestions, makeLinkComponent, useColor, useResponsiveValue, useSpace, useThemeName, useToast } from './wireframe.chunk.js';
|
|
1
|
+
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, IconBookmark, IconCareer, IconCategory, IconCaution, IconChecklist, IconChevron, IconClear, IconCompany, IconCompose, IconCopy, IconCoverLetter, IconCreditCard, IconCritical, IconDate, IconDelete, IconDesktop, IconDisallow, IconDocument, IconDocumentBroken, IconDownload, IconEdit, IconEducation, IconEnlarge, IconExperience, IconFilter, IconFlag, IconGift, IconGlobe, IconGrid, IconHash, IconHeart, IconHelp, IconHistory, IconHome, IconImage, IconInfo, IconInvoice, IconLanguage, IconLicence, IconLink, IconLinkBroken, IconList, IconLocation, IconMail, IconMessage, IconMinus, IconMobile, IconMoney, IconNewWindow, IconNote, IconNotification, IconOverflow, IconPeople, IconPersonAdd, IconPersonVerified, IconPhone, IconPlatformAndroid, IconPlatformApple, IconPositive, IconPrint, IconProfile, IconPromote, IconQR, IconRecommended, IconRefresh, IconRenderer, IconResume, IconRocket, IconSearch, IconSecurity, IconSend, IconSent, IconSentiment, IconSettings, IconShare, IconSkills, IconSocialFacebook, IconSocialGitHub, IconSocialInstagram, IconSocialLinkedIn, IconSocialMedium, IconSocialX, IconSocialYouTube, IconSort, IconStar, IconStatistics, IconSubCategory, IconTag, IconThumb, IconTick, IconTime, IconTip, 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 } from './wireframe.chunk.js';
|
package/dist/index.mjs
CHANGED
|
@@ -60,6 +60,12 @@ import { Stack } from "./lib/components/Stack/Stack.mjs";
|
|
|
60
60
|
import { Step } from "./lib/components/Stepper/Step.mjs";
|
|
61
61
|
import { Stepper } from "./lib/components/Stepper/Stepper.mjs";
|
|
62
62
|
import { Strong } from "./lib/components/Strong/Strong.mjs";
|
|
63
|
+
import { Table } from "./lib/components/Table/Table.mjs";
|
|
64
|
+
import { TableBody } from "./lib/components/Table/TableBody.mjs";
|
|
65
|
+
import { TableCell, TableHeaderCell } from "./lib/components/Table/TableCell.mjs";
|
|
66
|
+
import { TableFooter } from "./lib/components/Table/TableFooter.mjs";
|
|
67
|
+
import { TableHeader } from "./lib/components/Table/TableHeader.mjs";
|
|
68
|
+
import { TableRow } from "./lib/components/Table/TableRow.mjs";
|
|
63
69
|
import { Tab } from "./lib/components/Tabs/Tab.mjs";
|
|
64
70
|
import { TabsProvider } from "./lib/components/Tabs/TabsProvider.mjs";
|
|
65
71
|
import { Tabs } from "./lib/components/Tabs/Tabs.mjs";
|
|
@@ -340,6 +346,13 @@ export {
|
|
|
340
346
|
Tab,
|
|
341
347
|
TabPanel,
|
|
342
348
|
TabPanels,
|
|
349
|
+
Table,
|
|
350
|
+
TableBody,
|
|
351
|
+
TableCell,
|
|
352
|
+
TableFooter,
|
|
353
|
+
TableHeader,
|
|
354
|
+
TableHeaderCell,
|
|
355
|
+
TableRow,
|
|
343
356
|
Tabs,
|
|
344
357
|
TabsProvider,
|
|
345
358
|
Tag,
|
|
@@ -11,23 +11,24 @@ const lib_utils_flattenChildren_cjs = require("../../utils/flattenChildren.cjs")
|
|
|
11
11
|
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
12
12
|
const assert__default = /* @__PURE__ */ _interopDefaultCompat(assert);
|
|
13
13
|
const validSpaceValues = ["medium", "large", "xlarge"];
|
|
14
|
+
const defaultSize = "large";
|
|
14
15
|
const defaultSpaceForSize = {
|
|
15
16
|
divided: {
|
|
16
17
|
xsmall: "medium",
|
|
17
18
|
small: "medium",
|
|
18
19
|
standard: "medium",
|
|
19
|
-
large: "
|
|
20
|
+
large: "medium"
|
|
20
21
|
},
|
|
21
22
|
undivided: {
|
|
22
|
-
xsmall: "
|
|
23
|
-
small: "
|
|
23
|
+
xsmall: "medium",
|
|
24
|
+
small: "medium",
|
|
24
25
|
standard: "large",
|
|
25
26
|
large: "large"
|
|
26
27
|
}
|
|
27
28
|
};
|
|
28
29
|
const Accordion = ({
|
|
29
30
|
children,
|
|
30
|
-
size =
|
|
31
|
+
size = defaultSize,
|
|
31
32
|
tone,
|
|
32
33
|
weight,
|
|
33
34
|
space: spaceProp,
|
|
@@ -72,4 +73,5 @@ const Accordion = ({
|
|
|
72
73
|
) });
|
|
73
74
|
};
|
|
74
75
|
exports.Accordion = Accordion;
|
|
76
|
+
exports.defaultSize = defaultSize;
|
|
75
77
|
exports.validSpaceValues = validSpaceValues;
|
|
@@ -8,23 +8,24 @@ import { Divider } from "../Divider/Divider.mjs";
|
|
|
8
8
|
import { validTones, AccordionContext } from "./AccordionContext.mjs";
|
|
9
9
|
import { flattenChildren } from "../../utils/flattenChildren.mjs";
|
|
10
10
|
const validSpaceValues = ["medium", "large", "xlarge"];
|
|
11
|
+
const defaultSize = "large";
|
|
11
12
|
const defaultSpaceForSize = {
|
|
12
13
|
divided: {
|
|
13
14
|
xsmall: "medium",
|
|
14
15
|
small: "medium",
|
|
15
16
|
standard: "medium",
|
|
16
|
-
large: "
|
|
17
|
+
large: "medium"
|
|
17
18
|
},
|
|
18
19
|
undivided: {
|
|
19
|
-
xsmall: "
|
|
20
|
-
small: "
|
|
20
|
+
xsmall: "medium",
|
|
21
|
+
small: "medium",
|
|
21
22
|
standard: "large",
|
|
22
23
|
large: "large"
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
26
|
const Accordion = ({
|
|
26
27
|
children,
|
|
27
|
-
size =
|
|
28
|
+
size = defaultSize,
|
|
28
29
|
tone,
|
|
29
30
|
weight,
|
|
30
31
|
space: spaceProp,
|
|
@@ -70,5 +71,6 @@ const Accordion = ({
|
|
|
70
71
|
};
|
|
71
72
|
export {
|
|
72
73
|
Accordion,
|
|
74
|
+
defaultSize,
|
|
73
75
|
validSpaceValues
|
|
74
76
|
};
|
|
@@ -4,23 +4,24 @@ const React = require("react");
|
|
|
4
4
|
const assert = require("assert");
|
|
5
5
|
const lib_components_Box_Box_cjs = require("../Box/Box.cjs");
|
|
6
6
|
const lib_components_Text_Text_cjs = require("../Text/Text.cjs");
|
|
7
|
-
const lib_components_Columns_Columns_cjs = require("../Columns/Columns.cjs");
|
|
8
|
-
const lib_components_Column_Column_cjs = require("../Column/Column.cjs");
|
|
9
7
|
const lib_components_Disclosure_useDisclosure_cjs = require("../Disclosure/useDisclosure.cjs");
|
|
10
8
|
const lib_components_private_Overlay_Overlay_cjs = require("../private/Overlay/Overlay.cjs");
|
|
11
9
|
const lib_components_Accordion_AccordionContext_cjs = require("./AccordionContext.cjs");
|
|
12
10
|
const lib_components_private_buildDataAttributes_cjs = require("../private/buildDataAttributes.cjs");
|
|
13
11
|
const lib_components_private_badgeSlotSpace_cjs = require("../private/badgeSlotSpace.cjs");
|
|
14
12
|
const lib_components_Accordion_AccordionItem_css_cjs = require("./AccordionItem.css.cjs");
|
|
13
|
+
const lib_components_Spread_Spread_cjs = require("../Spread/Spread.cjs");
|
|
14
|
+
const lib_components_Accordion_Accordion_cjs = require("./Accordion.cjs");
|
|
15
|
+
const lib_components_Stack_Stack_cjs = require("../Stack/Stack.cjs");
|
|
15
16
|
const lib_components_icons_IconChevron_IconChevron_cjs = require("../icons/IconChevron/IconChevron.cjs");
|
|
16
17
|
const lib_components_private_hideFocusRings_hideFocusRings_css_cjs = require("../private/hideFocusRings/hideFocusRings.css.cjs");
|
|
17
18
|
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
18
19
|
const assert__default = /* @__PURE__ */ _interopDefaultCompat(assert);
|
|
19
20
|
const itemSpaceForSize = {
|
|
20
21
|
xsmall: "small",
|
|
21
|
-
small: "
|
|
22
|
+
small: "small",
|
|
22
23
|
standard: "medium",
|
|
23
|
-
large: "
|
|
24
|
+
large: "medium"
|
|
24
25
|
};
|
|
25
26
|
const AccordionItem = ({
|
|
26
27
|
id,
|
|
@@ -64,7 +65,7 @@ const AccordionItem = ({
|
|
|
64
65
|
!icon || icon.props.size === void 0 && icon.props.tone === void 0,
|
|
65
66
|
"Icons cannot set the 'size' or 'tone' prop when passed to an AccordionItem component"
|
|
66
67
|
);
|
|
67
|
-
const size = (accordionContext == null ? void 0 : accordionContext.size) ?? sizeProp ??
|
|
68
|
+
const size = (accordionContext == null ? void 0 : accordionContext.size) ?? sizeProp ?? lib_components_Accordion_Accordion_cjs.defaultSize;
|
|
68
69
|
const tone = (accordionContext == null ? void 0 : accordionContext.tone) ?? toneProp ?? "neutral";
|
|
69
70
|
const weight = (accordionContext == null ? void 0 : accordionContext.weight) ?? weightProp ?? "medium";
|
|
70
71
|
const itemSpace = itemSpaceForSize[size] ?? "none";
|
|
@@ -81,55 +82,54 @@ const AccordionItem = ({
|
|
|
81
82
|
onToggle: restProps.onToggle
|
|
82
83
|
}
|
|
83
84
|
});
|
|
84
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
...contentProps,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
] });
|
|
85
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
86
|
+
lib_components_Stack_Stack_cjs.Stack,
|
|
87
|
+
{
|
|
88
|
+
space: itemSpace,
|
|
89
|
+
...lib_components_private_buildDataAttributes_cjs.buildDataAttributes({ data, validateRestProps: restProps }),
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsxRuntime.jsxs(lib_components_Box_Box_cjs.Box, { position: "relative", display: "flex", children: [
|
|
92
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
93
|
+
lib_components_Box_Box_cjs.Box,
|
|
94
|
+
{
|
|
95
|
+
component: "button",
|
|
96
|
+
type: "button",
|
|
97
|
+
cursor: "pointer",
|
|
98
|
+
className: lib_components_Accordion_AccordionItem_css_cjs.button,
|
|
99
|
+
outline: "none",
|
|
100
|
+
width: "full",
|
|
101
|
+
textAlign: "left",
|
|
102
|
+
...buttonProps,
|
|
103
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { component: "span", position: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs(lib_components_Spread_Spread_cjs.Spread, { component: "span", space: itemSpace, children: [
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsxs(lib_components_Text_Text_cjs.Text, { size, weight, tone, icon, children: [
|
|
105
|
+
badge ? /* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { component: "span", paddingRight: lib_components_private_badgeSlotSpace_cjs.badgeSlotSpace, children: label }) : label,
|
|
106
|
+
badge ? React.cloneElement(badge, {}) : null
|
|
107
|
+
] }),
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
109
|
+
lib_components_Text_Text_cjs.Text,
|
|
110
|
+
{
|
|
111
|
+
size,
|
|
112
|
+
weight,
|
|
113
|
+
tone: tone === "neutral" ? "secondary" : tone,
|
|
114
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lib_components_icons_IconChevron_IconChevron_cjs.IconChevron, { direction: expanded ? "up" : "down" })
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
] }) })
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
+
lib_components_private_Overlay_Overlay_cjs.Overlay,
|
|
122
|
+
{
|
|
123
|
+
boxShadow: "outlineFocus",
|
|
124
|
+
borderRadius: "standard",
|
|
125
|
+
transition: "fast",
|
|
126
|
+
className: [lib_components_Accordion_AccordionItem_css_cjs.focusRing, lib_components_private_hideFocusRings_hideFocusRings_css_cjs.hideFocusRingsClassName]
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] }),
|
|
130
|
+
/* @__PURE__ */ jsxRuntime.jsx(lib_components_Box_Box_cjs.Box, { display: expanded ? "block" : "none", ...contentProps, children })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
134
|
};
|
|
135
135
|
exports.AccordionItem = AccordionItem;
|
|
@@ -3,21 +3,22 @@ import { useContext, cloneElement } from "react";
|
|
|
3
3
|
import assert from "assert";
|
|
4
4
|
import { Box } from "../Box/Box.mjs";
|
|
5
5
|
import { Text } from "../Text/Text.mjs";
|
|
6
|
-
import { Columns } from "../Columns/Columns.mjs";
|
|
7
|
-
import { Column } from "../Column/Column.mjs";
|
|
8
6
|
import { useDisclosure } from "../Disclosure/useDisclosure.mjs";
|
|
9
7
|
import { Overlay } from "../private/Overlay/Overlay.mjs";
|
|
10
8
|
import { AccordionContext, validTones } from "./AccordionContext.mjs";
|
|
11
9
|
import { buildDataAttributes } from "../private/buildDataAttributes.mjs";
|
|
12
10
|
import { badgeSlotSpace } from "../private/badgeSlotSpace.mjs";
|
|
13
11
|
import { button, focusRing } from "./AccordionItem.css.mjs";
|
|
12
|
+
import { Spread } from "../Spread/Spread.mjs";
|
|
13
|
+
import { defaultSize } from "./Accordion.mjs";
|
|
14
|
+
import { Stack } from "../Stack/Stack.mjs";
|
|
14
15
|
import { IconChevron } from "../icons/IconChevron/IconChevron.mjs";
|
|
15
16
|
import { hideFocusRingsClassName } from "../private/hideFocusRings/hideFocusRings.css.mjs";
|
|
16
17
|
const itemSpaceForSize = {
|
|
17
18
|
xsmall: "small",
|
|
18
|
-
small: "
|
|
19
|
+
small: "small",
|
|
19
20
|
standard: "medium",
|
|
20
|
-
large: "
|
|
21
|
+
large: "medium"
|
|
21
22
|
};
|
|
22
23
|
const AccordionItem = ({
|
|
23
24
|
id,
|
|
@@ -61,7 +62,7 @@ const AccordionItem = ({
|
|
|
61
62
|
!icon || icon.props.size === void 0 && icon.props.tone === void 0,
|
|
62
63
|
"Icons cannot set the 'size' or 'tone' prop when passed to an AccordionItem component"
|
|
63
64
|
);
|
|
64
|
-
const size = (accordionContext == null ? void 0 : accordionContext.size) ?? sizeProp ??
|
|
65
|
+
const size = (accordionContext == null ? void 0 : accordionContext.size) ?? sizeProp ?? defaultSize;
|
|
65
66
|
const tone = (accordionContext == null ? void 0 : accordionContext.tone) ?? toneProp ?? "neutral";
|
|
66
67
|
const weight = (accordionContext == null ? void 0 : accordionContext.weight) ?? weightProp ?? "medium";
|
|
67
68
|
const itemSpace = itemSpaceForSize[size] ?? "none";
|
|
@@ -78,56 +79,55 @@ const AccordionItem = ({
|
|
|
78
79
|
onToggle: restProps.onToggle
|
|
79
80
|
}
|
|
80
81
|
});
|
|
81
|
-
return /* @__PURE__ */ jsxs(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
...contentProps,
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
] });
|
|
82
|
+
return /* @__PURE__ */ jsxs(
|
|
83
|
+
Stack,
|
|
84
|
+
{
|
|
85
|
+
space: itemSpace,
|
|
86
|
+
...buildDataAttributes({ data, validateRestProps: restProps }),
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ jsxs(Box, { position: "relative", display: "flex", children: [
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
Box,
|
|
91
|
+
{
|
|
92
|
+
component: "button",
|
|
93
|
+
type: "button",
|
|
94
|
+
cursor: "pointer",
|
|
95
|
+
className: button,
|
|
96
|
+
outline: "none",
|
|
97
|
+
width: "full",
|
|
98
|
+
textAlign: "left",
|
|
99
|
+
...buttonProps,
|
|
100
|
+
children: /* @__PURE__ */ jsx(Box, { component: "span", position: "relative", children: /* @__PURE__ */ jsxs(Spread, { component: "span", space: itemSpace, children: [
|
|
101
|
+
/* @__PURE__ */ jsxs(Text, { size, weight, tone, icon, children: [
|
|
102
|
+
badge ? /* @__PURE__ */ jsx(Box, { component: "span", paddingRight: badgeSlotSpace, children: label }) : label,
|
|
103
|
+
badge ? cloneElement(badge, {}) : null
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ jsx(
|
|
106
|
+
Text,
|
|
107
|
+
{
|
|
108
|
+
size,
|
|
109
|
+
weight,
|
|
110
|
+
tone: tone === "neutral" ? "secondary" : tone,
|
|
111
|
+
children: /* @__PURE__ */ jsx(IconChevron, { direction: expanded ? "up" : "down" })
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
] }) })
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ jsx(
|
|
118
|
+
Overlay,
|
|
119
|
+
{
|
|
120
|
+
boxShadow: "outlineFocus",
|
|
121
|
+
borderRadius: "standard",
|
|
122
|
+
transition: "fast",
|
|
123
|
+
className: [focusRing, hideFocusRingsClassName]
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
] }),
|
|
127
|
+
/* @__PURE__ */ jsx(Box, { display: expanded ? "block" : "none", ...contentProps, children })
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
131
|
};
|
|
132
132
|
export {
|
|
133
133
|
AccordionItem
|
|
@@ -10,6 +10,7 @@ const lib_components_private_defaultTextProps_cjs = require("../private/defaultT
|
|
|
10
10
|
const lib_components_Text_TextContext_cjs = require("../Text/TextContext.cjs");
|
|
11
11
|
const lib_components_Heading_HeadingContext_cjs = require("../Heading/HeadingContext.cjs");
|
|
12
12
|
const lib_components_Badge_Badge_css_cjs = require("./Badge.css.cjs");
|
|
13
|
+
const lib_components_Badge_defaultBadgeProps_cjs = require("./defaultBadgeProps.cjs");
|
|
13
14
|
const _interopDefaultCompat = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
14
15
|
const assert__default = /* @__PURE__ */ _interopDefaultCompat(assert);
|
|
15
16
|
const validTones = [
|
|
@@ -41,7 +42,7 @@ const Badge = React.forwardRef(
|
|
|
41
42
|
({
|
|
42
43
|
tone = "info",
|
|
43
44
|
weight = "regular",
|
|
44
|
-
bleedY
|
|
45
|
+
bleedY: bleedYProp,
|
|
45
46
|
title,
|
|
46
47
|
children,
|
|
47
48
|
id,
|
|
@@ -64,9 +65,10 @@ const Badge = React.forwardRef(
|
|
|
64
65
|
const headingContext = React.useContext(lib_components_Heading_HeadingContext_cjs.HeadingContext);
|
|
65
66
|
const isInline = Boolean(textContext || headingContext);
|
|
66
67
|
assert__default.default(
|
|
67
|
-
!isInline || isInline &&
|
|
68
|
+
!isInline || isInline && typeof bleedYProp === "undefined",
|
|
68
69
|
"A `Badge` cannot use `bleedY` when rendered inside a `Text` or `Heading` component."
|
|
69
70
|
);
|
|
71
|
+
const { bleedY } = lib_components_Badge_defaultBadgeProps_cjs.useDefaultBadgeProps({ bleedY: bleedYProp });
|
|
70
72
|
const content = (
|
|
71
73
|
// Ensures the foreground text tone follows the default
|
|
72
74
|
// for the selected background colour
|
|
@@ -93,7 +95,7 @@ const Badge = React.forwardRef(
|
|
|
93
95
|
}
|
|
94
96
|
) }) })
|
|
95
97
|
);
|
|
96
|
-
return bleedY ? /* @__PURE__ */ jsxRuntime.jsx(lib_components_Bleed_Bleed_cjs.Bleed, { component: "span", vertical: lib_components_Badge_Badge_css_cjs.verticalPadding, children: content }) : content;
|
|
98
|
+
return bleedY && !isInline ? /* @__PURE__ */ jsxRuntime.jsx(lib_components_Bleed_Bleed_cjs.Bleed, { component: "span", vertical: lib_components_Badge_Badge_css_cjs.verticalPadding, children: content }) : content;
|
|
97
99
|
}
|
|
98
100
|
);
|
|
99
101
|
Badge.displayName = "Badge";
|
|
@@ -9,6 +9,7 @@ import { DefaultTextPropsProvider } from "../private/defaultTextProps.mjs";
|
|
|
9
9
|
import { TextContext } from "../Text/TextContext.mjs";
|
|
10
10
|
import { HeadingContext } from "../Heading/HeadingContext.mjs";
|
|
11
11
|
import { verticalPadding, inline } from "./Badge.css.mjs";
|
|
12
|
+
import { useDefaultBadgeProps } from "./defaultBadgeProps.mjs";
|
|
12
13
|
const validTones = [
|
|
13
14
|
"promote",
|
|
14
15
|
"info",
|
|
@@ -38,7 +39,7 @@ const Badge = forwardRef(
|
|
|
38
39
|
({
|
|
39
40
|
tone = "info",
|
|
40
41
|
weight = "regular",
|
|
41
|
-
bleedY
|
|
42
|
+
bleedY: bleedYProp,
|
|
42
43
|
title,
|
|
43
44
|
children,
|
|
44
45
|
id,
|
|
@@ -61,9 +62,10 @@ const Badge = forwardRef(
|
|
|
61
62
|
const headingContext = useContext(HeadingContext);
|
|
62
63
|
const isInline = Boolean(textContext || headingContext);
|
|
63
64
|
assert(
|
|
64
|
-
!isInline || isInline &&
|
|
65
|
+
!isInline || isInline && typeof bleedYProp === "undefined",
|
|
65
66
|
"A `Badge` cannot use `bleedY` when rendered inside a `Text` or `Heading` component."
|
|
66
67
|
);
|
|
68
|
+
const { bleedY } = useDefaultBadgeProps({ bleedY: bleedYProp });
|
|
67
69
|
const content = (
|
|
68
70
|
// Ensures the foreground text tone follows the default
|
|
69
71
|
// for the selected background colour
|
|
@@ -90,7 +92,7 @@ const Badge = forwardRef(
|
|
|
90
92
|
}
|
|
91
93
|
) }) })
|
|
92
94
|
);
|
|
93
|
-
return bleedY ? /* @__PURE__ */ jsx(Bleed, { component: "span", vertical: verticalPadding, children: content }) : content;
|
|
95
|
+
return bleedY && !isInline ? /* @__PURE__ */ jsx(Bleed, { component: "span", vertical: verticalPadding, children: content }) : content;
|
|
94
96
|
}
|
|
95
97
|
);
|
|
96
98
|
Badge.displayName = "Badge";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const DefaultBadgePropsContext = React.createContext({
|
|
5
|
+
bleedY: void 0
|
|
6
|
+
});
|
|
7
|
+
const DefaultBadgePropsProvider = ({
|
|
8
|
+
bleedY,
|
|
9
|
+
children
|
|
10
|
+
}) => {
|
|
11
|
+
const defaultBadgeProps = React.useMemo(
|
|
12
|
+
() => ({
|
|
13
|
+
bleedY
|
|
14
|
+
}),
|
|
15
|
+
[bleedY]
|
|
16
|
+
);
|
|
17
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DefaultBadgePropsContext.Provider, { value: defaultBadgeProps, children });
|
|
18
|
+
};
|
|
19
|
+
const useDefaultBadgeProps = ({
|
|
20
|
+
bleedY: bleedYProp
|
|
21
|
+
}) => {
|
|
22
|
+
const { bleedY } = React.useContext(DefaultBadgePropsContext);
|
|
23
|
+
return {
|
|
24
|
+
bleedY: bleedYProp ?? bleedY ?? false
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
exports.DefaultBadgePropsProvider = DefaultBadgePropsProvider;
|
|
28
|
+
exports.useDefaultBadgeProps = useDefaultBadgeProps;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useMemo } from "react";
|
|
3
|
+
const DefaultBadgePropsContext = createContext({
|
|
4
|
+
bleedY: void 0
|
|
5
|
+
});
|
|
6
|
+
const DefaultBadgePropsProvider = ({
|
|
7
|
+
bleedY,
|
|
8
|
+
children
|
|
9
|
+
}) => {
|
|
10
|
+
const defaultBadgeProps = useMemo(
|
|
11
|
+
() => ({
|
|
12
|
+
bleedY
|
|
13
|
+
}),
|
|
14
|
+
[bleedY]
|
|
15
|
+
);
|
|
16
|
+
return /* @__PURE__ */ jsx(DefaultBadgePropsContext.Provider, { value: defaultBadgeProps, children });
|
|
17
|
+
};
|
|
18
|
+
const useDefaultBadgeProps = ({
|
|
19
|
+
bleedY: bleedYProp
|
|
20
|
+
}) => {
|
|
21
|
+
const { bleedY } = useContext(DefaultBadgePropsContext);
|
|
22
|
+
return {
|
|
23
|
+
bleedY: bleedYProp ?? bleedY ?? false
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
DefaultBadgePropsProvider,
|
|
28
|
+
useDefaultBadgeProps
|
|
29
|
+
};
|