@alto-avios/alto-ui 2.3.3 → 2.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.
Files changed (108) hide show
  1. package/README.md +20 -9
  2. package/dist/assets/Badge.css +1 -1
  3. package/dist/assets/Button.css +1 -1
  4. package/dist/assets/ButtonGroup.css +1 -1
  5. package/dist/assets/CardSection.css +1 -1
  6. package/dist/assets/Checkbox.css +1 -1
  7. package/dist/assets/CheckboxGroup.css +1 -1
  8. package/dist/assets/ClearFieldButton.css +1 -1
  9. package/dist/assets/DateField.css +1 -1
  10. package/dist/assets/Eyebrow.css +1 -1
  11. package/dist/assets/FieldDescription.css +1 -1
  12. package/dist/assets/FieldError.css +1 -1
  13. package/dist/assets/FieldHeader.css +1 -1
  14. package/dist/assets/FieldLabel.css +1 -1
  15. package/dist/assets/Grid.css +1 -1
  16. package/dist/assets/Heading.css +1 -1
  17. package/dist/assets/IconButton.css +1 -1
  18. package/dist/assets/Link.css +1 -1
  19. package/dist/assets/LoadingSpinner.css +1 -1
  20. package/dist/assets/NewButton.css +1 -1
  21. package/dist/assets/NumberField.css +1 -0
  22. package/dist/assets/Radio.css +1 -1
  23. package/dist/assets/RadioGroup.css +1 -1
  24. package/dist/assets/Section.css +1 -0
  25. package/dist/assets/SubHeading.css +1 -1
  26. package/dist/assets/Tag.css +1 -1
  27. package/dist/assets/TextAreaField.css +1 -1
  28. package/dist/assets/ToggleButton.css +1 -1
  29. package/dist/assets/ToggleIconButton.css +1 -1
  30. package/dist/assets/Tooltip.css +1 -1
  31. package/dist/assets/fgColor.css +1 -1
  32. package/dist/assets/focusStyles.css +1 -1
  33. package/dist/assets/padding.css +1 -1
  34. package/dist/components/Badge/Badge.js +11 -11
  35. package/dist/components/Box/Box.d.ts +2 -2
  36. package/dist/components/Button/Button.js +23 -23
  37. package/dist/components/ButtonGroup/ButtonGroup.js +8 -8
  38. package/dist/components/CardSection/CardSection.js +7 -7
  39. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  40. package/dist/components/Checkbox/Checkbox.js +11 -9
  41. package/dist/components/Checkbox/Checkbox.js.map +1 -1
  42. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +12 -12
  43. package/dist/components/CheckboxGroup/CheckboxGroup.js +3 -3
  44. package/dist/components/ClearFieldButton/ClearFieldButton.d.ts +1 -1
  45. package/dist/components/ClearFieldButton/ClearFieldButton.js +4 -4
  46. package/dist/components/DateField/DateField.js +3 -3
  47. package/dist/components/DestinationHeading/DestinationHeading.d.ts +1 -1
  48. package/dist/components/Eyebrow/Eyebrow.js +5 -5
  49. package/dist/components/FieldDescription/FieldDescription.js +1 -1
  50. package/dist/components/FieldError/FieldError.js +1 -1
  51. package/dist/components/FieldHeader/FieldHeader.d.ts +2 -1
  52. package/dist/components/FieldHeader/FieldHeader.js +5 -4
  53. package/dist/components/FieldHeader/FieldHeader.js.map +1 -1
  54. package/dist/components/FieldLabel/FieldLabel.d.ts +1 -1
  55. package/dist/components/FieldLabel/FieldLabel.js +1 -2
  56. package/dist/components/FieldLabel/FieldLabel.js.map +1 -1
  57. package/dist/components/Grid/Grid.d.ts +35 -16
  58. package/dist/components/Grid/Grid.js +63 -30
  59. package/dist/components/Grid/Grid.js.map +1 -1
  60. package/dist/components/Heading/Heading.js +16 -16
  61. package/dist/components/Icon/Icon.d.ts +4 -4
  62. package/dist/components/Icon/Icon.js +1 -0
  63. package/dist/components/Icon/Icon.js.map +1 -1
  64. package/dist/components/IconButton/IconButton.js +22 -22
  65. package/dist/components/Link/Link.js +7 -7
  66. package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -2
  67. package/dist/components/LoadingSpinner/LoadingSpinner.js +5 -5
  68. package/dist/components/NewButton/NewButton.js +28 -28
  69. package/dist/components/NumberField/NumberField.d.ts +55 -0
  70. package/dist/components/NumberField/NumberField.js +43 -0
  71. package/dist/components/NumberField/NumberField.js.map +1 -0
  72. package/dist/components/NumberField/index.d.ts +1 -0
  73. package/dist/components/NumberField/index.js +5 -0
  74. package/dist/components/NumberField/index.js.map +1 -0
  75. package/dist/components/Paragraph/Paragraph.d.ts +3 -3
  76. package/dist/components/Radio/Radio.js +3 -3
  77. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  78. package/dist/components/RadioGroup/RadioGroup.js +1 -2
  79. package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
  80. package/dist/components/Section/Section.d.ts +29 -0
  81. package/dist/components/Section/Section.js +103 -0
  82. package/dist/components/Section/Section.js.map +1 -0
  83. package/dist/components/Section/index.d.ts +1 -0
  84. package/dist/components/Section/index.js +5 -0
  85. package/dist/components/Section/index.js.map +1 -0
  86. package/dist/components/SubHeading/SubHeading.js +8 -8
  87. package/dist/components/Tag/Tag.d.ts +2 -2
  88. package/dist/components/Tag/Tag.js +4 -4
  89. package/dist/components/TagGroup/TagGroup.d.ts +2 -2
  90. package/dist/components/TextAreaField/TextAreaField.js +2 -2
  91. package/dist/components/ToggleButton/ToggleButton.js +6 -6
  92. package/dist/components/ToggleIconButton/ToggleIconButton.js +6 -6
  93. package/dist/components/Tooltip/Tooltip.js +2 -2
  94. package/dist/components/index.d.ts +2 -0
  95. package/dist/components/index.js +8 -4
  96. package/dist/components/index.js.map +1 -1
  97. package/dist/index.js +8 -4
  98. package/dist/index.js.map +1 -1
  99. package/dist/utils/backgroundColour/backgroundColour.d.ts +1 -1
  100. package/dist/utils/fgColour/fgColor.js +34 -34
  101. package/dist/utils/focus/focusStyles.js +2 -2
  102. package/dist/utils/padding/padding.d.ts +7 -7
  103. package/dist/utils/padding/padding.js +271 -46
  104. package/dist/utils/padding/padding.js.map +1 -1
  105. package/dist/utils/spaceToken/spaceToken.d.ts +3 -0
  106. package/dist/utils/spaceToken/spaceToken.js +25 -0
  107. package/dist/utils/spaceToken/spaceToken.js.map +1 -0
  108. package/package.json +43 -6
@@ -2,17 +2,17 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { c as cva } from "../../index-Bi3v_EjJ.js";
3
3
  import { Icon } from "../Icon/Icon.js";
4
4
  import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
5
- import '../../assets/Badge.css';const badge$1 = "_badge_g5nmg_1";
6
- const md = "_md_g5nmg_16";
7
- const sm = "_sm_g5nmg_25";
8
- const neutral = "_neutral_g5nmg_33";
9
- const critical = "_critical_g5nmg_37";
10
- const warning = "_warning_g5nmg_41";
11
- const caution = "_caution_g5nmg_45";
12
- const success = "_success_g5nmg_49";
13
- const info = "_info_g5nmg_53";
14
- const brand = "_brand_g5nmg_57";
15
- const sale = "_sale_g5nmg_61";
5
+ import '../../assets/Badge.css';const badge$1 = "_badge_6jwot_1";
6
+ const md = "_md_6jwot_16";
7
+ const sm = "_sm_6jwot_25";
8
+ const neutral = "_neutral_6jwot_33";
9
+ const critical = "_critical_6jwot_37";
10
+ const warning = "_warning_6jwot_41";
11
+ const caution = "_caution_6jwot_45";
12
+ const success = "_success_6jwot_49";
13
+ const info = "_info_6jwot_53";
14
+ const brand = "_brand_6jwot_57";
15
+ const sale = "_sale_6jwot_61";
16
16
  const styles = {
17
17
  badge: badge$1,
18
18
  md,
@@ -8,12 +8,12 @@ export interface BoxProps extends BackgroundVariants, FlexVariants, BorderVarian
8
8
  /**
9
9
  * The HTML element to render the Box as.
10
10
  */
11
- as?: "div" | "article";
11
+ as?: 'div' | 'article';
12
12
  /**
13
13
  * The width of the Box.
14
14
  * Accepts any valid CSS unit or "full"
15
15
  */
16
- width?: "full" | string;
16
+ width?: 'full' | string;
17
17
  /**
18
18
  * The maximum width of the Box.
19
19
  * Accepts any valid CSS unit.
@@ -5,33 +5,33 @@ import { Button as Button$1 } from "react-aria-components";
5
5
  import { Icon } from "../Icon/Icon.js";
6
6
  import LoadingSpinner from "../LoadingSpinner/LoadingSpinner.js";
7
7
  import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
8
- import '../../assets/Button.css';const button$1 = "_button_1fapr_1";
9
- const sm = "_sm_1fapr_25";
10
- const md = "_md_1fapr_30";
11
- const lg = "_lg_1fapr_35";
12
- const accentPrimary = "_accentPrimary_1fapr_44";
13
- const accentSecondary = "_accentSecondary_1fapr_67";
14
- const accentTertiary = "_accentTertiary_1fapr_98";
15
- const accentQuaternary = "_accentQuaternary_1fapr_127";
16
- const criticalPrimary = "_criticalPrimary_1fapr_155";
17
- const criticalSecondary = "_criticalSecondary_1fapr_183";
18
- const criticalTertiary = "_criticalTertiary_1fapr_214";
19
- const criticalQuaternary = "_criticalQuaternary_1fapr_243";
20
- const neutralPrimary = "_neutralPrimary_1fapr_272";
21
- const neutralSecondary = "_neutralSecondary_1fapr_300";
22
- const neutralTertiary = "_neutralTertiary_1fapr_329";
23
- const neutralQuaternary = "_neutralQuaternary_1fapr_358";
24
- const whitePrimary = "_whitePrimary_1fapr_388";
25
- const whiteSecondary = "_whiteSecondary_1fapr_417";
26
- const whiteTertiary = "_whiteTertiary_1fapr_447";
27
- const whiteQuaternary = "_whiteQuaternary_1fapr_476";
8
+ import '../../assets/Button.css';const button$1 = "_button_fkkc6_1";
9
+ const sm = "_sm_fkkc6_25";
10
+ const md = "_md_fkkc6_30";
11
+ const lg = "_lg_fkkc6_35";
12
+ const accentPrimary = "_accentPrimary_fkkc6_44";
13
+ const accentSecondary = "_accentSecondary_fkkc6_67";
14
+ const accentTertiary = "_accentTertiary_fkkc6_100";
15
+ const accentQuaternary = "_accentQuaternary_fkkc6_129";
16
+ const criticalPrimary = "_criticalPrimary_fkkc6_157";
17
+ const criticalSecondary = "_criticalSecondary_fkkc6_185";
18
+ const criticalTertiary = "_criticalTertiary_fkkc6_218";
19
+ const criticalQuaternary = "_criticalQuaternary_fkkc6_247";
20
+ const neutralPrimary = "_neutralPrimary_fkkc6_276";
21
+ const neutralSecondary = "_neutralSecondary_fkkc6_304";
22
+ const neutralTertiary = "_neutralTertiary_fkkc6_335";
23
+ const neutralQuaternary = "_neutralQuaternary_fkkc6_364";
24
+ const whitePrimary = "_whitePrimary_fkkc6_394";
25
+ const whiteSecondary = "_whiteSecondary_fkkc6_423";
26
+ const whiteTertiary = "_whiteTertiary_fkkc6_454";
27
+ const whiteQuaternary = "_whiteQuaternary_fkkc6_483";
28
28
  const styles = {
29
29
  button: button$1,
30
30
  sm,
31
31
  md,
32
32
  lg,
33
33
  accentPrimary,
34
- "local-class": "_local-class_1fapr_61",
34
+ "local-class": "_local-class_fkkc6_61",
35
35
  accentSecondary,
36
36
  accentTertiary,
37
37
  accentQuaternary,
@@ -47,8 +47,8 @@ const styles = {
47
47
  whiteSecondary,
48
48
  whiteTertiary,
49
49
  whiteQuaternary,
50
- "fa-spinner-third": "_fa-spinner-third_1fapr_507",
51
- "icon-wrapper": "_icon-wrapper_1fapr_512"
50
+ "fa-spinner-third": "_fa-spinner-third_fkkc6_514",
51
+ "icon-wrapper": "_icon-wrapper_fkkc6_519"
52
52
  };
53
53
  const button = cva(styles.button, {
54
54
  variants: {
@@ -1,14 +1,14 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { c as cva } from "../../index-Bi3v_EjJ.js";
4
- import '../../assets/ButtonGroup.css';const buttonGroup = "_buttonGroup_1tzc6_2";
5
- const alignStart = "_alignStart_1tzc6_11";
6
- const alignCenter = "_alignCenter_1tzc6_15";
7
- const alignEnd = "_alignEnd_1tzc6_19";
8
- const alignJustify = "_alignJustify_1tzc6_23";
9
- const alignSplit = "_alignSplit_1tzc6_28";
10
- const alignStack = "_alignStack_1tzc6_41";
11
- const alignStackFlip = "_alignStackFlip_1tzc6_46";
4
+ import '../../assets/ButtonGroup.css';const buttonGroup = "_buttonGroup_zcnod_2";
5
+ const alignStart = "_alignStart_zcnod_10";
6
+ const alignCenter = "_alignCenter_zcnod_14";
7
+ const alignEnd = "_alignEnd_zcnod_18";
8
+ const alignJustify = "_alignJustify_zcnod_22";
9
+ const alignSplit = "_alignSplit_zcnod_26";
10
+ const alignStack = "_alignStack_zcnod_39";
11
+ const alignStackFlip = "_alignStackFlip_zcnod_44";
12
12
  const styles = {
13
13
  buttonGroup,
14
14
  alignStart,
@@ -1,13 +1,13 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c as cva } from "../../index-Bi3v_EjJ.js";
3
3
  import { forwardRef } from "react";
4
- import '../../assets/CardSection.css';const cardSection$1 = "_cardSection_97jhf_1";
5
- const cardContainer = "_cardContainer_97jhf_11";
6
- const cardGrid = "_cardGrid_97jhf_23";
7
- const contentCell = "_contentCell_97jhf_33";
8
- const contentBox = "_contentBox_97jhf_40";
9
- const mediaCell = "_mediaCell_97jhf_51";
10
- const isReversed = "_isReversed_97jhf_65";
4
+ import '../../assets/CardSection.css';const cardSection$1 = "_cardSection_1qtaq_1";
5
+ const cardContainer = "_cardContainer_1qtaq_12";
6
+ const cardGrid = "_cardGrid_1qtaq_24";
7
+ const contentCell = "_contentCell_1qtaq_33";
8
+ const contentBox = "_contentBox_1qtaq_40";
9
+ const mediaCell = "_mediaCell_1qtaq_51";
10
+ const isReversed = "_isReversed_1qtaq_65";
11
11
  const styles = {
12
12
  cardSection: cardSection$1,
13
13
  cardContainer,
@@ -30,7 +30,7 @@ export interface CheckboxProps extends AriaCheckboxProps {
30
30
  * or invalid via ARIA.
31
31
  * @default 'aria'
32
32
  */
33
- validationBehavior?: "native" | "aria";
33
+ validationBehavior?: 'native' | 'aria';
34
34
  description?: string;
35
35
  children?: React.ReactNode;
36
36
  focusStyle?: 'default' | 'white';
@@ -1,16 +1,18 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import { Checkbox as Checkbox$1 } from "react-aria-components";
3
3
  import { c as cva } from "../../index-Bi3v_EjJ.js";
4
4
  import FieldDescription from "../FieldDescription/FieldDescription.js";
5
- import '../../assets/Checkbox.css';const checkbox$1 = "_checkbox_1xmgx_2";
6
- const checkboxLabel = "_checkboxLabel_1xmgx_19";
7
- const checkboxDescription = "_checkboxDescription_1xmgx_23";
8
- const checkboxSvgWrapper = "_checkboxSvgWrapper_1xmgx_27";
9
- const svg = "_svg_1xmgx_41";
10
- const defaultFocus = "_defaultFocus_1xmgx_69";
11
- const whiteFocus = "_whiteFocus_1xmgx_73";
5
+ import '../../assets/Checkbox.css';const checkbox$1 = "_checkbox_1twm2_2";
6
+ const checkboxContainer = "_checkboxContainer_1twm2_19";
7
+ const checkboxLabel = "_checkboxLabel_1twm2_24";
8
+ const checkboxDescription = "_checkboxDescription_1twm2_28";
9
+ const checkboxSvgWrapper = "_checkboxSvgWrapper_1twm2_32";
10
+ const svg = "_svg_1twm2_46";
11
+ const defaultFocus = "_defaultFocus_1twm2_74";
12
+ const whiteFocus = "_whiteFocus_1twm2_78";
12
13
  const styles = {
13
14
  checkbox: checkbox$1,
15
+ checkboxContainer,
14
16
  checkboxLabel,
15
17
  checkboxDescription,
16
18
  checkboxSvgWrapper,
@@ -48,7 +50,7 @@ const Checkbox = ({
48
50
  focusStyle = "default",
49
51
  ...props
50
52
  }) => {
51
- return /* @__PURE__ */ jsxs(Fragment, { children: [
53
+ return /* @__PURE__ */ jsxs("div", { className: styles.checkboxContainer, children: [
52
54
  /* @__PURE__ */ jsx(Checkbox$1, { className: checkbox({
53
55
  focusStyle
54
56
  }), isIndeterminate, defaultSelected, isSelected, value, isDisabled, isReadOnly, isRequired, isInvalid, validate, autoFocus, name, validationBehavior, ...props, children: ({
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Checkbox.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,28 +2,28 @@ import { default as React } from 'react';
2
2
  import { CheckboxGroupProps as AriaCheckboxGroupProps, ValidationResult } from 'react-aria-components';
3
3
  export interface CheckboxGroupProps extends AriaCheckboxGroupProps {
4
4
  /**
5
- * The field label.
6
- */
5
+ * The field label.
6
+ */
7
7
  label?: string;
8
8
  /**
9
- * The children to render.
10
- */
9
+ * The children to render.
10
+ */
11
11
  children: React.ReactNode;
12
12
  /**
13
- * The descriptive text located underneath the checkbox group.
14
- */
13
+ * The descriptive text located underneath the checkbox group.
14
+ */
15
15
  description?: string;
16
16
  /**
17
- * The error message to display when the input value is invalid.
18
- */
17
+ * The error message to display when the input value is invalid.
18
+ */
19
19
  errorMessage?: string | ((validation: ValidationResult) => string);
20
20
  /**
21
- * Whether the input is disabled.
22
- */
21
+ * Whether the input is disabled.
22
+ */
23
23
  isDisabled?: boolean;
24
24
  /**
25
- * Whether the input value is invalid.
26
- */
25
+ * Whether the input value is invalid.
26
+ */
27
27
  isInvalid?: boolean;
28
28
  }
29
29
  export declare const CheckboxGroup: ({ label, children, description, errorMessage, isDisabled, isInvalid, ...props }: CheckboxGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { CheckboxGroup as CheckboxGroup$1 } from "react-aria-components";
3
3
  import { FieldHeader } from "../FieldHeader/FieldHeader.js";
4
- import '../../assets/CheckboxGroup.css';const checkboxGroup = "_checkboxGroup_cykce_1";
5
- const errorMessage = "_errorMessage_cykce_8";
6
- const description = "_description_cykce_13";
4
+ import '../../assets/CheckboxGroup.css';const checkboxGroup = "_checkboxGroup_1vs5o_1";
5
+ const errorMessage = "_errorMessage_1vs5o_8";
6
+ const description = "_description_1vs5o_13";
7
7
  const styles = {
8
8
  checkboxGroup,
9
9
  errorMessage,
@@ -1,7 +1,7 @@
1
1
  import { ButtonProps } from '../Button/Button';
2
2
  import { IconSize } from '../Icon/Icon';
3
3
  export type ClearFieldButtonButtonSize = 'lg' | 'md' | 'sm';
4
- export interface ClearFieldButtonProps extends Omit<ButtonProps, "$styleText"> {
4
+ export interface ClearFieldButtonProps extends Omit<ButtonProps, '$styleText'> {
5
5
  slot?: string;
6
6
  iconSize?: IconSize;
7
7
  className?: string;
@@ -3,10 +3,10 @@ import { c as cva } from "../../index-Bi3v_EjJ.js";
3
3
  import { Button } from "react-aria-components";
4
4
  import { Icon } from "../Icon/Icon.js";
5
5
  import { focusStyleVariants } from "../../utils/focus/focusStyles.js";
6
- import '../../assets/ClearFieldButton.css';const clearFieldButton$1 = "_clearFieldButton_1wxbm_1";
7
- const sm = "_sm_1wxbm_18";
8
- const md = "_md_1wxbm_23";
9
- const lg = "_lg_1wxbm_28";
6
+ import '../../assets/ClearFieldButton.css';const clearFieldButton$1 = "_clearFieldButton_hkevp_1";
7
+ const sm = "_sm_hkevp_18";
8
+ const md = "_md_hkevp_23";
9
+ const lg = "_lg_hkevp_28";
10
10
  const styles = {
11
11
  clearFieldButton: clearFieldButton$1,
12
12
  sm,
@@ -1,9 +1,9 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { DateField as DateField$1, DateInput, DateSegment } from "react-aria-components";
3
3
  import { FieldHeader } from "../FieldHeader/FieldHeader.js";
4
- import '../../assets/DateField.css';const dateField = "_dateField_197xm_1";
5
- const dateInput = "_dateInput_197xm_5";
6
- const dateSegment = "_dateSegment_197xm_48";
4
+ import '../../assets/DateField.css';const dateField = "_dateField_1mc0h_1";
5
+ const dateInput = "_dateInput_1mc0h_5";
6
+ const dateSegment = "_dateSegment_1mc0h_48";
7
7
  const styles = {
8
8
  dateField,
9
9
  dateInput,
@@ -1,5 +1,5 @@
1
1
  import { HeadingProps } from '../Heading/Heading';
2
- export interface DestinationHeadingProps extends Omit<HeadingProps, "children"> {
2
+ export interface DestinationHeadingProps extends Omit<HeadingProps, 'children'> {
3
3
  from: string;
4
4
  to: string;
5
5
  /**
@@ -1,10 +1,10 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { c as cva } from "../../index-Bi3v_EjJ.js";
3
- import '../../assets/Eyebrow.css';const eyebrow$1 = "_eyebrow_c96e1_1";
4
- const inspiration = "_inspiration_c96e1_15";
5
- const collect = "_collect_c96e1_19";
6
- const spend = "_spend_c96e1_23";
7
- const activate = "_activate_c96e1_28";
3
+ import '../../assets/Eyebrow.css';const eyebrow$1 = "_eyebrow_rc11b_1";
4
+ const inspiration = "_inspiration_rc11b_16";
5
+ const collect = "_collect_rc11b_20";
6
+ const spend = "_spend_rc11b_24";
7
+ const activate = "_activate_rc11b_29";
8
8
  const styles = {
9
9
  eyebrow: eyebrow$1,
10
10
  inspiration,
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Text } from "react-aria-components";
3
- import '../../assets/FieldDescription.css';const fieldDescription = "_fieldDescription_2cs9c_1";
3
+ import '../../assets/FieldDescription.css';const fieldDescription = "_fieldDescription_18783_1";
4
4
  const styles = {
5
5
  fieldDescription
6
6
  };
@@ -1,7 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { FieldError as FieldError$1 } from "react-aria-components";
3
3
  import { Icon } from "../Icon/Icon.js";
4
- import '../../assets/FieldError.css';const fieldError = "_fieldError_c0ugd_1";
4
+ import '../../assets/FieldError.css';const fieldError = "_fieldError_1tsix_1";
5
5
  const styles = {
6
6
  fieldError
7
7
  };
@@ -5,6 +5,7 @@ export interface FieldHeaderProps {
5
5
  errorMessage?: string | ((validation: ValidationResult) => string);
6
6
  isInvalid?: boolean;
7
7
  isRequired?: boolean;
8
+ labelFor?: string;
8
9
  }
9
- export declare const FieldHeader: ({ label, description, isInvalid, isRequired, errorMessage, }: FieldHeaderProps) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const FieldHeader: ({ label, description, isInvalid, isRequired, errorMessage, labelFor, }: FieldHeaderProps) => import("react/jsx-runtime").JSX.Element;
10
11
  export default FieldHeader;
@@ -2,21 +2,22 @@ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import FieldDescription from "../FieldDescription/FieldDescription.js";
3
3
  import { FieldError } from "../FieldError/FieldError.js";
4
4
  import { FieldLabel } from "../FieldLabel/FieldLabel.js";
5
- import '../../assets/FieldHeader.css';const fieldHeader = "_fieldHeader_t60vq_1";
5
+ import '../../assets/FieldHeader.css';const fieldHeader = "_fieldHeader_3rjlj_1";
6
6
  const styles = {
7
7
  fieldHeader,
8
- "label-container": "_label-container_t60vq_12"
8
+ "label-container": "_label-container_3rjlj_12"
9
9
  };
10
10
  const FieldHeader = ({
11
11
  label,
12
12
  description,
13
13
  isInvalid,
14
14
  isRequired,
15
- errorMessage
15
+ errorMessage,
16
+ labelFor
16
17
  }) => {
17
18
  return /* @__PURE__ */ jsxs("div", { className: styles.fieldHeader, "data-invalid": isInvalid ? true : void 0, children: [
18
19
  /* @__PURE__ */ jsxs("div", { className: styles["label-container"], children: [
19
- label && /* @__PURE__ */ jsx(FieldLabel, { required: isRequired ? true : void 0, children: label }),
20
+ label && /* @__PURE__ */ jsx(FieldLabel, { required: isRequired ? true : void 0, htmlFor: labelFor, children: label }),
20
21
  !isRequired && /* @__PURE__ */ jsx("span", { children: "Optional" })
21
22
  ] }),
22
23
  description && /* @__PURE__ */ jsx(FieldDescription, { children: description }),
@@ -1 +1 @@
1
- {"version":3,"file":"FieldHeader.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"FieldHeader.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,5 +2,5 @@ import { LabelProps as AriaLabelProps } from 'react-aria-components';
2
2
  export interface FieldLabelProps extends AriaLabelProps {
3
3
  required?: boolean;
4
4
  }
5
- export declare const FieldLabel: ({ children, required, ...props }: FieldLabelProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const FieldLabel: ({ children, ...props }: FieldLabelProps) => import("react/jsx-runtime").JSX.Element;
6
6
  export default FieldLabel;
@@ -1,12 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Label } from "react-aria-components";
3
- import '../../assets/FieldLabel.css';const fieldLabel = "_fieldLabel_7i7ld_1";
3
+ import '../../assets/FieldLabel.css';const fieldLabel = "_fieldLabel_1jqml_1";
4
4
  const styles = {
5
5
  fieldLabel
6
6
  };
7
7
  const FieldLabel = ({
8
8
  children,
9
- required,
10
9
  ...props
11
10
  }) => {
12
11
  return /* @__PURE__ */ jsx(Label, { className: styles.fieldLabel, ...props, children });
@@ -1 +1 @@
1
- {"version":3,"file":"FieldLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"FieldLabel.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -1,30 +1,46 @@
1
1
  import { default as React } from 'react';
2
- type SpaceToken = 'default' | '5xs' | '4xs' | '3xs' | '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl';
2
+ import { SpaceToken } from '../../utils/spaceToken/spaceToken';
3
3
  type AutoFlowValue = 'row' | 'column' | 'dense' | 'row dense' | 'column dense';
4
4
  type AlignContentValue = 'start' | 'end' | 'center' | 'stretch' | 'space-around' | 'space-between' | 'space-evenly';
5
- export interface GridCellProps extends React.HTMLAttributes<HTMLDivElement> {
5
+ type ValidElements = 'div' | 'span';
6
+ type PolymorphicProps<E extends ValidElements> = {
7
+ as?: E;
8
+ } & Omit<React.ComponentPropsWithRef<E>, 'as'>;
9
+ export interface GridCellBaseProps {
6
10
  /**
7
- * Number of columns this cell should span
11
+ * Number of columns/rows this cell should span
12
+ * Can be a single number for column span or an object for both
8
13
  */
9
- colSpan?: number;
14
+ span?: number | {
15
+ column?: number;
16
+ row?: number;
17
+ };
10
18
  /**
11
- * Number of rows this cell should span
19
+ * Named grid area for placing the cell
12
20
  */
13
- rowSpan?: number;
21
+ area?: string;
14
22
  /**
15
- * The starting column for this cell
23
+ * Column number where the cell will be placed
16
24
  */
17
- colStart?: number;
25
+ column?: string | number;
18
26
  /**
19
- * The starting row for this cell
27
+ * Starting column for the cell
20
28
  */
21
- rowStart?: number;
29
+ columnStart?: number;
30
+ /**
31
+ * Ending column for spanning multiple columns
32
+ */
33
+ columnEnd?: number;
22
34
  /**
23
- * The ending column for this cell
35
+ * Row number where the cell will be placed
24
36
  */
25
- colEnd?: number;
37
+ row?: string | number;
26
38
  /**
27
- * The ending row for this cell
39
+ * Starting row for the cell
40
+ */
41
+ rowStart?: number;
42
+ /**
43
+ * Ending row for spanning multiple rows
28
44
  */
29
45
  rowEnd?: number;
30
46
  /**
@@ -37,7 +53,8 @@ export interface GridCellProps extends React.HTMLAttributes<HTMLDivElement> {
37
53
  */
38
54
  style?: React.CSSProperties;
39
55
  }
40
- export declare const GridCell: ({ colSpan, rowSpan, colStart, colEnd, rowStart, rowEnd, children, style, ...rest }: GridCellProps) => import("react/jsx-runtime").JSX.Element;
56
+ export type GridCellProps<E extends ValidElements = 'div'> = GridCellBaseProps & PolymorphicProps<E>;
57
+ export declare const GridCell: <E extends ValidElements = "div">({ as, span, area, column, columnStart, columnEnd, row, rowStart, rowEnd, children, style, ...rest }: GridCellProps<E>) => import("react/jsx-runtime").JSX.Element;
41
58
  export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
42
59
  /**
43
60
  * Optional unique identifier for the grid
@@ -99,7 +116,7 @@ export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
99
116
  /**
100
117
  * The content of the grid
101
118
  */
102
- children: React.ReactNode;
119
+ children?: React.ReactNode;
103
120
  /**
104
121
  * @internal
105
122
  * Additional CSS properties to apply to the grid
@@ -108,6 +125,8 @@ export interface GridProps extends React.HTMLAttributes<HTMLDivElement> {
108
125
  }
109
126
  export declare const Grid: {
110
127
  ({ id, isInline, alignContent, autoColumns, autoFlow, columns, rows, templateColumns, templateRows, gap, rowGap, columnGap, children, style, ...rest }: GridProps): import("react/jsx-runtime").JSX.Element;
111
- Cell: ({ colSpan, rowSpan, colStart, colEnd, rowStart, rowEnd, children, style, ...rest }: GridCellProps) => import("react/jsx-runtime").JSX.Element;
128
+ Cell: <E extends ValidElements = "div">({ as, span, area, column, columnStart, columnEnd, row, rowStart, rowEnd, children, style, ...rest }: GridCellProps<E>) => import("react/jsx-runtime").JSX.Element;
112
129
  };
130
+ declare const isValidElement: (value: unknown) => value is ValidElements;
131
+ export { isValidElement };
113
132
  export default Grid;
@@ -1,46 +1,74 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import '../../assets/Grid.css';const grid = "_grid_f3f0m_1";
3
- const gridItem = "_gridItem_f3f0m_6";
2
+ import { getSpaceValue } from "../../utils/spaceToken/spaceToken.js";
3
+ import '../../assets/Grid.css';const grid = "_grid_agdpw_1";
4
+ const gridItem = "_gridItem_agdpw_6";
4
5
  const styles = {
5
6
  grid,
6
7
  gridItem
7
8
  };
8
- const getGapValue = (token) => {
9
- return token === "default" ? "var(--alto-grid-gutter-default)" : `var(--alto-sem-space-${token})`;
10
- };
11
9
  const GridCell = ({
12
- colSpan,
13
- rowSpan,
14
- colStart,
15
- colEnd,
10
+ as,
11
+ span,
12
+ area,
13
+ column,
14
+ columnStart,
15
+ columnEnd,
16
+ row,
16
17
  rowStart,
17
18
  rowEnd,
18
19
  children,
19
20
  style,
20
21
  ...rest
21
22
  }) => {
23
+ const Component = as || "div";
24
+ const getSpanStyles = () => {
25
+ if (!span) return {};
26
+ if (typeof span === "number") {
27
+ return {
28
+ gridColumn: `span ${span}`
29
+ };
30
+ }
31
+ return {
32
+ ...span.column && {
33
+ gridColumn: `span ${span.column}`
34
+ },
35
+ ...span.row && {
36
+ gridRow: `span ${span.row}`
37
+ }
38
+ };
39
+ };
22
40
  const gridCellStyle = {
23
- ...colSpan && {
24
- gridColumn: `span ${colSpan}`
25
- },
26
- ...rowSpan && {
27
- gridRow: `span ${rowSpan}`
28
- },
29
- ...colStart && {
30
- gridColumnStart: colStart
41
+ // Grid area takes precedence over individual positioning
42
+ ...area && {
43
+ gridArea: area
31
44
  },
32
- ...colEnd && {
33
- gridColumnEnd: colEnd
34
- },
35
- ...rowStart && {
36
- gridRowStart: rowStart
37
- },
38
- ...rowEnd && {
39
- gridRowEnd: rowEnd
45
+ // If no area is specified, use individual positioning props
46
+ ...!area && {
47
+ ...column && {
48
+ gridColumn: column
49
+ },
50
+ ...columnStart && {
51
+ gridColumnStart: columnStart
52
+ },
53
+ ...columnEnd && {
54
+ gridColumnEnd: columnEnd
55
+ },
56
+ ...row && {
57
+ gridRow: row
58
+ },
59
+ ...rowStart && {
60
+ gridRowStart: rowStart
61
+ },
62
+ ...rowEnd && {
63
+ gridRowEnd: rowEnd
64
+ }
40
65
  },
66
+ // Apply span styles
67
+ ...getSpanStyles(),
68
+ // Apply any custom styles
41
69
  ...style
42
70
  };
43
- return /* @__PURE__ */ jsx("div", { className: styles.gridCell, style: gridCellStyle, ...rest, children });
71
+ return /* @__PURE__ */ jsx(Component, { className: styles.gridCell, style: gridCellStyle, ...rest, children });
44
72
  };
45
73
  const Grid = ({
46
74
  id,
@@ -69,19 +97,24 @@ const Grid = ({
69
97
  gridAutoFlow: autoFlow,
70
98
  alignContent,
71
99
  ...rowGap || columnGap ? {
72
- rowGap: getGapValue(rowGap || "default"),
73
- columnGap: getGapValue(columnGap || "default")
100
+ rowGap: rowGap ? getSpaceValue(rowGap) : void 0,
101
+ columnGap: columnGap ? getSpaceValue(columnGap) : void 0
74
102
  } : {
75
- gap: getGapValue(gap || "default")
103
+ gap: getSpaceValue(gap || "default")
76
104
  },
77
105
  ...style
78
106
  };
79
107
  return /* @__PURE__ */ jsx("div", { id, className: styles.grid, style: gridStyle, ...rest, children });
80
108
  };
109
+ const isValidElement = (value) => {
110
+ const validElements = ["div", "span"];
111
+ return typeof value === "string" && validElements.includes(value);
112
+ };
81
113
  Grid.Cell = GridCell;
82
114
  export {
83
115
  Grid,
84
116
  GridCell,
85
- Grid as default
117
+ Grid as default,
118
+ isValidElement
86
119
  };
87
120
  //# sourceMappingURL=Grid.js.map