braid-design-system 32.3.0 → 32.4.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 CHANGED
@@ -1,5 +1,84 @@
1
1
  # braid-design-system
2
2
 
3
+ ## 32.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - **Text, Heading:** Add `maxLines` support ([#1286](https://github.com/seek-oss/braid-design-system/pull/1286))
8
+
9
+ Provide support for limiting the number of lines shown by a `Text` or `Heading` component.
10
+
11
+ **EXAMPLE USAGE:**
12
+
13
+ ```jsx
14
+ <Text maxLines={3}>...</Text>
15
+ ```
16
+
17
+ **MIGRATION:**
18
+
19
+ With the addition of this feature, the `truncate` prop is now deprecated and will be removed in a future release.
20
+ Existing consumers should start migrating as below:
21
+
22
+ ```diff
23
+ <Text
24
+ - truncate
25
+ + maxLines={1}
26
+ />
27
+ ```
28
+
29
+ - **Card:** Add full height support ([#1285](https://github.com/seek-oss/braid-design-system/pull/1285))
30
+
31
+ Provide support for making a `Card` use all available vertical space.
32
+ This is useful when laying out rows of `Card` elements and having them all be equal height.
33
+
34
+ **EXAMPLE USAGE:**
35
+
36
+ ```jsx
37
+ <Card height="full">...</Card>
38
+ ```
39
+
40
+ ### Patch Changes
41
+
42
+ - **TextLink, TextLinkButton:** Update underline design ([#1288](https://github.com/seek-oss/braid-design-system/pull/1288))
43
+
44
+ Uplift the design of the the text underline used on `TextLink` and `TextLinkButton` components.
45
+
46
+ - **Column:** Support full height content ([#1285](https://github.com/seek-oss/braid-design-system/pull/1285))
47
+
48
+ Provide support for full height content by growing all `Column` elements to be uniform in height.
49
+
50
+ This will have no effect on the content itself, but enables consumers to create designs of uniform content, such as rows of `Card` elements.
51
+
52
+ ## 32.3.1
53
+
54
+ ### Patch Changes
55
+
56
+ - **RadioItem, Checkbox:** Fix stacking context behaviour ([#1284](https://github.com/seek-oss/braid-design-system/pull/1284))
57
+
58
+ A `RadioItem` and `Checkbox` previously created a new stacking context with an elevated `z-index` applied on hover, resulting in their labels overlaying other elements in an unpredictable ways — most noticable when [toggling nested content].
59
+
60
+ For example, toggling nested content containing an `Autosuggest`, would see the list of suggestions list would be overlayed by the next `RadioItem` on hover.
61
+
62
+ To fix this, the `z-index` is no longer elevated on hover, and additionally the nested content container applies an elevated index when the field is **checked**.
63
+
64
+ [toggling nested content]: https://seek-oss.github.io/braid-design-system/components/RadioGroup#toggling-nested-content
65
+
66
+ - **Textarea:** Adjust `highlightRange` background to support different line heights ([#1279](https://github.com/seek-oss/braid-design-system/pull/1279))
67
+
68
+ Remove the vertical padding on the highlight element to prevent the background colour overlapping the wavy underline in themes with tighter line heights.
69
+
70
+ - **MenuItemCheckbox:** Align checkbox size with a `small` Checkbox ([#1276](https://github.com/seek-oss/braid-design-system/pull/1276))
71
+
72
+ Align the size of a `MenuItemCheckbox` with a `small` sized `Checkbox`.
73
+
74
+ - **Checkbox, RadioItem:** Fix alignment with updated Badge layout ([#1280](https://github.com/seek-oss/braid-design-system/pull/1280))
75
+
76
+ Improve layout to work with updated Badge layout which is no longer driven by line height.
77
+
78
+ - **MonthPicker:** Reduce space between fields ([#1277](https://github.com/seek-oss/braid-design-system/pull/1277))
79
+
80
+ Reduce the space between the month and year fields.
81
+
3
82
  ## 32.3.0
4
83
 
5
84
  ### Minor Changes
@@ -17,7 +17,8 @@ const styles_lib_components_Hidden_Hidden_css_cjs = require("./styles/lib/compon
17
17
  const styles_lib_css_negativeMargin_negativeMargin_css_cjs = require("./styles/lib/css/negativeMargin/negativeMargin.css.cjs");
18
18
  const styles_lib_components_Column_Column_css_cjs = require("./styles/lib/components/Column/Column.css.cjs");
19
19
  const styles_lib_components_ContentBlock_ContentBlock_css_cjs = require("./styles/lib/components/ContentBlock/ContentBlock.css.cjs");
20
- const styles_lib_components_private_Truncate_Truncate_css_cjs = require("./styles/lib/components/private/Truncate/Truncate.css.cjs");
20
+ const dynamic = require("@vanilla-extract/dynamic");
21
+ const styles_lib_components_private_MaxLines_MaxLines_css_cjs = require("./styles/lib/components/private/MaxLines/MaxLines.css.cjs");
21
22
  const styles_lib_components_private_AvoidWidowIcon_AvoidWidowIcon_css_cjs = require("./styles/lib/components/private/AvoidWidowIcon/AvoidWidowIcon.css.cjs");
22
23
  const styles_lib_components_private_touchable_virtualTouchable_css_cjs = require("./styles/lib/components/private/touchable/virtualTouchable.css.cjs");
23
24
  const styles_lib_components_TextLink_TextLink_css_cjs = require("./styles/lib/components/TextLink/TextLink.css.cjs");
@@ -647,19 +648,48 @@ function textStyles({
647
648
  (baseline ? styles_lib_css_typography_css_cjs.textSizeTrimmed : styles_lib_css_typography_css_cjs.textSizeUntrimmed)[size]
648
649
  ];
649
650
  }
650
- const Truncate = ({ children }) => /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", className: styles_lib_components_private_Truncate_Truncate_css_cjs.truncate, children });
651
+ const MaxLines = ({
652
+ children,
653
+ lines
654
+ }) => /* @__PURE__ */ jsxRuntime.jsx(
655
+ Box,
656
+ {
657
+ component: "span",
658
+ className: [styles_lib_components_private_MaxLines_MaxLines_css_cjs.base, lines > 1 ? styles_lib_components_private_MaxLines_MaxLines_css_cjs.multiLine : void 0],
659
+ style: lines > 1 ? dynamic.assignInlineVars({ [styles_lib_components_private_MaxLines_MaxLines_css_cjs.lineLimit]: String(lines) }) : void 0,
660
+ children
661
+ }
662
+ );
651
663
  const Typography = ({
652
664
  id,
653
665
  component = "span",
654
666
  className,
655
667
  align,
656
668
  truncate = false,
669
+ maxLines,
657
670
  icon,
658
671
  data,
659
672
  children,
660
673
  ...restProps
661
674
  }) => {
662
- const contents = truncate ? /* @__PURE__ */ jsxRuntime.jsx(Truncate, { children }) : children;
675
+ const lines = truncate ? 1 : maxLines;
676
+ const contents = typeof lines === "number" ? /* @__PURE__ */ jsxRuntime.jsx(MaxLines, { lines, children }) : children;
677
+ if (process.env.NODE_ENV !== "production") {
678
+ if (typeof truncate !== "undefined") {
679
+ console.warn(
680
+ dedent__default.default`
681
+ The "truncate" prop has been deprecated and will be removed in a future version. Use "maxLines" instead.
682
+ <Text
683
+ %c- truncate
684
+ %c+ maxLines={1}
685
+ %c/>
686
+ `,
687
+ "color: red",
688
+ "color: green",
689
+ "color: inherit"
690
+ );
691
+ }
692
+ }
663
693
  return /* @__PURE__ */ jsxRuntime.jsx(
664
694
  Box,
665
695
  {
@@ -910,6 +940,7 @@ const Column = ({
910
940
  minWidth: 0,
911
941
  width: width !== "content" ? "full" : void 0,
912
942
  flexShrink: width === "content" ? 0 : void 0,
943
+ flexGrow: 1,
913
944
  className: [
914
945
  styles_lib_components_Column_Column_css_cjs.column,
915
946
  width !== "content" ? styles_lib_components_Column_Column_css_cjs.width[width] : null
@@ -16,10 +16,11 @@ import { hiddenOnPrint } from "./styles/lib/components/Hidden/Hidden.css.mjs";
16
16
  import { preventCollapsePseudo, top, right, bottom, left } from "./styles/lib/css/negativeMargin/negativeMargin.css.mjs";
17
17
  import { column, width, columnContent } from "./styles/lib/components/Column/Column.css.mjs";
18
18
  import { marginAuto } from "./styles/lib/components/ContentBlock/ContentBlock.css.mjs";
19
- import { truncate } from "./styles/lib/components/private/Truncate/Truncate.css.mjs";
19
+ import { assignInlineVars } from "@vanilla-extract/dynamic";
20
+ import { base as base$2, multiLine, lineLimit } from "./styles/lib/components/private/MaxLines/MaxLines.css.mjs";
20
21
  import { nowrap } from "./styles/lib/components/private/AvoidWidowIcon/AvoidWidowIcon.css.mjs";
21
22
  import { virtualTouchable as virtualTouchable$1, yAxisOnly } from "./styles/lib/components/private/touchable/virtualTouchable.css.mjs";
22
- import { weakLink, regularLinkLightMode, regularLinkDarkMode, base as base$2, visitedLightMode, visitedDarkMode } from "./styles/lib/components/TextLink/TextLink.css.mjs";
23
+ import { weakLink, regularLinkLightMode, regularLinkDarkMode, base as base$3, visitedLightMode, visitedDarkMode } from "./styles/lib/components/TextLink/TextLink.css.mjs";
23
24
  import { lineHeightContainer } from "./styles/lib/css/lineHeightContainer.css.mjs";
24
25
  import { size, inlineCrop, inline, alignY, cropToTextSize, blockWidths } from "./styles/lib/hooks/useIcon/icon.css.mjs";
25
26
  import { hideFocusRingsClassName } from "./styles/lib/components/private/hideFocusRings/hideFocusRings.css.mjs";
@@ -640,19 +641,48 @@ function textStyles({
640
641
  (baseline ? textSizeTrimmed : textSizeUntrimmed)[size2]
641
642
  ];
642
643
  }
643
- const Truncate = ({ children }) => /* @__PURE__ */ jsx(Box, { component: "span", className: truncate, children });
644
+ const MaxLines = ({
645
+ children,
646
+ lines
647
+ }) => /* @__PURE__ */ jsx(
648
+ Box,
649
+ {
650
+ component: "span",
651
+ className: [base$2, lines > 1 ? multiLine : void 0],
652
+ style: lines > 1 ? assignInlineVars({ [lineLimit]: String(lines) }) : void 0,
653
+ children
654
+ }
655
+ );
644
656
  const Typography = ({
645
657
  id,
646
658
  component = "span",
647
659
  className,
648
660
  align,
649
- truncate: truncate2 = false,
661
+ truncate = false,
662
+ maxLines,
650
663
  icon,
651
664
  data,
652
665
  children,
653
666
  ...restProps
654
667
  }) => {
655
- const contents = truncate2 ? /* @__PURE__ */ jsx(Truncate, { children }) : children;
668
+ const lines = truncate ? 1 : maxLines;
669
+ const contents = typeof lines === "number" ? /* @__PURE__ */ jsx(MaxLines, { lines, children }) : children;
670
+ if (process.env.NODE_ENV !== "production") {
671
+ if (typeof truncate !== "undefined") {
672
+ console.warn(
673
+ dedent`
674
+ The "truncate" prop has been deprecated and will be removed in a future version. Use "maxLines" instead.
675
+ <Text
676
+ %c- truncate
677
+ %c+ maxLines={1}
678
+ %c/>
679
+ `,
680
+ "color: red",
681
+ "color: green",
682
+ "color: inherit"
683
+ );
684
+ }
685
+ }
656
686
  return /* @__PURE__ */ jsx(
657
687
  Box,
658
688
  {
@@ -903,6 +933,7 @@ const Column = ({
903
933
  minWidth: 0,
904
934
  width: width$1 !== "content" ? "full" : void 0,
905
935
  flexShrink: width$1 === "content" ? 0 : void 0,
936
+ flexGrow: 1,
906
937
  className: [
907
938
  column,
908
939
  width$1 !== "content" ? width[width$1] : null
@@ -1975,7 +2006,7 @@ const useLinkStyles = ({
1975
2006
  isPlainBackground(backgroundContext2.darkMode, "dark") || weight === "regular" ? regularLinkDarkMode[backgroundLightness.darkMode] : weakLink
1976
2007
  ];
1977
2008
  return clsx(
1978
- base$2,
2009
+ base$3,
1979
2010
  linkStyles,
1980
2011
  fontWeight.medium,
1981
2012
  showVisited ? [
@@ -28,6 +28,7 @@ const styles_lib_components_private_Modal_Modal_css_cjs = require("./styles/lib/
28
28
  const styles_lib_css_lineHeightContainer_css_cjs = require("./styles/lib/css/lineHeightContainer.css.cjs");
29
29
  const styles_lib_components_List_List_css_cjs = require("./styles/lib/components/List/List.css.cjs");
30
30
  const styles_lib_components_Loader_Loader_css_cjs = require("./styles/lib/components/Loader/Loader.css.cjs");
31
+ const styles_lib_components_MenuItemCheckbox_MenuItemCheckbox_css_cjs = require("./styles/lib/components/MenuItemCheckbox/MenuItemCheckbox.css.cjs");
31
32
  const styles_lib_components_MenuItem_useMenuItem_css_cjs = require("./styles/lib/components/MenuItem/useMenuItem.css.cjs");
32
33
  const styles_lib_components_MenuRenderer_MenuRenderer_css_cjs = require("./styles/lib/components/MenuRenderer/MenuRenderer.css.cjs");
33
34
  const styles_lib_components_OverflowMenu_OverflowMenu_css_cjs = require("./styles/lib/components/OverflowMenu/OverflowMenu.css.cjs");
@@ -3643,7 +3644,7 @@ const Badge = React.forwardRef(
3643
3644
  paddingX: "xsmall",
3644
3645
  borderRadius: "standard",
3645
3646
  overflow: "hidden",
3646
- children: /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Text, { size: "xsmall", weight: "medium", truncate: true, children })
3647
+ children: /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Text, { size: "xsmall", weight: "medium", maxLines: 1, children })
3647
3648
  }
3648
3649
  )
3649
3650
  }
@@ -3795,6 +3796,7 @@ const Card = ({
3795
3796
  component = "div",
3796
3797
  tone,
3797
3798
  data,
3799
+ height,
3798
3800
  ...restProps
3799
3801
  }) => {
3800
3802
  assert__default.default(
@@ -3821,6 +3823,7 @@ const Card = ({
3821
3823
  background: "surface",
3822
3824
  padding: "gutter",
3823
3825
  borderRadius: resolvedRounding,
3826
+ height: height === "full" ? height : void 0,
3824
3827
  ...ToastContext.buildDataAttributes({ data, validateRestProps: restProps }),
3825
3828
  children: [
3826
3829
  tone ? /* @__PURE__ */ jsxRuntime.jsx(Keyline, { tone, borderRadius: resolvedRounding }) : null,
@@ -3946,7 +3949,7 @@ const StyledInput = React.forwardRef(
3946
3949
  zIndex: 1,
3947
3950
  className: [
3948
3951
  styles_lib_components_private_InlineField_InlineField_css_cjs.realField,
3949
- styles_lib_components_private_InlineField_InlineField_css_cjs.realFieldPosition[size],
3952
+ styles_lib_components_private_InlineField_InlineField_css_cjs.sizeVars[size],
3950
3953
  isMixed ? styles_lib_components_private_InlineField_InlineField_css_cjs.isMixed : void 0
3951
3954
  ],
3952
3955
  cursor: !disabled ? "pointer" : void 0,
@@ -3967,7 +3970,7 @@ const StyledInput = React.forwardRef(
3967
3970
  {
3968
3971
  flexShrink: 0,
3969
3972
  position: "relative",
3970
- className: [styles_lib_components_private_InlineField_InlineField_css_cjs.fakeField, styles_lib_components_private_InlineField_InlineField_css_cjs.fakeFieldSize[size]],
3973
+ className: [styles_lib_components_private_InlineField_InlineField_css_cjs.fakeField, styles_lib_components_private_InlineField_InlineField_css_cjs.sizeVars[size]],
3971
3974
  background: fieldBackground,
3972
3975
  borderRadius: fieldBorderRadius,
3973
3976
  children: [
@@ -4047,7 +4050,14 @@ const InlineField = React.forwardRef(
4047
4050
  const messageId = `${id}-message`;
4048
4051
  const descriptionId = `${id}-description`;
4049
4052
  const hasMessage = message || reserveMessageSpace;
4050
- return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Box, { position: "relative", zIndex: 0, className: styles_lib_components_private_InlineField_InlineField_css_cjs.root, children: [
4053
+ if (process.env.NODE_ENV !== "production") {
4054
+ if (badge && badge.props.bleedY !== void 0) {
4055
+ console.warn(
4056
+ `Badge elements cannot set the \`bleedY\` prop when passed to a ${type.charAt(0).toUpperCase()}${type.slice(1)} component`
4057
+ );
4058
+ }
4059
+ }
4060
+ return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Box, { position: "relative", children: [
4051
4061
  /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Box, { display: "flex", children: [
4052
4062
  /* @__PURE__ */ jsxRuntime.jsx(
4053
4063
  StyledInput,
@@ -4074,7 +4084,7 @@ const InlineField = React.forwardRef(
4074
4084
  }
4075
4085
  ),
4076
4086
  /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Box, { paddingLeft: "small", flexGrow: 1, children: [
4077
- /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Inline, { space: "small", children: [
4087
+ /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Box, { className: [styles_lib_components_private_InlineField_InlineField_css_cjs.sizeVars[size], styles_lib_components_private_InlineField_InlineField_css_cjs.labelOffset], children: /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Inline, { space: "small", alignY: "center", children: [
4078
4088
  /* @__PURE__ */ jsxRuntime.jsx(
4079
4089
  ToastContext.Box,
4080
4090
  {
@@ -4083,7 +4093,7 @@ const InlineField = React.forwardRef(
4083
4093
  userSelect: "none",
4084
4094
  display: "block",
4085
4095
  cursor: !disabled ? "pointer" : void 0,
4086
- className: [styles_lib_components_private_InlineField_InlineField_css_cjs.labelOffset[size], ToastContext.virtualTouchable()],
4096
+ className: ToastContext.virtualTouchable(),
4087
4097
  children: /* @__PURE__ */ jsxRuntime.jsx(
4088
4098
  ToastContext.Text,
4089
4099
  {
@@ -4095,12 +4105,13 @@ const InlineField = React.forwardRef(
4095
4105
  )
4096
4106
  }
4097
4107
  ),
4098
- badge ? /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Box, { className: styles_lib_components_private_InlineField_InlineField_css_cjs.badgeOffset[size], children: badge }) : null
4099
- ] }),
4108
+ badge ? React.cloneElement(badge, { bleedY: true }) : null
4109
+ ] }) }),
4100
4110
  description ? /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Box, { paddingTop: "small", children: /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Text, { tone: "secondary", size, id: descriptionId, children: description }) }) : null,
4101
4111
  children ? /* @__PURE__ */ jsxRuntime.jsx(
4102
4112
  ToastContext.Box,
4103
4113
  {
4114
+ position: "relative",
4104
4115
  display: "none",
4105
4116
  paddingTop: "small",
4106
4117
  className: styles_lib_components_private_InlineField_InlineField_css_cjs.children,
@@ -5430,7 +5441,7 @@ function MenuItemChildren({
5430
5441
  size: menuItemChildrenSize,
5431
5442
  baseline: false,
5432
5443
  tone: tone === "critical" ? tone : void 0,
5433
- truncate: true,
5444
+ maxLines: 1,
5434
5445
  children
5435
5446
  }
5436
5447
  ) }),
@@ -5499,7 +5510,7 @@ const MenuItemCheckbox = ({
5499
5510
  background: { lightMode: "surface" },
5500
5511
  marginRight: "small",
5501
5512
  flexShrink: 0,
5502
- className: ToastContext.iconSize(),
5513
+ className: styles_lib_components_MenuItemCheckbox_MenuItemCheckbox_css_cjs.checkboxSize,
5503
5514
  children: /* @__PURE__ */ jsxRuntime.jsx(
5504
5515
  ToastContext.Box,
5505
5516
  {
@@ -5790,7 +5801,7 @@ const MonthPicker = ({
5790
5801
  ] })
5791
5802
  }
5792
5803
  );
5793
- const customFieldGroup = /* @__PURE__ */ jsxRuntime.jsx(FieldGroup, { id, tone, disabled, ...restProps, children: (fieldGroupProps) => /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Columns, { space: "medium", children: [
5804
+ const customFieldGroup = /* @__PURE__ */ jsxRuntime.jsx(FieldGroup, { id, tone, disabled, ...restProps, children: (fieldGroupProps) => /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Columns, { space: "small", children: [
5794
5805
  /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Column, { children: /* @__PURE__ */ jsxRuntime.jsx(
5795
5806
  Dropdown,
5796
5807
  {
@@ -7521,7 +7532,7 @@ const Tag = ({
7521
7532
  paddingRight: onClear ? void 0 : "small",
7522
7533
  borderRadius: "full",
7523
7534
  children: [
7524
- /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Box, { minWidth: 0, title: children, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Text, { baseline: false, truncate: true, icon: icon2, children }) }),
7535
+ /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Box, { minWidth: 0, title: children, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Text, { baseline: false, maxLines: 1, icon: icon2, children }) }),
7525
7536
  onClear ? /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Box, { flexShrink: 0, display: "flex", className: styles_lib_components_Tag_Tag_css_cjs.clearGutter, children: /* @__PURE__ */ jsxRuntime.jsx(
7526
7537
  ToastContext.ButtonIcon,
7527
7538
  {
@@ -27,6 +27,7 @@ import { headingRoot, headingFocus, pointerEventsAll, maxSize, closeIconOffset,
27
27
  import { lineHeightContainer } from "./styles/lib/css/lineHeightContainer.css.mjs";
28
28
  import { currentColor, size, minCharacterWidth, trimGutter } from "./styles/lib/components/List/List.css.mjs";
29
29
  import { rootSize, delay, size as size$1, currentColor as currentColor$1, circle } from "./styles/lib/components/Loader/Loader.css.mjs";
30
+ import { checkboxSize } from "./styles/lib/components/MenuItemCheckbox/MenuItemCheckbox.css.mjs";
30
31
  import { menuItem } from "./styles/lib/components/MenuItem/useMenuItem.css.mjs";
31
32
  import { backdrop as backdrop$2, menuIsClosed, width as width$1, placementBottom } from "./styles/lib/components/MenuRenderer/MenuRenderer.css.mjs";
32
33
  import { triggerOffset } from "./styles/lib/components/OverflowMenu/OverflowMenu.css.mjs";
@@ -34,19 +35,19 @@ import { isMobile } from "is-mobile";
34
35
  import { field as field$1 } from "./styles/lib/components/Dropdown/Dropdown.css.mjs";
35
36
  import { nativeInput } from "./styles/lib/components/MonthPicker/MonthPicker.css.mjs";
36
37
  import { hover, background, current, lightModeCurrentKeyline, darkModeCurrentKeyline } from "./styles/lib/components/Pagination/Pagination.css.mjs";
37
- import { realField, realFieldPosition, isMixed, fakeField, fakeFieldSize, selected, focusOverlay as focusOverlay$1, hoverOverlay as hoverOverlay$1, checkboxIndicator, radioIndicator, root as root$4, labelOffset, badgeOffset, children } from "./styles/lib/components/private/InlineField/InlineField.css.mjs";
38
+ import { realField, sizeVars, isMixed, fakeField, selected, focusOverlay as focusOverlay$1, hoverOverlay as hoverOverlay$1, checkboxIndicator, radioIndicator, labelOffset, children } from "./styles/lib/components/private/InlineField/InlineField.css.mjs";
38
39
  import { starSpacing, textSpacing, lightModeStarColor, darkModeStarColor } from "./styles/lib/components/Rating/Rating.css.mjs";
39
40
  import { step, tone as tone$2, progressTrack, progressTrackCentered, progressLine, progressUnfilled, indicatorContainer, focusOverlay as focusOverlay$2, indicator, highlight, complete, active, inner, tick, stretch, stretchLastAboveTablet } from "./styles/lib/components/Stepper/Stepper.css.mjs";
40
41
  import { tab, cropToIconX, hoveredTab, tabFocusRing, scroll as scroll$1, nowrap, mask, marginAuto, divider, tabUnderline, tabUnderlineActiveDarkMode, underlineLeft, underlineWidth, tabPanel, tabPanelFocusRing } from "./styles/lib/components/Tabs/Tabs.css.mjs";
41
42
  import { assignInlineVars } from "@vanilla-extract/dynamic";
42
43
  import { clearGutter } from "./styles/lib/components/Tag/Tag.css.mjs";
43
- import { root as root$5, caution, critical } from "./styles/lib/components/Textarea/Highlight/Highlight.css.mjs";
44
+ import { root as root$4, caution, critical } from "./styles/lib/components/Textarea/Highlight/Highlight.css.mjs";
44
45
  import { highlights, field as field$2 } from "./styles/lib/components/Textarea/Textarea.css.mjs";
45
46
  import { select, focusOverlay as focusOverlay$3 } from "./styles/lib/components/TextDropdown/TextDropdown.css.mjs";
46
47
  import { root as root$1, up, left, right } from "./styles/lib/components/icons/IconChevron/IconChevron.css.mjs";
47
48
  import { secondaryIconSpace, field, placeholderColor, iconSpace, verticalDivider, focusOverlay, hoverOverlay } from "./styles/lib/components/private/Field/Field.css.mjs";
48
49
  import { columnsWide, columnsDesktop, columnsTablet, columnsMobile } from "./styles/lib/components/Tiles/Tiles.css.mjs";
49
- import { root as root$6, realField as realField$1, realFieldPosition as realFieldPosition$1, fieldSize, slideContainer, slideContainerSize, slideTrack, slideTrackMask, slideTrackBgLightMode, slideTrackBgDarkMode, slideTrackSelected, slider, icon as icon$1, focusOverlay as focusOverlay$4, hoverOverlay as hoverOverlay$2, label } from "./styles/lib/components/Toggle/Toggle.css.mjs";
50
+ import { root as root$5, realField as realField$1, realFieldPosition, fieldSize, slideContainer, slideContainerSize, slideTrack, slideTrackMask, slideTrackBgLightMode, slideTrackBgDarkMode, slideTrackSelected, slider, icon as icon$1, focusOverlay as focusOverlay$4, hoverOverlay as hoverOverlay$2, label } from "./styles/lib/components/Toggle/Toggle.css.mjs";
50
51
  const ThemeNameConsumer = ({ children: children2 }) => children2(useThemeName());
51
52
  const useColor = () => useBraidTheme().color;
52
53
  const useBreakpoint = () => {
@@ -3635,7 +3636,7 @@ const Badge = forwardRef(
3635
3636
  paddingX: "xsmall",
3636
3637
  borderRadius: "standard",
3637
3638
  overflow: "hidden",
3638
- children: /* @__PURE__ */ jsx(Text, { size: "xsmall", weight: "medium", truncate: true, children: children2 })
3639
+ children: /* @__PURE__ */ jsx(Text, { size: "xsmall", weight: "medium", maxLines: 1, children: children2 })
3639
3640
  }
3640
3641
  )
3641
3642
  }
@@ -3787,6 +3788,7 @@ const Card = ({
3787
3788
  component = "div",
3788
3789
  tone: tone2,
3789
3790
  data,
3791
+ height,
3790
3792
  ...restProps
3791
3793
  }) => {
3792
3794
  assert(
@@ -3813,6 +3815,7 @@ const Card = ({
3813
3815
  background: "surface",
3814
3816
  padding: "gutter",
3815
3817
  borderRadius: resolvedRounding,
3818
+ height: height === "full" ? height : void 0,
3816
3819
  ...buildDataAttributes({ data, validateRestProps: restProps }),
3817
3820
  children: [
3818
3821
  tone2 ? /* @__PURE__ */ jsx(Keyline, { tone: tone2, borderRadius: resolvedRounding }) : null,
@@ -3938,7 +3941,7 @@ const StyledInput = forwardRef(
3938
3941
  zIndex: 1,
3939
3942
  className: [
3940
3943
  realField,
3941
- realFieldPosition[size2],
3944
+ sizeVars[size2],
3942
3945
  isMixed$1 ? isMixed : void 0
3943
3946
  ],
3944
3947
  cursor: !disabled ? "pointer" : void 0,
@@ -3959,7 +3962,7 @@ const StyledInput = forwardRef(
3959
3962
  {
3960
3963
  flexShrink: 0,
3961
3964
  position: "relative",
3962
- className: [fakeField, fakeFieldSize[size2]],
3965
+ className: [fakeField, sizeVars[size2]],
3963
3966
  background: fieldBackground,
3964
3967
  borderRadius: fieldBorderRadius,
3965
3968
  children: [
@@ -4039,7 +4042,14 @@ const InlineField = forwardRef(
4039
4042
  const messageId = `${id}-message`;
4040
4043
  const descriptionId = `${id}-description`;
4041
4044
  const hasMessage = message || reserveMessageSpace;
4042
- return /* @__PURE__ */ jsxs(Box, { position: "relative", zIndex: 0, className: root$4, children: [
4045
+ if (process.env.NODE_ENV !== "production") {
4046
+ if (badge && badge.props.bleedY !== void 0) {
4047
+ console.warn(
4048
+ `Badge elements cannot set the \`bleedY\` prop when passed to a ${type.charAt(0).toUpperCase()}${type.slice(1)} component`
4049
+ );
4050
+ }
4051
+ }
4052
+ return /* @__PURE__ */ jsxs(Box, { position: "relative", children: [
4043
4053
  /* @__PURE__ */ jsxs(Box, { display: "flex", children: [
4044
4054
  /* @__PURE__ */ jsx(
4045
4055
  StyledInput,
@@ -4066,7 +4076,7 @@ const InlineField = forwardRef(
4066
4076
  }
4067
4077
  ),
4068
4078
  /* @__PURE__ */ jsxs(Box, { paddingLeft: "small", flexGrow: 1, children: [
4069
- /* @__PURE__ */ jsxs(Inline, { space: "small", children: [
4079
+ /* @__PURE__ */ jsx(Box, { className: [sizeVars[size2], labelOffset], children: /* @__PURE__ */ jsxs(Inline, { space: "small", alignY: "center", children: [
4070
4080
  /* @__PURE__ */ jsx(
4071
4081
  Box,
4072
4082
  {
@@ -4075,7 +4085,7 @@ const InlineField = forwardRef(
4075
4085
  userSelect: "none",
4076
4086
  display: "block",
4077
4087
  cursor: !disabled ? "pointer" : void 0,
4078
- className: [labelOffset[size2], virtualTouchable()],
4088
+ className: virtualTouchable(),
4079
4089
  children: /* @__PURE__ */ jsx(
4080
4090
  Text,
4081
4091
  {
@@ -4087,12 +4097,13 @@ const InlineField = forwardRef(
4087
4097
  )
4088
4098
  }
4089
4099
  ),
4090
- badge ? /* @__PURE__ */ jsx(Box, { className: badgeOffset[size2], children: badge }) : null
4091
- ] }),
4100
+ badge ? cloneElement(badge, { bleedY: true }) : null
4101
+ ] }) }),
4092
4102
  description ? /* @__PURE__ */ jsx(Box, { paddingTop: "small", children: /* @__PURE__ */ jsx(Text, { tone: "secondary", size: size2, id: descriptionId, children: description }) }) : null,
4093
4103
  children$1 ? /* @__PURE__ */ jsx(
4094
4104
  Box,
4095
4105
  {
4106
+ position: "relative",
4096
4107
  display: "none",
4097
4108
  paddingTop: "small",
4098
4109
  className: children,
@@ -5422,7 +5433,7 @@ function MenuItemChildren({
5422
5433
  size: menuItemChildrenSize,
5423
5434
  baseline: false,
5424
5435
  tone: tone2 === "critical" ? tone2 : void 0,
5425
- truncate: true,
5436
+ maxLines: 1,
5426
5437
  children: children2
5427
5438
  }
5428
5439
  ) }),
@@ -5491,7 +5502,7 @@ const MenuItemCheckbox = ({
5491
5502
  background: { lightMode: "surface" },
5492
5503
  marginRight: "small",
5493
5504
  flexShrink: 0,
5494
- className: iconSize(),
5505
+ className: checkboxSize,
5495
5506
  children: /* @__PURE__ */ jsx(
5496
5507
  Box,
5497
5508
  {
@@ -5782,7 +5793,7 @@ const MonthPicker = ({
5782
5793
  ] })
5783
5794
  }
5784
5795
  );
5785
- const customFieldGroup = /* @__PURE__ */ jsx(FieldGroup, { id, tone: tone2, disabled, ...restProps, children: (fieldGroupProps) => /* @__PURE__ */ jsxs(Columns, { space: "medium", children: [
5796
+ const customFieldGroup = /* @__PURE__ */ jsx(FieldGroup, { id, tone: tone2, disabled, ...restProps, children: (fieldGroupProps) => /* @__PURE__ */ jsxs(Columns, { space: "small", children: [
5786
5797
  /* @__PURE__ */ jsx(Column, { children: /* @__PURE__ */ jsx(
5787
5798
  Dropdown,
5788
5799
  {
@@ -7513,7 +7524,7 @@ const Tag = ({
7513
7524
  paddingRight: onClear ? void 0 : "small",
7514
7525
  borderRadius: "full",
7515
7526
  children: [
7516
- /* @__PURE__ */ jsx(Box, { minWidth: 0, title: children2, children: /* @__PURE__ */ jsx(Text, { baseline: false, truncate: true, icon: icon2, children: children2 }) }),
7527
+ /* @__PURE__ */ jsx(Box, { minWidth: 0, title: children2, children: /* @__PURE__ */ jsx(Text, { baseline: false, maxLines: 1, icon: icon2, children: children2 }) }),
7517
7528
  onClear ? /* @__PURE__ */ jsx(Box, { flexShrink: 0, display: "flex", className: clearGutter, children: /* @__PURE__ */ jsx(
7518
7529
  ButtonIcon,
7519
7530
  {
@@ -7533,7 +7544,7 @@ const Tag = ({
7533
7544
  );
7534
7545
  };
7535
7546
  const styleForTone = { caution, critical };
7536
- const Highlight = ({ children: children2, tone: tone2 }) => /* @__PURE__ */ jsx(Box, { component: "mark", className: [root$5, styleForTone[tone2]], children: children2 });
7547
+ const Highlight = ({ children: children2, tone: tone2 }) => /* @__PURE__ */ jsx(Box, { component: "mark", className: [root$4, styleForTone[tone2]], children: children2 });
7537
7548
  const formatRanges = (value, highlightRanges, tone2) => {
7538
7549
  if (highlightRanges && value) {
7539
7550
  let lastEnd = 0;
@@ -7951,7 +7962,7 @@ const Toggle = forwardRef(
7951
7962
  zIndex: 0,
7952
7963
  display: "flex",
7953
7964
  flexDirection: align === "left" ? void 0 : "rowReverse",
7954
- className: root$6,
7965
+ className: root$5,
7955
7966
  ...buildDataAttributes({ data, validateRestProps: restProps }),
7956
7967
  children: [
7957
7968
  /* @__PURE__ */ jsx(
@@ -7968,7 +7979,7 @@ const Toggle = forwardRef(
7968
7979
  opacity: 0,
7969
7980
  className: [
7970
7981
  realField$1,
7971
- realFieldPosition$1[size2],
7982
+ realFieldPosition[size2],
7972
7983
  fieldSize[size2]
7973
7984
  ],
7974
7985
  ref: forwardedRef
package/dist/reset.d.ts CHANGED
@@ -2724,7 +2724,9 @@ interface TypographyProps extends Pick<BoxProps, 'id' | 'component'> {
2724
2724
  children?: ReactNode;
2725
2725
  icon?: ReactElement<UseIconProps>;
2726
2726
  align?: BoxProps['textAlign'];
2727
+ /** @deprecated Use `maxLines={1}` instead. */
2727
2728
  truncate?: boolean;
2729
+ maxLines?: number;
2728
2730
  data?: DataAttributeMap;
2729
2731
  }
2730
2732
 
@@ -3061,9 +3063,10 @@ type CardProps = {
3061
3063
  children: ReactNode;
3062
3064
  tone?: 'promote' | 'formAccent';
3063
3065
  component?: (typeof validCardComponents)[number];
3066
+ height?: Extract<BoxProps['height'], 'full'> | 'content';
3064
3067
  data?: DataAttributeMap;
3065
3068
  } & (SimpleCardRounding | ResponsiveCardRounding);
3066
- declare const Card$1: ({ children, component, tone, data, ...restProps }: CardProps) => JSX.Element;
3069
+ declare const Card$1: ({ children, component, tone, data, height, ...restProps }: CardProps) => JSX.Element;
3067
3070
 
3068
3071
  declare const sizes$1: {
3069
3072
  readonly standard: "standard";
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ const fileScope = require("@vanilla-extract/css/fileScope");
3
+ const css = require("@vanilla-extract/css");
4
+ const cssUtils = require("@vanilla-extract/css-utils");
5
+ const styles_lib_css_responsiveStyle_cjs = require("../../css/responsiveStyle.cjs");
6
+ const styles_lib_themes_vars_css_cjs = require("../../themes/vars.css.cjs");
7
+ fileScope.setFileScope("src/lib/components/MenuItemCheckbox/MenuItemCheckbox.css.ts?used", "braid-design-system");
8
+ const checkboxFieldSize = styles_lib_themes_vars_css_cjs.vars.inlineFieldSize.small;
9
+ const menuItemCapHeight = css.createVar("menuItemCapHeight");
10
+ const crop = css.createVar("crop");
11
+ const checkboxSize = css.style([styles_lib_css_responsiveStyle_cjs.responsiveStyle({
12
+ mobile: {
13
+ vars: {
14
+ [menuItemCapHeight]: styles_lib_themes_vars_css_cjs.vars.textSize.standard.mobile.capHeight,
15
+ [crop]: cssUtils.calc(checkboxFieldSize).subtract(menuItemCapHeight).divide(2).negate().toString()
16
+ }
17
+ },
18
+ tablet: {
19
+ vars: {
20
+ [menuItemCapHeight]: styles_lib_themes_vars_css_cjs.vars.textSize.standard.tablet.capHeight
21
+ }
22
+ }
23
+ }), {
24
+ height: checkboxFieldSize,
25
+ width: checkboxFieldSize,
26
+ marginTop: crop,
27
+ marginBottom: crop
28
+ }], "checkboxSize");
29
+ fileScope.endFileScope();
30
+ exports.checkboxSize = checkboxSize;
@@ -0,0 +1,31 @@
1
+ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
+ import { createVar, style } from "@vanilla-extract/css";
3
+ import { calc } from "@vanilla-extract/css-utils";
4
+ import { responsiveStyle } from "../../css/responsiveStyle.mjs";
5
+ import { vars } from "../../themes/vars.css.mjs";
6
+ setFileScope("src/lib/components/MenuItemCheckbox/MenuItemCheckbox.css.ts?used", "braid-design-system");
7
+ const checkboxFieldSize = vars.inlineFieldSize.small;
8
+ const menuItemCapHeight = createVar("menuItemCapHeight");
9
+ const crop = createVar("crop");
10
+ const checkboxSize = style([responsiveStyle({
11
+ mobile: {
12
+ vars: {
13
+ [menuItemCapHeight]: vars.textSize.standard.mobile.capHeight,
14
+ [crop]: calc(checkboxFieldSize).subtract(menuItemCapHeight).divide(2).negate().toString()
15
+ }
16
+ },
17
+ tablet: {
18
+ vars: {
19
+ [menuItemCapHeight]: vars.textSize.standard.tablet.capHeight
20
+ }
21
+ }
22
+ }), {
23
+ height: checkboxFieldSize,
24
+ width: checkboxFieldSize,
25
+ marginTop: crop,
26
+ marginBottom: crop
27
+ }], "checkboxSize");
28
+ endFileScope();
29
+ export {
30
+ checkboxSize
31
+ };
@@ -31,9 +31,21 @@ const weakLinkVars = css.assignVars(textLinkVars, {
31
31
  const base = css.style({
32
32
  color: textLinkVars.color,
33
33
  textDecoration: textLinkVars.textDecoration,
34
+ textDecorationThickness: "0.1em",
35
+ textUnderlineOffset: "0.32em",
34
36
  ":hover": {
35
37
  color: textLinkVars.colorHover,
36
- textDecoration: textLinkVars.textDecorationHover
38
+ textDecoration: textLinkVars.textDecorationHover,
39
+ /*
40
+ Duplicating the thickness rule due to inconsistent support
41
+ for shorthand properties of `text-decoration`. Without this,
42
+ applying the above decoration rule resets the thickness in
43
+ browsers that do support shorthands.
44
+
45
+ We also cannot use the long-form `text-decoration-line` due
46
+ to browser support policy of Edge 16+.
47
+ */
48
+ textDecorationThickness: "0.1em"
37
49
  },
38
50
  ":focus": {
39
51
  color: textLinkVars.colorHover
@@ -30,9 +30,21 @@ const weakLinkVars = assignVars(textLinkVars, {
30
30
  const base = style({
31
31
  color: textLinkVars.color,
32
32
  textDecoration: textLinkVars.textDecoration,
33
+ textDecorationThickness: "0.1em",
34
+ textUnderlineOffset: "0.32em",
33
35
  ":hover": {
34
36
  color: textLinkVars.colorHover,
35
- textDecoration: textLinkVars.textDecorationHover
37
+ textDecoration: textLinkVars.textDecorationHover,
38
+ /*
39
+ Duplicating the thickness rule due to inconsistent support
40
+ for shorthand properties of `text-decoration`. Without this,
41
+ applying the above decoration rule resets the thickness in
42
+ browsers that do support shorthands.
43
+
44
+ We also cannot use the long-form `text-decoration-line` due
45
+ to browser support policy of Edge 16+.
46
+ */
47
+ textDecorationThickness: "0.1em"
36
48
  },
37
49
  ":focus": {
38
50
  color: textLinkVars.colorHover
@@ -5,20 +5,17 @@ const styles_lib_css_atoms_atoms_cjs = require("../../../css/atoms/atoms.cjs");
5
5
  const styles_lib_css_colorModeStyle_cjs = require("../../../css/colorModeStyle.cjs");
6
6
  const styles_lib_themes_vars_css_cjs = require("../../../themes/vars.css.cjs");
7
7
  fileScope.setFileScope("src/lib/components/Textarea/Highlight/Highlight.css.ts?used", "braid-design-system");
8
- const space = 2;
9
- const lineThickness = 2;
8
+ const space = "2px";
10
9
  const root = css.style([styles_lib_css_atoms_atoms_cjs.atoms({
11
10
  borderRadius: "small"
12
11
  }), {
13
- padding: space,
14
- margin: -space,
12
+ padding: `0 ${space}`,
13
+ margin: `0 -${space}`,
15
14
  textDecoration: "underline",
16
15
  textDecorationStyle: "wavy",
17
16
  textDecorationSkipInk: "none",
18
- textDecorationThickness: lineThickness,
19
- textUnderlineOffset: 2,
20
- paddingBottom: lineThickness / 2,
21
- marginBottom: -(lineThickness / 2)
17
+ textDecorationThickness: 2,
18
+ textUnderlineOffset: 2
22
19
  }], "root");
23
20
  const critical = css.style(styles_lib_css_colorModeStyle_cjs.colorModeStyle({
24
21
  lightMode: {
@@ -4,20 +4,17 @@ import { atoms } from "../../../css/atoms/atoms.mjs";
4
4
  import { colorModeStyle } from "../../../css/colorModeStyle.mjs";
5
5
  import { vars } from "../../../themes/vars.css.mjs";
6
6
  setFileScope("src/lib/components/Textarea/Highlight/Highlight.css.ts?used", "braid-design-system");
7
- const space = 2;
8
- const lineThickness = 2;
7
+ const space = "2px";
9
8
  const root = style([atoms({
10
9
  borderRadius: "small"
11
10
  }), {
12
- padding: space,
13
- margin: -space,
11
+ padding: `0 ${space}`,
12
+ margin: `0 -${space}`,
14
13
  textDecoration: "underline",
15
14
  textDecorationStyle: "wavy",
16
15
  textDecorationSkipInk: "none",
17
- textDecorationThickness: lineThickness,
18
- textUnderlineOffset: 2,
19
- paddingBottom: lineThickness / 2,
20
- marginBottom: -(lineThickness / 2)
16
+ textDecorationThickness: 2,
17
+ textUnderlineOffset: 2
21
18
  }], "root");
22
19
  const critical = style(colorModeStyle({
23
20
  lightMode: {
@@ -5,48 +5,48 @@ const cssUtils = require("@vanilla-extract/css-utils");
5
5
  const styles_lib_themes_vars_css_cjs = require("../../../themes/vars.css.cjs");
6
6
  const styles_lib_components_private_touchable_hitArea_cjs = require("../touchable/hitArea.cjs");
7
7
  const styles_lib_components_private_touchable_debugTouchable_cjs = require("../touchable/debugTouchable.cjs");
8
+ const styles_lib_css_responsiveStyle_cjs = require("../../../css/responsiveStyle.cjs");
8
9
  fileScope.setFileScope("src/lib/components/private/InlineField/InlineField.css.ts?used", "braid-design-system");
9
10
  const sizes = {
10
11
  standard: "standard",
11
12
  small: "small"
12
13
  };
13
- const root = css.style({
14
- ":hover": {
15
- zIndex: 1
14
+ const fieldSize = css.createVar("fieldSize");
15
+ const labelCapHeight = css.createVar("labelCapHeight");
16
+ const sizeVars = css.styleVariants(sizes, (size) => styles_lib_css_responsiveStyle_cjs.responsiveStyle({
17
+ mobile: {
18
+ vars: {
19
+ [fieldSize]: styles_lib_themes_vars_css_cjs.vars.inlineFieldSize[size],
20
+ [labelCapHeight]: styles_lib_themes_vars_css_cjs.vars.textSize[size].mobile.capHeight
21
+ }
22
+ },
23
+ tablet: {
24
+ vars: {
25
+ [labelCapHeight]: styles_lib_themes_vars_css_cjs.vars.textSize[size].tablet.capHeight
26
+ }
16
27
  }
17
- }, "root");
28
+ }), "sizeVars");
29
+ const hitAreaOffset = cssUtils.calc(styles_lib_components_private_touchable_hitArea_cjs.hitArea).subtract(fieldSize).divide(2).negate().toString();
18
30
  const realField = css.style([{
19
31
  width: styles_lib_components_private_touchable_hitArea_cjs.hitArea,
20
- height: styles_lib_components_private_touchable_hitArea_cjs.hitArea
32
+ height: styles_lib_components_private_touchable_hitArea_cjs.hitArea,
33
+ top: hitAreaOffset,
34
+ left: hitAreaOffset
21
35
  }, styles_lib_components_private_touchable_debugTouchable_cjs.debugTouchable()], "realField");
22
- const realFieldPosition = css.styleVariants(sizes, (size) => {
23
- const offset = cssUtils.calc(styles_lib_components_private_touchable_hitArea_cjs.hitArea).subtract(styles_lib_themes_vars_css_cjs.vars.inlineFieldSize[size]).divide(2).negate().toString();
24
- return {
25
- top: offset,
26
- left: offset
27
- };
28
- }, "realFieldPosition");
29
- const fakeField = css.style({}, "fakeField");
30
- const fakeFieldSize = css.styleVariants(sizes, (size) => ({
31
- height: styles_lib_themes_vars_css_cjs.vars.inlineFieldSize[size],
32
- width: styles_lib_themes_vars_css_cjs.vars.inlineFieldSize[size]
33
- }), "fakeFieldSize");
34
- const badgeOffset = css.styleVariants(sizes, (size) => {
35
- const offset = cssUtils.calc(styles_lib_themes_vars_css_cjs.vars.inlineFieldSize[size]).subtract(styles_lib_themes_vars_css_cjs.vars.textSize.xsmall.mobile.lineHeight).divide(2).toString();
36
- return {
37
- paddingTop: offset,
38
- paddingBottom: offset
39
- };
40
- }, "badgeOffset");
41
- const labelOffset = css.styleVariants(sizes, (size) => ({
42
- paddingTop: cssUtils.calc(styles_lib_themes_vars_css_cjs.vars.inlineFieldSize[size]).subtract(styles_lib_themes_vars_css_cjs.vars.textSize[size].mobile.capHeight).divide(2).toString()
43
- }), "labelOffset");
36
+ const fakeField = css.style({
37
+ height: fieldSize,
38
+ width: fieldSize
39
+ }, "fakeField");
40
+ const labelOffset = css.style({
41
+ paddingTop: cssUtils.calc(fieldSize).subtract(labelCapHeight).divide(2).toString()
42
+ }, "labelOffset");
44
43
  const isMixed = css.style({}, "isMixed");
45
44
  const children = css.style({
46
45
  selectors: {
47
46
  [`${realField}:checked ~ * &,
48
47
  ${realField}${isMixed} ~ * &`]: {
49
- display: "block"
48
+ display: "block",
49
+ zIndex: 1
50
50
  }
51
51
  }
52
52
  }, "children");
@@ -99,17 +99,14 @@ const radioScale = css.style({
99
99
  }, "radioScale");
100
100
  const radioIndicator = [indicator, radioScale];
101
101
  fileScope.endFileScope();
102
- exports.badgeOffset = badgeOffset;
103
102
  exports.checkboxIndicator = checkboxIndicator;
104
103
  exports.children = children;
105
104
  exports.fakeField = fakeField;
106
- exports.fakeFieldSize = fakeFieldSize;
107
105
  exports.focusOverlay = focusOverlay;
108
106
  exports.hoverOverlay = hoverOverlay;
109
107
  exports.isMixed = isMixed;
110
108
  exports.labelOffset = labelOffset;
111
109
  exports.radioIndicator = radioIndicator;
112
110
  exports.realField = realField;
113
- exports.realFieldPosition = realFieldPosition;
114
- exports.root = root;
115
111
  exports.selected = selected;
112
+ exports.sizeVars = sizeVars;
@@ -1,51 +1,51 @@
1
1
  import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { style, styleVariants } from "@vanilla-extract/css";
2
+ import { createVar, styleVariants, style } from "@vanilla-extract/css";
3
3
  import { calc } from "@vanilla-extract/css-utils";
4
4
  import { vars } from "../../../themes/vars.css.mjs";
5
5
  import { hitArea } from "../touchable/hitArea.mjs";
6
6
  import { debugTouchable } from "../touchable/debugTouchable.mjs";
7
+ import { responsiveStyle } from "../../../css/responsiveStyle.mjs";
7
8
  setFileScope("src/lib/components/private/InlineField/InlineField.css.ts?used", "braid-design-system");
8
9
  const sizes = {
9
10
  standard: "standard",
10
11
  small: "small"
11
12
  };
12
- const root = style({
13
- ":hover": {
14
- zIndex: 1
13
+ const fieldSize = createVar("fieldSize");
14
+ const labelCapHeight = createVar("labelCapHeight");
15
+ const sizeVars = styleVariants(sizes, (size) => responsiveStyle({
16
+ mobile: {
17
+ vars: {
18
+ [fieldSize]: vars.inlineFieldSize[size],
19
+ [labelCapHeight]: vars.textSize[size].mobile.capHeight
20
+ }
21
+ },
22
+ tablet: {
23
+ vars: {
24
+ [labelCapHeight]: vars.textSize[size].tablet.capHeight
25
+ }
15
26
  }
16
- }, "root");
27
+ }), "sizeVars");
28
+ const hitAreaOffset = calc(hitArea).subtract(fieldSize).divide(2).negate().toString();
17
29
  const realField = style([{
18
30
  width: hitArea,
19
- height: hitArea
31
+ height: hitArea,
32
+ top: hitAreaOffset,
33
+ left: hitAreaOffset
20
34
  }, debugTouchable()], "realField");
21
- const realFieldPosition = styleVariants(sizes, (size) => {
22
- const offset = calc(hitArea).subtract(vars.inlineFieldSize[size]).divide(2).negate().toString();
23
- return {
24
- top: offset,
25
- left: offset
26
- };
27
- }, "realFieldPosition");
28
- const fakeField = style({}, "fakeField");
29
- const fakeFieldSize = styleVariants(sizes, (size) => ({
30
- height: vars.inlineFieldSize[size],
31
- width: vars.inlineFieldSize[size]
32
- }), "fakeFieldSize");
33
- const badgeOffset = styleVariants(sizes, (size) => {
34
- const offset = calc(vars.inlineFieldSize[size]).subtract(vars.textSize.xsmall.mobile.lineHeight).divide(2).toString();
35
- return {
36
- paddingTop: offset,
37
- paddingBottom: offset
38
- };
39
- }, "badgeOffset");
40
- const labelOffset = styleVariants(sizes, (size) => ({
41
- paddingTop: calc(vars.inlineFieldSize[size]).subtract(vars.textSize[size].mobile.capHeight).divide(2).toString()
42
- }), "labelOffset");
35
+ const fakeField = style({
36
+ height: fieldSize,
37
+ width: fieldSize
38
+ }, "fakeField");
39
+ const labelOffset = style({
40
+ paddingTop: calc(fieldSize).subtract(labelCapHeight).divide(2).toString()
41
+ }, "labelOffset");
43
42
  const isMixed = style({}, "isMixed");
44
43
  const children = style({
45
44
  selectors: {
46
45
  [`${realField}:checked ~ * &,
47
46
  ${realField}${isMixed} ~ * &`]: {
48
- display: "block"
47
+ display: "block",
48
+ zIndex: 1
49
49
  }
50
50
  }
51
51
  }, "children");
@@ -99,18 +99,15 @@ const radioScale = style({
99
99
  const radioIndicator = [indicator, radioScale];
100
100
  endFileScope();
101
101
  export {
102
- badgeOffset,
103
102
  checkboxIndicator,
104
103
  children,
105
104
  fakeField,
106
- fakeFieldSize,
107
105
  focusOverlay,
108
106
  hoverOverlay,
109
107
  isMixed,
110
108
  labelOffset,
111
109
  radioIndicator,
112
110
  realField,
113
- realFieldPosition,
114
- root,
115
- selected
111
+ selected,
112
+ sizeVars
116
113
  };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ const fileScope = require("@vanilla-extract/css/fileScope");
3
+ const css = require("@vanilla-extract/css");
4
+ const styles_entries_css_cjs = require("../../../../../css.cjs");
5
+ fileScope.setFileScope("src/lib/components/private/MaxLines/MaxLines.css.ts?used", "braid-design-system");
6
+ const base = css.style([styles_entries_css_cjs.atoms({
7
+ display: "block",
8
+ overflow: "hidden",
9
+ minWidth: 0
10
+ }), {
11
+ textOverflow: "ellipsis",
12
+ whiteSpace: "nowrap"
13
+ }], "base");
14
+ const lineLimit = css.createVar("lineLimit");
15
+ const lineClampSupportsQuery = "(display: -webkit-box) and (-webkit-line-clamp: 1)";
16
+ const multiLine = css.style({
17
+ // Can drop supports query when Edge 16 is removed from browser support policy
18
+ "@supports": {
19
+ [lineClampSupportsQuery]: {
20
+ whiteSpace: "initial",
21
+ display: "-webkit-box",
22
+ WebkitLineClamp: lineLimit,
23
+ WebkitBoxOrient: "vertical"
24
+ }
25
+ }
26
+ }, "multiLine");
27
+ fileScope.endFileScope();
28
+ exports.base = base;
29
+ exports.lineLimit = lineLimit;
30
+ exports.multiLine = multiLine;
@@ -0,0 +1,31 @@
1
+ import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
+ import { style, createVar } from "@vanilla-extract/css";
3
+ import { atoms } from "../../../../../css.mjs";
4
+ setFileScope("src/lib/components/private/MaxLines/MaxLines.css.ts?used", "braid-design-system");
5
+ const base = style([atoms({
6
+ display: "block",
7
+ overflow: "hidden",
8
+ minWidth: 0
9
+ }), {
10
+ textOverflow: "ellipsis",
11
+ whiteSpace: "nowrap"
12
+ }], "base");
13
+ const lineLimit = createVar("lineLimit");
14
+ const lineClampSupportsQuery = "(display: -webkit-box) and (-webkit-line-clamp: 1)";
15
+ const multiLine = style({
16
+ // Can drop supports query when Edge 16 is removed from browser support policy
17
+ "@supports": {
18
+ [lineClampSupportsQuery]: {
19
+ whiteSpace: "initial",
20
+ display: "-webkit-box",
21
+ WebkitLineClamp: lineLimit,
22
+ WebkitBoxOrient: "vertical"
23
+ }
24
+ }
25
+ }, "multiLine");
26
+ endFileScope();
27
+ export {
28
+ base,
29
+ lineLimit,
30
+ multiLine
31
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-design-system",
3
- "version": "32.3.0",
3
+ "version": "32.4.0",
4
4
  "description": "Themeable design system for the SEEK Group",
5
5
  "homepage": "https://seek-oss.github.io/braid-design-system/",
6
6
  "bugs": {
@@ -1,15 +0,0 @@
1
- "use strict";
2
- const fileScope = require("@vanilla-extract/css/fileScope");
3
- const css = require("@vanilla-extract/css");
4
- const styles_entries_css_cjs = require("../../../../../css.cjs");
5
- fileScope.setFileScope("src/lib/components/private/Truncate/Truncate.css.ts?used", "braid-design-system");
6
- const truncate = css.style([styles_entries_css_cjs.atoms({
7
- display: "block",
8
- overflow: "hidden",
9
- minWidth: 0
10
- }), {
11
- whiteSpace: "nowrap",
12
- textOverflow: "ellipsis"
13
- }], "truncate");
14
- fileScope.endFileScope();
15
- exports.truncate = truncate;
@@ -1,16 +0,0 @@
1
- import { setFileScope, endFileScope } from "@vanilla-extract/css/fileScope";
2
- import { style } from "@vanilla-extract/css";
3
- import { atoms } from "../../../../../css.mjs";
4
- setFileScope("src/lib/components/private/Truncate/Truncate.css.ts?used", "braid-design-system");
5
- const truncate = style([atoms({
6
- display: "block",
7
- overflow: "hidden",
8
- minWidth: 0
9
- }), {
10
- whiteSpace: "nowrap",
11
- textOverflow: "ellipsis"
12
- }], "truncate");
13
- endFileScope();
14
- export {
15
- truncate
16
- };